diff --git a/.github/PUBLISHING.md b/.github/PUBLISHING.md index 90f3d25d..e24bf60f 100644 --- a/.github/PUBLISHING.md +++ b/.github/PUBLISHING.md @@ -19,15 +19,14 @@ The GitHub `pypi` environment requires approval and only permits tags matching ` To publish a new version: -1. **Update the changelog** (if not already done): - ```bash - # Edit CHANGELOG.md to add new version details - ``` +1. **Review the Release Drafter draft**: + - Label merged pull requests `breaking` for a major version or `enhancement` for a minor version; unlabelled changes default to patch. + - Review the draft release notes and OpenAPI diff; do not edit `CHANGELOG.md`. 2. **Create and push a version tag**: ```bash # Create a new version tag (e.g., v1.2.3) - git tag v1.2.3 + git tag -a v1.2.3 -m "" # Push the tag to trigger the workflow git push origin v1.2.3 @@ -42,6 +41,7 @@ To publish a new version: - Build the package using Python build - Wait for approval on the `pypi` environment - Publish to PyPI using a short-lived Trusted Publishing credential + - Publish the most recent Release Drafter draft regardless of its current tag, rename it to the pushed tag, and prepend the annotated tag message under "Highlights"; or create a release with generated notes if no draft exists ### 3. Version Numbering diff --git a/.github/dependabot.yml b/.github/dependabot.yml index de7d060f..0f10b713 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,5 +1,12 @@ version: 2 updates: + - package-ecosystem: "uv" + directory: "/" + schedule: + interval: "weekly" + cooldown: + default-days: 3 + - package-ecosystem: "pip" directory: "/" schedule: diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 40c14d1c..bf6ece34 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -10,6 +10,16 @@ template: | categories: + - type: version-resolver + semver-increment: major + when: + label: breaking + - type: version-resolver + semver-increment: minor + when: + label: enhancement + - type: version-resolver + semver-increment: patch - title: 🚀 New features and improvements labels: - enhancement @@ -34,16 +44,6 @@ categories: - 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 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 932e898b..8e0c4f7d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -64,3 +64,48 @@ jobs: - name: Publish to PyPI uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # release/v1 + release: + needs: publish-to-pypi + runs-on: blacksmith-2vcpu-ubuntu-2404 + timeout-minutes: 5 + permissions: + contents: write + steps: + - name: Checkout Repository + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Fetch annotated tag message + run: git fetch --force origin "refs/tags/${GITHUB_REF_NAME}:refs/tags/${GITHUB_REF_NAME}" + - name: Publish GitHub Release + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + TAG_REF="refs/tags/${GITHUB_REF_NAME}" + HIGHLIGHTS="" + if [ "$(git cat-file -t "$TAG_REF" 2>/dev/null || true)" = "tag" ]; then + HIGHLIGHTS=$(git for-each-ref "$TAG_REF" --format='%(contents)' | sed '/^-----BEGIN PGP SIGNATURE-----/,$d') + if [ -z "$(printf '%s' "$HIGHLIGHTS" | tr -d '[:space:]')" ]; then + HIGHLIGHTS="" + fi + fi + + RELEASE_ID=$(gh api "repos/${GITHUB_REPOSITORY}/releases?per_page=100" --jq 'map(select(.draft))[0].id // empty') + if [ -n "$RELEASE_ID" ]; then + BODY=$(gh api "repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}" --jq '.body // ""') + if [ -n "$HIGHLIGHTS" ]; then + BODY=$(printf '## Highlights\n\n%s\n\n%s' "$HIGHLIGHTS" "$BODY") + fi + jq -n \ + --arg tag_name "$GITHUB_REF_NAME" \ + --arg name "$GITHUB_REF_NAME" \ + --arg body "$BODY" \ + '{tag_name: $tag_name, name: $name, body: $body, draft: false, make_latest: "true"}' \ + > /tmp/release.json + gh api --method PATCH "repos/${GITHUB_REPOSITORY}/releases/${RELEASE_ID}" --input /tmp/release.json + elif [ -n "$HIGHLIGHTS" ]; then + gh release create "$GITHUB_REF_NAME" --verify-tag --generate-notes \ + --title "$GITHUB_REF_NAME" --latest \ + --notes "$(printf '## Highlights\n\n%s' "$HIGHLIGHTS")" + else + gh release create "$GITHUB_REF_NAME" --verify-tag --generate-notes \ + --title "$GITHUB_REF_NAME" --latest + fi diff --git a/.gitignore b/.gitignore index 73dc337f..f70ef056 100644 --- a/.gitignore +++ b/.gitignore @@ -24,3 +24,5 @@ dmypy.json # Serena .serena/ + +tools/swagger.json diff --git a/CHANGELOG.md b/CHANGELOG.md index 57675cdc..76a042f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,10 @@ # Changelog -All notable changes to this project will be documented in this file. +Release notes for every version are published on [GitHub Releases](https://github.com/rootlyhq/rootly-python/releases). They are drafted automatically by Release Drafter from merged pull requests and include an OpenAPI diff against the previous release. -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## Older releases -## [Unreleased] +_Entries below predate GitHub Releases and are no longer updated._ ## [2.0.1] - 2026-08-31 diff --git a/CLAUDE.md b/CLAUDE.md index 6db6957f..936cf4f7 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -13,14 +13,14 @@ This is a Python SDK for the Rootly API v1. ## Dependencies -- Python 3.9+ +- Python 3.10+ - httpx (HTTP client) - attrs (data classes) - python-dateutil (date parsing) ## Development -- Uses Poetry for dependency management +- Uses uv for dependency management - Follows Ruff linting rules (line length 120, select F/I/UP) - Generated from OpenAPI specification @@ -33,11 +33,12 @@ python -c "import rootly_sdk; print('SDK imports successfully')" ## Regenerating the Client -To regenerate the client from the OpenAPI specification: +Use `make regenerate` to fetch and preprocess the OpenAPI specification, run the generator pinned in `uv.lock`, and apply the post-generation fixes. Never run a global `openapi-python-client`. + ```bash -openapi-python-client generate --url https://rootly-heroku.s3.amazonaws.com/swagger/v1/swagger.json --no-fail-on-warning --output-path . --overwrite --config tools/config.yaml +make regenerate ``` ## Building -Uses Poetry build system with `poetry-core` backend. \ No newline at end of file +Uses `poetry-core` as the build backend. \ No newline at end of file diff --git a/Makefile b/Makefile index 9cbc5d5a..9ed1266e 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -.PHONY: bump-major bump-minor bump-patch regenerate test +.PHONY: bump-major bump-minor bump-patch fetch-spec generate regenerate test # Get current version from pyproject.toml CURRENT_VERSION := $(shell grep -E '^version = ' pyproject.toml | sed 's/version = "\(.*\)"/\1/') @@ -18,34 +18,40 @@ RUFF_VERSION := 0.16.3 bump-major: @echo "Bumping version: $(CURRENT_VERSION) -> $(NEW_MAJOR)" @sed -i '' 's/version = "$(CURRENT_VERSION)"/version = "$(NEW_MAJOR)"/' pyproject.toml - @sed -i '' 's/## \[Unreleased\]/## [Unreleased]\n\n## [$(NEW_MAJOR)] - $(TODAY)/' CHANGELOG.md @echo "Version bumped to $(NEW_MAJOR)" bump-minor: @echo "Bumping version: $(CURRENT_VERSION) -> $(NEW_MINOR)" @sed -i '' 's/version = "$(CURRENT_VERSION)"/version = "$(NEW_MINOR)"/' pyproject.toml - @sed -i '' 's/## \[Unreleased\]/## [Unreleased]\n\n## [$(NEW_MINOR)] - $(TODAY)/' CHANGELOG.md @echo "Version bumped to $(NEW_MINOR)" bump-patch: @echo "Bumping version: $(CURRENT_VERSION) -> $(NEW_PATCH)" @sed -i '' 's/version = "$(CURRENT_VERSION)"/version = "$(NEW_PATCH)"/' pyproject.toml - @sed -i '' 's/## \[Unreleased\]/## [Unreleased]\n\n## [$(NEW_PATCH)] - $(TODAY)/' CHANGELOG.md @echo "Version bumped to $(NEW_PATCH)" -regenerate: - openapi-python-client generate \ - --url https://rootly-heroku.s3.amazonaws.com/swagger/v1/swagger.json \ +fetch-spec: + curl -fsSL https://rootly-heroku.s3.amazonaws.com/swagger/v1/swagger.json -o tools/swagger.json + uv run python tools/fix_openapi_escalation_paths.py tools/swagger.json + uv run python tools/fix_nullable_severity.py tools/swagger.json + +# openapi-python-client requires Python 3.11+. +generate: + uv run --python 3.12 --group dev openapi-python-client generate \ + --path tools/swagger.json \ --no-fail-on-warning \ - --output-path . \ + --meta none \ + --output-path rootly_sdk \ --overwrite \ --config tools/config.yaml @echo "Applying nullable enum fix..." - @python tools/fix_nullable_enums.py + @uv run --python 3.12 python tools/fix_nullable_enums.py @echo "Fixing lint errors..." - @uvx --from ruff==$(RUFF_VERSION) ruff check --fix . + @uv run --python 3.12 --group dev ruff check --fix . @echo "Formatting patched files..." - @uvx --from ruff==$(RUFF_VERSION) ruff format . + @uv run --python 3.12 --group dev ruff format . + +regenerate: fetch-spec generate test: python -m unittest discover -s tests diff --git a/pyproject.toml b/pyproject.toml index c8dbe4f9..f3047f71 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "rootly" -version = "2.0.1" +version = "3.0.0" description = "A client library for accessing Rootly API v1" authors = [] readme = "README.md" @@ -17,11 +17,14 @@ classifiers = [ ] dynamic = ["dependencies"] +[dependency-groups] +dev = ["openapi-python-client==0.29.0; python_version >= '3.11'", "ruff==0.16.3"] + [project.urls] Homepage = "https://github.com/rootlyhq/rootly-python" Issues = "https://github.com/rootlyhq/rootly-python/issues" Repository = "https://github.com/rootlyhq/rootly-python.git" -Changelog = "https://github.com/rootlyhq/rootly-python/blob/master/CHANGELOG.md" +Changelog = "https://github.com/rootlyhq/rootly-python/releases" [tool.poetry] packages = [ diff --git a/rootly_sdk/api/ai_chat/create_ai_chat.py b/rootly_sdk/api/ai_chat/create_ai_chat.py index 77ab6bae..a1b78093 100644 --- a/rootly_sdk/api/ai_chat/create_ai_chat.py +++ b/rootly_sdk/api/ai_chat/create_ai_chat.py @@ -13,25 +13,26 @@ def _get_kwargs( *, message: str, - session_id: Unset | UUID = UNSET, - incident_id: Unset | UUID = UNSET, - alert_id: Unset | UUID = UNSET, + session_id: UUID | Unset = UNSET, + incident_id: UUID | Unset = UNSET, + alert_id: UUID | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["message"] = message - json_session_id: Unset | str = UNSET + json_session_id: str | Unset = UNSET if not isinstance(session_id, Unset): json_session_id = str(session_id) params["session_id"] = json_session_id - json_incident_id: Unset | str = UNSET + json_incident_id: str | Unset = UNSET if not isinstance(incident_id, Unset): json_incident_id = str(incident_id) params["incident_id"] = json_incident_id - json_alert_id: Unset | str = UNSET + json_alert_id: str | Unset = UNSET if not isinstance(alert_id, Unset): json_alert_id = str(alert_id) params["alert_id"] = json_alert_id @@ -82,9 +83,9 @@ def sync_detailed( *, client: AuthenticatedClient, message: str, - session_id: Unset | UUID = UNSET, - incident_id: Unset | UUID = UNSET, - alert_id: Unset | UUID = UNSET, + session_id: UUID | Unset = UNSET, + incident_id: UUID | Unset = UNSET, + alert_id: UUID | Unset = UNSET, ) -> Response[AiChatResponse | Any]: """Send AI chat message @@ -94,16 +95,16 @@ def sync_detailed( Args: message (str): - session_id (Union[Unset, UUID]): - incident_id (Union[Unset, UUID]): - alert_id (Union[Unset, UUID]): + session_id (UUID | Unset): + incident_id (UUID | Unset): + alert_id (UUID | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AiChatResponse, Any]] + Response[AiChatResponse | Any] """ kwargs = _get_kwargs( @@ -124,9 +125,9 @@ def sync( *, client: AuthenticatedClient, message: str, - session_id: Unset | UUID = UNSET, - incident_id: Unset | UUID = UNSET, - alert_id: Unset | UUID = UNSET, + session_id: UUID | Unset = UNSET, + incident_id: UUID | Unset = UNSET, + alert_id: UUID | Unset = UNSET, ) -> AiChatResponse | Any | None: """Send AI chat message @@ -136,16 +137,16 @@ def sync( Args: message (str): - session_id (Union[Unset, UUID]): - incident_id (Union[Unset, UUID]): - alert_id (Union[Unset, UUID]): + session_id (UUID | Unset): + incident_id (UUID | Unset): + alert_id (UUID | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AiChatResponse, Any] + AiChatResponse | Any """ return sync_detailed( @@ -161,9 +162,9 @@ async def asyncio_detailed( *, client: AuthenticatedClient, message: str, - session_id: Unset | UUID = UNSET, - incident_id: Unset | UUID = UNSET, - alert_id: Unset | UUID = UNSET, + session_id: UUID | Unset = UNSET, + incident_id: UUID | Unset = UNSET, + alert_id: UUID | Unset = UNSET, ) -> Response[AiChatResponse | Any]: """Send AI chat message @@ -173,16 +174,16 @@ async def asyncio_detailed( Args: message (str): - session_id (Union[Unset, UUID]): - incident_id (Union[Unset, UUID]): - alert_id (Union[Unset, UUID]): + session_id (UUID | Unset): + incident_id (UUID | Unset): + alert_id (UUID | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AiChatResponse, Any]] + Response[AiChatResponse | Any] """ kwargs = _get_kwargs( @@ -201,9 +202,9 @@ async def asyncio( *, client: AuthenticatedClient, message: str, - session_id: Unset | UUID = UNSET, - incident_id: Unset | UUID = UNSET, - alert_id: Unset | UUID = UNSET, + session_id: UUID | Unset = UNSET, + incident_id: UUID | Unset = UNSET, + alert_id: UUID | Unset = UNSET, ) -> AiChatResponse | Any | None: """Send AI chat message @@ -213,16 +214,16 @@ async def asyncio( Args: message (str): - session_id (Union[Unset, UUID]): - incident_id (Union[Unset, UUID]): - alert_id (Union[Unset, UUID]): + session_id (UUID | Unset): + incident_id (UUID | Unset): + alert_id (UUID | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AiChatResponse, Any] + 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 2a6cfc00..810d9b1e 100644 --- a/rootly_sdk/api/ai_chat/delete_ai_chat_session.py +++ b/rootly_sdk/api/ai_chat/delete_ai_chat_session.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/ai/chat/sessions/{id}", + "url": "/v1/ai/chat/sessions/{id}".format( + id=quote(str(id), safe=""), + ), } 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 22f548c3..8f13b2d4 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,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote from uuid import UUID import httpx @@ -13,9 +14,10 @@ def _get_kwargs( session_id: UUID, *, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -26,7 +28,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/ai/chat/sessions/{session_id}/messages", + "url": "/v1/ai/chat/sessions/{session_id}/messages".format( + session_id=quote(str(session_id), safe=""), + ), "params": params, } @@ -66,8 +70,8 @@ def sync_detailed( session_id: UUID, *, client: AuthenticatedClient, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[AiChatSessionMessageList | Any]: """List AI chat session messages @@ -76,15 +80,15 @@ def sync_detailed( Args: session_id (UUID): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AiChatSessionMessageList, Any]] + Response[AiChatSessionMessageList | Any] """ kwargs = _get_kwargs( @@ -104,8 +108,8 @@ def sync( session_id: UUID, *, client: AuthenticatedClient, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> AiChatSessionMessageList | Any | None: """List AI chat session messages @@ -114,15 +118,15 @@ def sync( Args: session_id (UUID): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AiChatSessionMessageList, Any] + AiChatSessionMessageList | Any """ return sync_detailed( @@ -137,8 +141,8 @@ async def asyncio_detailed( session_id: UUID, *, client: AuthenticatedClient, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[AiChatSessionMessageList | Any]: """List AI chat session messages @@ -147,15 +151,15 @@ async def asyncio_detailed( Args: session_id (UUID): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AiChatSessionMessageList, Any]] + Response[AiChatSessionMessageList | Any] """ kwargs = _get_kwargs( @@ -173,8 +177,8 @@ async def asyncio( session_id: UUID, *, client: AuthenticatedClient, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> AiChatSessionMessageList | Any | None: """List AI chat session messages @@ -183,15 +187,15 @@ async def asyncio( Args: session_id (UUID): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AiChatSessionMessageList, Any] + 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 1dab0fe1..db3d600b 100644 --- a/rootly_sdk/api/ai_chat/stream_ai_chat.py +++ b/rootly_sdk/api/ai_chat/stream_ai_chat.py @@ -12,25 +12,26 @@ def _get_kwargs( *, message: str, - session_id: Unset | UUID = UNSET, - incident_id: Unset | UUID = UNSET, - alert_id: Unset | UUID = UNSET, + session_id: UUID | Unset = UNSET, + incident_id: UUID | Unset = UNSET, + alert_id: UUID | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["message"] = message - json_session_id: Unset | str = UNSET + json_session_id: str | Unset = UNSET if not isinstance(session_id, Unset): json_session_id = str(session_id) params["session_id"] = json_session_id - json_incident_id: Unset | str = UNSET + json_incident_id: str | Unset = UNSET if not isinstance(incident_id, Unset): json_incident_id = str(incident_id) params["incident_id"] = json_incident_id - json_alert_id: Unset | str = UNSET + json_alert_id: str | Unset = UNSET if not isinstance(alert_id, Unset): json_alert_id = str(alert_id) params["alert_id"] = json_alert_id @@ -72,9 +73,9 @@ def sync_detailed( *, client: AuthenticatedClient, message: str, - session_id: Unset | UUID = UNSET, - incident_id: Unset | UUID = UNSET, - alert_id: Unset | UUID = UNSET, + session_id: UUID | Unset = UNSET, + incident_id: UUID | Unset = UNSET, + alert_id: UUID | Unset = UNSET, ) -> Response[Any]: """Stream AI chat response (SSE) @@ -85,9 +86,9 @@ def sync_detailed( Args: message (str): - session_id (Union[Unset, UUID]): - incident_id (Union[Unset, UUID]): - alert_id (Union[Unset, UUID]): + session_id (UUID | Unset): + incident_id (UUID | Unset): + alert_id (UUID | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -115,9 +116,9 @@ async def asyncio_detailed( *, client: AuthenticatedClient, message: str, - session_id: Unset | UUID = UNSET, - incident_id: Unset | UUID = UNSET, - alert_id: Unset | UUID = UNSET, + session_id: UUID | Unset = UNSET, + incident_id: UUID | Unset = UNSET, + alert_id: UUID | Unset = UNSET, ) -> Response[Any]: """Stream AI chat response (SSE) @@ -128,9 +129,9 @@ async def asyncio_detailed( Args: message (str): - session_id (Union[Unset, UUID]): - incident_id (Union[Unset, UUID]): - alert_id (Union[Unset, UUID]): + session_id (UUID | Unset): + incident_id (UUID | Unset): + alert_id (UUID | Unset): 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_retrigger_rules/__init__.py b/rootly_sdk/api/alert_configuration/__init__.py similarity index 100% rename from rootly_sdk/api/alert_retrigger_rules/__init__.py rename to rootly_sdk/api/alert_configuration/__init__.py diff --git a/rootly_sdk/api/alert_retrigger_rules/list_alert_retrigger_rules.py b/rootly_sdk/api/alert_configuration/get_alert_configuration.py similarity index 67% rename from rootly_sdk/api/alert_retrigger_rules/list_alert_retrigger_rules.py rename to rootly_sdk/api/alert_configuration/get_alert_configuration.py index 8b9a6032..f89e1923 100644 --- a/rootly_sdk/api/alert_retrigger_rules/list_alert_retrigger_rules.py +++ b/rootly_sdk/api/alert_configuration/get_alert_configuration.py @@ -5,25 +5,34 @@ from ... import errors from ...client import AuthenticatedClient, Client -from ...models.alert_retrigger_rule_list import AlertRetriggerRuleList +from ...models.alert_configuration_response import AlertConfigurationResponse +from ...models.errors_list import ErrorsList from ...types import Response def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": "/v1/alert_retrigger_rules", + "url": "/v1/alert_configuration", } return _kwargs -def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> AlertRetriggerRuleList | None: +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> AlertConfigurationResponse | ErrorsList | None: if response.status_code == 200: - response_200 = AlertRetriggerRuleList.from_dict(response.json()) + response_200 = AlertConfigurationResponse.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: @@ -32,7 +41,7 @@ def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Res def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertRetriggerRuleList]: +) -> Response[AlertConfigurationResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -44,15 +53,15 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, -) -> Response[AlertRetriggerRuleList]: - """List alert re-trigger rules +) -> Response[AlertConfigurationResponse | ErrorsList]: + """Retrieves the team's alert configuration Raises: errors.UnexpectedStatus: If the server returns 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] + Response[AlertConfigurationResponse | ErrorsList] """ kwargs = _get_kwargs() @@ -67,15 +76,15 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, -) -> AlertRetriggerRuleList | None: - """List alert re-trigger rules +) -> AlertConfigurationResponse | ErrorsList | None: + """Retrieves the team's alert configuration Raises: errors.UnexpectedStatus: If the server 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 + AlertConfigurationResponse | ErrorsList """ return sync_detailed( @@ -86,15 +95,15 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, -) -> Response[AlertRetriggerRuleList]: - """List alert re-trigger rules +) -> Response[AlertConfigurationResponse | ErrorsList]: + """Retrieves the team's alert configuration Raises: errors.UnexpectedStatus: If the server returns 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] + Response[AlertConfigurationResponse | ErrorsList] """ kwargs = _get_kwargs() @@ -107,15 +116,15 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, -) -> AlertRetriggerRuleList | None: - """List alert re-trigger rules +) -> AlertConfigurationResponse | ErrorsList | None: + """Retrieves the team's alert configuration Raises: errors.UnexpectedStatus: If the server 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 + AlertConfigurationResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/alert_configuration/update_alert_configuration.py b/rootly_sdk/api/alert_configuration/update_alert_configuration.py new file mode 100644 index 00000000..a96af892 --- /dev/null +++ b/rootly_sdk/api/alert_configuration/update_alert_configuration.py @@ -0,0 +1,176 @@ +from http import HTTPStatus +from typing import Any + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.alert_configuration_response import AlertConfigurationResponse +from ...models.errors_list import ErrorsList +from ...models.update_alert_configuration import UpdateAlertConfiguration +from ...types import Response + + +def _get_kwargs( + *, + body: UpdateAlertConfiguration, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/alert_configuration", + } + + _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 +) -> AlertConfigurationResponse | ErrorsList | None: + if response.status_code == 200: + response_200 = AlertConfigurationResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 403: + response_403 = ErrorsList.from_dict(response.json()) + + return response_403 + + if response.status_code == 404: + response_404 = ErrorsList.from_dict(response.json()) + + 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: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[AlertConfigurationResponse | 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: UpdateAlertConfiguration, +) -> Response[AlertConfigurationResponse | ErrorsList]: + """Updates the team's alert configuration + + Args: + body (UpdateAlertConfiguration): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AlertConfigurationResponse | 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: UpdateAlertConfiguration, +) -> AlertConfigurationResponse | ErrorsList | None: + """Updates the team's alert configuration + + Args: + body (UpdateAlertConfiguration): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AlertConfigurationResponse | ErrorsList + """ + + return sync_detailed( + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + body: UpdateAlertConfiguration, +) -> Response[AlertConfigurationResponse | ErrorsList]: + """Updates the team's alert configuration + + Args: + body (UpdateAlertConfiguration): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[AlertConfigurationResponse | 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: UpdateAlertConfiguration, +) -> AlertConfigurationResponse | ErrorsList | None: + """Updates the team's alert configuration + + Args: + body (UpdateAlertConfiguration): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + AlertConfigurationResponse | ErrorsList + """ + + return ( + await asyncio_detailed( + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/alert_events/create_alert_event.py b/rootly_sdk/api/alert_events/create_alert_event.py index f5d287dc..1ba1d753 100644 --- a/rootly_sdk/api/alert_events/create_alert_event.py +++ b/rootly_sdk/api/alert_events/create_alert_event.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -8,22 +9,25 @@ from ...models.alert_event_response import AlertEventResponse from ...models.errors_list import ErrorsList from ...models.new_alert_event import NewAlertEvent -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( alert_id: str, *, - body: NewAlertEvent, + body: NewAlertEvent | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/alerts/{alert_id}/events", + "url": "/v1/alerts/{alert_id}/events".format( + alert_id=quote(str(alert_id), safe=""), + ), } - _kwargs["json"] = body.to_dict() + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -65,7 +69,7 @@ def sync_detailed( alert_id: str, *, client: AuthenticatedClient, - body: NewAlertEvent, + body: NewAlertEvent | Unset = UNSET, ) -> Response[AlertEventResponse | ErrorsList]: """Create alert event @@ -73,14 +77,14 @@ def sync_detailed( Args: alert_id (str): - body (NewAlertEvent): + body (NewAlertEvent | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertEventResponse, ErrorsList]] + Response[AlertEventResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( alert_id: str, *, client: AuthenticatedClient, - body: NewAlertEvent, + body: NewAlertEvent | Unset = UNSET, ) -> AlertEventResponse | ErrorsList | None: """Create alert event @@ -107,14 +111,14 @@ def sync( Args: alert_id (str): - body (NewAlertEvent): + body (NewAlertEvent | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertEventResponse, ErrorsList] + AlertEventResponse | ErrorsList """ return sync_detailed( @@ -128,7 +132,7 @@ async def asyncio_detailed( alert_id: str, *, client: AuthenticatedClient, - body: NewAlertEvent, + body: NewAlertEvent | Unset = UNSET, ) -> Response[AlertEventResponse | ErrorsList]: """Create alert event @@ -136,14 +140,14 @@ async def asyncio_detailed( Args: alert_id (str): - body (NewAlertEvent): + body (NewAlertEvent | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertEventResponse, ErrorsList]] + Response[AlertEventResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -160,7 +164,7 @@ async def asyncio( alert_id: str, *, client: AuthenticatedClient, - body: NewAlertEvent, + body: NewAlertEvent | Unset = UNSET, ) -> AlertEventResponse | ErrorsList | None: """Create alert event @@ -168,14 +172,14 @@ async def asyncio( Args: alert_id (str): - body (NewAlertEvent): + body (NewAlertEvent | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertEventResponse, ErrorsList] + 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 cb3dd9b6..fa37ebdf 100644 --- a/rootly_sdk/api/alert_events/delete_alert_event.py +++ b/rootly_sdk/api/alert_events/delete_alert_event.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/alert_events/{id}", + "url": "/v1/alert_events/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -63,7 +67,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ErrorsList]] + Response[Any | ErrorsList] """ kwargs = _get_kwargs( @@ -95,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ErrorsList] + Any | ErrorsList """ return sync_detailed( @@ -122,7 +126,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ErrorsList]] + Response[Any | ErrorsList] """ kwargs = _get_kwargs( @@ -152,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ErrorsList] + 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 97436121..0c7b7f99 100644 --- a/rootly_sdk/api/alert_events/get_alert_event.py +++ b/rootly_sdk/api/alert_events/get_alert_event.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/alert_events/{id}", + "url": "/v1/alert_events/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertEventResponse, ErrorsList]] + Response[AlertEventResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertEventResponse, ErrorsList] + AlertEventResponse | ErrorsList """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertEventResponse, ErrorsList]] + Response[AlertEventResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertEventResponse, ErrorsList] + 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 9f2e292e..cdbb09b0 100644 --- a/rootly_sdk/api/alert_events/list_alert_events.py +++ b/rootly_sdk/api/alert_events/list_alert_events.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,12 +13,13 @@ def _get_kwargs( alert_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterkind: Unset | str = UNSET, - filteraction: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterkind: str | Unset = UNSET, + filteraction: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -34,7 +36,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/alerts/{alert_id}/events", + "url": "/v1/alerts/{alert_id}/events".format( + alert_id=quote(str(alert_id), safe=""), + ), "params": params, } @@ -66,11 +70,11 @@ def sync_detailed( alert_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterkind: Unset | str = UNSET, - filteraction: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterkind: str | Unset = UNSET, + filteraction: str | Unset = UNSET, ) -> Response[AlertEventList]: """List alert events @@ -78,11 +82,11 @@ def sync_detailed( Args: alert_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterkind (Union[Unset, str]): - filteraction (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterkind (str | Unset): + filteraction (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -112,11 +116,11 @@ def sync( alert_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterkind: Unset | str = UNSET, - filteraction: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterkind: str | Unset = UNSET, + filteraction: str | Unset = UNSET, ) -> AlertEventList | None: """List alert events @@ -124,11 +128,11 @@ def sync( Args: alert_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterkind (Union[Unset, str]): - filteraction (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterkind (str | Unset): + filteraction (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -153,11 +157,11 @@ async def asyncio_detailed( alert_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterkind: Unset | str = UNSET, - filteraction: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterkind: str | Unset = UNSET, + filteraction: str | Unset = UNSET, ) -> Response[AlertEventList]: """List alert events @@ -165,11 +169,11 @@ async def asyncio_detailed( Args: alert_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterkind (Union[Unset, str]): - filteraction (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterkind (str | Unset): + filteraction (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -197,11 +201,11 @@ async def asyncio( alert_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterkind: Unset | str = UNSET, - filteraction: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterkind: str | Unset = UNSET, + filteraction: str | Unset = UNSET, ) -> AlertEventList | None: """List alert events @@ -209,11 +213,11 @@ async def asyncio( Args: alert_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterkind (Union[Unset, str]): - filteraction (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterkind (str | Unset): + filteraction (str | Unset): 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 aa204cc1..b9a7a95a 100644 --- a/rootly_sdk/api/alert_events/list_alert_events_feed.py +++ b/rootly_sdk/api/alert_events/list_alert_events_feed.py @@ -18,18 +18,19 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -38,19 +39,19 @@ def _get_kwargs( params["page[after]"] = pageafter - json_sort: Unset | str = UNSET + json_sort: str | Unset = UNSET if not isinstance(sort, Unset): json_sort = sort params["sort"] = json_sort - json_filterkind: Unset | str = UNSET + json_filterkind: str | Unset = UNSET if not isinstance(filterkind, Unset): json_filterkind = filterkind params["filter[kind]"] = json_filterkind - json_filteraction: Unset | str = UNSET + json_filteraction: str | Unset = UNSET if not isinstance(filteraction, Unset): json_filteraction = filteraction @@ -101,17 +102,17 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AlertEventFeedList]: """List alert events across alerts @@ -120,17 +121,17 @@ def sync_detailed( stream forward. Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -164,17 +165,17 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> AlertEventFeedList | None: """List alert events across alerts @@ -183,17 +184,17 @@ def sync( stream forward. Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -222,17 +223,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AlertEventFeedList]: """List alert events across alerts @@ -241,17 +242,17 @@ async def asyncio_detailed( stream forward. Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -283,17 +284,17 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> AlertEventFeedList | None: """List alert events across alerts @@ -302,17 +303,17 @@ async def asyncio( stream forward. Args: - 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]): + 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): 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 f4649948..ef172e7d 100644 --- a/rootly_sdk/api/alert_events/update_alert_event.py +++ b/rootly_sdk/api/alert_events/update_alert_event.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -8,22 +9,25 @@ from ...models.alert_event_response import AlertEventResponse from ...models.errors_list import ErrorsList from ...models.update_alert_event import UpdateAlertEvent -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( id: str, *, - body: UpdateAlertEvent, + body: UpdateAlertEvent | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/v1/alert_events/{id}", + "url": "/v1/alert_events/{id}".format( + id=quote(str(id), safe=""), + ), } - _kwargs["json"] = body.to_dict() + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -65,7 +69,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateAlertEvent, + body: UpdateAlertEvent | Unset = UNSET, ) -> Response[AlertEventResponse | ErrorsList]: """Update alert event @@ -74,15 +78,15 @@ def sync_detailed( Args: id (str): - body (UpdateAlertEvent): Update an alert event. Note: Only alert events with kind='note' - can be updated. You cannot change the kind field. + body (UpdateAlertEvent | Unset): 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[Union[AlertEventResponse, ErrorsList]] + Response[AlertEventResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -101,7 +105,7 @@ def sync( id: str, *, client: AuthenticatedClient, - body: UpdateAlertEvent, + body: UpdateAlertEvent | Unset = UNSET, ) -> AlertEventResponse | ErrorsList | None: """Update alert event @@ -110,15 +114,15 @@ def sync( Args: id (str): - body (UpdateAlertEvent): Update an alert event. Note: Only alert events with kind='note' - can be updated. You cannot change the kind field. + body (UpdateAlertEvent | Unset): 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: - Union[AlertEventResponse, ErrorsList] + AlertEventResponse | ErrorsList """ return sync_detailed( @@ -132,7 +136,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateAlertEvent, + body: UpdateAlertEvent | Unset = UNSET, ) -> Response[AlertEventResponse | ErrorsList]: """Update alert event @@ -141,15 +145,15 @@ async def asyncio_detailed( Args: id (str): - body (UpdateAlertEvent): Update an alert event. Note: Only alert events with kind='note' - can be updated. You cannot change the kind field. + body (UpdateAlertEvent | Unset): 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[Union[AlertEventResponse, ErrorsList]] + Response[AlertEventResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -166,7 +170,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: UpdateAlertEvent, + body: UpdateAlertEvent | Unset = UNSET, ) -> AlertEventResponse | ErrorsList | None: """Update alert event @@ -175,15 +179,15 @@ async def asyncio( Args: id (str): - body (UpdateAlertEvent): Update an alert event. Note: Only alert events with kind='note' - can be updated. You cannot change the kind field. + body (UpdateAlertEvent | Unset): 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: - Union[AlertEventResponse, ErrorsList] + 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 768e2a75..7d0b7150 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[Union[AlertFieldResponse, ErrorsList]] + Response[AlertFieldResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertFieldResponse, ErrorsList] + 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[Union[AlertFieldResponse, ErrorsList]] + Response[AlertFieldResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertFieldResponse, ErrorsList] + 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 7adfde1f..0b0984e0 100644 --- a/rootly_sdk/api/alert_fields/delete_alert_field.py +++ b/rootly_sdk/api/alert_fields/delete_alert_field.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/alert_fields/{id}", + "url": "/v1/alert_fields/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -58,7 +62,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[AlertFieldResponse | ErrorsList]: @@ -67,14 +71,14 @@ def sync_detailed( Delete a specific alert field by id Args: - id (Union[UUID, str]): + id (str | 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[Union[AlertFieldResponse, ErrorsList]] + Response[AlertFieldResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -89,7 +93,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> AlertFieldResponse | ErrorsList | None: @@ -98,14 +102,14 @@ def sync( Delete a specific alert field by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[AlertFieldResponse, ErrorsList] + AlertFieldResponse | ErrorsList """ return sync_detailed( @@ -115,7 +119,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[AlertFieldResponse | ErrorsList]: @@ -124,14 +128,14 @@ async def asyncio_detailed( Delete a specific alert field by id Args: - id (Union[UUID, str]): + id (str | 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[Union[AlertFieldResponse, ErrorsList]] + Response[AlertFieldResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -144,7 +148,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> AlertFieldResponse | ErrorsList | None: @@ -153,14 +157,14 @@ async def asyncio( Delete a specific alert field by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[AlertFieldResponse, ErrorsList] + 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 5d58ac0c..10e2a4c9 100644 --- a/rootly_sdk/api/alert_fields/get_alert_field.py +++ b/rootly_sdk/api/alert_fields/get_alert_field.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/alert_fields/{id}", + "url": "/v1/alert_fields/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[AlertFieldResponse | ErrorsList]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific alert field by id Args: - id (Union[UUID, str]): + id (str | 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[Union[AlertFieldResponse, ErrorsList]] + Response[AlertFieldResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> AlertFieldResponse | ErrorsList | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific alert field by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[AlertFieldResponse, ErrorsList] + AlertFieldResponse | ErrorsList """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[AlertFieldResponse | ErrorsList]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific alert field by id Args: - id (Union[UUID, str]): + id (str | 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[Union[AlertFieldResponse, ErrorsList]] + Response[AlertFieldResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> AlertFieldResponse | ErrorsList | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific alert field by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[AlertFieldResponse, ErrorsList] + 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 68df61d3..3215ff00 100644 --- a/rootly_sdk/api/alert_fields/list_alert_fields.py +++ b/rootly_sdk/api/alert_fields/list_alert_fields.py @@ -11,26 +11,27 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -106,50 +107,50 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AlertFieldList]: """List alert fields List alert fields Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,50 +192,50 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> AlertFieldList | None: """List alert fields List alert fields Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -271,50 +272,50 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AlertFieldList]: """List alert fields List alert fields Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -354,50 +355,50 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> AlertFieldList | None: """List alert fields List alert fields Args: - 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]): + 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): 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 256920be..a65a1e6f 100644 --- a/rootly_sdk/api/alert_fields/update_alert_field.py +++ b/rootly_sdk/api/alert_fields/update_alert_field.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateAlertField, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/alert_fields/{id}", + "url": "/v1/alert_fields/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateAlertField, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific alert field by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateAlertField): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertFieldResponse, ErrorsList]] + Response[AlertFieldResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateAlertField, @@ -107,7 +110,7 @@ def sync( Update a specific alert field by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateAlertField): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertFieldResponse, ErrorsList] + AlertFieldResponse | ErrorsList """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateAlertField, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific alert field by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateAlertField): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertFieldResponse, ErrorsList]] + Response[AlertFieldResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateAlertField, @@ -168,7 +171,7 @@ async def asyncio( Update a specific alert field by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateAlertField): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertFieldResponse, ErrorsList] + 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 0a1096b0..fc100c79 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[Union[AlertGroupResponse, ErrorsList]] + Response[AlertGroupResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -117,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertGroupResponse, ErrorsList] + 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[Union[AlertGroupResponse, ErrorsList]] + Response[AlertGroupResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -176,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertGroupResponse, ErrorsList] + 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 71a11c17..e23900a9 100644 --- a/rootly_sdk/api/alert_groups/delete_alert_group.py +++ b/rootly_sdk/api/alert_groups/delete_alert_group.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/alert_groups/{id}", + "url": "/v1/alert_groups/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[AlertGroupResponse | ErrorsList]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific alert group by id Args: - id (Union[UUID, str]): + id (str | 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[Union[AlertGroupResponse, ErrorsList]] + Response[AlertGroupResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> AlertGroupResponse | ErrorsList | None: @@ -93,14 +97,14 @@ def sync( Delete a specific alert group by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[AlertGroupResponse, ErrorsList] + AlertGroupResponse | ErrorsList """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[AlertGroupResponse | ErrorsList]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific alert group by id Args: - id (Union[UUID, str]): + id (str | 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[Union[AlertGroupResponse, ErrorsList]] + Response[AlertGroupResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> AlertGroupResponse | ErrorsList | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific alert group by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[AlertGroupResponse, ErrorsList] + 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 01d08e47..67e96c43 100644 --- a/rootly_sdk/api/alert_groups/get_alert_group.py +++ b/rootly_sdk/api/alert_groups/get_alert_group.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/alert_groups/{id}", + "url": "/v1/alert_groups/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[AlertGroupResponse | ErrorsList]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific alert group by id Args: - id (Union[UUID, str]): + id (str | 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[Union[AlertGroupResponse, ErrorsList]] + Response[AlertGroupResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> AlertGroupResponse | ErrorsList | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific alert group by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[AlertGroupResponse, ErrorsList] + AlertGroupResponse | ErrorsList """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[AlertGroupResponse | ErrorsList]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific alert group by id Args: - id (Union[UUID, str]): + id (str | 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[Union[AlertGroupResponse, ErrorsList]] + Response[AlertGroupResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> AlertGroupResponse | ErrorsList | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific alert group by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[AlertGroupResponse, ErrorsList] + 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 c094e22c..a7d416e0 100644 --- a/rootly_sdk/api/alert_groups/list_alert_groups.py +++ b/rootly_sdk/api/alert_groups/list_alert_groups.py @@ -11,16 +11,17 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -76,30 +77,30 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AlertGroupList]: """List alert groups List alert groups Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -131,30 +132,30 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> AlertGroupList | None: """List alert groups List alert groups Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,30 +182,30 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AlertGroupList]: """List alert groups List alert groups Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -234,30 +235,30 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> AlertGroupList | None: """List alert groups List alert groups Args: - 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]): + 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): 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 f61520b5..34654d17 100644 --- a/rootly_sdk/api/alert_groups/update_alert_group.py +++ b/rootly_sdk/api/alert_groups/update_alert_group.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateAlertGroup, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/v1/alert_groups/{id}", + "url": "/v1/alert_groups/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateAlertGroup, @@ -75,7 +78,7 @@ def sync_detailed( `group_by_alert_title`, `group_by_alert_urgency`, and `attributes` fields. Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateAlertGroup): Raises: @@ -83,7 +86,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertGroupResponse, ErrorsList]] + Response[AlertGroupResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +102,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateAlertGroup, @@ -111,7 +114,7 @@ def sync( `group_by_alert_title`, `group_by_alert_urgency`, and `attributes` fields. Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateAlertGroup): Raises: @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertGroupResponse, ErrorsList] + AlertGroupResponse | ErrorsList """ return sync_detailed( @@ -130,7 +133,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateAlertGroup, @@ -142,7 +145,7 @@ async def asyncio_detailed( `group_by_alert_title`, `group_by_alert_urgency`, and `attributes` fields. Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateAlertGroup): Raises: @@ -150,7 +153,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertGroupResponse, ErrorsList]] + Response[AlertGroupResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -164,7 +167,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateAlertGroup, @@ -176,7 +179,7 @@ async def asyncio( `group_by_alert_title`, `group_by_alert_urgency`, and `attributes` fields. Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateAlertGroup): Raises: @@ -184,7 +187,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertGroupResponse, ErrorsList] + AlertGroupResponse | ErrorsList """ return ( 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 deleted file mode 100644 index e7846c20..00000000 --- a/rootly_sdk/api/alert_retrigger_rules/delete_alert_retrigger_rule.py +++ /dev/null @@ -1,94 +0,0 @@ -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_routes/create_alert_route.py b/rootly_sdk/api/alert_routes/create_alert_route.py index 71352eb9..92279782 100644 --- a/rootly_sdk/api/alert_routes/create_alert_route.py +++ b/rootly_sdk/api/alert_routes/create_alert_route.py @@ -81,9 +81,15 @@ def sync_detailed( For organizations with large numbers of routing rules, Rootly supports asynchronous rule processing to improve performance. When enabled, rule creation happens in the background. - **Important**: When async processing is enabled, the rules list in the API response will not be up- - to-date immediately after creation. You should refetch the alert route after a few minutes to get - the updated rules. + Asynchronous processing is also applied automatically, whether or not it is enabled for your + organization, when a request carries a rule graph too large to save within the request timeout. Size + is measured in total dependent records — rules plus their condition groups, conditions and + destinations — and for an update it includes the rules already on the route, not just those in the + payload. + + **Important**: Whenever rules are processed asynchronously, the rules list in the API response will + not be up-to-date immediately after creation. You should refetch the alert route, or poll the async + rule creation status endpoint with the `request_id` you supplied, to confirm the rules have landed. If you experience slow operations when managing alert routes with many rules, contact Rootly customer support to enable asynchronous rule processing for your organization. @@ -96,7 +102,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertRouteResponse, ErrorsList]] + Response[AlertRouteResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -126,9 +132,15 @@ def sync( For organizations with large numbers of routing rules, Rootly supports asynchronous rule processing to improve performance. When enabled, rule creation happens in the background. - **Important**: When async processing is enabled, the rules list in the API response will not be up- - to-date immediately after creation. You should refetch the alert route after a few minutes to get - the updated rules. + Asynchronous processing is also applied automatically, whether or not it is enabled for your + organization, when a request carries a rule graph too large to save within the request timeout. Size + is measured in total dependent records — rules plus their condition groups, conditions and + destinations — and for an update it includes the rules already on the route, not just those in the + payload. + + **Important**: Whenever rules are processed asynchronously, the rules list in the API response will + not be up-to-date immediately after creation. You should refetch the alert route, or poll the async + rule creation status endpoint with the `request_id` you supplied, to confirm the rules have landed. If you experience slow operations when managing alert routes with many rules, contact Rootly customer support to enable asynchronous rule processing for your organization. @@ -141,7 +153,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertRouteResponse, ErrorsList] + AlertRouteResponse | ErrorsList """ return sync_detailed( @@ -166,9 +178,15 @@ async def asyncio_detailed( For organizations with large numbers of routing rules, Rootly supports asynchronous rule processing to improve performance. When enabled, rule creation happens in the background. - **Important**: When async processing is enabled, the rules list in the API response will not be up- - to-date immediately after creation. You should refetch the alert route after a few minutes to get - the updated rules. + Asynchronous processing is also applied automatically, whether or not it is enabled for your + organization, when a request carries a rule graph too large to save within the request timeout. Size + is measured in total dependent records — rules plus their condition groups, conditions and + destinations — and for an update it includes the rules already on the route, not just those in the + payload. + + **Important**: Whenever rules are processed asynchronously, the rules list in the API response will + not be up-to-date immediately after creation. You should refetch the alert route, or poll the async + rule creation status endpoint with the `request_id` you supplied, to confirm the rules have landed. If you experience slow operations when managing alert routes with many rules, contact Rootly customer support to enable asynchronous rule processing for your organization. @@ -181,7 +199,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertRouteResponse, ErrorsList]] + Response[AlertRouteResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -209,9 +227,15 @@ async def asyncio( For organizations with large numbers of routing rules, Rootly supports asynchronous rule processing to improve performance. When enabled, rule creation happens in the background. - **Important**: When async processing is enabled, the rules list in the API response will not be up- - to-date immediately after creation. You should refetch the alert route after a few minutes to get - the updated rules. + Asynchronous processing is also applied automatically, whether or not it is enabled for your + organization, when a request carries a rule graph too large to save within the request timeout. Size + is measured in total dependent records — rules plus their condition groups, conditions and + destinations — and for an update it includes the rules already on the route, not just those in the + payload. + + **Important**: Whenever rules are processed asynchronously, the rules list in the API response will + not be up-to-date immediately after creation. You should refetch the alert route, or poll the async + rule creation status endpoint with the `request_id` you supplied, to confirm the rules have landed. If you experience slow operations when managing alert routes with many rules, contact Rootly customer support to enable asynchronous rule processing for your organization. @@ -224,7 +248,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertRouteResponse, ErrorsList] + 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 58ef7c73..013c2d58 100644 --- a/rootly_sdk/api/alert_routes/delete_alert_route.py +++ b/rootly_sdk/api/alert_routes/delete_alert_route.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/alert_routes/{id}", + "url": "/v1/alert_routes/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -80,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[DeleteAlertRouteResponse200, ErrorsList]] + Response[DeleteAlertRouteResponse200 | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[DeleteAlertRouteResponse200, ErrorsList] + DeleteAlertRouteResponse200 | ErrorsList """ return sync_detailed( @@ -141,7 +145,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[DeleteAlertRouteResponse200, ErrorsList]] + Response[DeleteAlertRouteResponse200 | ErrorsList] """ kwargs = _get_kwargs( @@ -172,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[DeleteAlertRouteResponse200, ErrorsList] + 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 0cc6a688..72f3fec8 100644 --- a/rootly_sdk/api/alert_routes/get_alert_route.py +++ b/rootly_sdk/api/alert_routes/get_alert_route.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/alert_routes/{id}", + "url": "/v1/alert_routes/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -82,7 +86,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertRouteResponse, ErrorsList]] + Response[AlertRouteResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -122,7 +126,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertRouteResponse, ErrorsList] + AlertRouteResponse | ErrorsList """ return sync_detailed( @@ -157,7 +161,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertRouteResponse, ErrorsList]] + Response[AlertRouteResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -195,7 +199,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertRouteResponse, ErrorsList] + 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 e248dc32..45ccfeeb 100644 --- a/rootly_sdk/api/alert_routes/list_alert_routes.py +++ b/rootly_sdk/api/alert_routes/list_alert_routes.py @@ -12,20 +12,21 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -98,19 +99,19 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AlertRouteList | ErrorsList]: """List alert routes @@ -119,26 +120,26 @@ def sync_detailed( please contact Rootly customer support.** Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns 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[AlertRouteList, ErrorsList]] + Response[AlertRouteList | ErrorsList] """ kwargs = _get_kwargs( @@ -167,19 +168,19 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> AlertRouteList | ErrorsList | None: """List alert routes @@ -188,26 +189,26 @@ def sync( please contact Rootly customer support.** Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server 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[AlertRouteList, ErrorsList] + AlertRouteList | ErrorsList """ return sync_detailed( @@ -231,19 +232,19 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AlertRouteList | ErrorsList]: """List alert routes @@ -252,26 +253,26 @@ async def asyncio_detailed( please contact Rootly customer support.** Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns 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[AlertRouteList, ErrorsList]] + Response[AlertRouteList | ErrorsList] """ kwargs = _get_kwargs( @@ -298,19 +299,19 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> AlertRouteList | ErrorsList | None: """List alert routes @@ -319,26 +320,26 @@ async def asyncio( please contact Rootly customer support.** Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server 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[AlertRouteList, ErrorsList] + 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 019b4703..a8c0c4a9 100644 --- a/rootly_sdk/api/alert_routes/patch_alert_route.py +++ b/rootly_sdk/api/alert_routes/patch_alert_route.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/v1/alert_routes/{id}", + "url": "/v1/alert_routes/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -91,7 +94,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertRouteResponse, ErrorsList]] + Response[AlertRouteResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -126,7 +129,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertRouteResponse, ErrorsList] + AlertRouteResponse | ErrorsList """ return sync_detailed( @@ -156,7 +159,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertRouteResponse, ErrorsList]] + Response[AlertRouteResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -189,7 +192,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertRouteResponse, ErrorsList] + 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 61f7adaa..116b49a2 100644 --- a/rootly_sdk/api/alert_routes/update_alert_route.py +++ b/rootly_sdk/api/alert_routes/update_alert_route.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/alert_routes/{id}", + "url": "/v1/alert_routes/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -83,9 +86,15 @@ def sync_detailed( For organizations with large numbers of routing rules, Rootly supports asynchronous rule processing to improve performance. When enabled, rule updates happen in the background. - **Important**: When async processing is enabled, the rules list in the API response will not be up- - to-date immediately after update. You should refetch the alert route after a few minutes to get the - updated rules. + Asynchronous processing is also applied automatically, whether or not it is enabled for your + organization, when a request carries a rule graph too large to save within the request timeout. Size + is measured in total dependent records — rules plus their condition groups, conditions and + destinations — and includes the rules already on the route, not just those in the payload, so a + small payload against a large route may still be processed asynchronously. + + **Important**: Whenever rules are processed asynchronously, the rules list in the API response will + not be up-to-date immediately after update. You should refetch the alert route, or poll the async + rule creation status endpoint with the `request_id` you supplied, to confirm the rules have landed. If you experience slow operations when managing alert routes with many rules, contact Rootly customer support to enable asynchronous rule processing for your organization. @@ -99,7 +108,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertRouteResponse, ErrorsList]] + Response[AlertRouteResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -131,9 +140,15 @@ def sync( For organizations with large numbers of routing rules, Rootly supports asynchronous rule processing to improve performance. When enabled, rule updates happen in the background. - **Important**: When async processing is enabled, the rules list in the API response will not be up- - to-date immediately after update. You should refetch the alert route after a few minutes to get the - updated rules. + Asynchronous processing is also applied automatically, whether or not it is enabled for your + organization, when a request carries a rule graph too large to save within the request timeout. Size + is measured in total dependent records — rules plus their condition groups, conditions and + destinations — and includes the rules already on the route, not just those in the payload, so a + small payload against a large route may still be processed asynchronously. + + **Important**: Whenever rules are processed asynchronously, the rules list in the API response will + not be up-to-date immediately after update. You should refetch the alert route, or poll the async + rule creation status endpoint with the `request_id` you supplied, to confirm the rules have landed. If you experience slow operations when managing alert routes with many rules, contact Rootly customer support to enable asynchronous rule processing for your organization. @@ -147,7 +162,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertRouteResponse, ErrorsList] + AlertRouteResponse | ErrorsList """ return sync_detailed( @@ -174,9 +189,15 @@ async def asyncio_detailed( For organizations with large numbers of routing rules, Rootly supports asynchronous rule processing to improve performance. When enabled, rule updates happen in the background. - **Important**: When async processing is enabled, the rules list in the API response will not be up- - to-date immediately after update. You should refetch the alert route after a few minutes to get the - updated rules. + Asynchronous processing is also applied automatically, whether or not it is enabled for your + organization, when a request carries a rule graph too large to save within the request timeout. Size + is measured in total dependent records — rules plus their condition groups, conditions and + destinations — and includes the rules already on the route, not just those in the payload, so a + small payload against a large route may still be processed asynchronously. + + **Important**: Whenever rules are processed asynchronously, the rules list in the API response will + not be up-to-date immediately after update. You should refetch the alert route, or poll the async + rule creation status endpoint with the `request_id` you supplied, to confirm the rules have landed. If you experience slow operations when managing alert routes with many rules, contact Rootly customer support to enable asynchronous rule processing for your organization. @@ -190,7 +211,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertRouteResponse, ErrorsList]] + Response[AlertRouteResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -220,9 +241,15 @@ async def asyncio( For organizations with large numbers of routing rules, Rootly supports asynchronous rule processing to improve performance. When enabled, rule updates happen in the background. - **Important**: When async processing is enabled, the rules list in the API response will not be up- - to-date immediately after update. You should refetch the alert route after a few minutes to get the - updated rules. + Asynchronous processing is also applied automatically, whether or not it is enabled for your + organization, when a request carries a rule graph too large to save within the request timeout. Size + is measured in total dependent records — rules plus their condition groups, conditions and + destinations — and includes the rules already on the route, not just those in the payload, so a + small payload against a large route may still be processed asynchronously. + + **Important**: Whenever rules are processed asynchronously, the rules list in the API response will + not be up-to-date immediately after update. You should refetch the alert route, or poll the async + rule creation status endpoint with the `request_id` you supplied, to confirm the rules have landed. If you experience slow operations when managing alert routes with many rules, contact Rootly customer support to enable asynchronous rule processing for your organization. @@ -236,7 +263,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertRouteResponse, ErrorsList] + 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 1d62f2ab..55f243d7 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[Union[AlertRoutingRuleResponse, ErrorsList]] + Response[AlertRoutingRuleResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -117,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertRoutingRuleResponse, ErrorsList] + 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[Union[AlertRoutingRuleResponse, ErrorsList]] + Response[AlertRoutingRuleResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -176,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertRoutingRuleResponse, ErrorsList] + 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 fbb953a2..9a0263e6 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/alert_routing_rules/{id}", + "url": "/v1/alert_routing_rules/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[AlertRoutingRuleResponse | ErrorsList]: @@ -64,14 +68,14 @@ def sync_detailed( advanced user, please contact Rootly customer support.** Args: - id (Union[UUID, str]): + id (str | 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[Union[AlertRoutingRuleResponse, ErrorsList]] + Response[AlertRoutingRuleResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -86,7 +90,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> AlertRoutingRuleResponse | ErrorsList | None: @@ -97,14 +101,14 @@ def sync( advanced user, please contact Rootly customer support.** Args: - id (Union[UUID, str]): + id (str | 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: - Union[AlertRoutingRuleResponse, ErrorsList] + AlertRoutingRuleResponse | ErrorsList """ return sync_detailed( @@ -114,7 +118,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[AlertRoutingRuleResponse | ErrorsList]: @@ -125,14 +129,14 @@ async def asyncio_detailed( advanced user, please contact Rootly customer support.** Args: - id (Union[UUID, str]): + id (str | 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[Union[AlertRoutingRuleResponse, ErrorsList]] + Response[AlertRoutingRuleResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -145,7 +149,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> AlertRoutingRuleResponse | ErrorsList | None: @@ -156,14 +160,14 @@ async def asyncio( advanced user, please contact Rootly customer support.** Args: - id (Union[UUID, str]): + id (str | 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: - Union[AlertRoutingRuleResponse, ErrorsList] + 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 bf683612..5946c97a 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/alert_routing_rules/{id}", + "url": "/v1/alert_routing_rules/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[AlertRoutingRuleResponse | ErrorsList]: @@ -64,14 +68,14 @@ def sync_detailed( an advanced user, please contact Rootly customer support.** Args: - id (Union[UUID, str]): + id (str | 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[Union[AlertRoutingRuleResponse, ErrorsList]] + Response[AlertRoutingRuleResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -86,7 +90,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> AlertRoutingRuleResponse | ErrorsList | None: @@ -97,14 +101,14 @@ def sync( an advanced user, please contact Rootly customer support.** Args: - id (Union[UUID, str]): + id (str | 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: - Union[AlertRoutingRuleResponse, ErrorsList] + AlertRoutingRuleResponse | ErrorsList """ return sync_detailed( @@ -114,7 +118,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[AlertRoutingRuleResponse | ErrorsList]: @@ -125,14 +129,14 @@ async def asyncio_detailed( an advanced user, please contact Rootly customer support.** Args: - id (Union[UUID, str]): + id (str | 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[Union[AlertRoutingRuleResponse, ErrorsList]] + Response[AlertRoutingRuleResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -145,7 +149,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> AlertRoutingRuleResponse | ErrorsList | None: @@ -156,14 +160,14 @@ async def asyncio( an advanced user, please contact Rootly customer support.** Args: - id (Union[UUID, str]): + id (str | 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: - Union[AlertRoutingRuleResponse, ErrorsList] + 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 80ae8d97..19c93281 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,25 +11,26 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -105,24 +106,24 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AlertRoutingRuleList]: """List alert routing rules @@ -131,24 +132,24 @@ def sync_detailed( please contact Rootly customer support.** Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -189,24 +190,24 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> AlertRoutingRuleList | None: """List alert routing rules @@ -215,24 +216,24 @@ def sync( please contact Rootly customer support.** Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -268,24 +269,24 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AlertRoutingRuleList]: """List alert routing rules @@ -294,24 +295,24 @@ async def asyncio_detailed( please contact Rootly customer support.** Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -350,24 +351,24 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> AlertRoutingRuleList | None: """List alert routing rules @@ -376,24 +377,24 @@ async def asyncio( please contact Rootly customer support.** Args: - 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]): + 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): 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 2963b725..6bc038cd 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateAlertRoutingRule, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/alert_routing_rules/{id}", + "url": "/v1/alert_routing_rules/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateAlertRoutingRule, @@ -75,7 +78,7 @@ def sync_detailed( advanced user, please contact Rootly customer support.** Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateAlertRoutingRule): Raises: @@ -83,7 +86,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertRoutingRuleResponse, ErrorsList]] + Response[AlertRoutingRuleResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +102,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateAlertRoutingRule, @@ -111,7 +114,7 @@ def sync( advanced user, please contact Rootly customer support.** Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateAlertRoutingRule): Raises: @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertRoutingRuleResponse, ErrorsList] + AlertRoutingRuleResponse | ErrorsList """ return sync_detailed( @@ -130,7 +133,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateAlertRoutingRule, @@ -142,7 +145,7 @@ async def asyncio_detailed( advanced user, please contact Rootly customer support.** Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateAlertRoutingRule): Raises: @@ -150,7 +153,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertRoutingRuleResponse, ErrorsList]] + Response[AlertRoutingRuleResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -164,7 +167,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateAlertRoutingRule, @@ -176,7 +179,7 @@ async def asyncio( advanced user, please contact Rootly customer support.** Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateAlertRoutingRule): Raises: @@ -184,7 +187,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertRoutingRuleResponse, ErrorsList] + 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 2799fd4c..893eb998 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[Union[AlertsSourceResponse, ErrorsList]] + Response[AlertsSourceResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertsSourceResponse, ErrorsList] + 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[Union[AlertsSourceResponse, ErrorsList]] + Response[AlertsSourceResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertsSourceResponse, ErrorsList] + 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 92d06bad..24e0748d 100644 --- a/rootly_sdk/api/alert_sources/delete_alerts_source.py +++ b/rootly_sdk/api/alert_sources/delete_alerts_source.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/alert_sources/{id}", + "url": "/v1/alert_sources/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertsSourceResponse, ErrorsList]] + Response[AlertsSourceResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertsSourceResponse, ErrorsList] + AlertsSourceResponse | ErrorsList """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertsSourceResponse, ErrorsList]] + Response[AlertsSourceResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertsSourceResponse, ErrorsList] + 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 dcca8a3e..e3617a5a 100644 --- a/rootly_sdk/api/alert_sources/get_alerts_source.py +++ b/rootly_sdk/api/alert_sources/get_alerts_source.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/alert_sources/{id}", + "url": "/v1/alert_sources/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertsSourceResponse, ErrorsList]] + Response[AlertsSourceResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertsSourceResponse, ErrorsList] + AlertsSourceResponse | ErrorsList """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertsSourceResponse, ErrorsList]] + Response[AlertsSourceResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertsSourceResponse, ErrorsList] + 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 be6ae53e..39744362 100644 --- a/rootly_sdk/api/alert_sources/list_alerts_sources.py +++ b/rootly_sdk/api/alert_sources/list_alerts_sources.py @@ -11,16 +11,17 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -76,30 +77,30 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AlertsSourceList]: """List alert sources List alert sources Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -131,30 +132,30 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> AlertsSourceList | None: """List alert sources List alert sources Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,30 +182,30 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AlertsSourceList]: """List alert sources List alert sources Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -234,30 +235,30 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> AlertsSourceList | None: """List alert sources List alert sources Args: - 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]): + 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): 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 0a73d9e4..73f3a827 100644 --- a/rootly_sdk/api/alert_sources/update_alerts_source.py +++ b/rootly_sdk/api/alert_sources/update_alerts_source.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/alert_sources/{id}", + "url": "/v1/alert_sources/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -44,6 +47,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: @@ -80,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertsSourceResponse, ErrorsList]] + Response[AlertsSourceResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -114,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertsSourceResponse, ErrorsList] + AlertsSourceResponse | ErrorsList """ return sync_detailed( @@ -143,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertsSourceResponse, ErrorsList]] + Response[AlertsSourceResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -175,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertsSourceResponse, ErrorsList] + 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 875f1fa0..d44f0d38 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[Union[AlertUrgencyResponse, ErrorsList]] + Response[AlertUrgencyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertUrgencyResponse, ErrorsList] + 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[Union[AlertUrgencyResponse, ErrorsList]] + Response[AlertUrgencyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertUrgencyResponse, ErrorsList] + 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 e9f92b31..46ed88c4 100644 --- a/rootly_sdk/api/alert_urgencies/delete_alert_urgency.py +++ b/rootly_sdk/api/alert_urgencies/delete_alert_urgency.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/alert_urgencies/{id}", + "url": "/v1/alert_urgencies/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertUrgencyResponse, ErrorsList]] + Response[AlertUrgencyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertUrgencyResponse, ErrorsList] + AlertUrgencyResponse | ErrorsList """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertUrgencyResponse, ErrorsList]] + Response[AlertUrgencyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertUrgencyResponse, ErrorsList] + 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 a1b9d84b..947f8dd9 100644 --- a/rootly_sdk/api/alert_urgencies/get_alert_urgency.py +++ b/rootly_sdk/api/alert_urgencies/get_alert_urgency.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/alert_urgencies/{id}", + "url": "/v1/alert_urgencies/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertUrgencyResponse, ErrorsList]] + Response[AlertUrgencyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertUrgencyResponse, ErrorsList] + AlertUrgencyResponse | ErrorsList """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertUrgencyResponse, ErrorsList]] + Response[AlertUrgencyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertUrgencyResponse, ErrorsList] + 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 3ce979c9..a4455d0f 100644 --- a/rootly_sdk/api/alert_urgencies/list_alert_urgencies.py +++ b/rootly_sdk/api/alert_urgencies/list_alert_urgencies.py @@ -11,21 +11,22 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -91,40 +92,40 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AlertUrgencyList]: """List alert urgencies List alert urgencies Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -161,40 +162,40 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> AlertUrgencyList | None: """List alert urgencies List alert urgencies Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -226,40 +227,40 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AlertUrgencyList]: """List alert urgencies List alert urgencies Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -294,40 +295,40 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> AlertUrgencyList | None: """List alert urgencies List alert urgencies Args: - 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]): + 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): 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 fb82767a..2bef0a08 100644 --- a/rootly_sdk/api/alert_urgencies/update_alert_urgency.py +++ b/rootly_sdk/api/alert_urgencies/update_alert_urgency.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/alert_urgencies/{id}", + "url": "/v1/alert_urgencies/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertUrgencyResponse, ErrorsList]] + Response[AlertUrgencyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertUrgencyResponse, ErrorsList] + AlertUrgencyResponse | ErrorsList """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertUrgencyResponse, ErrorsList]] + Response[AlertUrgencyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertUrgencyResponse, ErrorsList] + AlertUrgencyResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/alerts/acknowledge_alert.py b/rootly_sdk/api/alerts/acknowledge_alert.py index 7bc7b1dd..2baf2e70 100644 --- a/rootly_sdk/api/alerts/acknowledge_alert.py +++ b/rootly_sdk/api/alerts/acknowledge_alert.py @@ -1,23 +1,37 @@ 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.acknowledge_alert import AcknowledgeAlert from ...models.alert_response import AlertResponse from ...models.errors_list import ErrorsList -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( id: str, + *, + body: AcknowledgeAlert | Unset = UNSET, ) -> dict[str, Any]: + headers: dict[str, Any] = {} + _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/alerts/{id}/acknowledge", + "url": "/v1/alerts/{id}/acknowledge".format( + id=quote(str(id), safe=""), + ), } + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() + + headers["Content-Type"] = "application/vnd.api+json" + + _kwargs["headers"] = headers return _kwargs @@ -34,11 +48,21 @@ def _parse_response( return response_400 + if response.status_code == 403: + response_403 = ErrorsList.from_dict(response.json()) + + return response_403 + if response.status_code == 404: response_404 = ErrorsList.from_dict(response.json()) 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: @@ -60,6 +84,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, + body: AcknowledgeAlert | Unset = UNSET, ) -> Response[AlertResponse | ErrorsList]: """Acknowledges an alert @@ -67,17 +92,19 @@ def sync_detailed( Args: id (str): + body (AcknowledgeAlert | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertResponse, ErrorsList]] + Response[AlertResponse | ErrorsList] """ kwargs = _get_kwargs( id=id, + body=body, ) response = client.get_httpx_client().request( @@ -91,6 +118,7 @@ def sync( id: str, *, client: AuthenticatedClient, + body: AcknowledgeAlert | Unset = UNSET, ) -> AlertResponse | ErrorsList | None: """Acknowledges an alert @@ -98,18 +126,20 @@ def sync( Args: id (str): + body (AcknowledgeAlert | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertResponse, ErrorsList] + AlertResponse | ErrorsList """ return sync_detailed( id=id, client=client, + body=body, ).parsed @@ -117,6 +147,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, + body: AcknowledgeAlert | Unset = UNSET, ) -> Response[AlertResponse | ErrorsList]: """Acknowledges an alert @@ -124,17 +155,19 @@ async def asyncio_detailed( Args: id (str): + body (AcknowledgeAlert | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertResponse, ErrorsList]] + Response[AlertResponse | ErrorsList] """ kwargs = _get_kwargs( id=id, + body=body, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -146,6 +179,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, + body: AcknowledgeAlert | Unset = UNSET, ) -> AlertResponse | ErrorsList | None: """Acknowledges an alert @@ -153,18 +187,20 @@ async def asyncio( Args: id (str): + body (AcknowledgeAlert | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertResponse, ErrorsList] + AlertResponse | ErrorsList """ return ( await asyncio_detailed( id=id, client=client, + body=body, ) ).parsed diff --git a/rootly_sdk/api/alerts/attach_alert.py b/rootly_sdk/api/alerts/attach_alert.py index 2c0ce528..3f0911e6 100644 --- a/rootly_sdk/api/alerts/attach_alert.py +++ b/rootly_sdk/api/alerts/attach_alert.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/incidents/{incident_id}/alerts", + "url": "/v1/incidents/{incident_id}/alerts".format( + incident_id=quote(str(incident_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -78,7 +81,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertList, ErrorsList]] + Response[AlertList | ErrorsList] """ kwargs = _get_kwargs( @@ -112,7 +115,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertList, ErrorsList] + AlertList | ErrorsList """ return sync_detailed( @@ -141,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertList, ErrorsList]] + Response[AlertList | ErrorsList] """ kwargs = _get_kwargs( @@ -173,7 +176,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertList, ErrorsList] + AlertList | ErrorsList """ return ( diff --git a/rootly_sdk/api/alerts/create_alert.py b/rootly_sdk/api/alerts/create_alert.py index 9578c1ca..e7ef6e59 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[Union[AlertResponse, ErrorsList]] + Response[AlertResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertResponse, ErrorsList] + 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[Union[AlertResponse, ErrorsList]] + Response[AlertResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertResponse, ErrorsList] + AlertResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/alerts/escalate_alert.py b/rootly_sdk/api/alerts/escalate_alert.py index bd4ac638..c4a33380 100644 --- a/rootly_sdk/api/alerts/escalate_alert.py +++ b/rootly_sdk/api/alerts/escalate_alert.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -8,22 +9,25 @@ from ...models.alert_response import AlertResponse from ...models.errors_list import ErrorsList from ...models.escalate_alert import EscalateAlert -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( id: str, *, - body: EscalateAlert, + body: EscalateAlert | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/alerts/{id}/escalate", + "url": "/v1/alerts/{id}/escalate".format( + id=quote(str(id), safe=""), + ), } - _kwargs["json"] = body.to_dict() + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -75,7 +79,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: EscalateAlert, + body: EscalateAlert | Unset = UNSET, ) -> Response[AlertResponse | ErrorsList]: """Escalates an alert @@ -83,14 +87,14 @@ def sync_detailed( Args: id (str): - body (EscalateAlert): + body (EscalateAlert | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertResponse, ErrorsList]] + Response[AlertResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -109,7 +113,7 @@ def sync( id: str, *, client: AuthenticatedClient, - body: EscalateAlert, + body: EscalateAlert | Unset = UNSET, ) -> AlertResponse | ErrorsList | None: """Escalates an alert @@ -117,14 +121,14 @@ def sync( Args: id (str): - body (EscalateAlert): + body (EscalateAlert | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertResponse, ErrorsList] + AlertResponse | ErrorsList """ return sync_detailed( @@ -138,7 +142,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: EscalateAlert, + body: EscalateAlert | Unset = UNSET, ) -> Response[AlertResponse | ErrorsList]: """Escalates an alert @@ -146,14 +150,14 @@ async def asyncio_detailed( Args: id (str): - body (EscalateAlert): + body (EscalateAlert | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertResponse, ErrorsList]] + Response[AlertResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -170,7 +174,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: EscalateAlert, + body: EscalateAlert | Unset = UNSET, ) -> AlertResponse | ErrorsList | None: """Escalates an alert @@ -178,14 +182,14 @@ async def asyncio( Args: id (str): - body (EscalateAlert): + body (EscalateAlert | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertResponse, ErrorsList] + AlertResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/alerts/get_alert.py b/rootly_sdk/api/alerts/get_alert.py index c34c24e4..20a1c7fd 100644 --- a/rootly_sdk/api/alerts/get_alert.py +++ b/rootly_sdk/api/alerts/get_alert.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -14,11 +15,12 @@ def _get_kwargs( id: str, *, - include: Unset | GetAlertInclude = UNSET, + include: GetAlertInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/alerts/{id}", + "url": "/v1/alerts/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -69,7 +73,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetAlertInclude = UNSET, + include: GetAlertInclude | Unset = UNSET, ) -> Response[AlertResponse | ErrorsList]: """Retrieves an alert @@ -77,14 +81,14 @@ def sync_detailed( Args: id (str): - include (Union[Unset, GetAlertInclude]): + include (GetAlertInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertResponse, ErrorsList]] + Response[AlertResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -103,7 +107,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Unset | GetAlertInclude = UNSET, + include: GetAlertInclude | Unset = UNSET, ) -> AlertResponse | ErrorsList | None: """Retrieves an alert @@ -111,14 +115,14 @@ def sync( Args: id (str): - include (Union[Unset, GetAlertInclude]): + include (GetAlertInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertResponse, ErrorsList] + AlertResponse | ErrorsList """ return sync_detailed( @@ -132,7 +136,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetAlertInclude = UNSET, + include: GetAlertInclude | Unset = UNSET, ) -> Response[AlertResponse | ErrorsList]: """Retrieves an alert @@ -140,14 +144,14 @@ async def asyncio_detailed( Args: id (str): - include (Union[Unset, GetAlertInclude]): + include (GetAlertInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertResponse, ErrorsList]] + Response[AlertResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -164,7 +168,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Unset | GetAlertInclude = UNSET, + include: GetAlertInclude | Unset = UNSET, ) -> AlertResponse | ErrorsList | None: """Retrieves an alert @@ -172,14 +176,14 @@ async def asyncio( Args: id (str): - include (Union[Unset, GetAlertInclude]): + include (GetAlertInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertResponse, ErrorsList] + AlertResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/alerts/get_receipt.py b/rootly_sdk/api/alerts/get_receipt.py index 032cd781..0cd00675 100644 --- a/rootly_sdk/api/alerts/get_receipt.py +++ b/rootly_sdk/api/alerts/get_receipt.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/alerts/receipts/{id}", + "url": "/v1/alerts/receipts/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -63,7 +67,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, Receipt]] + Response[Any | Receipt] """ kwargs = _get_kwargs( @@ -95,7 +99,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, Receipt] + Any | Receipt """ return sync_detailed( @@ -122,7 +126,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, Receipt]] + Response[Any | Receipt] """ kwargs = _get_kwargs( @@ -152,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, Receipt] + Any | Receipt """ return ( diff --git a/rootly_sdk/api/alerts/list_alerts.py b/rootly_sdk/api/alerts/list_alerts.py index 0193806d..6e36af8d 100644 --- a/rootly_sdk/api/alerts/list_alerts.py +++ b/rootly_sdk/api/alerts/list_alerts.py @@ -12,60 +12,61 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -204,112 +205,112 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AlertList]: """List alerts List alerts Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -382,112 +383,112 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> AlertList | None: """List alerts List alerts Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -555,112 +556,112 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AlertList]: """List alerts List alerts Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -731,112 +732,112 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> AlertList | None: """List alerts List alerts Args: - 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]): + 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): 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 0932d1c3..4358b186 100644 --- a/rootly_sdk/api/alerts/list_incident_alerts.py +++ b/rootly_sdk/api/alerts/list_incident_alerts.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,11 +14,12 @@ def _get_kwargs( incident_id: str, *, - include: Unset | ListIncidentAlertsInclude = UNSET, + include: ListIncidentAlertsInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -27,7 +29,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incidents/{incident_id}/alerts", + "url": "/v1/incidents/{incident_id}/alerts".format( + incident_id=quote(str(incident_id), safe=""), + ), "params": params, } @@ -59,7 +63,7 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Unset | ListIncidentAlertsInclude = UNSET, + include: ListIncidentAlertsInclude | Unset = UNSET, ) -> Response[AlertList]: """List Incident alerts @@ -67,7 +71,7 @@ def sync_detailed( Args: incident_id (str): - include (Union[Unset, ListIncidentAlertsInclude]): + include (ListIncidentAlertsInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -93,7 +97,7 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: Unset | ListIncidentAlertsInclude = UNSET, + include: ListIncidentAlertsInclude | Unset = UNSET, ) -> AlertList | None: """List Incident alerts @@ -101,7 +105,7 @@ def sync( Args: incident_id (str): - include (Union[Unset, ListIncidentAlertsInclude]): + include (ListIncidentAlertsInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -122,7 +126,7 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Unset | ListIncidentAlertsInclude = UNSET, + include: ListIncidentAlertsInclude | Unset = UNSET, ) -> Response[AlertList]: """List Incident alerts @@ -130,7 +134,7 @@ async def asyncio_detailed( Args: incident_id (str): - include (Union[Unset, ListIncidentAlertsInclude]): + include (ListIncidentAlertsInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -154,7 +158,7 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: Unset | ListIncidentAlertsInclude = UNSET, + include: ListIncidentAlertsInclude | Unset = UNSET, ) -> AlertList | None: """List Incident alerts @@ -162,7 +166,7 @@ async def asyncio( Args: incident_id (str): - include (Union[Unset, ListIncidentAlertsInclude]): + include (ListIncidentAlertsInclude | Unset): 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 0dfeab41..66ec0165 100644 --- a/rootly_sdk/api/alerts/resolve_alert.py +++ b/rootly_sdk/api/alerts/resolve_alert.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -8,22 +9,25 @@ from ...models.alert_response import AlertResponse from ...models.errors_list import ErrorsList from ...models.resolve_alert import ResolveAlert -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( id: str, *, - body: ResolveAlert, + body: ResolveAlert | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/alerts/{id}/resolve", + "url": "/v1/alerts/{id}/resolve".format( + id=quote(str(id), safe=""), + ), } - _kwargs["json"] = body.to_dict() + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -65,7 +69,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: ResolveAlert, + body: ResolveAlert | Unset = UNSET, ) -> Response[AlertResponse | ErrorsList]: """Resolves an alert @@ -73,14 +77,14 @@ def sync_detailed( Args: id (str): - body (ResolveAlert): + body (ResolveAlert | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertResponse, ErrorsList]] + Response[AlertResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( id: str, *, client: AuthenticatedClient, - body: ResolveAlert, + body: ResolveAlert | Unset = UNSET, ) -> AlertResponse | ErrorsList | None: """Resolves an alert @@ -107,14 +111,14 @@ def sync( Args: id (str): - body (ResolveAlert): + body (ResolveAlert | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertResponse, ErrorsList] + AlertResponse | ErrorsList """ return sync_detailed( @@ -128,7 +132,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: ResolveAlert, + body: ResolveAlert | Unset = UNSET, ) -> Response[AlertResponse | ErrorsList]: """Resolves an alert @@ -136,14 +140,14 @@ async def asyncio_detailed( Args: id (str): - body (ResolveAlert): + body (ResolveAlert | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertResponse, ErrorsList]] + Response[AlertResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -160,7 +164,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: ResolveAlert, + body: ResolveAlert | Unset = UNSET, ) -> AlertResponse | ErrorsList | None: """Resolves an alert @@ -168,14 +172,14 @@ async def asyncio( Args: id (str): - body (ResolveAlert): + body (ResolveAlert | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertResponse, ErrorsList] + AlertResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/alerts/snooze_alert.py b/rootly_sdk/api/alerts/snooze_alert.py index 3c2d9ff0..cf592ccd 100644 --- a/rootly_sdk/api/alerts/snooze_alert.py +++ b/rootly_sdk/api/alerts/snooze_alert.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/alerts/{id}/snooze", + "url": "/v1/alerts/{id}/snooze".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -90,7 +93,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertResponse, ErrorsList]] + Response[AlertResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -124,7 +127,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertResponse, ErrorsList] + AlertResponse | ErrorsList """ return sync_detailed( @@ -153,7 +156,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertResponse, ErrorsList]] + Response[AlertResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -185,7 +188,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertResponse, ErrorsList] + AlertResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/alerts/update_alert.py b/rootly_sdk/api/alerts/update_alert.py index 169e0410..5a60b818 100644 --- a/rootly_sdk/api/alerts/update_alert.py +++ b/rootly_sdk/api/alerts/update_alert.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -8,22 +9,25 @@ from ...models.alert_response import AlertResponse from ...models.errors_list import ErrorsList from ...models.update_alert import UpdateAlert -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( id: str, *, - body: UpdateAlert, + body: UpdateAlert | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/v1/alerts/{id}", + "url": "/v1/alerts/{id}".format( + id=quote(str(id), safe=""), + ), } - _kwargs["json"] = body.to_dict() + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -65,7 +69,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateAlert, + body: UpdateAlert | Unset = UNSET, ) -> Response[AlertResponse | ErrorsList]: """Update alert @@ -73,14 +77,14 @@ def sync_detailed( Args: id (str): - body (UpdateAlert): + body (UpdateAlert | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertResponse, ErrorsList]] + Response[AlertResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( id: str, *, client: AuthenticatedClient, - body: UpdateAlert, + body: UpdateAlert | Unset = UNSET, ) -> AlertResponse | ErrorsList | None: """Update alert @@ -107,14 +111,14 @@ def sync( Args: id (str): - body (UpdateAlert): + body (UpdateAlert | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertResponse, ErrorsList] + AlertResponse | ErrorsList """ return sync_detailed( @@ -128,7 +132,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateAlert, + body: UpdateAlert | Unset = UNSET, ) -> Response[AlertResponse | ErrorsList]: """Update alert @@ -136,14 +140,14 @@ async def asyncio_detailed( Args: id (str): - body (UpdateAlert): + body (UpdateAlert | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AlertResponse, ErrorsList]] + Response[AlertResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -160,7 +164,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: UpdateAlert, + body: UpdateAlert | Unset = UNSET, ) -> AlertResponse | ErrorsList | None: """Update alert @@ -168,14 +172,14 @@ async def asyncio( Args: id (str): - body (UpdateAlert): + body (UpdateAlert | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AlertResponse, ErrorsList] + 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 5df4ee0d..6573821d 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[Union[ApiKeyWithTokenResponse, ErrorsList]] + Response[ApiKeyWithTokenResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -135,7 +135,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ApiKeyWithTokenResponse, ErrorsList] + 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[Union[ApiKeyWithTokenResponse, ErrorsList]] + Response[ApiKeyWithTokenResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -212,7 +212,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ApiKeyWithTokenResponse, ErrorsList] + 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 6760e4a8..948015a0 100644 --- a/rootly_sdk/api/api_keys/delete_api_key.py +++ b/rootly_sdk/api/api_keys/delete_api_key.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -14,9 +15,12 @@ def _get_kwargs( id: UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/api_keys/{id}", + "url": "/v1/api_keys/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -73,7 +77,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ApiKeyResponse, ErrorsList]] + Response[ApiKeyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -108,7 +112,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ApiKeyResponse, ErrorsList] + ApiKeyResponse | ErrorsList """ return sync_detailed( @@ -138,7 +142,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ApiKeyResponse, ErrorsList]] + Response[ApiKeyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -171,7 +175,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ApiKeyResponse, ErrorsList] + 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 5cc91a24..6ba239a8 100644 --- a/rootly_sdk/api/api_keys/get_api_key.py +++ b/rootly_sdk/api/api_keys/get_api_key.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -14,8 +15,9 @@ def _get_kwargs( id: UUID, *, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -24,7 +26,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/api_keys/{id}", + "url": "/v1/api_keys/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -65,7 +69,7 @@ def sync_detailed( id: UUID, *, client: AuthenticatedClient, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> Response[ApiKeyResponse | ErrorsList]: """Retrieves an API key @@ -74,14 +78,14 @@ def sync_detailed( Args: id (UUID): - include (Union[Unset, str]): + include (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ApiKeyResponse, ErrorsList]] + Response[ApiKeyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -100,7 +104,7 @@ def sync( id: UUID, *, client: AuthenticatedClient, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> ApiKeyResponse | ErrorsList | None: """Retrieves an API key @@ -109,14 +113,14 @@ def sync( Args: id (UUID): - include (Union[Unset, str]): + include (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ApiKeyResponse, ErrorsList] + ApiKeyResponse | ErrorsList """ return sync_detailed( @@ -130,7 +134,7 @@ async def asyncio_detailed( id: UUID, *, client: AuthenticatedClient, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> Response[ApiKeyResponse | ErrorsList]: """Retrieves an API key @@ -139,14 +143,14 @@ async def asyncio_detailed( Args: id (UUID): - include (Union[Unset, str]): + include (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ApiKeyResponse, ErrorsList]] + Response[ApiKeyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -163,7 +167,7 @@ async def asyncio( id: UUID, *, client: AuthenticatedClient, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> ApiKeyResponse | ErrorsList | None: """Retrieves an API key @@ -172,14 +176,14 @@ async def asyncio( Args: id (UUID): - include (Union[Unset, str]): + include (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ApiKeyResponse, ErrorsList] + 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 2c8322c6..6f057d91 100644 --- a/rootly_sdk/api/api_keys/list_api_keys.py +++ b/rootly_sdk/api/api_keys/list_api_keys.py @@ -12,31 +12,32 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -131,30 +132,30 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[ApiKeyList | ErrorsList]: """List API keys @@ -177,37 +178,37 @@ def sync_detailed( `updated_at`, `expires_at`, `last_used_at`. Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns 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[ApiKeyList, ErrorsList]] + Response[ApiKeyList | ErrorsList] """ kwargs = _get_kwargs( @@ -247,30 +248,30 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> ApiKeyList | ErrorsList | None: """List API keys @@ -293,37 +294,37 @@ def sync( `updated_at`, `expires_at`, `last_used_at`. Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server 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[ApiKeyList, ErrorsList] + ApiKeyList | ErrorsList """ return sync_detailed( @@ -358,30 +359,30 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[ApiKeyList | ErrorsList]: """List API keys @@ -404,37 +405,37 @@ async def asyncio_detailed( `updated_at`, `expires_at`, `last_used_at`. Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns 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[ApiKeyList, ErrorsList]] + Response[ApiKeyList | ErrorsList] """ kwargs = _get_kwargs( @@ -472,30 +473,30 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> ApiKeyList | ErrorsList | None: """List API keys @@ -518,37 +519,37 @@ async def asyncio( `updated_at`, `expires_at`, `last_used_at`. Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server 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[ApiKeyList, ErrorsList] + 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 7fff187b..9bdb2773 100644 --- a/rootly_sdk/api/api_keys/rotate_api_key.py +++ b/rootly_sdk/api/api_keys/rotate_api_key.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -8,22 +9,25 @@ 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 Response +from ...types import UNSET, Response, Unset def _get_kwargs( id: str, *, - body: RotateApiKey, + body: RotateApiKey | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/api_keys/{id}/rotate", + "url": "/v1/api_keys/{id}/rotate".format( + id=quote(str(id), safe=""), + ), } - _kwargs["json"] = body.to_dict() + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -65,7 +69,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: RotateApiKey, + body: RotateApiKey | Unset = UNSET, ) -> Response[ApiKeyWithTokenResponse | ErrorsList]: """Rotate an API key @@ -92,14 +96,14 @@ def sync_detailed( Args: id (str): - body (RotateApiKey): + body (RotateApiKey | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ApiKeyWithTokenResponse, ErrorsList]] + Response[ApiKeyWithTokenResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -118,7 +122,7 @@ def sync( id: str, *, client: AuthenticatedClient, - body: RotateApiKey, + body: RotateApiKey | Unset = UNSET, ) -> ApiKeyWithTokenResponse | ErrorsList | None: """Rotate an API key @@ -145,14 +149,14 @@ def sync( Args: id (str): - body (RotateApiKey): + body (RotateApiKey | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ApiKeyWithTokenResponse, ErrorsList] + ApiKeyWithTokenResponse | ErrorsList """ return sync_detailed( @@ -166,7 +170,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: RotateApiKey, + body: RotateApiKey | Unset = UNSET, ) -> Response[ApiKeyWithTokenResponse | ErrorsList]: """Rotate an API key @@ -193,14 +197,14 @@ async def asyncio_detailed( Args: id (str): - body (RotateApiKey): + body (RotateApiKey | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ApiKeyWithTokenResponse, ErrorsList]] + Response[ApiKeyWithTokenResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -217,7 +221,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: RotateApiKey, + body: RotateApiKey | Unset = UNSET, ) -> ApiKeyWithTokenResponse | ErrorsList | None: """Rotate an API key @@ -244,14 +248,14 @@ async def asyncio( Args: id (str): - body (RotateApiKey): + body (RotateApiKey | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ApiKeyWithTokenResponse, ErrorsList] + 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 1411b1d1..94cebad5 100644 --- a/rootly_sdk/api/api_keys/update_api_key.py +++ b/rootly_sdk/api/api_keys/update_api_key.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/api_keys/{id}", + "url": "/v1/api_keys/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -87,7 +90,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ApiKeyResponse, ErrorsList]] + Response[ApiKeyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -127,7 +130,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ApiKeyResponse, ErrorsList] + ApiKeyResponse | ErrorsList """ return sync_detailed( @@ -162,7 +165,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ApiKeyResponse, ErrorsList]] + Response[ApiKeyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -200,7 +203,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ApiKeyResponse, ErrorsList] + ApiKeyResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/audits/list_audits.py b/rootly_sdk/api/audits/list_audits.py index 4bca1146..fce7f754 100644 --- a/rootly_sdk/api/audits/list_audits.py +++ b/rootly_sdk/api/audits/list_audits.py @@ -11,35 +11,36 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -133,68 +134,68 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AuditsList]: """List audits List audits Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -245,68 +246,68 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> AuditsList | None: """List audits List audits Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -352,68 +353,68 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AuditsList]: """List audits List audits Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -462,68 +463,68 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> AuditsList | None: """List audits List audits Args: - 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]): + 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): 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 42583829..2d0bfee5 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[Union[AuthorizationResponse, ErrorsList]] + Response[AuthorizationResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -108,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AuthorizationResponse, ErrorsList] + 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[Union[AuthorizationResponse, ErrorsList]] + Response[AuthorizationResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -163,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AuthorizationResponse, ErrorsList] + AuthorizationResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/authorizations/delete_authorization.py b/rootly_sdk/api/authorizations/delete_authorization.py index bfe0dd26..9fed121b 100644 --- a/rootly_sdk/api/authorizations/delete_authorization.py +++ b/rootly_sdk/api/authorizations/delete_authorization.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/authorizations/{id}", + "url": "/v1/authorizations/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AuthorizationResponse, ErrorsList]] + Response[AuthorizationResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AuthorizationResponse, ErrorsList] + AuthorizationResponse | ErrorsList """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AuthorizationResponse, ErrorsList]] + Response[AuthorizationResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AuthorizationResponse, ErrorsList] + AuthorizationResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/authorizations/get_authorization.py b/rootly_sdk/api/authorizations/get_authorization.py index f715f915..c58b0704 100644 --- a/rootly_sdk/api/authorizations/get_authorization.py +++ b/rootly_sdk/api/authorizations/get_authorization.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/authorizations/{id}", + "url": "/v1/authorizations/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AuthorizationResponse, ErrorsList]] + Response[AuthorizationResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AuthorizationResponse, ErrorsList] + AuthorizationResponse | ErrorsList """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AuthorizationResponse, ErrorsList]] + Response[AuthorizationResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AuthorizationResponse, ErrorsList] + AuthorizationResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/authorizations/list_authorizations.py b/rootly_sdk/api/authorizations/list_authorizations.py index a5da47f3..46d7343d 100644 --- a/rootly_sdk/api/authorizations/list_authorizations.py +++ b/rootly_sdk/api/authorizations/list_authorizations.py @@ -11,19 +11,20 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -85,36 +86,36 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AuthorizationList]: """List authorizations List authorizations Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -149,36 +150,36 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> AuthorizationList | None: """List authorizations List authorizations Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -208,36 +209,36 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[AuthorizationList]: """List authorizations List authorizations Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -270,36 +271,36 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> AuthorizationList | None: """List authorizations List authorizations Args: - 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]): + 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): 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 67dfa1c8..958e25ad 100644 --- a/rootly_sdk/api/authorizations/update_authorization.py +++ b/rootly_sdk/api/authorizations/update_authorization.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/authorizations/{id}", + "url": "/v1/authorizations/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AuthorizationResponse, ErrorsList]] + Response[AuthorizationResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AuthorizationResponse, ErrorsList] + AuthorizationResponse | ErrorsList """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[AuthorizationResponse, ErrorsList]] + Response[AuthorizationResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[AuthorizationResponse, ErrorsList] + 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 a78ecfc4..a0c9a8cf 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[Union[CatalogChecklistTemplateResponse, ErrorsList]] + Response[CatalogChecklistTemplateResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogChecklistTemplateResponse, ErrorsList] + 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[Union[CatalogChecklistTemplateResponse, ErrorsList]] + Response[CatalogChecklistTemplateResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogChecklistTemplateResponse, ErrorsList] + 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 8dabe3aa..e96022f3 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/catalog_checklist_templates/{id}", + "url": "/v1/catalog_checklist_templates/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific catalog checklist template by id Args: - id (Union[UUID, str]): + id (str | 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[Union[CatalogChecklistTemplateResponse, ErrorsList]] + Response[CatalogChecklistTemplateResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> CatalogChecklistTemplateResponse | ErrorsList | None: @@ -93,14 +97,14 @@ def sync( Delete a specific catalog checklist template by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[CatalogChecklistTemplateResponse, ErrorsList] + CatalogChecklistTemplateResponse | ErrorsList """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific catalog checklist template by id Args: - id (Union[UUID, str]): + id (str | 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[Union[CatalogChecklistTemplateResponse, ErrorsList]] + Response[CatalogChecklistTemplateResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> CatalogChecklistTemplateResponse | ErrorsList | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific catalog checklist template by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[CatalogChecklistTemplateResponse, ErrorsList] + 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 7b09302b..baaac4c8 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/catalog_checklist_templates/{id}", + "url": "/v1/catalog_checklist_templates/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific catalog checklist template by id Args: - id (Union[UUID, str]): + id (str | 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[Union[CatalogChecklistTemplateResponse, ErrorsList]] + Response[CatalogChecklistTemplateResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> CatalogChecklistTemplateResponse | ErrorsList | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific catalog checklist template by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[CatalogChecklistTemplateResponse, ErrorsList] + CatalogChecklistTemplateResponse | ErrorsList """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[CatalogChecklistTemplateResponse | ErrorsList]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific catalog checklist template by id Args: - id (Union[UUID, str]): + id (str | 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[Union[CatalogChecklistTemplateResponse, ErrorsList]] + Response[CatalogChecklistTemplateResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> CatalogChecklistTemplateResponse | ErrorsList | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific catalog checklist template by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[CatalogChecklistTemplateResponse, ErrorsList] + 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 3201e961..4b04ef57 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,28 +17,29 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Unset | str = UNSET + json_sort: str | Unset = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -103,36 +104,36 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogChecklistTemplateList]: """List catalog checklist templates List catalog checklist templates Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -167,36 +168,36 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogChecklistTemplateList | None: """List catalog checklist templates List catalog checklist templates Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -226,36 +227,36 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogChecklistTemplateList]: """List catalog checklist templates List catalog checklist templates Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -288,36 +289,36 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogChecklistTemplateList | None: """List catalog checklist templates List catalog checklist templates Args: - 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]): + 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): 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 6d42ab1f..03363ecf 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,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote from uuid import UUID import httpx @@ -11,11 +12,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/catalog_checklist_templates/{id}/trigger", + "url": "/v1/catalog_checklist_templates/{id}/trigger".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -47,7 +51,7 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[Any | ErrorsList]: @@ -56,14 +60,14 @@ def sync_detailed( Triggers an audit for all applicable entities of the checklist template Args: - id (Union[UUID, str]): + id (str | 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[Union[Any, ErrorsList]] + Response[Any | ErrorsList] """ kwargs = _get_kwargs( @@ -78,7 +82,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Any | ErrorsList | None: @@ -87,14 +91,14 @@ def sync( Triggers an audit for all applicable entities of the checklist template Args: - id (Union[UUID, str]): + id (str | 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: - Union[Any, ErrorsList] + Any | ErrorsList """ return sync_detailed( @@ -104,7 +108,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[Any | ErrorsList]: @@ -113,14 +117,14 @@ async def asyncio_detailed( Triggers an audit for all applicable entities of the checklist template Args: - id (Union[UUID, str]): + id (str | 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[Union[Any, ErrorsList]] + Response[Any | ErrorsList] """ kwargs = _get_kwargs( @@ -133,7 +137,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Any | ErrorsList | None: @@ -142,14 +146,14 @@ async def asyncio( Triggers an audit for all applicable entities of the checklist template Args: - id (Union[UUID, str]): + id (str | 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: - Union[Any, ErrorsList] + 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 23ee77cb..180d4b3c 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateCatalogChecklistTemplate, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/catalog_checklist_templates/{id}", + "url": "/v1/catalog_checklist_templates/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCatalogChecklistTemplate, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific catalog checklist template by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCatalogChecklistTemplate): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogChecklistTemplateResponse, ErrorsList]] + Response[CatalogChecklistTemplateResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCatalogChecklistTemplate, @@ -107,7 +110,7 @@ def sync( Update a specific catalog checklist template by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCatalogChecklistTemplate): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogChecklistTemplateResponse, ErrorsList] + CatalogChecklistTemplateResponse | ErrorsList """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCatalogChecklistTemplate, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific catalog checklist template by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCatalogChecklistTemplate): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogChecklistTemplateResponse, ErrorsList]] + Response[CatalogChecklistTemplateResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCatalogChecklistTemplate, @@ -168,7 +171,7 @@ async def asyncio( Update a specific catalog checklist template by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCatalogChecklistTemplate): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogChecklistTemplateResponse, ErrorsList] + 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 e356f8df..2e7b988d 100644 --- a/rootly_sdk/api/catalog_entities/bulk_delete_catalog_entities.py +++ b/rootly_sdk/api/catalog_entities/bulk_delete_catalog_entities.py @@ -1,5 +1,6 @@ from http import HTTPStatus -from typing import Any, Union +from typing import Any +from urllib.parse import quote import httpx @@ -15,16 +16,17 @@ def _get_kwargs( catalog_id: str, *, - body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], + body: BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/catalogs/{catalog_id}/entities/bulk_delete", + "url": "/v1/catalogs/{catalog_id}/entities/bulk_delete".format( + catalog_id=quote(str(catalog_id), safe=""), + ), } - _kwargs["json"]: dict[str, Any] if isinstance(body, BulkDestroyCatalogEntitiesType0): _kwargs["json"] = body.to_dict() else: @@ -38,7 +40,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkDestroyCatalogEntitiesResponse | ErrorsList | Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"] | None: +) -> BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList | None: if response.status_code == 200: response_200 = BulkDestroyCatalogEntitiesResponse.from_dict(response.json()) @@ -51,14 +53,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"]: + def _parse_response_422(data: object) -> BulkDestroyCatalogEntitiesResponse | ErrorsList: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -78,9 +80,7 @@ def _parse_response_422(data: object) -> Union["BulkDestroyCatalogEntitiesRespon def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ - BulkDestroyCatalogEntitiesResponse | ErrorsList | Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"] -]: +) -> Response[BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -93,10 +93,8 @@ def sync_detailed( catalog_id: str, *, client: AuthenticatedClient, - body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], -) -> Response[ - BulkDestroyCatalogEntitiesResponse | ErrorsList | Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"] -]: + body: BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1, +) -> Response[BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList]: """Bulk delete Catalog Entities Delete catalog entities by external_id list, or prune by managed_by source. Two mutually exclusive @@ -104,8 +102,8 @@ def sync_detailed( Args: catalog_id (str): - body (Union['BulkDestroyCatalogEntitiesType0', 'BulkDestroyCatalogEntitiesType1']): Two - mutually exclusive modes. Pass exactly one of: external_ids (delete specific entities) or + body (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: @@ -113,7 +111,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union['BulkDestroyCatalogEntitiesResponse', 'ErrorsList']]] + Response[BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList] """ kwargs = _get_kwargs( @@ -132,8 +130,8 @@ def sync( catalog_id: str, *, client: AuthenticatedClient, - body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], -) -> BulkDestroyCatalogEntitiesResponse | ErrorsList | Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"] | None: + body: BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1, +) -> BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList | None: """Bulk delete Catalog Entities Delete catalog entities by external_id list, or prune by managed_by source. Two mutually exclusive @@ -141,8 +139,8 @@ def sync( Args: catalog_id (str): - body (Union['BulkDestroyCatalogEntitiesType0', 'BulkDestroyCatalogEntitiesType1']): Two - mutually exclusive modes. Pass exactly one of: external_ids (delete specific entities) or + body (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: @@ -150,7 +148,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union['BulkDestroyCatalogEntitiesResponse', 'ErrorsList']] + BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList """ return sync_detailed( @@ -164,10 +162,8 @@ async def asyncio_detailed( catalog_id: str, *, client: AuthenticatedClient, - body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], -) -> Response[ - BulkDestroyCatalogEntitiesResponse | ErrorsList | Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"] -]: + body: BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1, +) -> Response[BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList]: """Bulk delete Catalog Entities Delete catalog entities by external_id list, or prune by managed_by source. Two mutually exclusive @@ -175,8 +171,8 @@ async def asyncio_detailed( Args: catalog_id (str): - body (Union['BulkDestroyCatalogEntitiesType0', 'BulkDestroyCatalogEntitiesType1']): Two - mutually exclusive modes. Pass exactly one of: external_ids (delete specific entities) or + body (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: @@ -184,7 +180,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union['BulkDestroyCatalogEntitiesResponse', 'ErrorsList']]] + Response[BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList] """ kwargs = _get_kwargs( @@ -201,8 +197,8 @@ async def asyncio( catalog_id: str, *, client: AuthenticatedClient, - body: Union["BulkDestroyCatalogEntitiesType0", "BulkDestroyCatalogEntitiesType1"], -) -> BulkDestroyCatalogEntitiesResponse | ErrorsList | Union["BulkDestroyCatalogEntitiesResponse", "ErrorsList"] | None: + body: BulkDestroyCatalogEntitiesType0 | BulkDestroyCatalogEntitiesType1, +) -> BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | ErrorsList | None: """Bulk delete Catalog Entities Delete catalog entities by external_id list, or prune by managed_by source. Two mutually exclusive @@ -210,8 +206,8 @@ async def asyncio( Args: catalog_id (str): - body (Union['BulkDestroyCatalogEntitiesType0', 'BulkDestroyCatalogEntitiesType1']): Two - mutually exclusive modes. Pass exactly one of: external_ids (delete specific entities) or + body (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: @@ -219,7 +215,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[BulkDestroyCatalogEntitiesResponse, ErrorsList, Union['BulkDestroyCatalogEntitiesResponse', 'ErrorsList']] + BulkDestroyCatalogEntitiesResponse | BulkDestroyCatalogEntitiesResponse | ErrorsList | 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 f9eacd35..586bef40 100644 --- a/rootly_sdk/api/catalog_entities/bulk_upsert_catalog_entities.py +++ b/rootly_sdk/api/catalog_entities/bulk_upsert_catalog_entities.py @@ -1,5 +1,6 @@ from http import HTTPStatus -from typing import Any, Union +from typing import Any +from urllib.parse import quote import httpx @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/catalogs/{catalog_id}/entities/bulk_upsert", + "url": "/v1/catalogs/{catalog_id}/entities/bulk_upsert".format( + catalog_id=quote(str(catalog_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -34,7 +37,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkUpsertCatalogEntitiesResponse | ErrorsList | Union["BulkUpsertCatalogEntitiesError", "ErrorsList"] | None: +) -> BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList | None: if response.status_code == 200: response_200 = BulkUpsertCatalogEntitiesResponse.from_dict(response.json()) @@ -47,14 +50,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]: + def _parse_response_422(data: object) -> BulkUpsertCatalogEntitiesError | ErrorsList: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -74,7 +77,7 @@ def _parse_response_422(data: object) -> Union["BulkUpsertCatalogEntitiesError", def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkUpsertCatalogEntitiesResponse | ErrorsList | Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]]: +) -> Response[BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -88,7 +91,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertCatalogEntities, -) -> Response[BulkUpsertCatalogEntitiesResponse | ErrorsList | Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]]: +) -> Response[BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList]: """Bulk upsert Catalog Entities Create or update multiple catalog entities by external_id. Only attributes present in the payload @@ -103,7 +106,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union['BulkUpsertCatalogEntitiesError', 'ErrorsList']]] + Response[BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -123,7 +126,7 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertCatalogEntities, -) -> BulkUpsertCatalogEntitiesResponse | ErrorsList | Union["BulkUpsertCatalogEntitiesError", "ErrorsList"] | None: +) -> BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList | None: """Bulk upsert Catalog Entities Create or update multiple catalog entities by external_id. Only attributes present in the payload @@ -138,7 +141,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union['BulkUpsertCatalogEntitiesError', 'ErrorsList']] + BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList """ return sync_detailed( @@ -153,7 +156,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertCatalogEntities, -) -> Response[BulkUpsertCatalogEntitiesResponse | ErrorsList | Union["BulkUpsertCatalogEntitiesError", "ErrorsList"]]: +) -> Response[BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList]: """Bulk upsert Catalog Entities Create or update multiple catalog entities by external_id. Only attributes present in the payload @@ -168,7 +171,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union['BulkUpsertCatalogEntitiesError', 'ErrorsList']]] + Response[BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -186,7 +189,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertCatalogEntities, -) -> BulkUpsertCatalogEntitiesResponse | ErrorsList | Union["BulkUpsertCatalogEntitiesError", "ErrorsList"] | None: +) -> BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | ErrorsList | None: """Bulk upsert Catalog Entities Create or update multiple catalog entities by external_id. Only attributes present in the payload @@ -201,7 +204,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[BulkUpsertCatalogEntitiesResponse, ErrorsList, Union['BulkUpsertCatalogEntitiesError', 'ErrorsList']] + BulkUpsertCatalogEntitiesError | ErrorsList | BulkUpsertCatalogEntitiesResponse | 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 19599362..37fa998e 100644 --- a/rootly_sdk/api/catalog_entities/create_catalog_entity.py +++ b/rootly_sdk/api/catalog_entities/create_catalog_entity.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/catalogs/{catalog_id}/entities", + "url": "/v1/catalogs/{catalog_id}/entities".format( + catalog_id=quote(str(catalog_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogEntityResponse, ErrorsList]] + Response[CatalogEntityResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogEntityResponse, ErrorsList] + CatalogEntityResponse | ErrorsList """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogEntityResponse, ErrorsList]] + Response[CatalogEntityResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogEntityResponse, ErrorsList] + 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 0507b2ea..f256d19c 100644 --- a/rootly_sdk/api/catalog_entities/delete_catalog_entity.py +++ b/rootly_sdk/api/catalog_entities/delete_catalog_entity.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/catalog_entities/{id}", + "url": "/v1/catalog_entities/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[CatalogEntityResponse | ErrorsList]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific Catalog Entity by id Args: - id (Union[UUID, str]): + id (str | 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[Union[CatalogEntityResponse, ErrorsList]] + Response[CatalogEntityResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> CatalogEntityResponse | ErrorsList | None: @@ -93,14 +97,14 @@ def sync( Delete a specific Catalog Entity by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[CatalogEntityResponse, ErrorsList] + CatalogEntityResponse | ErrorsList """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[CatalogEntityResponse | ErrorsList]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific Catalog Entity by id Args: - id (Union[UUID, str]): + id (str | 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[Union[CatalogEntityResponse, ErrorsList]] + Response[CatalogEntityResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> CatalogEntityResponse | ErrorsList | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific Catalog Entity by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[CatalogEntityResponse, ErrorsList] + 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 6251c47a..a2b59694 100644 --- a/rootly_sdk/api/catalog_entities/get_catalog_entity.py +++ b/rootly_sdk/api/catalog_entities/get_catalog_entity.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,13 +14,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, - include: Unset | GetCatalogEntityInclude = UNSET, + include: GetCatalogEntityInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -29,7 +31,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/catalog_entities/{id}", + "url": "/v1/catalog_entities/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -67,25 +71,25 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetCatalogEntityInclude = UNSET, + include: GetCatalogEntityInclude | Unset = UNSET, ) -> Response[CatalogEntityResponse | ErrorsList]: """Retrieves a Catalog Entity Retrieves a specific Catalog Entity by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetCatalogEntityInclude]): + id (str | UUID): + include (GetCatalogEntityInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogEntityResponse, ErrorsList]] + Response[CatalogEntityResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -101,25 +105,25 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetCatalogEntityInclude = UNSET, + include: GetCatalogEntityInclude | Unset = UNSET, ) -> CatalogEntityResponse | ErrorsList | None: """Retrieves a Catalog Entity Retrieves a specific Catalog Entity by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetCatalogEntityInclude]): + id (str | UUID): + include (GetCatalogEntityInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogEntityResponse, ErrorsList] + CatalogEntityResponse | ErrorsList """ return sync_detailed( @@ -130,25 +134,25 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetCatalogEntityInclude = UNSET, + include: GetCatalogEntityInclude | Unset = UNSET, ) -> Response[CatalogEntityResponse | ErrorsList]: """Retrieves a Catalog Entity Retrieves a specific Catalog Entity by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetCatalogEntityInclude]): + id (str | UUID): + include (GetCatalogEntityInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogEntityResponse, ErrorsList]] + Response[CatalogEntityResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -162,25 +166,25 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetCatalogEntityInclude = UNSET, + include: GetCatalogEntityInclude | Unset = UNSET, ) -> CatalogEntityResponse | ErrorsList | None: """Retrieves a Catalog Entity Retrieves a specific Catalog Entity by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetCatalogEntityInclude]): + id (str | UUID): + include (GetCatalogEntityInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogEntityResponse, ErrorsList] + 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 2e2ba6b7..82ca16de 100644 --- a/rootly_sdk/api/catalog_entities/list_catalog_entities.py +++ b/rootly_sdk/api/catalog_entities/list_catalog_entities.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -14,42 +15,43 @@ def _get_kwargs( catalog_id: str, *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Unset | str = UNSET + json_sort: str | Unset = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -107,7 +109,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/catalogs/{catalog_id}/entities", + "url": "/v1/catalogs/{catalog_id}/entities".format( + catalog_id=quote(str(catalog_id), safe=""), + ), "params": params, } @@ -139,32 +143,32 @@ def sync_detailed( catalog_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogEntityList]: """List Catalog Entities @@ -172,32 +176,32 @@ def sync_detailed( Args: catalog_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -248,32 +252,32 @@ def sync( catalog_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogEntityList | None: """List Catalog Entities @@ -281,32 +285,32 @@ def sync( Args: catalog_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -352,32 +356,32 @@ async def asyncio_detailed( catalog_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogEntityList]: """List Catalog Entities @@ -385,32 +389,32 @@ async def asyncio_detailed( Args: catalog_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -459,32 +463,32 @@ async def asyncio( catalog_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogEntityList | None: """List Catalog Entities @@ -492,32 +496,32 @@ async def asyncio( Args: catalog_id (str): - 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]): + 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): 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 9d1d2f5c..6613d141 100644 --- a/rootly_sdk/api/catalog_entities/update_catalog_entity.py +++ b/rootly_sdk/api/catalog_entities/update_catalog_entity.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateCatalogEntity, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/catalog_entities/{id}", + "url": "/v1/catalog_entities/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCatalogEntity, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific Catalog Entity by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCatalogEntity): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogEntityResponse, ErrorsList]] + Response[CatalogEntityResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCatalogEntity, @@ -107,7 +110,7 @@ def sync( Update a specific Catalog Entity by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCatalogEntity): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogEntityResponse, ErrorsList] + CatalogEntityResponse | ErrorsList """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCatalogEntity, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific Catalog Entity by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCatalogEntity): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogEntityResponse, ErrorsList]] + Response[CatalogEntityResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCatalogEntity, @@ -168,7 +171,7 @@ async def asyncio( Update a specific Catalog Entity by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCatalogEntity): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogEntityResponse, ErrorsList] + 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 3b9a528e..b1dacf13 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -14,9 +15,12 @@ def _get_kwargs( id: UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/catalog_entity_checklists/{id}", + "url": "/v1/catalog_entity_checklists/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -69,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogEntityChecklistResponse, ErrorsList]] + Response[CatalogEntityChecklistResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -100,7 +104,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogEntityChecklistResponse, ErrorsList] + CatalogEntityChecklistResponse | ErrorsList """ return sync_detailed( @@ -126,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogEntityChecklistResponse, ErrorsList]] + Response[CatalogEntityChecklistResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -155,7 +159,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogEntityChecklistResponse, ErrorsList] + 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 78dacef1..63fefcf6 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,17 +11,18 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -83,32 +84,32 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogEntityChecklistList]: """List catalog entity checklists List catalog entity checklists Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -141,32 +142,32 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogEntityChecklistList | None: """List catalog entity checklists List catalog entity checklists Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -194,32 +195,32 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogEntityChecklistList]: """List catalog entity checklists List catalog entity checklists Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -250,32 +251,32 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogEntityChecklistList | None: """List catalog entity checklists List catalog entity checklists Args: - 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]): + 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): 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 43ab5578..3c834928 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/catalog_entities/{catalog_entity_id}/properties", + "url": "/v1/catalog_entities/{catalog_entity_id}/properties".format( + catalog_entity_id=quote(str(catalog_entity_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -91,7 +94,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogEntityPropertyResponse, ErrorsList]] + Response[CatalogEntityPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -131,7 +134,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogEntityPropertyResponse, ErrorsList] + CatalogEntityPropertyResponse | ErrorsList """ return sync_detailed( @@ -166,7 +169,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogEntityPropertyResponse, ErrorsList]] + Response[CatalogEntityPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -204,7 +207,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogEntityPropertyResponse, ErrorsList] + 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 acd0aab7..5fb2acac 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/catalog_entity_properties/{id}", + "url": "/v1/catalog_entity_properties/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -72,7 +76,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogEntityPropertyResponse, ErrorsList]] + Response[CatalogEntityPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -107,7 +111,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogEntityPropertyResponse, ErrorsList] + CatalogEntityPropertyResponse | ErrorsList """ return sync_detailed( @@ -137,7 +141,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogEntityPropertyResponse, ErrorsList]] + Response[CatalogEntityPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -170,7 +174,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogEntityPropertyResponse, ErrorsList] + 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 774c79cb..698b1a78 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -16,11 +17,12 @@ def _get_kwargs( id: str, *, - include: Unset | GetCatalogEntityPropertyInclude = UNSET, + include: GetCatalogEntityPropertyInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -30,7 +32,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/catalog_entity_properties/{id}", + "url": "/v1/catalog_entity_properties/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -71,7 +75,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetCatalogEntityPropertyInclude = UNSET, + include: GetCatalogEntityPropertyInclude | Unset = UNSET, ) -> Response[CatalogEntityPropertyResponse | ErrorsList]: """Retrieves a Catalog Entity Property @@ -83,14 +87,14 @@ def sync_detailed( Args: id (str): - include (Union[Unset, GetCatalogEntityPropertyInclude]): + include (GetCatalogEntityPropertyInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogEntityPropertyResponse, ErrorsList]] + Response[CatalogEntityPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -109,7 +113,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Unset | GetCatalogEntityPropertyInclude = UNSET, + include: GetCatalogEntityPropertyInclude | Unset = UNSET, ) -> CatalogEntityPropertyResponse | ErrorsList | None: """Retrieves a Catalog Entity Property @@ -121,14 +125,14 @@ def sync( Args: id (str): - include (Union[Unset, GetCatalogEntityPropertyInclude]): + include (GetCatalogEntityPropertyInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogEntityPropertyResponse, ErrorsList] + CatalogEntityPropertyResponse | ErrorsList """ return sync_detailed( @@ -142,7 +146,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetCatalogEntityPropertyInclude = UNSET, + include: GetCatalogEntityPropertyInclude | Unset = UNSET, ) -> Response[CatalogEntityPropertyResponse | ErrorsList]: """Retrieves a Catalog Entity Property @@ -154,14 +158,14 @@ async def asyncio_detailed( Args: id (str): - include (Union[Unset, GetCatalogEntityPropertyInclude]): + include (GetCatalogEntityPropertyInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogEntityPropertyResponse, ErrorsList]] + Response[CatalogEntityPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -178,7 +182,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Unset | GetCatalogEntityPropertyInclude = UNSET, + include: GetCatalogEntityPropertyInclude | Unset = UNSET, ) -> CatalogEntityPropertyResponse | ErrorsList | None: """Retrieves a Catalog Entity Property @@ -190,14 +194,14 @@ async def asyncio( Args: id (str): - include (Union[Unset, GetCatalogEntityPropertyInclude]): + include (GetCatalogEntityPropertyInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogEntityPropertyResponse, ErrorsList] + 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 b0e16a22..f4183034 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -18,26 +19,27 @@ def _get_kwargs( catalog_entity_id: str, *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Unset | str = UNSET + json_sort: str | Unset = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -63,7 +65,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/catalog_entities/{catalog_entity_id}/properties", + "url": "/v1/catalog_entities/{catalog_entity_id}/properties".format( + catalog_entity_id=quote(str(catalog_entity_id), safe=""), + ), "params": params, } @@ -99,16 +103,16 @@ def sync_detailed( catalog_entity_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogEntityPropertyList]: """List catalog properties @@ -120,16 +124,16 @@ def sync_detailed( Args: catalog_entity_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -164,16 +168,16 @@ def sync( catalog_entity_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogEntityPropertyList | None: """List catalog properties @@ -185,16 +189,16 @@ def sync( Args: catalog_entity_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -224,16 +228,16 @@ async def asyncio_detailed( catalog_entity_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogEntityPropertyList]: """List catalog properties @@ -245,16 +249,16 @@ async def asyncio_detailed( Args: catalog_entity_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -287,16 +291,16 @@ async def asyncio( catalog_entity_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogEntityPropertyList | None: """List catalog properties @@ -308,16 +312,16 @@ async def asyncio( Args: catalog_entity_id (str): - 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]): + 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): 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 121225f3..5d1cc4b3 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/catalog_entity_properties/{id}", + "url": "/v1/catalog_entity_properties/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -87,7 +90,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogEntityPropertyResponse, ErrorsList]] + Response[CatalogEntityPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -128,7 +131,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogEntityPropertyResponse, ErrorsList] + CatalogEntityPropertyResponse | ErrorsList """ return sync_detailed( @@ -164,7 +167,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogEntityPropertyResponse, ErrorsList]] + Response[CatalogEntityPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -203,7 +206,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogEntityPropertyResponse, ErrorsList] + 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 572706bb..ce8b71c5 100644 --- a/rootly_sdk/api/catalog_properties/create_catalog_property.py +++ b/rootly_sdk/api/catalog_properties/create_catalog_property.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -18,7 +19,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/catalogs/{catalog_id}/properties", + "url": "/v1/catalogs/{catalog_id}/properties".format( + catalog_id=quote(str(catalog_id), safe=""), + ), } _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 357e3f0a..b08c47da 100644 --- a/rootly_sdk/api/catalog_properties/delete_catalog_property.py +++ b/rootly_sdk/api/catalog_properties/delete_catalog_property.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -11,9 +12,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/catalog_properties/{id}", + "url": "/v1/catalog_properties/{id}".format( + id=quote(str(id), safe=""), + ), } 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 4735f106..e42871f8 100644 --- a/rootly_sdk/api/catalog_properties/get_catalog_property.py +++ b/rootly_sdk/api/catalog_properties/get_catalog_property.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -11,9 +12,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/catalog_properties/{id}", + "url": "/v1/catalog_properties/{id}".format( + id=quote(str(id), safe=""), + ), } 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 95f3c5c7..4d717126 100644 --- a/rootly_sdk/api/catalog_properties/list_catalog_properties.py +++ b/rootly_sdk/api/catalog_properties/list_catalog_properties.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -11,9 +12,12 @@ def _get_kwargs( catalog_id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/catalogs/{catalog_id}/properties", + "url": "/v1/catalogs/{catalog_id}/properties".format( + catalog_id=quote(str(catalog_id), safe=""), + ), } 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 b52f9831..2847e350 100644 --- a/rootly_sdk/api/catalog_properties/update_catalog_property.py +++ b/rootly_sdk/api/catalog_properties/update_catalog_property.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -18,7 +19,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/catalog_properties/{id}", + "url": "/v1/catalog_properties/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() diff --git a/rootly_sdk/api/catalogs/create_catalog.py b/rootly_sdk/api/catalogs/create_catalog.py index 17867409..736014b9 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[Union[CatalogResponse, ErrorsList]] + Response[CatalogResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogResponse, ErrorsList] + 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[Union[CatalogResponse, ErrorsList]] + Response[CatalogResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogResponse, ErrorsList] + CatalogResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/catalogs/delete_catalog.py b/rootly_sdk/api/catalogs/delete_catalog.py index ec886956..eeebd62e 100644 --- a/rootly_sdk/api/catalogs/delete_catalog.py +++ b/rootly_sdk/api/catalogs/delete_catalog.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/catalogs/{id}", + "url": "/v1/catalogs/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[CatalogResponse | ErrorsList]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific catalog by id Args: - id (Union[UUID, str]): + id (str | 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[Union[CatalogResponse, ErrorsList]] + Response[CatalogResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> CatalogResponse | ErrorsList | None: @@ -93,14 +97,14 @@ def sync( Delete a specific catalog by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[CatalogResponse, ErrorsList] + CatalogResponse | ErrorsList """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[CatalogResponse | ErrorsList]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific catalog by id Args: - id (Union[UUID, str]): + id (str | 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[Union[CatalogResponse, ErrorsList]] + Response[CatalogResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> CatalogResponse | ErrorsList | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific catalog by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[CatalogResponse, ErrorsList] + CatalogResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/catalogs/get_catalog.py b/rootly_sdk/api/catalogs/get_catalog.py index 4d6d46de..146cb1a4 100644 --- a/rootly_sdk/api/catalogs/get_catalog.py +++ b/rootly_sdk/api/catalogs/get_catalog.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/catalogs/{id}", + "url": "/v1/catalogs/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[CatalogResponse | ErrorsList]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific catalog by id Args: - id (Union[UUID, str]): + id (str | 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[Union[CatalogResponse, ErrorsList]] + Response[CatalogResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> CatalogResponse | ErrorsList | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific catalog by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[CatalogResponse, ErrorsList] + CatalogResponse | ErrorsList """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[CatalogResponse | ErrorsList]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific catalog by id Args: - id (Union[UUID, str]): + id (str | 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[Union[CatalogResponse, ErrorsList]] + Response[CatalogResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> CatalogResponse | ErrorsList | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific catalog by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[CatalogResponse, ErrorsList] + CatalogResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/catalogs/list_catalogs.py b/rootly_sdk/api/catalogs/list_catalogs.py index cd3bd35f..47f483e2 100644 --- a/rootly_sdk/api/catalogs/list_catalogs.py +++ b/rootly_sdk/api/catalogs/list_catalogs.py @@ -13,41 +13,42 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Unset | str = UNSET + json_sort: str | Unset = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -134,62 +135,62 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogList]: """List catalogs List catalogs Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -237,62 +238,62 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogList | None: """List catalogs List catalogs Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -335,62 +336,62 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogList]: """List catalogs List catalogs Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -436,62 +437,62 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogList | None: """List catalogs List catalogs Args: - 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]): + 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): 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 c4838523..47da6eea 100644 --- a/rootly_sdk/api/catalogs/update_catalog.py +++ b/rootly_sdk/api/catalogs/update_catalog.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateCatalog, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/catalogs/{id}", + "url": "/v1/catalogs/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCatalog, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific catalog by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCatalog): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogResponse, ErrorsList]] + Response[CatalogResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCatalog, @@ -107,7 +110,7 @@ def sync( Update a specific catalog by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCatalog): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogResponse, ErrorsList] + CatalogResponse | ErrorsList """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCatalog, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific catalog by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCatalog): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CatalogResponse, ErrorsList]] + Response[CatalogResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCatalog, @@ -168,7 +171,7 @@ async def asyncio( Update a specific catalog by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCatalog): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogResponse, ErrorsList] + CatalogResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/causes/create_cause.py b/rootly_sdk/api/causes/create_cause.py index 963bab83..c1e704a0 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[Union[CauseResponse, ErrorsList]] + Response[CauseResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CauseResponse, ErrorsList] + 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[Union[CauseResponse, ErrorsList]] + Response[CauseResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CauseResponse, ErrorsList] + 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 753ab575..6e2bf436 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[Union[CatalogPropertyResponse, ErrorsList]] + Response[CatalogPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogPropertyResponse, ErrorsList] + 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[Union[CatalogPropertyResponse, ErrorsList]] + Response[CatalogPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogPropertyResponse, ErrorsList] + CatalogPropertyResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/causes/delete_cause.py b/rootly_sdk/api/causes/delete_cause.py index e025be3a..3edaf3a4 100644 --- a/rootly_sdk/api/causes/delete_cause.py +++ b/rootly_sdk/api/causes/delete_cause.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/causes/{id}", + "url": "/v1/causes/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[CauseResponse | ErrorsList]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific cause by id Args: - id (Union[UUID, str]): + id (str | 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[Union[CauseResponse, ErrorsList]] + Response[CauseResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> CauseResponse | ErrorsList | None: @@ -93,14 +97,14 @@ def sync( Delete a specific cause by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[CauseResponse, ErrorsList] + CauseResponse | ErrorsList """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[CauseResponse | ErrorsList]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific cause by id Args: - id (Union[UUID, str]): + id (str | 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[Union[CauseResponse, ErrorsList]] + Response[CauseResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> CauseResponse | ErrorsList | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific cause by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[CauseResponse, ErrorsList] + CauseResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/causes/get_cause.py b/rootly_sdk/api/causes/get_cause.py index d0c85914..e8c8bff7 100644 --- a/rootly_sdk/api/causes/get_cause.py +++ b/rootly_sdk/api/causes/get_cause.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/causes/{id}", + "url": "/v1/causes/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[CauseResponse | ErrorsList]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific cause by id Args: - id (Union[UUID, str]): + id (str | 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[Union[CauseResponse, ErrorsList]] + Response[CauseResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> CauseResponse | ErrorsList | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific cause by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[CauseResponse, ErrorsList] + CauseResponse | ErrorsList """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[CauseResponse | ErrorsList]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific cause by id Args: - id (Union[UUID, str]): + id (str | 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[Union[CauseResponse, ErrorsList]] + Response[CauseResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> CauseResponse | ErrorsList | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific cause by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[CauseResponse, ErrorsList] + 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 665840f4..56923dc0 100644 --- a/rootly_sdk/api/causes/list_cause_catalog_properties.py +++ b/rootly_sdk/api/causes/list_cause_catalog_properties.py @@ -17,27 +17,28 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Unset | str = UNSET + json_sort: str | Unset = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -96,34 +97,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Cause Catalog Properties Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -157,34 +158,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogPropertyList | None: """List Catalog Properties List Cause Catalog Properties Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -213,34 +214,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Cause Catalog Properties Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -272,34 +273,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogPropertyList | None: """List Catalog Properties List Cause Catalog Properties Args: - 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]): + 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): 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 2da725c2..183d88e9 100644 --- a/rootly_sdk/api/causes/list_causes.py +++ b/rootly_sdk/api/causes/list_causes.py @@ -11,25 +11,26 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -103,48 +104,48 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CauseList]: """List causes List causes Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -185,48 +186,48 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> CauseList | None: """List causes List causes Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -262,48 +263,48 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CauseList]: """List causes List causes Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -342,48 +343,48 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> CauseList | None: """List causes List causes Args: - 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]): + 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): 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 a33c39fc..46e11dce 100644 --- a/rootly_sdk/api/causes/update_cause.py +++ b/rootly_sdk/api/causes/update_cause.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateCause, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/causes/{id}", + "url": "/v1/causes/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCause, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific cause by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCause): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CauseResponse, ErrorsList]] + Response[CauseResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCause, @@ -107,7 +110,7 @@ def sync( Update a specific cause by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCause): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CauseResponse, ErrorsList] + CauseResponse | ErrorsList """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCause, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific cause by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCause): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CauseResponse, ErrorsList]] + Response[CauseResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCause, @@ -168,7 +171,7 @@ async def asyncio( Update a specific cause by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCause): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CauseResponse, ErrorsList] + 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 c3ed86fd..84fa7b89 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[Union[CommunicationsGroupResponse, ErrorsList]] + Response[CommunicationsGroupResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -108,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsGroupResponse, ErrorsList] + 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[Union[CommunicationsGroupResponse, ErrorsList]] + Response[CommunicationsGroupResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -163,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsGroupResponse, ErrorsList] + 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 3101f2d4..7bb4306a 100644 --- a/rootly_sdk/api/communications_groups/delete_communications_group.py +++ b/rootly_sdk/api/communications_groups/delete_communications_group.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/communications/groups/{id}", + "url": "/v1/communications/groups/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -62,7 +66,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ErrorsList]] + Response[Any | ErrorsList] """ kwargs = _get_kwargs( @@ -93,7 +97,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ErrorsList] + Any | ErrorsList """ return sync_detailed( @@ -119,7 +123,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ErrorsList]] + Response[Any | ErrorsList] """ kwargs = _get_kwargs( @@ -148,7 +152,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ErrorsList] + 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 d50430d4..9c1e74ef 100644 --- a/rootly_sdk/api/communications_groups/get_communications_group.py +++ b/rootly_sdk/api/communications_groups/get_communications_group.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/communications/groups/{id}", + "url": "/v1/communications/groups/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CommunicationsGroupResponse, ErrorsList]] + Response[CommunicationsGroupResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsGroupResponse, ErrorsList] + CommunicationsGroupResponse | ErrorsList """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CommunicationsGroupResponse, ErrorsList]] + Response[CommunicationsGroupResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsGroupResponse, ErrorsList] + 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 c3054d0c..880eea27 100644 --- a/rootly_sdk/api/communications_groups/list_communications_groups.py +++ b/rootly_sdk/api/communications_groups/list_communications_groups.py @@ -11,20 +11,21 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -92,38 +93,38 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CommunicationsGroupsResponse]: """Lists communications groups Lists communications groups Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -159,38 +160,38 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> CommunicationsGroupsResponse | None: """Lists communications groups Lists communications groups Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -221,38 +222,38 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CommunicationsGroupsResponse]: """Lists communications groups Lists communications groups Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -286,38 +287,38 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> CommunicationsGroupsResponse | None: """Lists communications groups Lists communications groups Args: - 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]): + 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): 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 d8ec28ec..56751baf 100644 --- a/rootly_sdk/api/communications_groups/update_communications_group.py +++ b/rootly_sdk/api/communications_groups/update_communications_group.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/v1/communications/groups/{id}", + "url": "/v1/communications/groups/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CommunicationsGroupResponse, ErrorsList]] + Response[CommunicationsGroupResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsGroupResponse, ErrorsList] + CommunicationsGroupResponse | ErrorsList """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CommunicationsGroupResponse, ErrorsList]] + Response[CommunicationsGroupResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsGroupResponse, ErrorsList] + 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 6d610ff8..9e90afde 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[Union[CommunicationsStageResponse, ErrorsList]] + Response[CommunicationsStageResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsStageResponse, ErrorsList] + 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[Union[CommunicationsStageResponse, ErrorsList]] + Response[CommunicationsStageResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsStageResponse, ErrorsList] + 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 acee9e80..b5921be8 100644 --- a/rootly_sdk/api/communications_stages/delete_communications_stage.py +++ b/rootly_sdk/api/communications_stages/delete_communications_stage.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/communications/stages/{id}", + "url": "/v1/communications/stages/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -62,7 +66,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ErrorsList]] + Response[Any | ErrorsList] """ kwargs = _get_kwargs( @@ -93,7 +97,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ErrorsList] + Any | ErrorsList """ return sync_detailed( @@ -119,7 +123,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ErrorsList]] + Response[Any | ErrorsList] """ kwargs = _get_kwargs( @@ -148,7 +152,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ErrorsList] + 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 11af7837..477e0d9a 100644 --- a/rootly_sdk/api/communications_stages/get_communications_stage.py +++ b/rootly_sdk/api/communications_stages/get_communications_stage.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/communications/stages/{id}", + "url": "/v1/communications/stages/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CommunicationsStageResponse, ErrorsList]] + Response[CommunicationsStageResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsStageResponse, ErrorsList] + CommunicationsStageResponse | ErrorsList """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CommunicationsStageResponse, ErrorsList]] + Response[CommunicationsStageResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsStageResponse, ErrorsList] + 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 e68a79e0..174a6873 100644 --- a/rootly_sdk/api/communications_stages/list_communications_stages.py +++ b/rootly_sdk/api/communications_stages/list_communications_stages.py @@ -11,17 +11,18 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -83,32 +84,32 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CommunicationsStagesResponse]: """Lists communications stages Lists communications stages Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -141,32 +142,32 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> CommunicationsStagesResponse | None: """Lists communications stages Lists communications stages Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -194,32 +195,32 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CommunicationsStagesResponse]: """Lists communications stages Lists communications stages Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -250,32 +251,32 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> CommunicationsStagesResponse | None: """Lists communications stages Lists communications stages Args: - 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]): + 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): 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 0214d959..13ed4698 100644 --- a/rootly_sdk/api/communications_stages/update_communications_stage.py +++ b/rootly_sdk/api/communications_stages/update_communications_stage.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/v1/communications/stages/{id}", + "url": "/v1/communications/stages/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CommunicationsStageResponse, ErrorsList]] + Response[CommunicationsStageResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsStageResponse, ErrorsList] + CommunicationsStageResponse | ErrorsList """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CommunicationsStageResponse, ErrorsList]] + Response[CommunicationsStageResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsStageResponse, ErrorsList] + 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 6c67d411..5c62ff97 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[Union[CommunicationsTemplateResponse, ErrorsList]] + Response[CommunicationsTemplateResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -108,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsTemplateResponse, ErrorsList] + 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[Union[CommunicationsTemplateResponse, ErrorsList]] + Response[CommunicationsTemplateResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -163,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsTemplateResponse, ErrorsList] + 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 d1ffce2e..5750a7a4 100644 --- a/rootly_sdk/api/communications_templates/delete_communications_template.py +++ b/rootly_sdk/api/communications_templates/delete_communications_template.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/communications/templates/{id}", + "url": "/v1/communications/templates/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -62,7 +66,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ErrorsList]] + Response[Any | ErrorsList] """ kwargs = _get_kwargs( @@ -93,7 +97,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ErrorsList] + Any | ErrorsList """ return sync_detailed( @@ -119,7 +123,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ErrorsList]] + Response[Any | ErrorsList] """ kwargs = _get_kwargs( @@ -148,7 +152,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ErrorsList] + 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 f8d67d19..84eda309 100644 --- a/rootly_sdk/api/communications_templates/get_communications_template.py +++ b/rootly_sdk/api/communications_templates/get_communications_template.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/communications/templates/{id}", + "url": "/v1/communications/templates/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CommunicationsTemplateResponse, ErrorsList]] + Response[CommunicationsTemplateResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsTemplateResponse, ErrorsList] + CommunicationsTemplateResponse | ErrorsList """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CommunicationsTemplateResponse, ErrorsList]] + Response[CommunicationsTemplateResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsTemplateResponse, ErrorsList] + 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 a3161de8..8d3f4fb0 100644 --- a/rootly_sdk/api/communications_templates/list_communications_templates.py +++ b/rootly_sdk/api/communications_templates/list_communications_templates.py @@ -11,18 +11,19 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -86,34 +87,34 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CommunicationsTemplatesResponse]: """Lists communications templates Lists communications templates Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -147,34 +148,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> CommunicationsTemplatesResponse | None: """Lists communications templates Lists communications templates Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -203,34 +204,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CommunicationsTemplatesResponse]: """Lists communications templates Lists communications templates Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -262,34 +263,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> CommunicationsTemplatesResponse | None: """Lists communications templates Lists communications templates Args: - 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]): + 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): 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 5894b08a..d3b3b5a0 100644 --- a/rootly_sdk/api/communications_templates/update_communications_template.py +++ b/rootly_sdk/api/communications_templates/update_communications_template.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/v1/communications/templates/{id}", + "url": "/v1/communications/templates/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CommunicationsTemplateResponse, ErrorsList]] + Response[CommunicationsTemplateResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsTemplateResponse, ErrorsList] + CommunicationsTemplateResponse | ErrorsList """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CommunicationsTemplateResponse, ErrorsList]] + Response[CommunicationsTemplateResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsTemplateResponse, ErrorsList] + 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 62e71775..873b6e89 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[Union[CommunicationsTypeResponse, ErrorsList]] + Response[CommunicationsTypeResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -108,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsTypeResponse, ErrorsList] + 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[Union[CommunicationsTypeResponse, ErrorsList]] + Response[CommunicationsTypeResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -163,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsTypeResponse, ErrorsList] + 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 50705d45..c14a941b 100644 --- a/rootly_sdk/api/communications_types/delete_communications_type.py +++ b/rootly_sdk/api/communications_types/delete_communications_type.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/communications/types/{id}", + "url": "/v1/communications/types/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -62,7 +66,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ErrorsList]] + Response[Any | ErrorsList] """ kwargs = _get_kwargs( @@ -93,7 +97,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ErrorsList] + Any | ErrorsList """ return sync_detailed( @@ -119,7 +123,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ErrorsList]] + Response[Any | ErrorsList] """ kwargs = _get_kwargs( @@ -148,7 +152,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ErrorsList] + 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 6c3d3e3f..1326081e 100644 --- a/rootly_sdk/api/communications_types/get_communications_type.py +++ b/rootly_sdk/api/communications_types/get_communications_type.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/communications/types/{id}", + "url": "/v1/communications/types/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CommunicationsTypeResponse, ErrorsList]] + Response[CommunicationsTypeResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsTypeResponse, ErrorsList] + CommunicationsTypeResponse | ErrorsList """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CommunicationsTypeResponse, ErrorsList]] + Response[CommunicationsTypeResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsTypeResponse, ErrorsList] + 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 1d7c6b9a..fdbac8ae 100644 --- a/rootly_sdk/api/communications_types/list_communications_types.py +++ b/rootly_sdk/api/communications_types/list_communications_types.py @@ -11,17 +11,18 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -83,32 +84,32 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CommunicationsTypesResponse]: """Lists communications types Lists communications types Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -141,32 +142,32 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> CommunicationsTypesResponse | None: """Lists communications types Lists communications types Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -194,32 +195,32 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CommunicationsTypesResponse]: """Lists communications types Lists communications types Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -250,32 +251,32 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> CommunicationsTypesResponse | None: """Lists communications types Lists communications types Args: - 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]): + 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): 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 cda47a9b..7e463b14 100644 --- a/rootly_sdk/api/communications_types/update_communications_type.py +++ b/rootly_sdk/api/communications_types/update_communications_type.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/v1/communications/types/{id}", + "url": "/v1/communications/types/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CommunicationsTypeResponse, ErrorsList]] + Response[CommunicationsTypeResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsTypeResponse, ErrorsList] + CommunicationsTypeResponse | ErrorsList """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CommunicationsTypeResponse, ErrorsList]] + Response[CommunicationsTypeResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CommunicationsTypeResponse, ErrorsList] + 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 bbe174d9..3ce9ad7d 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[Union[CustomFormResponse, ErrorsList]] + Response[CustomFormResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFormResponse, ErrorsList] + 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[Union[CustomFormResponse, ErrorsList]] + Response[CustomFormResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFormResponse, ErrorsList] + 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 18759967..596f17a9 100644 --- a/rootly_sdk/api/custom_forms/delete_custom_form.py +++ b/rootly_sdk/api/custom_forms/delete_custom_form.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/custom_forms/{id}", + "url": "/v1/custom_forms/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[CustomFormResponse | ErrorsList]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific custom form by id Args: - id (Union[UUID, str]): + id (str | 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[Union[CustomFormResponse, ErrorsList]] + Response[CustomFormResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> CustomFormResponse | ErrorsList | None: @@ -93,14 +97,14 @@ def sync( Delete a specific custom form by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[CustomFormResponse, ErrorsList] + CustomFormResponse | ErrorsList """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[CustomFormResponse | ErrorsList]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific custom form by id Args: - id (Union[UUID, str]): + id (str | 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[Union[CustomFormResponse, ErrorsList]] + Response[CustomFormResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> CustomFormResponse | ErrorsList | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific custom form by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[CustomFormResponse, ErrorsList] + 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 b6d6b985..bddf53a7 100644 --- a/rootly_sdk/api/custom_forms/get_custom_form.py +++ b/rootly_sdk/api/custom_forms/get_custom_form.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/custom_forms/{id}", + "url": "/v1/custom_forms/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[CustomFormResponse | ErrorsList]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific custom form by id Args: - id (Union[UUID, str]): + id (str | 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[Union[CustomFormResponse, ErrorsList]] + Response[CustomFormResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> CustomFormResponse | ErrorsList | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific custom form by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[CustomFormResponse, ErrorsList] + CustomFormResponse | ErrorsList """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[CustomFormResponse | ErrorsList]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific custom form by id Args: - id (Union[UUID, str]): + id (str | 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[Union[CustomFormResponse, ErrorsList]] + Response[CustomFormResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> CustomFormResponse | ErrorsList | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific custom form by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[CustomFormResponse, ErrorsList] + 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 d1dc7aa2..0308a583 100644 --- a/rootly_sdk/api/custom_forms/list_custom_forms.py +++ b/rootly_sdk/api/custom_forms/list_custom_forms.py @@ -12,18 +12,19 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -92,41 +93,41 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CustomFormList | ErrorsList]: """List custom forms List custom forms Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns 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[CustomFormList, ErrorsList]] + Response[CustomFormList | ErrorsList] """ kwargs = _get_kwargs( @@ -153,41 +154,41 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> CustomFormList | ErrorsList | None: """List custom forms List custom forms Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server 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[CustomFormList, ErrorsList] + CustomFormList | ErrorsList """ return sync_detailed( @@ -209,41 +210,41 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CustomFormList | ErrorsList]: """List custom forms List custom forms Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns 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[CustomFormList, ErrorsList]] + Response[CustomFormList | ErrorsList] """ kwargs = _get_kwargs( @@ -268,41 +269,41 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> CustomFormList | ErrorsList | None: """List custom forms List custom forms Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server 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[CustomFormList, ErrorsList] + 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 c5e1b259..1b640d81 100644 --- a/rootly_sdk/api/custom_forms/update_custom_form.py +++ b/rootly_sdk/api/custom_forms/update_custom_form.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateCustomForm, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/custom_forms/{id}", + "url": "/v1/custom_forms/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCustomForm, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific custom form by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCustomForm): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CustomFormResponse, ErrorsList]] + Response[CustomFormResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCustomForm, @@ -107,7 +110,7 @@ def sync( Update a specific custom form by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCustomForm): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFormResponse, ErrorsList] + CustomFormResponse | ErrorsList """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCustomForm, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific custom form by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCustomForm): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CustomFormResponse, ErrorsList]] + Response[CustomFormResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateCustomForm, @@ -168,7 +171,7 @@ async def asyncio( Update a specific custom form by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateCustomForm): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFormResponse, ErrorsList] + 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 e1302e00..293bd57e 100644 --- a/rootly_sdk/api/dashboard_panels/create_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/create_dashboard_panel.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/dashboards/{dashboard_id}/panels", + "url": "/v1/dashboards/{dashboard_id}/panels".format( + dashboard_id=quote(str(dashboard_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -44,6 +47,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: @@ -80,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[DashboardPanelResponse, ErrorsList]] + Response[DashboardPanelResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -114,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[DashboardPanelResponse, ErrorsList] + DashboardPanelResponse | ErrorsList """ return sync_detailed( @@ -143,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[DashboardPanelResponse, ErrorsList]] + Response[DashboardPanelResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -175,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[DashboardPanelResponse, ErrorsList] + 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 9580cb4c..d630d717 100644 --- a/rootly_sdk/api/dashboard_panels/delete_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/delete_dashboard_panel.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/dashboard_panels/{id}", + "url": "/v1/dashboard_panels/{id}".format( + id=quote(str(id), safe=""), + ), } 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 ef54bcfd..825e1ab8 100644 --- a/rootly_sdk/api/dashboard_panels/duplicate_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/duplicate_dashboard_panel.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/dashboard_panels/{id}/duplicate", + "url": "/v1/dashboard_panels/{id}/duplicate".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[DashboardPanelResponse, ErrorsList]] + Response[DashboardPanelResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[DashboardPanelResponse, ErrorsList] + DashboardPanelResponse | ErrorsList """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[DashboardPanelResponse, ErrorsList]] + Response[DashboardPanelResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[DashboardPanelResponse, ErrorsList] + 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 8fabc049..9bee49b7 100644 --- a/rootly_sdk/api/dashboard_panels/get_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/get_dashboard_panel.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( id: str, *, - range_: Unset | str = UNSET, - period: Unset | str = UNSET, - time_zone: Unset | str = UNSET, + range_: str | Unset = UNSET, + period: str | Unset = UNSET, + time_zone: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["range"] = range_ @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/dashboard_panels/{id}", + "url": "/v1/dashboard_panels/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -62,9 +66,9 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - range_: Unset | str = UNSET, - period: Unset | str = UNSET, - time_zone: Unset | str = UNSET, + range_: str | Unset = UNSET, + period: str | Unset = UNSET, + time_zone: str | Unset = UNSET, ) -> Response[DashboardPanelResponse]: """Retrieves a dashboard panel @@ -72,9 +76,9 @@ def sync_detailed( Args: id (str): - range_ (Union[Unset, str]): - period (Union[Unset, str]): - time_zone (Union[Unset, str]): + range_ (str | Unset): + period (str | Unset): + time_zone (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -102,9 +106,9 @@ def sync( id: str, *, client: AuthenticatedClient, - range_: Unset | str = UNSET, - period: Unset | str = UNSET, - time_zone: Unset | str = UNSET, + range_: str | Unset = UNSET, + period: str | Unset = UNSET, + time_zone: str | Unset = UNSET, ) -> DashboardPanelResponse | None: """Retrieves a dashboard panel @@ -112,9 +116,9 @@ def sync( Args: id (str): - range_ (Union[Unset, str]): - period (Union[Unset, str]): - time_zone (Union[Unset, str]): + range_ (str | Unset): + period (str | Unset): + time_zone (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -137,9 +141,9 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - range_: Unset | str = UNSET, - period: Unset | str = UNSET, - time_zone: Unset | str = UNSET, + range_: str | Unset = UNSET, + period: str | Unset = UNSET, + time_zone: str | Unset = UNSET, ) -> Response[DashboardPanelResponse]: """Retrieves a dashboard panel @@ -147,9 +151,9 @@ async def asyncio_detailed( Args: id (str): - range_ (Union[Unset, str]): - period (Union[Unset, str]): - time_zone (Union[Unset, str]): + range_ (str | Unset): + period (str | Unset): + time_zone (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -175,9 +179,9 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - range_: Unset | str = UNSET, - period: Unset | str = UNSET, - time_zone: Unset | str = UNSET, + range_: str | Unset = UNSET, + period: str | Unset = UNSET, + time_zone: str | Unset = UNSET, ) -> DashboardPanelResponse | None: """Retrieves a dashboard panel @@ -185,9 +189,9 @@ async def asyncio( Args: id (str): - range_ (Union[Unset, str]): - period (Union[Unset, str]): - time_zone (Union[Unset, str]): + range_ (str | Unset): + period (str | Unset): + time_zone (str | Unset): 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 60d15e58..d807646c 100644 --- a/rootly_sdk/api/dashboard_panels/list_dashboard_panels.py +++ b/rootly_sdk/api/dashboard_panels/list_dashboard_panels.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( dashboard_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/dashboards/{dashboard_id}/panels", + "url": "/v1/dashboards/{dashboard_id}/panels".format( + dashboard_id=quote(str(dashboard_id), safe=""), + ), "params": params, } @@ -60,9 +64,9 @@ def sync_detailed( dashboard_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[DashboardPanelList]: """List dashboard panels @@ -70,9 +74,9 @@ def sync_detailed( Args: dashboard_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -100,9 +104,9 @@ def sync( dashboard_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> DashboardPanelList | None: """List dashboard panels @@ -110,9 +114,9 @@ def sync( Args: dashboard_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -135,9 +139,9 @@ async def asyncio_detailed( dashboard_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[DashboardPanelList]: """List dashboard panels @@ -145,9 +149,9 @@ async def asyncio_detailed( Args: dashboard_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -173,9 +177,9 @@ async def asyncio( dashboard_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> DashboardPanelList | None: """List dashboard panels @@ -183,9 +187,9 @@ async def asyncio( Args: dashboard_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 05914600..8c15920b 100644 --- a/rootly_sdk/api/dashboard_panels/update_dashboard_panel.py +++ b/rootly_sdk/api/dashboard_panels/update_dashboard_panel.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -19,7 +20,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/dashboard_panels/{id}", + "url": "/v1/dashboard_panels/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() diff --git a/rootly_sdk/api/dashboards/create_dashboard.py b/rootly_sdk/api/dashboards/create_dashboard.py index aa3291f9..32bb4589 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[Union[DashboardResponse, ErrorsList]] + Response[DashboardResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[DashboardResponse, ErrorsList] + 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[Union[DashboardResponse, ErrorsList]] + Response[DashboardResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[DashboardResponse, ErrorsList] + DashboardResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/dashboards/delete_dashboard.py b/rootly_sdk/api/dashboards/delete_dashboard.py index 8d7d943a..e16a82d5 100644 --- a/rootly_sdk/api/dashboards/delete_dashboard.py +++ b/rootly_sdk/api/dashboards/delete_dashboard.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/dashboards/{id}", + "url": "/v1/dashboards/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[DashboardResponse | ErrorsList]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific dashboard by id Args: - id (Union[UUID, str]): + id (str | 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[Union[DashboardResponse, ErrorsList]] + Response[DashboardResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> DashboardResponse | ErrorsList | None: @@ -93,14 +97,14 @@ def sync( Delete a specific dashboard by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[DashboardResponse, ErrorsList] + DashboardResponse | ErrorsList """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[DashboardResponse | ErrorsList]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific dashboard by id Args: - id (Union[UUID, str]): + id (str | 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[Union[DashboardResponse, ErrorsList]] + Response[DashboardResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> DashboardResponse | ErrorsList | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific dashboard by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[DashboardResponse, ErrorsList] + DashboardResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/dashboards/duplicate_dashboard.py b/rootly_sdk/api/dashboards/duplicate_dashboard.py index ae8dfea4..2c874a17 100644 --- a/rootly_sdk/api/dashboards/duplicate_dashboard.py +++ b/rootly_sdk/api/dashboards/duplicate_dashboard.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/dashboards/{id}/duplicate", + "url": "/v1/dashboards/{id}/duplicate".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[DashboardResponse | ErrorsList]: @@ -62,14 +66,14 @@ def sync_detailed( Duplicates a dashboard Args: - id (Union[UUID, str]): + id (str | 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[Union[DashboardResponse, ErrorsList]] + Response[DashboardResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> DashboardResponse | ErrorsList | None: @@ -93,14 +97,14 @@ def sync( Duplicates a dashboard Args: - id (Union[UUID, str]): + id (str | 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: - Union[DashboardResponse, ErrorsList] + DashboardResponse | ErrorsList """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[DashboardResponse | ErrorsList]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Duplicates a dashboard Args: - id (Union[UUID, str]): + id (str | 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[Union[DashboardResponse, ErrorsList]] + Response[DashboardResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> DashboardResponse | ErrorsList | None: @@ -148,14 +152,14 @@ async def asyncio( Duplicates a dashboard Args: - id (Union[UUID, str]): + id (str | 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: - Union[DashboardResponse, ErrorsList] + DashboardResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/dashboards/get_dashboard.py b/rootly_sdk/api/dashboards/get_dashboard.py index 41389041..f20260b3 100644 --- a/rootly_sdk/api/dashboards/get_dashboard.py +++ b/rootly_sdk/api/dashboards/get_dashboard.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,13 +14,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, - include: Unset | GetDashboardInclude = UNSET, + include: GetDashboardInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -29,7 +31,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/dashboards/{id}", + "url": "/v1/dashboards/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -67,25 +71,25 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetDashboardInclude = UNSET, + include: GetDashboardInclude | Unset = UNSET, ) -> Response[DashboardResponse | ErrorsList]: """Retrieves a dashboard Retrieves a specific dashboard by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetDashboardInclude]): + id (str | UUID): + include (GetDashboardInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[DashboardResponse, ErrorsList]] + Response[DashboardResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -101,25 +105,25 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetDashboardInclude = UNSET, + include: GetDashboardInclude | Unset = UNSET, ) -> DashboardResponse | ErrorsList | None: """Retrieves a dashboard Retrieves a specific dashboard by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetDashboardInclude]): + id (str | UUID): + include (GetDashboardInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[DashboardResponse, ErrorsList] + DashboardResponse | ErrorsList """ return sync_detailed( @@ -130,25 +134,25 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetDashboardInclude = UNSET, + include: GetDashboardInclude | Unset = UNSET, ) -> Response[DashboardResponse | ErrorsList]: """Retrieves a dashboard Retrieves a specific dashboard by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetDashboardInclude]): + id (str | UUID): + include (GetDashboardInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[DashboardResponse, ErrorsList]] + Response[DashboardResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -162,25 +166,25 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetDashboardInclude = UNSET, + include: GetDashboardInclude | Unset = UNSET, ) -> DashboardResponse | ErrorsList | None: """Retrieves a dashboard Retrieves a specific dashboard by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetDashboardInclude]): + id (str | UUID): + include (GetDashboardInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[DashboardResponse, ErrorsList] + DashboardResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/dashboards/list_dashboards.py b/rootly_sdk/api/dashboards/list_dashboards.py index 13665e62..c0c41cd8 100644 --- a/rootly_sdk/api/dashboards/list_dashboards.py +++ b/rootly_sdk/api/dashboards/list_dashboards.py @@ -12,13 +12,14 @@ def _get_kwargs( *, - include: Unset | ListDashboardsInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListDashboardsInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -63,18 +64,18 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: Unset | ListDashboardsInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListDashboardsInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[DashboardList]: """List dashboards List dashboards Args: - include (Union[Unset, ListDashboardsInclude]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (ListDashboardsInclude | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -100,18 +101,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Unset | ListDashboardsInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListDashboardsInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> DashboardList | None: """List dashboards List dashboards Args: - include (Union[Unset, ListDashboardsInclude]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (ListDashboardsInclude | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -132,18 +133,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Unset | ListDashboardsInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListDashboardsInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[DashboardList]: """List dashboards List dashboards Args: - include (Union[Unset, ListDashboardsInclude]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (ListDashboardsInclude | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -167,18 +168,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Unset | ListDashboardsInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListDashboardsInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> DashboardList | None: """List dashboards List dashboards Args: - include (Union[Unset, ListDashboardsInclude]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (ListDashboardsInclude | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 d6fb3419..7cf3246d 100644 --- a/rootly_sdk/api/dashboards/set_default_dashboard.py +++ b/rootly_sdk/api/dashboards/set_default_dashboard.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/dashboards/{id}/set_default", + "url": "/v1/dashboards/{id}/set_default".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[DashboardResponse | ErrorsList]: @@ -62,14 +66,14 @@ def sync_detailed( Sets dashboard to user default Args: - id (Union[UUID, str]): + id (str | 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[Union[DashboardResponse, ErrorsList]] + Response[DashboardResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> DashboardResponse | ErrorsList | None: @@ -93,14 +97,14 @@ def sync( Sets dashboard to user default Args: - id (Union[UUID, str]): + id (str | 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: - Union[DashboardResponse, ErrorsList] + DashboardResponse | ErrorsList """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[DashboardResponse | ErrorsList]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Sets dashboard to user default Args: - id (Union[UUID, str]): + id (str | 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[Union[DashboardResponse, ErrorsList]] + Response[DashboardResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> DashboardResponse | ErrorsList | None: @@ -148,14 +152,14 @@ async def asyncio( Sets dashboard to user default Args: - id (Union[UUID, str]): + id (str | 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: - Union[DashboardResponse, ErrorsList] + DashboardResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/dashboards/update_dashboard.py b/rootly_sdk/api/dashboards/update_dashboard.py index f1dab2cb..56ac6566 100644 --- a/rootly_sdk/api/dashboards/update_dashboard.py +++ b/rootly_sdk/api/dashboards/update_dashboard.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateDashboard, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/dashboards/{id}", + "url": "/v1/dashboards/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateDashboard, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific dashboard by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateDashboard): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[DashboardResponse, ErrorsList]] + Response[DashboardResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateDashboard, @@ -107,7 +110,7 @@ def sync( Update a specific dashboard by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateDashboard): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[DashboardResponse, ErrorsList] + DashboardResponse | ErrorsList """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateDashboard, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific dashboard by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateDashboard): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[DashboardResponse, ErrorsList]] + Response[DashboardResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateDashboard, @@ -168,7 +171,7 @@ async def asyncio( Update a specific dashboard by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateDashboard): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[DashboardResponse, ErrorsList] + 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 64fb8702..65314afc 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/custom_fields/{custom_field_id}/options", + "url": "/v1/custom_fields/{custom_field_id}/options".format( + custom_field_id=quote(str(custom_field_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CustomFieldOptionResponse, ErrorsList]] + Response[CustomFieldOptionResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFieldOptionResponse, ErrorsList] + CustomFieldOptionResponse | ErrorsList """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CustomFieldOptionResponse, ErrorsList]] + Response[CustomFieldOptionResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFieldOptionResponse, ErrorsList] + 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 331f1a0e..3968cd4d 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/custom_field_options/{id}", + "url": "/v1/custom_field_options/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CustomFieldOptionResponse, ErrorsList]] + Response[CustomFieldOptionResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFieldOptionResponse, ErrorsList] + CustomFieldOptionResponse | ErrorsList """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CustomFieldOptionResponse, ErrorsList]] + Response[CustomFieldOptionResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFieldOptionResponse, ErrorsList] + 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 1f7ee239..afdda05c 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/custom_field_options/{id}", + "url": "/v1/custom_field_options/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CustomFieldOptionResponse, ErrorsList]] + Response[CustomFieldOptionResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFieldOptionResponse, ErrorsList] + CustomFieldOptionResponse | ErrorsList """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CustomFieldOptionResponse, ErrorsList]] + Response[CustomFieldOptionResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFieldOptionResponse, ErrorsList] + 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 cec6b6d7..bca688b3 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,12 +13,13 @@ def _get_kwargs( custom_field_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filtervalue: Unset | str = UNSET, - filtercolor: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filtervalue: str | Unset = UNSET, + filtercolor: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -34,7 +36,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/custom_fields/{custom_field_id}/options", + "url": "/v1/custom_fields/{custom_field_id}/options".format( + custom_field_id=quote(str(custom_field_id), safe=""), + ), "params": params, } @@ -68,11 +72,11 @@ def sync_detailed( custom_field_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filtervalue: Unset | str = UNSET, - filtercolor: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filtervalue: str | Unset = UNSET, + filtercolor: str | Unset = UNSET, ) -> Response[CustomFieldOptionList]: """[DEPRECATED] List custom field options @@ -80,11 +84,11 @@ def sync_detailed( Args: custom_field_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filtervalue (Union[Unset, str]): - filtercolor (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filtervalue (str | Unset): + filtercolor (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -114,11 +118,11 @@ def sync( custom_field_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filtervalue: Unset | str = UNSET, - filtercolor: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filtervalue: str | Unset = UNSET, + filtercolor: str | Unset = UNSET, ) -> CustomFieldOptionList | None: """[DEPRECATED] List custom field options @@ -126,11 +130,11 @@ def sync( Args: custom_field_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filtervalue (Union[Unset, str]): - filtercolor (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filtervalue (str | Unset): + filtercolor (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -155,11 +159,11 @@ async def asyncio_detailed( custom_field_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filtervalue: Unset | str = UNSET, - filtercolor: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filtervalue: str | Unset = UNSET, + filtercolor: str | Unset = UNSET, ) -> Response[CustomFieldOptionList]: """[DEPRECATED] List custom field options @@ -167,11 +171,11 @@ async def asyncio_detailed( Args: custom_field_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filtervalue (Union[Unset, str]): - filtercolor (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filtervalue (str | Unset): + filtercolor (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -199,11 +203,11 @@ async def asyncio( custom_field_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filtervalue: Unset | str = UNSET, - filtercolor: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filtervalue: str | Unset = UNSET, + filtercolor: str | Unset = UNSET, ) -> CustomFieldOptionList | None: """[DEPRECATED] List custom field options @@ -211,11 +215,11 @@ async def asyncio( Args: custom_field_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filtervalue (Union[Unset, str]): - filtercolor (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filtervalue (str | Unset): + filtercolor (str | Unset): 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 4f114d44..394362f8 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/custom_field_options/{id}", + "url": "/v1/custom_field_options/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CustomFieldOptionResponse, ErrorsList]] + Response[CustomFieldOptionResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFieldOptionResponse, ErrorsList] + CustomFieldOptionResponse | ErrorsList """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CustomFieldOptionResponse, ErrorsList]] + Response[CustomFieldOptionResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFieldOptionResponse, ErrorsList] + 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 d8545178..d4ca5660 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[Union[CustomFieldResponse, ErrorsList]] + Response[CustomFieldResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFieldResponse, ErrorsList] + 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[Union[CustomFieldResponse, ErrorsList]] + Response[CustomFieldResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFieldResponse, ErrorsList] + 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 3391f10e..9fa62894 100644 --- a/rootly_sdk/api/deprecated_custom_fields/delete_custom_field.py +++ b/rootly_sdk/api/deprecated_custom_fields/delete_custom_field.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/custom_fields/{id}", + "url": "/v1/custom_fields/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CustomFieldResponse, ErrorsList]] + Response[CustomFieldResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFieldResponse, ErrorsList] + CustomFieldResponse | ErrorsList """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CustomFieldResponse, ErrorsList]] + Response[CustomFieldResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFieldResponse, ErrorsList] + 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 693eb8ff..3ee224fc 100644 --- a/rootly_sdk/api/deprecated_custom_fields/get_custom_field.py +++ b/rootly_sdk/api/deprecated_custom_fields/get_custom_field.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -14,11 +15,12 @@ def _get_kwargs( id: str, *, - include: Unset | GetCustomFieldInclude = UNSET, + include: GetCustomFieldInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/custom_fields/{id}", + "url": "/v1/custom_fields/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -69,7 +73,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetCustomFieldInclude = UNSET, + include: GetCustomFieldInclude | Unset = UNSET, ) -> Response[CustomFieldResponse | ErrorsList]: """[DEPRECATED] Retrieves a Custom Field @@ -77,14 +81,14 @@ def sync_detailed( Args: id (str): - include (Union[Unset, GetCustomFieldInclude]): + include (GetCustomFieldInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CustomFieldResponse, ErrorsList]] + Response[CustomFieldResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -103,7 +107,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Unset | GetCustomFieldInclude = UNSET, + include: GetCustomFieldInclude | Unset = UNSET, ) -> CustomFieldResponse | ErrorsList | None: """[DEPRECATED] Retrieves a Custom Field @@ -111,14 +115,14 @@ def sync( Args: id (str): - include (Union[Unset, GetCustomFieldInclude]): + include (GetCustomFieldInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFieldResponse, ErrorsList] + CustomFieldResponse | ErrorsList """ return sync_detailed( @@ -132,7 +136,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetCustomFieldInclude = UNSET, + include: GetCustomFieldInclude | Unset = UNSET, ) -> Response[CustomFieldResponse | ErrorsList]: """[DEPRECATED] Retrieves a Custom Field @@ -140,14 +144,14 @@ async def asyncio_detailed( Args: id (str): - include (Union[Unset, GetCustomFieldInclude]): + include (GetCustomFieldInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CustomFieldResponse, ErrorsList]] + Response[CustomFieldResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -164,7 +168,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Unset | GetCustomFieldInclude = UNSET, + include: GetCustomFieldInclude | Unset = UNSET, ) -> CustomFieldResponse | ErrorsList | None: """[DEPRECATED] Retrieves a Custom Field @@ -172,14 +176,14 @@ async def asyncio( Args: id (str): - include (Union[Unset, GetCustomFieldInclude]): + include (GetCustomFieldInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFieldResponse, ErrorsList] + 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 c792fd54..3d059a21 100644 --- a/rootly_sdk/api/deprecated_custom_fields/list_custom_fields.py +++ b/rootly_sdk/api/deprecated_custom_fields/list_custom_fields.py @@ -13,44 +13,45 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Unset | str = UNSET + json_sort: str | Unset = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -143,68 +144,68 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CustomFieldList]: """[DEPRECATED] List Custom Fields [DEPRECATED] Use form field endpoints instead. List Custom fields Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -255,68 +256,68 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> CustomFieldList | None: """[DEPRECATED] List Custom Fields [DEPRECATED] Use form field endpoints instead. List Custom fields Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -362,68 +363,68 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CustomFieldList]: """[DEPRECATED] List Custom Fields [DEPRECATED] Use form field endpoints instead. List Custom fields Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -472,68 +473,68 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> CustomFieldList | None: """[DEPRECATED] List Custom Fields [DEPRECATED] Use form field endpoints instead. List Custom fields Args: - 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]): + 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): 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 bd9635d7..6c03fcb7 100644 --- a/rootly_sdk/api/deprecated_custom_fields/update_custom_field.py +++ b/rootly_sdk/api/deprecated_custom_fields/update_custom_field.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/custom_fields/{id}", + "url": "/v1/custom_fields/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CustomFieldResponse, ErrorsList]] + Response[CustomFieldResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFieldResponse, ErrorsList] + CustomFieldResponse | ErrorsList """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[CustomFieldResponse, ErrorsList]] + Response[CustomFieldResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CustomFieldResponse, ErrorsList] + 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 c8df48b9..656ce720 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/incidents/{incident_id}/custom_field_selections", + "url": "/v1/incidents/{incident_id}/custom_field_selections".format( + incident_id=quote(str(incident_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -86,7 +89,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] + Response[ErrorsList | IncidentCustomFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -121,7 +124,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentCustomFieldSelectionResponse] + ErrorsList | IncidentCustomFieldSelectionResponse """ return sync_detailed( @@ -151,7 +154,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] + Response[ErrorsList | IncidentCustomFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -184,7 +187,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentCustomFieldSelectionResponse] + 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 649c250e..b96d8ac0 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/incident_custom_field_selections/{id}", + "url": "/v1/incident_custom_field_selections/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -69,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] + Response[ErrorsList | IncidentCustomFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -101,7 +105,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentCustomFieldSelectionResponse] + ErrorsList | IncidentCustomFieldSelectionResponse """ return sync_detailed( @@ -128,7 +132,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] + Response[ErrorsList | IncidentCustomFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -158,7 +162,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentCustomFieldSelectionResponse] + 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 2eb7fe16..51ee55a3 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incident_custom_field_selections/{id}", + "url": "/v1/incident_custom_field_selections/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -69,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] + Response[ErrorsList | IncidentCustomFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -101,7 +105,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentCustomFieldSelectionResponse] + ErrorsList | IncidentCustomFieldSelectionResponse """ return sync_detailed( @@ -128,7 +132,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] + Response[ErrorsList | IncidentCustomFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -158,7 +162,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentCustomFieldSelectionResponse] + 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 d57c8279..5e6f60d6 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( incident_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incidents/{incident_id}/custom_field_selections", + "url": "/v1/incidents/{incident_id}/custom_field_selections".format( + incident_id=quote(str(incident_id), safe=""), + ), "params": params, } @@ -64,9 +68,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[IncidentCustomFieldSelectionList]: """[DEPRECATED] List incident custom field selections @@ -74,9 +78,9 @@ def sync_detailed( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +108,9 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> IncidentCustomFieldSelectionList | None: """[DEPRECATED] List incident custom field selections @@ -114,9 +118,9 @@ def sync( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +143,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[IncidentCustomFieldSelectionList]: """[DEPRECATED] List incident custom field selections @@ -149,9 +153,9 @@ async def asyncio_detailed( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +181,9 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> IncidentCustomFieldSelectionList | None: """[DEPRECATED] List incident custom field selections @@ -187,9 +191,9 @@ async def asyncio( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 7269c699..b94030b8 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incident_custom_field_selections/{id}", + "url": "/v1/incident_custom_field_selections/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] + Response[ErrorsList | IncidentCustomFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -116,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentCustomFieldSelectionResponse] + ErrorsList | IncidentCustomFieldSelectionResponse """ return sync_detailed( @@ -146,7 +149,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentCustomFieldSelectionResponse]] + Response[ErrorsList | IncidentCustomFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -179,7 +182,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentCustomFieldSelectionResponse] + 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 5e0751b7..60ac3c5d 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/workflows/{workflow_id}/custom_field_selections", + "url": "/v1/workflows/{workflow_id}/custom_field_selections".format( + workflow_id=quote(str(workflow_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] + Response[ErrorsList | WorkflowCustomFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -116,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowCustomFieldSelectionResponse] + ErrorsList | WorkflowCustomFieldSelectionResponse """ return sync_detailed( @@ -146,7 +149,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] + Response[ErrorsList | WorkflowCustomFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -179,7 +182,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowCustomFieldSelectionResponse] + 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 6a1c1aed..c41ac11d 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/workflow_custom_field_selections/{id}", + "url": "/v1/workflow_custom_field_selections/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -69,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] + Response[ErrorsList | WorkflowCustomFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -101,7 +105,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowCustomFieldSelectionResponse] + ErrorsList | WorkflowCustomFieldSelectionResponse """ return sync_detailed( @@ -128,7 +132,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] + Response[ErrorsList | WorkflowCustomFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -158,7 +162,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowCustomFieldSelectionResponse] + 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 01b037e7..30f721e6 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/workflow_custom_field_selections/{id}", + "url": "/v1/workflow_custom_field_selections/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -69,7 +73,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] + Response[ErrorsList | WorkflowCustomFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -101,7 +105,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowCustomFieldSelectionResponse] + ErrorsList | WorkflowCustomFieldSelectionResponse """ return sync_detailed( @@ -128,7 +132,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] + Response[ErrorsList | WorkflowCustomFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -158,7 +162,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowCustomFieldSelectionResponse] + 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 b023d80d..764381f7 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( workflow_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/workflows/{workflow_id}/custom_field_selections", + "url": "/v1/workflows/{workflow_id}/custom_field_selections".format( + workflow_id=quote(str(workflow_id), safe=""), + ), "params": params, } @@ -64,9 +68,9 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[WorkflowCustomFieldSelectionList]: """[DEPRECATED] List workflow custom field selections @@ -74,9 +78,9 @@ def sync_detailed( Args: workflow_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +108,9 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> WorkflowCustomFieldSelectionList | None: """[DEPRECATED] List workflow custom field selections @@ -114,9 +118,9 @@ def sync( Args: workflow_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +143,9 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[WorkflowCustomFieldSelectionList]: """[DEPRECATED] List workflow custom field selections @@ -149,9 +153,9 @@ async def asyncio_detailed( Args: workflow_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +181,9 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> WorkflowCustomFieldSelectionList | None: """[DEPRECATED] List workflow custom field selections @@ -187,9 +191,9 @@ async def asyncio( Args: workflow_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 78517bb2..5f683704 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/workflow_custom_field_selections/{id}", + "url": "/v1/workflow_custom_field_selections/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] + Response[ErrorsList | WorkflowCustomFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -116,7 +119,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowCustomFieldSelectionResponse] + ErrorsList | WorkflowCustomFieldSelectionResponse """ return sync_detailed( @@ -146,7 +149,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowCustomFieldSelectionResponse]] + Response[ErrorsList | WorkflowCustomFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -179,7 +182,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowCustomFieldSelectionResponse] + 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 29ca9bbd..2fab426e 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,27 +1,31 @@ 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 Response +from ...types import UNSET, Response, Unset def _get_kwargs( edge_connector_id: str, *, - body: CreateEdgeConnectorActionBody, + body: CreateEdgeConnectorActionBody | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/edge_connectors/{edge_connector_id}/actions", + "url": "/v1/edge_connectors/{edge_connector_id}/actions".format( + edge_connector_id=quote(str(edge_connector_id), safe=""), + ), } - _kwargs["json"] = body.to_dict() + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -55,13 +59,13 @@ def sync_detailed( edge_connector_id: str, *, client: AuthenticatedClient, - body: CreateEdgeConnectorActionBody, + body: CreateEdgeConnectorActionBody | Unset = UNSET, ) -> Response[Any]: """Create edge connector action Args: edge_connector_id (str): - body (CreateEdgeConnectorActionBody): + body (CreateEdgeConnectorActionBody | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -87,13 +91,13 @@ async def asyncio_detailed( edge_connector_id: str, *, client: AuthenticatedClient, - body: CreateEdgeConnectorActionBody, + body: CreateEdgeConnectorActionBody | Unset = UNSET, ) -> Response[Any]: """Create edge connector action Args: edge_connector_id (str): - body (CreateEdgeConnectorActionBody): + body (CreateEdgeConnectorActionBody | Unset): 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 5ec477b2..bcad29a3 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -11,11 +12,15 @@ def _get_kwargs( edge_connector_id: str, - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/edge_connectors/{edge_connector_id}/actions/{id}", + "url": "/v1/edge_connectors/{edge_connector_id}/actions/{id}".format( + edge_connector_id=quote(str(edge_connector_id), safe=""), + id=quote(str(id), safe=""), + ), } return _kwargs @@ -42,7 +47,7 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( edge_connector_id: str, - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[Any]: @@ -50,7 +55,7 @@ def sync_detailed( Args: edge_connector_id (str): - id (Union[UUID, str]): + id (str | UUID): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -74,7 +79,7 @@ def sync_detailed( async def asyncio_detailed( edge_connector_id: str, - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[Any]: @@ -82,7 +87,7 @@ async def asyncio_detailed( Args: edge_connector_id (str): - id (Union[UUID, str]): + id (str | 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/edge_connector_actions/get_edge_connector_action.py b/rootly_sdk/api/edge_connector_actions/get_edge_connector_action.py index 880d1923..35449bd3 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -11,11 +12,15 @@ def _get_kwargs( edge_connector_id: str, - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/edge_connectors/{edge_connector_id}/actions/{id}", + "url": "/v1/edge_connectors/{edge_connector_id}/actions/{id}".format( + edge_connector_id=quote(str(edge_connector_id), safe=""), + id=quote(str(id), safe=""), + ), } return _kwargs @@ -45,7 +50,7 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( edge_connector_id: str, - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[Any]: @@ -53,7 +58,7 @@ def sync_detailed( Args: edge_connector_id (str): - id (Union[UUID, str]): + id (str | UUID): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -77,7 +82,7 @@ def sync_detailed( async def asyncio_detailed( edge_connector_id: str, - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[Any]: @@ -85,7 +90,7 @@ async def asyncio_detailed( Args: edge_connector_id (str): - id (Union[UUID, str]): + id (str | 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/edge_connector_actions/list_edge_connector_actions.py b/rootly_sdk/api/edge_connector_actions/list_edge_connector_actions.py index 28079f6d..ac27ce42 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -11,9 +12,12 @@ def _get_kwargs( edge_connector_id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/edge_connectors/{edge_connector_id}/actions", + "url": "/v1/edge_connectors/{edge_connector_id}/actions".format( + edge_connector_id=quote(str(edge_connector_id), safe=""), + ), } 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 cf2b03a1..9be920e7 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -7,23 +8,27 @@ from ... import errors from ...client import AuthenticatedClient, Client from ...models.update_edge_connector_action_body import UpdateEdgeConnectorActionBody -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( edge_connector_id: str, - id: UUID | str, + id: str | UUID, *, - body: UpdateEdgeConnectorActionBody, + body: UpdateEdgeConnectorActionBody | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/v1/edge_connectors/{edge_connector_id}/actions/{id}", + "url": "/v1/edge_connectors/{edge_connector_id}/actions/{id}".format( + edge_connector_id=quote(str(edge_connector_id), safe=""), + id=quote(str(id), safe=""), + ), } - _kwargs["json"] = body.to_dict() + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -52,17 +57,17 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( edge_connector_id: str, - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - body: UpdateEdgeConnectorActionBody, + body: UpdateEdgeConnectorActionBody | Unset = UNSET, ) -> Response[Any]: """Update edge connector action Args: edge_connector_id (str): - id (Union[UUID, str]): - body (UpdateEdgeConnectorActionBody): + id (str | UUID): + body (UpdateEdgeConnectorActionBody | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -87,17 +92,17 @@ def sync_detailed( async def asyncio_detailed( edge_connector_id: str, - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - body: UpdateEdgeConnectorActionBody, + body: UpdateEdgeConnectorActionBody | Unset = UNSET, ) -> Response[Any]: """Update edge connector action Args: edge_connector_id (str): - id (Union[UUID, str]): - body (UpdateEdgeConnectorActionBody): + id (str | UUID): + body (UpdateEdgeConnectorActionBody | Unset): 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 31971c77..4fd4237e 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 Response +from ...types import UNSET, Response, Unset def _get_kwargs( *, - body: CreateEdgeConnectorBody, + body: CreateEdgeConnectorBody | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -20,7 +20,8 @@ def _get_kwargs( "url": "/v1/edge_connectors", } - _kwargs["json"] = body.to_dict() + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -53,12 +54,12 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - body: CreateEdgeConnectorBody, + body: CreateEdgeConnectorBody | Unset = UNSET, ) -> Response[Any]: """Create edge connector Args: - body (CreateEdgeConnectorBody): + body (CreateEdgeConnectorBody | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -82,12 +83,12 @@ def sync_detailed( async def asyncio_detailed( *, client: AuthenticatedClient, - body: CreateEdgeConnectorBody, + body: CreateEdgeConnectorBody | Unset = UNSET, ) -> Response[Any]: """Create edge connector Args: - body (CreateEdgeConnectorBody): + body (CreateEdgeConnectorBody | Unset): 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 7f472c71..a289f349 100644 --- a/rootly_sdk/api/edge_connectors/delete_edge_connector.py +++ b/rootly_sdk/api/edge_connectors/delete_edge_connector.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -11,9 +12,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/edge_connectors/{id}", + "url": "/v1/edge_connectors/{id}".format( + id=quote(str(id), safe=""), + ), } 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 b1667ef7..ce73bfe0 100644 --- a/rootly_sdk/api/edge_connectors/get_edge_connector.py +++ b/rootly_sdk/api/edge_connectors/get_edge_connector.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -11,9 +12,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/edge_connectors/{id}", + "url": "/v1/edge_connectors/{id}".format( + id=quote(str(id), safe=""), + ), } 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 1e7b1c39..e24a0844 100644 --- a/rootly_sdk/api/edge_connectors/list_edge_connectors.py +++ b/rootly_sdk/api/edge_connectors/list_edge_connectors.py @@ -10,11 +10,12 @@ def _get_kwargs( *, - page: Unset | int = UNSET, - per_page: Unset | int = UNSET, - status: Unset | str = UNSET, - name: Unset | str = UNSET, + page: int | Unset = UNSET, + per_page: int | Unset = UNSET, + status: str | Unset = UNSET, + name: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["page"] = page @@ -58,18 +59,18 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - page: Unset | int = UNSET, - per_page: Unset | int = UNSET, - status: Unset | str = UNSET, - name: Unset | str = UNSET, + page: int | Unset = UNSET, + per_page: int | Unset = UNSET, + status: str | Unset = UNSET, + name: str | Unset = UNSET, ) -> Response[Any]: """List edge connectors Args: - page (Union[Unset, int]): - per_page (Union[Unset, int]): - status (Union[Unset, str]): - name (Union[Unset, str]): + page (int | Unset): + per_page (int | Unset): + status (str | Unset): + name (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -96,18 +97,18 @@ def sync_detailed( async def asyncio_detailed( *, client: AuthenticatedClient, - page: Unset | int = UNSET, - per_page: Unset | int = UNSET, - status: Unset | str = UNSET, - name: Unset | str = UNSET, + page: int | Unset = UNSET, + per_page: int | Unset = UNSET, + status: str | Unset = UNSET, + name: str | Unset = UNSET, ) -> Response[Any]: """List edge connectors Args: - page (Union[Unset, int]): - per_page (Union[Unset, int]): - status (Union[Unset, str]): - name (Union[Unset, str]): + page (int | Unset): + per_page (int | Unset): + status (str | Unset): + name (str | Unset): 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 1c7b0e27..df27a0bb 100644 --- a/rootly_sdk/api/edge_connectors/update_edge_connector.py +++ b/rootly_sdk/api/edge_connectors/update_edge_connector.py @@ -1,27 +1,31 @@ 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 Response +from ...types import UNSET, Response, Unset def _get_kwargs( id: str, *, - body: UpdateEdgeConnectorBody, + body: UpdateEdgeConnectorBody | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "patch", - "url": f"/v1/edge_connectors/{id}", + "url": "/v1/edge_connectors/{id}".format( + id=quote(str(id), safe=""), + ), } - _kwargs["json"] = body.to_dict() + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -55,13 +59,13 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateEdgeConnectorBody, + body: UpdateEdgeConnectorBody | Unset = UNSET, ) -> Response[Any]: """Update edge connector Args: id (str): - body (UpdateEdgeConnectorBody): + body (UpdateEdgeConnectorBody | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -87,13 +91,13 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateEdgeConnectorBody, + body: UpdateEdgeConnectorBody | Unset = UNSET, ) -> Response[Any]: """Update edge connector Args: id (str): - body (UpdateEdgeConnectorBody): + body (UpdateEdgeConnectorBody | Unset): 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 26e40317..7a889981 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, Union +from typing import Any import httpx @@ -14,7 +14,7 @@ def _get_kwargs( *, - body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], + body: BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -23,7 +23,6 @@ def _get_kwargs( "url": "/v1/environments/bulk_delete", } - _kwargs["json"]: dict[str, Any] if isinstance(body, BulkDestroyEnvironmentsType0): _kwargs["json"] = body.to_dict() else: @@ -37,7 +36,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkDestroyEnvironmentsResponse | ErrorsList | Union["BulkDestroyEnvironmentsResponse", "ErrorsList"] | None: +) -> BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList | None: if response.status_code == 200: response_200 = BulkDestroyEnvironmentsResponse.from_dict(response.json()) @@ -50,14 +49,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]: + def _parse_response_422(data: object) -> BulkDestroyEnvironmentsResponse | ErrorsList: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -77,7 +76,7 @@ def _parse_response_422(data: object) -> Union["BulkDestroyEnvironmentsResponse" def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkDestroyEnvironmentsResponse | ErrorsList | Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]]: +) -> Response[BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -89,24 +88,24 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], -) -> Response[BulkDestroyEnvironmentsResponse | ErrorsList | Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]]: + body: BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1, +) -> Response[BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList]: """Bulk delete Environments Delete environments by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - 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). + 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). Raises: errors.UnexpectedStatus: If the server returns 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[BulkDestroyEnvironmentsResponse, ErrorsList, Union['BulkDestroyEnvironmentsResponse', 'ErrorsList']]] + Response[BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList] """ kwargs = _get_kwargs( @@ -123,24 +122,24 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], -) -> BulkDestroyEnvironmentsResponse | ErrorsList | Union["BulkDestroyEnvironmentsResponse", "ErrorsList"] | None: + body: BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1, +) -> BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList | None: """Bulk delete Environments Delete environments by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - 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). + 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). Raises: errors.UnexpectedStatus: If the server 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[BulkDestroyEnvironmentsResponse, ErrorsList, Union['BulkDestroyEnvironmentsResponse', 'ErrorsList']] + BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList """ return sync_detailed( @@ -152,24 +151,24 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], -) -> Response[BulkDestroyEnvironmentsResponse | ErrorsList | Union["BulkDestroyEnvironmentsResponse", "ErrorsList"]]: + body: BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1, +) -> Response[BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList]: """Bulk delete Environments Delete environments by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - 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). + 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). Raises: errors.UnexpectedStatus: If the server returns 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[BulkDestroyEnvironmentsResponse, ErrorsList, Union['BulkDestroyEnvironmentsResponse', 'ErrorsList']]] + Response[BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList] """ kwargs = _get_kwargs( @@ -184,24 +183,24 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: Union["BulkDestroyEnvironmentsType0", "BulkDestroyEnvironmentsType1"], -) -> BulkDestroyEnvironmentsResponse | ErrorsList | Union["BulkDestroyEnvironmentsResponse", "ErrorsList"] | None: + body: BulkDestroyEnvironmentsType0 | BulkDestroyEnvironmentsType1, +) -> BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList | None: """Bulk delete Environments Delete environments by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - 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). + 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). Raises: errors.UnexpectedStatus: If the server 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[BulkDestroyEnvironmentsResponse, ErrorsList, Union['BulkDestroyEnvironmentsResponse', 'ErrorsList']] + BulkDestroyEnvironmentsResponse | BulkDestroyEnvironmentsResponse | ErrorsList | ErrorsList """ return ( diff --git a/rootly_sdk/api/environments/bulk_upsert_environments.py b/rootly_sdk/api/environments/bulk_upsert_environments.py index 8ad20328..32b2cd6c 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, Union +from typing import Any import httpx @@ -33,7 +33,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkUpsertEnvironmentsResponse | ErrorsList | Union["BulkUpsertEnvironmentsError", "ErrorsList"] | None: +) -> BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | 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) -> Union["BulkUpsertEnvironmentsError", "ErrorsList"]: + def _parse_response_422(data: object) -> BulkUpsertEnvironmentsError | ErrorsList: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -73,7 +73,7 @@ def _parse_response_422(data: object) -> Union["BulkUpsertEnvironmentsError", "E def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkUpsertEnvironmentsResponse | ErrorsList | Union["BulkUpsertEnvironmentsError", "ErrorsList"]]: +) -> Response[BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +86,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertEnvironments, -) -> Response[BulkUpsertEnvironmentsResponse | ErrorsList | Union["BulkUpsertEnvironmentsError", "ErrorsList"]]: +) -> Response[BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | 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[Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union['BulkUpsertEnvironmentsError', 'ErrorsList']]] + Response[BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -121,7 +121,7 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertEnvironments, -) -> BulkUpsertEnvironmentsResponse | ErrorsList | Union["BulkUpsertEnvironmentsError", "ErrorsList"] | None: +) -> BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | 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: - Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union['BulkUpsertEnvironmentsError', 'ErrorsList']] + BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList """ return sync_detailed( @@ -151,7 +151,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertEnvironments, -) -> Response[BulkUpsertEnvironmentsResponse | ErrorsList | Union["BulkUpsertEnvironmentsError", "ErrorsList"]]: +) -> Response[BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | 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[Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union['BulkUpsertEnvironmentsError', 'ErrorsList']]] + Response[BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -184,7 +184,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertEnvironments, -) -> BulkUpsertEnvironmentsResponse | ErrorsList | Union["BulkUpsertEnvironmentsError", "ErrorsList"] | None: +) -> BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | 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: - Union[BulkUpsertEnvironmentsResponse, ErrorsList, Union['BulkUpsertEnvironmentsError', 'ErrorsList']] + BulkUpsertEnvironmentsError | ErrorsList | BulkUpsertEnvironmentsResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/environments/create_environment.py b/rootly_sdk/api/environments/create_environment.py index caf794c0..a12a138c 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[Union[EnvironmentResponse, ErrorsList]] + Response[EnvironmentResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[EnvironmentResponse, ErrorsList] + 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[Union[EnvironmentResponse, ErrorsList]] + Response[EnvironmentResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[EnvironmentResponse, ErrorsList] + 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 2f99eba5..d3a415ba 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[Union[CatalogPropertyResponse, ErrorsList]] + Response[CatalogPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogPropertyResponse, ErrorsList] + 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[Union[CatalogPropertyResponse, ErrorsList]] + Response[CatalogPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogPropertyResponse, ErrorsList] + CatalogPropertyResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/environments/delete_environment.py b/rootly_sdk/api/environments/delete_environment.py index ef4496ee..48221a57 100644 --- a/rootly_sdk/api/environments/delete_environment.py +++ b/rootly_sdk/api/environments/delete_environment.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/environments/{id}", + "url": "/v1/environments/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[EnvironmentResponse | ErrorsList]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific environment by id Args: - id (Union[UUID, str]): + id (str | 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[Union[EnvironmentResponse, ErrorsList]] + Response[EnvironmentResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> EnvironmentResponse | ErrorsList | None: @@ -93,14 +97,14 @@ def sync( Delete a specific environment by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[EnvironmentResponse, ErrorsList] + EnvironmentResponse | ErrorsList """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[EnvironmentResponse | ErrorsList]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific environment by id Args: - id (Union[UUID, str]): + id (str | 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[Union[EnvironmentResponse, ErrorsList]] + Response[EnvironmentResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> EnvironmentResponse | ErrorsList | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific environment by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[EnvironmentResponse, ErrorsList] + EnvironmentResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/environments/get_environment.py b/rootly_sdk/api/environments/get_environment.py index 8481d2d2..2fb16213 100644 --- a/rootly_sdk/api/environments/get_environment.py +++ b/rootly_sdk/api/environments/get_environment.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/environments/{id}", + "url": "/v1/environments/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[EnvironmentResponse | ErrorsList]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific environment by id Args: - id (Union[UUID, str]): + id (str | 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[Union[EnvironmentResponse, ErrorsList]] + Response[EnvironmentResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> EnvironmentResponse | ErrorsList | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific environment by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[EnvironmentResponse, ErrorsList] + EnvironmentResponse | ErrorsList """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[EnvironmentResponse | ErrorsList]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific environment by id Args: - id (Union[UUID, str]): + id (str | 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[Union[EnvironmentResponse, ErrorsList]] + Response[EnvironmentResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> EnvironmentResponse | ErrorsList | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific environment by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[EnvironmentResponse, ErrorsList] + 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 6a882fc6..cb526165 100644 --- a/rootly_sdk/api/environments/list_environment_catalog_properties.py +++ b/rootly_sdk/api/environments/list_environment_catalog_properties.py @@ -17,27 +17,28 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Unset | str = UNSET + json_sort: str | Unset = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -96,34 +97,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Environment Catalog Properties Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -157,34 +158,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogPropertyList | None: """List Catalog Properties List Environment Catalog Properties Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -213,34 +214,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Environment Catalog Properties Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -272,34 +273,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogPropertyList | None: """List Catalog Properties List Environment Catalog Properties Args: - 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]): + 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): 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 00547daa..20855cd6 100644 --- a/rootly_sdk/api/environments/list_environments.py +++ b/rootly_sdk/api/environments/list_environments.py @@ -11,31 +11,32 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -121,60 +122,60 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[EnvironmentList]: """List environments List environments Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -221,60 +222,60 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> EnvironmentList | None: """List environments List environments Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -316,60 +317,60 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[EnvironmentList]: """List environments List environments Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -414,60 +415,60 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> EnvironmentList | None: """List environments List environments Args: - 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]): + 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): 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 9c168e2a..6e9348d0 100644 --- a/rootly_sdk/api/environments/update_environment.py +++ b/rootly_sdk/api/environments/update_environment.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateEnvironment, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/environments/{id}", + "url": "/v1/environments/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateEnvironment, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific environment by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateEnvironment): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[EnvironmentResponse, ErrorsList]] + Response[EnvironmentResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateEnvironment, @@ -107,7 +110,7 @@ def sync( Update a specific environment by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateEnvironment): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[EnvironmentResponse, ErrorsList] + EnvironmentResponse | ErrorsList """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateEnvironment, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific environment by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateEnvironment): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[EnvironmentResponse, ErrorsList]] + Response[EnvironmentResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateEnvironment, @@ -168,7 +171,7 @@ async def asyncio( Update a specific environment by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateEnvironment): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[EnvironmentResponse, ErrorsList] + 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 88675392..957eb67f 100644 --- a/rootly_sdk/api/escalation_levels/delete_escalation_level.py +++ b/rootly_sdk/api/escalation_levels/delete_escalation_level.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/escalation_levels/{id}", + "url": "/v1/escalation_levels/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyLevelResponse]] + Response[ErrorsList | EscalationPolicyLevelResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyLevelResponse] + ErrorsList | EscalationPolicyLevelResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyLevelResponse]] + Response[ErrorsList | EscalationPolicyLevelResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyLevelResponse] + 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 b60bf742..b8da372a 100644 --- a/rootly_sdk/api/escalation_levels/get_escalation_level.py +++ b/rootly_sdk/api/escalation_levels/get_escalation_level.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/escalation_levels/{id}", + "url": "/v1/escalation_levels/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyLevelResponse]] + Response[ErrorsList | EscalationPolicyLevelResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyLevelResponse] + ErrorsList | EscalationPolicyLevelResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyLevelResponse]] + Response[ErrorsList | EscalationPolicyLevelResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyLevelResponse] + 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 8a2a4146..880d0415 100644 --- a/rootly_sdk/api/escalation_levels/update_escalation_level.py +++ b/rootly_sdk/api/escalation_levels/update_escalation_level.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/escalation_levels/{id}", + "url": "/v1/escalation_levels/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyLevelResponse]] + Response[ErrorsList | EscalationPolicyLevelResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyLevelResponse] + ErrorsList | EscalationPolicyLevelResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyLevelResponse]] + Response[ErrorsList | EscalationPolicyLevelResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyLevelResponse] + 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 cf7dcc78..9527978d 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/escalation_paths/{escalation_policy_path_id}/escalation_levels", + "url": "/v1/escalation_paths/{escalation_policy_path_id}/escalation_levels".format( + escalation_policy_path_id=quote(str(escalation_policy_path_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyLevelResponse]] + Response[ErrorsList | EscalationPolicyLevelResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyLevelResponse] + ErrorsList | EscalationPolicyLevelResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyLevelResponse]] + Response[ErrorsList | EscalationPolicyLevelResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyLevelResponse] + 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 b5aa0f32..362d2739 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( escalation_policy_path_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/escalation_paths/{escalation_policy_path_id}/escalation_levels", + "url": "/v1/escalation_paths/{escalation_policy_path_id}/escalation_levels".format( + escalation_policy_path_id=quote(str(escalation_policy_path_id), safe=""), + ), "params": params, } @@ -64,9 +68,9 @@ def sync_detailed( escalation_policy_path_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[EscalationPolicyLevelList]: """List escalation levels for an Escalation Path @@ -74,9 +78,9 @@ def sync_detailed( Args: escalation_policy_path_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +108,9 @@ def sync( escalation_policy_path_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> EscalationPolicyLevelList | None: """List escalation levels for an Escalation Path @@ -114,9 +118,9 @@ def sync( Args: escalation_policy_path_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +143,9 @@ async def asyncio_detailed( escalation_policy_path_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[EscalationPolicyLevelList]: """List escalation levels for an Escalation Path @@ -149,9 +153,9 @@ async def asyncio_detailed( Args: escalation_policy_path_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +181,9 @@ async def asyncio( escalation_policy_path_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> EscalationPolicyLevelList | None: """List escalation levels for an Escalation Path @@ -187,9 +191,9 @@ async def asyncio( Args: escalation_policy_path_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 98b5d182..4132bf34 100644 --- a/rootly_sdk/api/escalation_levels_policies/create_escalation_level.py +++ b/rootly_sdk/api/escalation_levels_policies/create_escalation_level.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/escalation_policies/{escalation_policy_id}/escalation_levels", + "url": "/v1/escalation_policies/{escalation_policy_id}/escalation_levels".format( + escalation_policy_id=quote(str(escalation_policy_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyLevelResponse]] + Response[ErrorsList | EscalationPolicyLevelResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyLevelResponse] + ErrorsList | EscalationPolicyLevelResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyLevelResponse]] + Response[ErrorsList | EscalationPolicyLevelResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyLevelResponse] + 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 d0911eef..b6baf965 100644 --- a/rootly_sdk/api/escalation_levels_policies/list_escalation_levels.py +++ b/rootly_sdk/api/escalation_levels_policies/list_escalation_levels.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( escalation_policy_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/escalation_policies/{escalation_policy_id}/escalation_levels", + "url": "/v1/escalation_policies/{escalation_policy_id}/escalation_levels".format( + escalation_policy_id=quote(str(escalation_policy_id), safe=""), + ), "params": params, } @@ -64,9 +68,9 @@ def sync_detailed( escalation_policy_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[EscalationPolicyLevelList]: """List escalation levels for an Escalation Policy @@ -74,9 +78,9 @@ def sync_detailed( Args: escalation_policy_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +108,9 @@ def sync( escalation_policy_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> EscalationPolicyLevelList | None: """List escalation levels for an Escalation Policy @@ -114,9 +118,9 @@ def sync( Args: escalation_policy_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +143,9 @@ async def asyncio_detailed( escalation_policy_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[EscalationPolicyLevelList]: """List escalation levels for an Escalation Policy @@ -149,9 +153,9 @@ async def asyncio_detailed( Args: escalation_policy_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +181,9 @@ async def asyncio( escalation_policy_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> EscalationPolicyLevelList | None: """List escalation levels for an Escalation Policy @@ -187,9 +191,9 @@ async def asyncio( Args: escalation_policy_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 21f082d3..169f479f 100644 --- a/rootly_sdk/api/escalation_paths/create_escalation_path.py +++ b/rootly_sdk/api/escalation_paths/create_escalation_path.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/escalation_policies/{escalation_policy_id}/escalation_paths", + "url": "/v1/escalation_policies/{escalation_policy_id}/escalation_paths".format( + escalation_policy_id=quote(str(escalation_policy_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyPathResponse]] + Response[ErrorsList | EscalationPolicyPathResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyPathResponse] + ErrorsList | EscalationPolicyPathResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyPathResponse]] + Response[ErrorsList | EscalationPolicyPathResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyPathResponse] + 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 f7fd6f89..8162cca8 100644 --- a/rootly_sdk/api/escalation_paths/delete_escalation_path.py +++ b/rootly_sdk/api/escalation_paths/delete_escalation_path.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/escalation_paths/{id}", + "url": "/v1/escalation_paths/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyPathResponse]] + Response[ErrorsList | EscalationPolicyPathResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyPathResponse] + ErrorsList | EscalationPolicyPathResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyPathResponse]] + Response[ErrorsList | EscalationPolicyPathResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyPathResponse] + 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 98762af3..1735ff2f 100644 --- a/rootly_sdk/api/escalation_paths/get_escalation_path.py +++ b/rootly_sdk/api/escalation_paths/get_escalation_path.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -14,11 +15,12 @@ def _get_kwargs( id: str, *, - include: Unset | GetEscalationPathInclude = UNSET, + include: GetEscalationPathInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/escalation_paths/{id}", + "url": "/v1/escalation_paths/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -69,7 +73,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetEscalationPathInclude = UNSET, + include: GetEscalationPathInclude | Unset = UNSET, ) -> Response[ErrorsList | EscalationPolicyPathResponse]: """Retrieves an escalation path @@ -77,14 +81,14 @@ def sync_detailed( Args: id (str): - include (Union[Unset, GetEscalationPathInclude]): + include (GetEscalationPathInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyPathResponse]] + Response[ErrorsList | EscalationPolicyPathResponse] """ kwargs = _get_kwargs( @@ -103,7 +107,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Unset | GetEscalationPathInclude = UNSET, + include: GetEscalationPathInclude | Unset = UNSET, ) -> ErrorsList | EscalationPolicyPathResponse | None: """Retrieves an escalation path @@ -111,14 +115,14 @@ def sync( Args: id (str): - include (Union[Unset, GetEscalationPathInclude]): + include (GetEscalationPathInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyPathResponse] + ErrorsList | EscalationPolicyPathResponse """ return sync_detailed( @@ -132,7 +136,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetEscalationPathInclude = UNSET, + include: GetEscalationPathInclude | Unset = UNSET, ) -> Response[ErrorsList | EscalationPolicyPathResponse]: """Retrieves an escalation path @@ -140,14 +144,14 @@ async def asyncio_detailed( Args: id (str): - include (Union[Unset, GetEscalationPathInclude]): + include (GetEscalationPathInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyPathResponse]] + Response[ErrorsList | EscalationPolicyPathResponse] """ kwargs = _get_kwargs( @@ -164,7 +168,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Unset | GetEscalationPathInclude = UNSET, + include: GetEscalationPathInclude | Unset = UNSET, ) -> ErrorsList | EscalationPolicyPathResponse | None: """Retrieves an escalation path @@ -172,14 +176,14 @@ async def asyncio( Args: id (str): - include (Union[Unset, GetEscalationPathInclude]): + include (GetEscalationPathInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyPathResponse] + 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 117e1031..43a4fcd8 100644 --- a/rootly_sdk/api/escalation_paths/list_escalation_paths.py +++ b/rootly_sdk/api/escalation_paths/list_escalation_paths.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -16,20 +17,21 @@ def _get_kwargs( escalation_policy_id: str, *, - include: Unset | ListEscalationPathsInclude = UNSET, - filterpath_type: Unset | ListEscalationPathsFilterpathType = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListEscalationPathsInclude | Unset = UNSET, + filterpath_type: ListEscalationPathsFilterpathType | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_filterpath_type: Unset | str = UNSET + json_filterpath_type: str | Unset = UNSET if not isinstance(filterpath_type, Unset): json_filterpath_type = filterpath_type @@ -43,7 +45,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/escalation_policies/{escalation_policy_id}/escalation_paths", + "url": "/v1/escalation_policies/{escalation_policy_id}/escalation_paths".format( + escalation_policy_id=quote(str(escalation_policy_id), safe=""), + ), "params": params, } @@ -79,10 +83,10 @@ def sync_detailed( escalation_policy_id: str, *, client: AuthenticatedClient, - include: Unset | ListEscalationPathsInclude = UNSET, - filterpath_type: Unset | ListEscalationPathsFilterpathType = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListEscalationPathsInclude | Unset = UNSET, + filterpath_type: ListEscalationPathsFilterpathType | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[EscalationPolicyPathList]: """List escalation paths @@ -90,10 +94,10 @@ def sync_detailed( Args: escalation_policy_id (str): - include (Union[Unset, ListEscalationPathsInclude]): - filterpath_type (Union[Unset, ListEscalationPathsFilterpathType]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (ListEscalationPathsInclude | Unset): + filterpath_type (ListEscalationPathsFilterpathType | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -122,10 +126,10 @@ def sync( escalation_policy_id: str, *, client: AuthenticatedClient, - include: Unset | ListEscalationPathsInclude = UNSET, - filterpath_type: Unset | ListEscalationPathsFilterpathType = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListEscalationPathsInclude | Unset = UNSET, + filterpath_type: ListEscalationPathsFilterpathType | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> EscalationPolicyPathList | None: """List escalation paths @@ -133,10 +137,10 @@ def sync( Args: escalation_policy_id (str): - include (Union[Unset, ListEscalationPathsInclude]): - filterpath_type (Union[Unset, ListEscalationPathsFilterpathType]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (ListEscalationPathsInclude | Unset): + filterpath_type (ListEscalationPathsFilterpathType | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -160,10 +164,10 @@ async def asyncio_detailed( escalation_policy_id: str, *, client: AuthenticatedClient, - include: Unset | ListEscalationPathsInclude = UNSET, - filterpath_type: Unset | ListEscalationPathsFilterpathType = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListEscalationPathsInclude | Unset = UNSET, + filterpath_type: ListEscalationPathsFilterpathType | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[EscalationPolicyPathList]: """List escalation paths @@ -171,10 +175,10 @@ async def asyncio_detailed( Args: escalation_policy_id (str): - include (Union[Unset, ListEscalationPathsInclude]): - filterpath_type (Union[Unset, ListEscalationPathsFilterpathType]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (ListEscalationPathsInclude | Unset): + filterpath_type (ListEscalationPathsFilterpathType | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -201,10 +205,10 @@ async def asyncio( escalation_policy_id: str, *, client: AuthenticatedClient, - include: Unset | ListEscalationPathsInclude = UNSET, - filterpath_type: Unset | ListEscalationPathsFilterpathType = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListEscalationPathsInclude | Unset = UNSET, + filterpath_type: ListEscalationPathsFilterpathType | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> EscalationPolicyPathList | None: """List escalation paths @@ -212,10 +216,10 @@ async def asyncio( Args: escalation_policy_id (str): - include (Union[Unset, ListEscalationPathsInclude]): - filterpath_type (Union[Unset, ListEscalationPathsFilterpathType]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (ListEscalationPathsInclude | Unset): + filterpath_type (ListEscalationPathsFilterpathType | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 9187d4d9..ccbf345f 100644 --- a/rootly_sdk/api/escalation_paths/update_escalation_path.py +++ b/rootly_sdk/api/escalation_paths/update_escalation_path.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/escalation_paths/{id}", + "url": "/v1/escalation_paths/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyPathResponse]] + Response[ErrorsList | EscalationPolicyPathResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyPathResponse] + ErrorsList | EscalationPolicyPathResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyPathResponse]] + Response[ErrorsList | EscalationPolicyPathResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyPathResponse] + 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 74416a48..714b4503 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[Union[ErrorsList, EscalationPolicyResponse]] + Response[ErrorsList | EscalationPolicyResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyResponse] + 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[Union[ErrorsList, EscalationPolicyResponse]] + Response[ErrorsList | EscalationPolicyResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyResponse] + 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 e07ef4de..2c40b934 100644 --- a/rootly_sdk/api/escalation_policies/delete_escalation_policy.py +++ b/rootly_sdk/api/escalation_policies/delete_escalation_policy.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/escalation_policies/{id}", + "url": "/v1/escalation_policies/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyResponse]] + Response[ErrorsList | EscalationPolicyResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyResponse] + ErrorsList | EscalationPolicyResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyResponse]] + Response[ErrorsList | EscalationPolicyResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyResponse] + 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 c19bfb44..e17a0ca0 100644 --- a/rootly_sdk/api/escalation_policies/get_escalation_policy.py +++ b/rootly_sdk/api/escalation_policies/get_escalation_policy.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -14,11 +15,12 @@ def _get_kwargs( id: str, *, - include: Unset | GetEscalationPolicyInclude = UNSET, + include: GetEscalationPolicyInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/escalation_policies/{id}", + "url": "/v1/escalation_policies/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -69,7 +73,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetEscalationPolicyInclude = UNSET, + include: GetEscalationPolicyInclude | Unset = UNSET, ) -> Response[ErrorsList | EscalationPolicyResponse]: """Retrieves an escalation policy @@ -77,14 +81,14 @@ def sync_detailed( Args: id (str): - include (Union[Unset, GetEscalationPolicyInclude]): + include (GetEscalationPolicyInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyResponse]] + Response[ErrorsList | EscalationPolicyResponse] """ kwargs = _get_kwargs( @@ -103,7 +107,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Unset | GetEscalationPolicyInclude = UNSET, + include: GetEscalationPolicyInclude | Unset = UNSET, ) -> ErrorsList | EscalationPolicyResponse | None: """Retrieves an escalation policy @@ -111,14 +115,14 @@ def sync( Args: id (str): - include (Union[Unset, GetEscalationPolicyInclude]): + include (GetEscalationPolicyInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyResponse] + ErrorsList | EscalationPolicyResponse """ return sync_detailed( @@ -132,7 +136,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetEscalationPolicyInclude = UNSET, + include: GetEscalationPolicyInclude | Unset = UNSET, ) -> Response[ErrorsList | EscalationPolicyResponse]: """Retrieves an escalation policy @@ -140,14 +144,14 @@ async def asyncio_detailed( Args: id (str): - include (Union[Unset, GetEscalationPolicyInclude]): + include (GetEscalationPolicyInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyResponse]] + Response[ErrorsList | EscalationPolicyResponse] """ kwargs = _get_kwargs( @@ -164,7 +168,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Unset | GetEscalationPolicyInclude = UNSET, + include: GetEscalationPolicyInclude | Unset = UNSET, ) -> ErrorsList | EscalationPolicyResponse | None: """Retrieves an escalation policy @@ -172,14 +176,14 @@ async def asyncio( Args: id (str): - include (Union[Unset, GetEscalationPolicyInclude]): + include (GetEscalationPolicyInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyResponse] + 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 6d945707..28e01db1 100644 --- a/rootly_sdk/api/escalation_policies/list_escalation_policies.py +++ b/rootly_sdk/api/escalation_policies/list_escalation_policies.py @@ -14,28 +14,29 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -112,48 +113,48 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[EscalationPolicyList]: """List escalation policies List escalation policies Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -194,48 +195,48 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> EscalationPolicyList | None: """List escalation policies List escalation policies Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -271,48 +272,48 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[EscalationPolicyList]: """List escalation policies List escalation policies Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -351,48 +352,48 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> EscalationPolicyList | None: """List escalation policies List escalation policies Args: - 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]): + 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): 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 11db6e82..d779d41b 100644 --- a/rootly_sdk/api/escalation_policies/update_escalation_policy.py +++ b/rootly_sdk/api/escalation_policies/update_escalation_policy.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/escalation_policies/{id}", + "url": "/v1/escalation_policies/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyResponse]] + Response[ErrorsList | EscalationPolicyResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyResponse] + ErrorsList | EscalationPolicyResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, EscalationPolicyResponse]] + Response[ErrorsList | EscalationPolicyResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, EscalationPolicyResponse] + 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 292bf1c9..f403634b 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/form_fields/{form_field_id}/options", + "url": "/v1/form_fields/{form_field_id}/options".format( + form_field_id=quote(str(form_field_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldOptionResponse]] + Response[ErrorsList | FormFieldOptionResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldOptionResponse] + ErrorsList | FormFieldOptionResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldOptionResponse]] + Response[ErrorsList | FormFieldOptionResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldOptionResponse] + 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 b7ff0f29..7475c4c1 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/form_field_options/{id}", + "url": "/v1/form_field_options/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldOptionResponse]] + Response[ErrorsList | FormFieldOptionResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldOptionResponse] + ErrorsList | FormFieldOptionResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldOptionResponse]] + Response[ErrorsList | FormFieldOptionResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldOptionResponse] + 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 0cf1dfbc..6b07adca 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/form_field_options/{id}", + "url": "/v1/form_field_options/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldOptionResponse]] + Response[ErrorsList | FormFieldOptionResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldOptionResponse] + ErrorsList | FormFieldOptionResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldOptionResponse]] + Response[ErrorsList | FormFieldOptionResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldOptionResponse] + 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 08cd3f56..9acb8d0b 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,12 +13,13 @@ def _get_kwargs( form_field_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filtervalue: Unset | str = UNSET, - filtercolor: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filtervalue: str | Unset = UNSET, + filtercolor: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -34,7 +36,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/form_fields/{form_field_id}/options", + "url": "/v1/form_fields/{form_field_id}/options".format( + form_field_id=quote(str(form_field_id), safe=""), + ), "params": params, } @@ -66,11 +70,11 @@ def sync_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filtervalue: Unset | str = UNSET, - filtercolor: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filtervalue: str | Unset = UNSET, + filtercolor: str | Unset = UNSET, ) -> Response[FormFieldOptionList]: """List FormField Options @@ -78,11 +82,11 @@ def sync_detailed( Args: form_field_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filtervalue (Union[Unset, str]): - filtercolor (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filtervalue (str | Unset): + filtercolor (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -112,11 +116,11 @@ def sync( form_field_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filtervalue: Unset | str = UNSET, - filtercolor: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filtervalue: str | Unset = UNSET, + filtercolor: str | Unset = UNSET, ) -> FormFieldOptionList | None: """List FormField Options @@ -124,11 +128,11 @@ def sync( Args: form_field_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filtervalue (Union[Unset, str]): - filtercolor (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filtervalue (str | Unset): + filtercolor (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -153,11 +157,11 @@ async def asyncio_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filtervalue: Unset | str = UNSET, - filtercolor: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filtervalue: str | Unset = UNSET, + filtercolor: str | Unset = UNSET, ) -> Response[FormFieldOptionList]: """List FormField Options @@ -165,11 +169,11 @@ async def asyncio_detailed( Args: form_field_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filtervalue (Union[Unset, str]): - filtercolor (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filtervalue (str | Unset): + filtercolor (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -197,11 +201,11 @@ async def asyncio( form_field_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filtervalue: Unset | str = UNSET, - filtercolor: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filtervalue: str | Unset = UNSET, + filtercolor: str | Unset = UNSET, ) -> FormFieldOptionList | None: """List FormField Options @@ -209,11 +213,11 @@ async def asyncio( Args: form_field_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filtervalue (Union[Unset, str]): - filtercolor (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filtervalue (str | Unset): + filtercolor (str | Unset): 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 80c84c48..246e39f3 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/form_field_options/{id}", + "url": "/v1/form_field_options/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldOptionResponse]] + Response[ErrorsList | FormFieldOptionResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldOptionResponse] + ErrorsList | FormFieldOptionResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldOptionResponse]] + Response[ErrorsList | FormFieldOptionResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldOptionResponse] + 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 11a876d3..014965e1 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/form_field_placements/{form_field_placement_id}/conditions", + "url": "/v1/form_field_placements/{form_field_placement_id}/conditions".format( + form_field_placement_id=quote(str(form_field_placement_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] + Response[ErrorsList | FormFieldPlacementConditionResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPlacementConditionResponse] + ErrorsList | FormFieldPlacementConditionResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] + Response[ErrorsList | FormFieldPlacementConditionResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPlacementConditionResponse] + 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 39538b58..568253ab 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/form_field_placement_conditions/{id}", + "url": "/v1/form_field_placement_conditions/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] + Response[ErrorsList | FormFieldPlacementConditionResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPlacementConditionResponse] + ErrorsList | FormFieldPlacementConditionResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] + Response[ErrorsList | FormFieldPlacementConditionResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPlacementConditionResponse] + 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 5a711a1c..8d6e2170 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/form_field_placement_conditions/{id}", + "url": "/v1/form_field_placement_conditions/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] + Response[ErrorsList | FormFieldPlacementConditionResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPlacementConditionResponse] + ErrorsList | FormFieldPlacementConditionResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] + Response[ErrorsList | FormFieldPlacementConditionResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPlacementConditionResponse] + 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 b7b9946d..5730bb1d 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,11 +13,12 @@ def _get_kwargs( form_field_placement_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform_field_id: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform_field_id: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -31,7 +33,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/form_field_placements/{form_field_placement_id}/conditions", + "url": "/v1/form_field_placements/{form_field_placement_id}/conditions".format( + form_field_placement_id=quote(str(form_field_placement_id), safe=""), + ), "params": params, } @@ -67,10 +71,10 @@ def sync_detailed( form_field_placement_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform_field_id: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform_field_id: str | Unset = UNSET, ) -> Response[FormFieldPlacementConditionList]: """List Form Set Conditions @@ -78,10 +82,10 @@ def sync_detailed( Args: form_field_placement_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterform_field_id (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterform_field_id (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -110,10 +114,10 @@ def sync( form_field_placement_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform_field_id: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform_field_id: str | Unset = UNSET, ) -> FormFieldPlacementConditionList | None: """List Form Set Conditions @@ -121,10 +125,10 @@ def sync( Args: form_field_placement_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterform_field_id (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterform_field_id (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -148,10 +152,10 @@ async def asyncio_detailed( form_field_placement_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform_field_id: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform_field_id: str | Unset = UNSET, ) -> Response[FormFieldPlacementConditionList]: """List Form Set Conditions @@ -159,10 +163,10 @@ async def asyncio_detailed( Args: form_field_placement_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterform_field_id (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterform_field_id (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -189,10 +193,10 @@ async def asyncio( form_field_placement_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform_field_id: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform_field_id: str | Unset = UNSET, ) -> FormFieldPlacementConditionList | None: """List Form Set Conditions @@ -200,10 +204,10 @@ async def asyncio( Args: form_field_placement_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterform_field_id (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterform_field_id (str | Unset): 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 66a45fc6..a9fe050c 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/form_field_placement_conditions/{id}", + "url": "/v1/form_field_placement_conditions/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] + Response[ErrorsList | FormFieldPlacementConditionResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPlacementConditionResponse] + ErrorsList | FormFieldPlacementConditionResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPlacementConditionResponse]] + Response[ErrorsList | FormFieldPlacementConditionResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPlacementConditionResponse] + 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 6e198d96..247a26a7 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/form_fields/{form_field_id}/placements", + "url": "/v1/form_fields/{form_field_id}/placements".format( + form_field_id=quote(str(form_field_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPlacementResponse]] + Response[ErrorsList | FormFieldPlacementResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPlacementResponse] + ErrorsList | FormFieldPlacementResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPlacementResponse]] + Response[ErrorsList | FormFieldPlacementResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPlacementResponse] + 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 424e34e1..48da09b6 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/form_field_placements/{id}", + "url": "/v1/form_field_placements/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -34,6 +38,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: @@ -68,7 +77,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPlacementResponse]] + Response[ErrorsList | FormFieldPlacementResponse] """ kwargs = _get_kwargs( @@ -99,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPlacementResponse] + ErrorsList | FormFieldPlacementResponse """ return sync_detailed( @@ -125,7 +134,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPlacementResponse]] + Response[ErrorsList | FormFieldPlacementResponse] """ kwargs = _get_kwargs( @@ -154,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPlacementResponse] + 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 18e171f2..0d9e7d4e 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/form_field_placements/{id}", + "url": "/v1/form_field_placements/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPlacementResponse]] + Response[ErrorsList | FormFieldPlacementResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPlacementResponse] + ErrorsList | FormFieldPlacementResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPlacementResponse]] + Response[ErrorsList | FormFieldPlacementResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPlacementResponse] + 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 11bb34cc..cfc35101 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,11 +13,12 @@ def _get_kwargs( form_field_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform_field_id: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform_field_id: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -31,7 +33,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/form_fields/{form_field_id}/placements", + "url": "/v1/form_fields/{form_field_id}/placements".format( + form_field_id=quote(str(form_field_id), safe=""), + ), "params": params, } @@ -65,10 +69,10 @@ def sync_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform_field_id: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform_field_id: str | Unset = UNSET, ) -> Response[FormFieldPlacementList]: """List Form Field Placements @@ -76,10 +80,10 @@ def sync_detailed( Args: form_field_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterform_field_id (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterform_field_id (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,10 +112,10 @@ def sync( form_field_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform_field_id: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform_field_id: str | Unset = UNSET, ) -> FormFieldPlacementList | None: """List Form Field Placements @@ -119,10 +123,10 @@ def sync( Args: form_field_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterform_field_id (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterform_field_id (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -146,10 +150,10 @@ async def asyncio_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform_field_id: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform_field_id: str | Unset = UNSET, ) -> Response[FormFieldPlacementList]: """List Form Field Placements @@ -157,10 +161,10 @@ async def asyncio_detailed( Args: form_field_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterform_field_id (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterform_field_id (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -187,10 +191,10 @@ async def asyncio( form_field_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform_field_id: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform_field_id: str | Unset = UNSET, ) -> FormFieldPlacementList | None: """List Form Field Placements @@ -198,10 +202,10 @@ async def asyncio( Args: form_field_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterform_field_id (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterform_field_id (str | Unset): 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 87ff299a..47e84275 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/form_field_placements/{id}", + "url": "/v1/form_field_placements/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPlacementResponse]] + Response[ErrorsList | FormFieldPlacementResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPlacementResponse] + ErrorsList | FormFieldPlacementResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPlacementResponse]] + Response[ErrorsList | FormFieldPlacementResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPlacementResponse] + 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 b4a5ccb1..baa834ef 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/form_fields/{form_field_id}/positions", + "url": "/v1/form_fields/{form_field_id}/positions".format( + form_field_id=quote(str(form_field_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPositionResponse]] + Response[ErrorsList | FormFieldPositionResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPositionResponse] + ErrorsList | FormFieldPositionResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPositionResponse]] + Response[ErrorsList | FormFieldPositionResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPositionResponse] + 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 c4649baf..e4c0d5a2 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/form_field_positions/{id}", + "url": "/v1/form_field_positions/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPositionResponse]] + Response[ErrorsList | FormFieldPositionResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPositionResponse] + ErrorsList | FormFieldPositionResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPositionResponse]] + Response[ErrorsList | FormFieldPositionResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPositionResponse] + 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 c99f14ad..999abfae 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/form_field_positions/{id}", + "url": "/v1/form_field_positions/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPositionResponse]] + Response[ErrorsList | FormFieldPositionResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPositionResponse] + ErrorsList | FormFieldPositionResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPositionResponse]] + Response[ErrorsList | FormFieldPositionResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPositionResponse] + 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 d29efabe..cb81b62a 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,11 +13,12 @@ def _get_kwargs( form_field_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -31,7 +33,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/form_fields/{form_field_id}/positions", + "url": "/v1/form_fields/{form_field_id}/positions".format( + form_field_id=quote(str(form_field_id), safe=""), + ), "params": params, } @@ -65,10 +69,10 @@ def sync_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform: str | Unset = UNSET, ) -> Response[FormFieldPositionList]: """List FormField Position @@ -76,10 +80,10 @@ def sync_detailed( Args: form_field_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterform (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterform (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,10 +112,10 @@ def sync( form_field_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform: str | Unset = UNSET, ) -> FormFieldPositionList | None: """List FormField Position @@ -119,10 +123,10 @@ def sync( Args: form_field_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterform (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterform (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -146,10 +150,10 @@ async def asyncio_detailed( form_field_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform: str | Unset = UNSET, ) -> Response[FormFieldPositionList]: """List FormField Position @@ -157,10 +161,10 @@ async def asyncio_detailed( Args: form_field_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterform (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterform (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -187,10 +191,10 @@ async def asyncio( form_field_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform: str | Unset = UNSET, ) -> FormFieldPositionList | None: """List FormField Position @@ -198,10 +202,10 @@ async def asyncio( Args: form_field_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterform (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterform (str | Unset): 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 8a906621..71c94ee0 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/form_field_positions/{id}", + "url": "/v1/form_field_positions/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPositionResponse]] + Response[ErrorsList | FormFieldPositionResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPositionResponse] + ErrorsList | FormFieldPositionResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldPositionResponse]] + Response[ErrorsList | FormFieldPositionResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldPositionResponse] + 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 22ff4b11..c2069472 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[Union[ErrorsList, FormFieldResponse]] + Response[ErrorsList | FormFieldResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldResponse] + 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[Union[ErrorsList, FormFieldResponse]] + Response[ErrorsList | FormFieldResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldResponse] + 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 7fd167da..40362583 100644 --- a/rootly_sdk/api/form_fields/delete_form_field.py +++ b/rootly_sdk/api/form_fields/delete_form_field.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/form_fields/{id}", + "url": "/v1/form_fields/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FormFieldResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific form_field by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, FormFieldResponse]] + Response[ErrorsList | FormFieldResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | FormFieldResponse | None: @@ -93,14 +97,14 @@ def sync( Delete a specific form_field by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, FormFieldResponse] + ErrorsList | FormFieldResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FormFieldResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific form_field by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, FormFieldResponse]] + Response[ErrorsList | FormFieldResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | FormFieldResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific form_field by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, FormFieldResponse] + 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 f491ac34..b6fcd5f0 100644 --- a/rootly_sdk/api/form_fields/get_form_field.py +++ b/rootly_sdk/api/form_fields/get_form_field.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,13 +14,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, - include: Unset | GetFormFieldInclude = UNSET, + include: GetFormFieldInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -29,7 +31,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/form_fields/{id}", + "url": "/v1/form_fields/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -67,25 +71,25 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetFormFieldInclude = UNSET, + include: GetFormFieldInclude | Unset = UNSET, ) -> Response[ErrorsList | FormFieldResponse]: """Retrieves a Form Field Retrieves a specific form_field by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetFormFieldInclude]): + id (str | UUID): + include (GetFormFieldInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldResponse]] + Response[ErrorsList | FormFieldResponse] """ kwargs = _get_kwargs( @@ -101,25 +105,25 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetFormFieldInclude = UNSET, + include: GetFormFieldInclude | Unset = UNSET, ) -> ErrorsList | FormFieldResponse | None: """Retrieves a Form Field Retrieves a specific form_field by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetFormFieldInclude]): + id (str | UUID): + include (GetFormFieldInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldResponse] + ErrorsList | FormFieldResponse """ return sync_detailed( @@ -130,25 +134,25 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetFormFieldInclude = UNSET, + include: GetFormFieldInclude | Unset = UNSET, ) -> Response[ErrorsList | FormFieldResponse]: """Retrieves a Form Field Retrieves a specific form_field by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetFormFieldInclude]): + id (str | UUID): + include (GetFormFieldInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldResponse]] + Response[ErrorsList | FormFieldResponse] """ kwargs = _get_kwargs( @@ -162,25 +166,25 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetFormFieldInclude = UNSET, + include: GetFormFieldInclude | Unset = UNSET, ) -> ErrorsList | FormFieldResponse | None: """Retrieves a Form Field Retrieves a specific form_field by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetFormFieldInclude]): + id (str | UUID): + include (GetFormFieldInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldResponse] + 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 f41e79aa..737edc91 100644 --- a/rootly_sdk/api/form_fields/list_form_fields.py +++ b/rootly_sdk/api/form_fields/list_form_fields.py @@ -12,38 +12,39 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -138,68 +139,68 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[FormFieldList]: """List Form Fields List form_fields Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -250,68 +251,68 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> FormFieldList | None: """List Form Fields List form_fields Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -357,68 +358,68 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[FormFieldList]: """List Form Fields List form_fields Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -467,68 +468,68 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> FormFieldList | None: """List Form Fields List form_fields Args: - 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]): + 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): 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 ea2f4249..2aa102db 100644 --- a/rootly_sdk/api/form_fields/update_form_field.py +++ b/rootly_sdk/api/form_fields/update_form_field.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateFormField, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/form_fields/{id}", + "url": "/v1/form_fields/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateFormField, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific form_field by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateFormField): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldResponse]] + Response[ErrorsList | FormFieldResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateFormField, @@ -107,7 +110,7 @@ def sync( Update a specific form_field by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateFormField): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldResponse] + ErrorsList | FormFieldResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateFormField, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific form_field by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateFormField): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormFieldResponse]] + Response[ErrorsList | FormFieldResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateFormField, @@ -168,7 +171,7 @@ async def asyncio( Update a specific form_field by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateFormField): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormFieldResponse] + 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 6a3f278c..09e9bfec 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/form_sets/{form_set_id}/conditions", + "url": "/v1/form_sets/{form_set_id}/conditions".format( + form_set_id=quote(str(form_set_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormSetConditionResponse]] + Response[ErrorsList | FormSetConditionResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormSetConditionResponse] + ErrorsList | FormSetConditionResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormSetConditionResponse]] + Response[ErrorsList | FormSetConditionResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormSetConditionResponse] + 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 9fe830e3..ba34efc2 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/form_set_conditions/{id}", + "url": "/v1/form_set_conditions/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormSetConditionResponse]] + Response[ErrorsList | FormSetConditionResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormSetConditionResponse] + ErrorsList | FormSetConditionResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormSetConditionResponse]] + Response[ErrorsList | FormSetConditionResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormSetConditionResponse] + 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 08b6d6aa..e84846b0 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/form_set_conditions/{id}", + "url": "/v1/form_set_conditions/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormSetConditionResponse]] + Response[ErrorsList | FormSetConditionResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormSetConditionResponse] + ErrorsList | FormSetConditionResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormSetConditionResponse]] + Response[ErrorsList | FormSetConditionResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormSetConditionResponse] + 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 8d9548f1..c12eaca5 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,11 +13,12 @@ def _get_kwargs( form_set_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform_field_id: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform_field_id: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -31,7 +33,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/form_sets/{form_set_id}/conditions", + "url": "/v1/form_sets/{form_set_id}/conditions".format( + form_set_id=quote(str(form_set_id), safe=""), + ), "params": params, } @@ -65,10 +69,10 @@ def sync_detailed( form_set_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform_field_id: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform_field_id: str | Unset = UNSET, ) -> Response[FormSetConditionList]: """List Form Set Conditions @@ -76,10 +80,10 @@ def sync_detailed( Args: form_set_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterform_field_id (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterform_field_id (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,10 +112,10 @@ def sync( form_set_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform_field_id: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform_field_id: str | Unset = UNSET, ) -> FormSetConditionList | None: """List Form Set Conditions @@ -119,10 +123,10 @@ def sync( Args: form_set_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterform_field_id (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterform_field_id (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -146,10 +150,10 @@ async def asyncio_detailed( form_set_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform_field_id: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform_field_id: str | Unset = UNSET, ) -> Response[FormSetConditionList]: """List Form Set Conditions @@ -157,10 +161,10 @@ async def asyncio_detailed( Args: form_set_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterform_field_id (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterform_field_id (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -187,10 +191,10 @@ async def asyncio( form_set_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterform_field_id: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterform_field_id: str | Unset = UNSET, ) -> FormSetConditionList | None: """List Form Set Conditions @@ -198,10 +202,10 @@ async def asyncio( Args: form_set_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterform_field_id (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterform_field_id (str | Unset): 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 f0a6a415..e1ad30f4 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/form_set_conditions/{id}", + "url": "/v1/form_set_conditions/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormSetConditionResponse]] + Response[ErrorsList | FormSetConditionResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormSetConditionResponse] + ErrorsList | FormSetConditionResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormSetConditionResponse]] + Response[ErrorsList | FormSetConditionResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormSetConditionResponse] + 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 23414b97..b1132cef 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[Union[ErrorsList, FormSetResponse]] + Response[ErrorsList | FormSetResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormSetResponse] + 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[Union[ErrorsList, FormSetResponse]] + Response[ErrorsList | FormSetResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormSetResponse] + 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 9fe2a6fc..8f5e77e5 100644 --- a/rootly_sdk/api/form_sets/delete_form_set.py +++ b/rootly_sdk/api/form_sets/delete_form_set.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/form_sets/{id}", + "url": "/v1/form_sets/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FormSetResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific form_set by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, FormSetResponse]] + Response[ErrorsList | FormSetResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | FormSetResponse | None: @@ -93,14 +97,14 @@ def sync( Delete a specific form_set by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, FormSetResponse] + ErrorsList | FormSetResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FormSetResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific form_set by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, FormSetResponse]] + Response[ErrorsList | FormSetResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | FormSetResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific form_set by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, FormSetResponse] + 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 c1f524ab..6028ddb4 100644 --- a/rootly_sdk/api/form_sets/get_form_set.py +++ b/rootly_sdk/api/form_sets/get_form_set.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/form_sets/{id}", + "url": "/v1/form_sets/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FormSetResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific form_set by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, FormSetResponse]] + Response[ErrorsList | FormSetResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | FormSetResponse | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific form_set by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, FormSetResponse] + ErrorsList | FormSetResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FormSetResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific form_set by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, FormSetResponse]] + Response[ErrorsList | FormSetResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | FormSetResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific form_set by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, FormSetResponse] + 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 03441b76..794d9d24 100644 --- a/rootly_sdk/api/form_sets/list_form_sets.py +++ b/rootly_sdk/api/form_sets/list_form_sets.py @@ -11,16 +11,17 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -76,30 +77,30 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[FormSetList]: """List Form Sets List form_sets Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -131,30 +132,30 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> FormSetList | None: """List Form Sets List form_sets Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,30 +182,30 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[FormSetList]: """List Form Sets List form_sets Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -234,30 +235,30 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> FormSetList | None: """List Form Sets List form_sets Args: - 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]): + 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): 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 bb60765d..1fd4b788 100644 --- a/rootly_sdk/api/form_sets/update_form_set.py +++ b/rootly_sdk/api/form_sets/update_form_set.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateFormSet, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/form_sets/{id}", + "url": "/v1/form_sets/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateFormSet, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific form_set by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateFormSet): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormSetResponse]] + Response[ErrorsList | FormSetResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateFormSet, @@ -107,7 +110,7 @@ def sync( Update a specific form_set by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateFormSet): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormSetResponse] + ErrorsList | FormSetResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateFormSet, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific form_set by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateFormSet): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FormSetResponse]] + Response[ErrorsList | FormSetResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateFormSet, @@ -168,7 +171,7 @@ async def asyncio( Update a specific form_set by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateFormSet): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FormSetResponse] + ErrorsList | FormSetResponse """ return ( diff --git a/rootly_sdk/api/functionalities/bulk_delete_functionalities.py b/rootly_sdk/api/functionalities/bulk_delete_functionalities.py index 19ab8b52..9889d1b6 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, Union +from typing import Any import httpx @@ -14,7 +14,7 @@ def _get_kwargs( *, - body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], + body: BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -23,7 +23,6 @@ def _get_kwargs( "url": "/v1/functionalities/bulk_delete", } - _kwargs["json"]: dict[str, Any] if isinstance(body, BulkDestroyFunctionalitiesType0): _kwargs["json"] = body.to_dict() else: @@ -37,7 +36,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkDestroyFunctionalitiesResponse | ErrorsList | Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"] | None: +) -> BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList | None: if response.status_code == 200: response_200 = BulkDestroyFunctionalitiesResponse.from_dict(response.json()) @@ -50,14 +49,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"]: + def _parse_response_422(data: object) -> BulkDestroyFunctionalitiesResponse | ErrorsList: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -77,9 +76,7 @@ def _parse_response_422(data: object) -> Union["BulkDestroyFunctionalitiesRespon def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[ - BulkDestroyFunctionalitiesResponse | ErrorsList | Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"] -]: +) -> Response[BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -91,26 +88,24 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], -) -> Response[ - BulkDestroyFunctionalitiesResponse | ErrorsList | Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"] -]: + body: BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1, +) -> Response[BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList]: """Bulk delete Functionalities Delete functionalities by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - 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). + 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). Raises: errors.UnexpectedStatus: If the server returns 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[BulkDestroyFunctionalitiesResponse, ErrorsList, Union['BulkDestroyFunctionalitiesResponse', 'ErrorsList']]] + Response[BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList] """ kwargs = _get_kwargs( @@ -127,24 +122,24 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], -) -> BulkDestroyFunctionalitiesResponse | ErrorsList | Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"] | None: + body: BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1, +) -> BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList | None: """Bulk delete Functionalities Delete functionalities by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - 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). + 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). Raises: errors.UnexpectedStatus: If the server 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[BulkDestroyFunctionalitiesResponse, ErrorsList, Union['BulkDestroyFunctionalitiesResponse', 'ErrorsList']] + BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList """ return sync_detailed( @@ -156,26 +151,24 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], -) -> Response[ - BulkDestroyFunctionalitiesResponse | ErrorsList | Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"] -]: + body: BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1, +) -> Response[BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList]: """Bulk delete Functionalities Delete functionalities by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - 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). + 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). Raises: errors.UnexpectedStatus: If the server returns 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[BulkDestroyFunctionalitiesResponse, ErrorsList, Union['BulkDestroyFunctionalitiesResponse', 'ErrorsList']]] + Response[BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList] """ kwargs = _get_kwargs( @@ -190,24 +183,24 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: Union["BulkDestroyFunctionalitiesType0", "BulkDestroyFunctionalitiesType1"], -) -> BulkDestroyFunctionalitiesResponse | ErrorsList | Union["BulkDestroyFunctionalitiesResponse", "ErrorsList"] | None: + body: BulkDestroyFunctionalitiesType0 | BulkDestroyFunctionalitiesType1, +) -> BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList | None: """Bulk delete Functionalities Delete functionalities by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - 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). + 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). Raises: errors.UnexpectedStatus: If the server 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[BulkDestroyFunctionalitiesResponse, ErrorsList, Union['BulkDestroyFunctionalitiesResponse', 'ErrorsList']] + BulkDestroyFunctionalitiesResponse | BulkDestroyFunctionalitiesResponse | ErrorsList | ErrorsList """ return ( diff --git a/rootly_sdk/api/functionalities/bulk_upsert_functionalities.py b/rootly_sdk/api/functionalities/bulk_upsert_functionalities.py index d194bfb1..f2e88ac0 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, Union +from typing import Any import httpx @@ -33,7 +33,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkUpsertFunctionalitiesResponse | ErrorsList | Union["BulkUpsertFunctionalitiesError", "ErrorsList"] | None: +) -> BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | 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) -> Union["BulkUpsertFunctionalitiesError", "ErrorsList"]: + def _parse_response_422(data: object) -> BulkUpsertFunctionalitiesError | ErrorsList: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -73,7 +73,7 @@ def _parse_response_422(data: object) -> Union["BulkUpsertFunctionalitiesError", def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkUpsertFunctionalitiesResponse | ErrorsList | Union["BulkUpsertFunctionalitiesError", "ErrorsList"]]: +) -> Response[BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +86,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertFunctionalities, -) -> Response[BulkUpsertFunctionalitiesResponse | ErrorsList | Union["BulkUpsertFunctionalitiesError", "ErrorsList"]]: +) -> Response[BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | 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[Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union['BulkUpsertFunctionalitiesError', 'ErrorsList']]] + Response[BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -121,7 +121,7 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertFunctionalities, -) -> BulkUpsertFunctionalitiesResponse | ErrorsList | Union["BulkUpsertFunctionalitiesError", "ErrorsList"] | None: +) -> BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | 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: - Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union['BulkUpsertFunctionalitiesError', 'ErrorsList']] + BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList """ return sync_detailed( @@ -151,7 +151,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertFunctionalities, -) -> Response[BulkUpsertFunctionalitiesResponse | ErrorsList | Union["BulkUpsertFunctionalitiesError", "ErrorsList"]]: +) -> Response[BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | 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[Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union['BulkUpsertFunctionalitiesError', 'ErrorsList']]] + Response[BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -184,7 +184,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertFunctionalities, -) -> BulkUpsertFunctionalitiesResponse | ErrorsList | Union["BulkUpsertFunctionalitiesError", "ErrorsList"] | None: +) -> BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | 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: - Union[BulkUpsertFunctionalitiesResponse, ErrorsList, Union['BulkUpsertFunctionalitiesError', 'ErrorsList']] + BulkUpsertFunctionalitiesError | ErrorsList | BulkUpsertFunctionalitiesResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/functionalities/create_functionality.py b/rootly_sdk/api/functionalities/create_functionality.py index 182d32f4..1f7ef099 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[Union[ErrorsList, FunctionalityResponse]] + Response[ErrorsList | FunctionalityResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FunctionalityResponse] + 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[Union[ErrorsList, FunctionalityResponse]] + Response[ErrorsList | FunctionalityResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FunctionalityResponse] + 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 1d2108e9..ffaecab2 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[Union[CatalogPropertyResponse, ErrorsList]] + Response[CatalogPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogPropertyResponse, ErrorsList] + 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[Union[CatalogPropertyResponse, ErrorsList]] + Response[CatalogPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogPropertyResponse, ErrorsList] + CatalogPropertyResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/functionalities/delete_functionality.py b/rootly_sdk/api/functionalities/delete_functionality.py index 8859e976..fe3cb866 100644 --- a/rootly_sdk/api/functionalities/delete_functionality.py +++ b/rootly_sdk/api/functionalities/delete_functionality.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/functionalities/{id}", + "url": "/v1/functionalities/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FunctionalityResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific functionality by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, FunctionalityResponse]] + Response[ErrorsList | FunctionalityResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | FunctionalityResponse | None: @@ -93,14 +97,14 @@ def sync( Delete a specific functionality by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, FunctionalityResponse] + ErrorsList | FunctionalityResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FunctionalityResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific functionality by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, FunctionalityResponse]] + Response[ErrorsList | FunctionalityResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | FunctionalityResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific functionality by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, FunctionalityResponse] + ErrorsList | FunctionalityResponse """ return ( diff --git a/rootly_sdk/api/functionalities/get_functionality.py b/rootly_sdk/api/functionalities/get_functionality.py index 18143e81..746c5e60 100644 --- a/rootly_sdk/api/functionalities/get_functionality.py +++ b/rootly_sdk/api/functionalities/get_functionality.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/functionalities/{id}", + "url": "/v1/functionalities/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FunctionalityResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific functionality by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, FunctionalityResponse]] + Response[ErrorsList | FunctionalityResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | FunctionalityResponse | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific functionality by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, FunctionalityResponse] + ErrorsList | FunctionalityResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | FunctionalityResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific functionality by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, FunctionalityResponse]] + Response[ErrorsList | FunctionalityResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | FunctionalityResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific functionality by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, FunctionalityResponse] + 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 26df4c9a..0ebccfaf 100644 --- a/rootly_sdk/api/functionalities/get_functionality_incidents_chart.py +++ b/rootly_sdk/api/functionalities/get_functionality_incidents_chart.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,10 +13,11 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, period: str, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["period"] = period @@ -24,7 +26,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/functionalities/{id}/incidents_chart", + "url": "/v1/functionalities/{id}/incidents_chart".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -62,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, period: str, @@ -72,7 +76,7 @@ def sync_detailed( Get functionality incidents chart Args: - id (Union[UUID, str]): + id (str | UUID): period (str): Raises: @@ -80,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentsChartResponse]] + Response[ErrorsList | IncidentsChartResponse] """ kwargs = _get_kwargs( @@ -96,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, period: str, @@ -106,7 +110,7 @@ def sync( Get functionality incidents chart Args: - id (Union[UUID, str]): + id (str | UUID): period (str): Raises: @@ -114,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentsChartResponse] + ErrorsList | IncidentsChartResponse """ return sync_detailed( @@ -125,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, period: str, @@ -135,7 +139,7 @@ async def asyncio_detailed( Get functionality incidents chart Args: - id (Union[UUID, str]): + id (str | UUID): period (str): Raises: @@ -143,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentsChartResponse]] + Response[ErrorsList | IncidentsChartResponse] """ kwargs = _get_kwargs( @@ -157,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, period: str, @@ -167,7 +171,7 @@ async def asyncio( Get functionality incidents chart Args: - id (Union[UUID, str]): + id (str | UUID): period (str): Raises: @@ -175,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentsChartResponse] + 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 3ed7b9fd..6fa744af 100644 --- a/rootly_sdk/api/functionalities/get_functionality_uptime_chart.py +++ b/rootly_sdk/api/functionalities/get_functionality_uptime_chart.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,10 +13,11 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, - period: Unset | str = UNSET, + period: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["period"] = period @@ -24,7 +26,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/functionalities/{id}/uptime_chart", + "url": "/v1/functionalities/{id}/uptime_chart".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -62,25 +66,25 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - period: Unset | str = UNSET, + period: str | Unset = UNSET, ) -> Response[ErrorsList | UptimeChartResponse]: """Get functionality uptime chart Get functionality uptime chart Args: - id (Union[UUID, str]): - period (Union[Unset, str]): + id (str | UUID): + period (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UptimeChartResponse]] + Response[ErrorsList | UptimeChartResponse] """ kwargs = _get_kwargs( @@ -96,25 +100,25 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - period: Unset | str = UNSET, + period: str | Unset = UNSET, ) -> ErrorsList | UptimeChartResponse | None: """Get functionality uptime chart Get functionality uptime chart Args: - id (Union[UUID, str]): - period (Union[Unset, str]): + id (str | UUID): + period (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UptimeChartResponse] + ErrorsList | UptimeChartResponse """ return sync_detailed( @@ -125,25 +129,25 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - period: Unset | str = UNSET, + period: str | Unset = UNSET, ) -> Response[ErrorsList | UptimeChartResponse]: """Get functionality uptime chart Get functionality uptime chart Args: - id (Union[UUID, str]): - period (Union[Unset, str]): + id (str | UUID): + period (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UptimeChartResponse]] + Response[ErrorsList | UptimeChartResponse] """ kwargs = _get_kwargs( @@ -157,25 +161,25 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - period: Unset | str = UNSET, + period: str | Unset = UNSET, ) -> ErrorsList | UptimeChartResponse | None: """Get functionality uptime chart Get functionality uptime chart Args: - id (Union[UUID, str]): - period (Union[Unset, str]): + id (str | UUID): + period (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UptimeChartResponse] + ErrorsList | UptimeChartResponse """ return ( diff --git a/rootly_sdk/api/functionalities/list_functionalities.py b/rootly_sdk/api/functionalities/list_functionalities.py index d0dc2cbf..d00ffd21 100644 --- a/rootly_sdk/api/functionalities/list_functionalities.py +++ b/rootly_sdk/api/functionalities/list_functionalities.py @@ -11,30 +11,31 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -118,58 +119,58 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[FunctionalityList]: """List functionalities List functionalities Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -215,58 +216,58 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> FunctionalityList | None: """List functionalities List functionalities Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -307,58 +308,58 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[FunctionalityList]: """List functionalities List functionalities Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -402,58 +403,58 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> FunctionalityList | None: """List functionalities List functionalities Args: - 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]): + 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): 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 e5661399..80b13adb 100644 --- a/rootly_sdk/api/functionalities/list_functionality_catalog_properties.py +++ b/rootly_sdk/api/functionalities/list_functionality_catalog_properties.py @@ -17,27 +17,28 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Unset | str = UNSET + json_sort: str | Unset = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -96,34 +97,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Functionality Catalog Properties Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -157,34 +158,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogPropertyList | None: """List Catalog Properties List Functionality Catalog Properties Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -213,34 +214,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Functionality Catalog Properties Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -272,34 +273,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogPropertyList | None: """List Catalog Properties List Functionality Catalog Properties Args: - 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]): + 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): 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 9806eae2..5098e9df 100644 --- a/rootly_sdk/api/functionalities/update_functionality.py +++ b/rootly_sdk/api/functionalities/update_functionality.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateFunctionality, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/functionalities/{id}", + "url": "/v1/functionalities/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateFunctionality, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific functionality by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateFunctionality): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FunctionalityResponse]] + Response[ErrorsList | FunctionalityResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateFunctionality, @@ -107,7 +110,7 @@ def sync( Update a specific functionality by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateFunctionality): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FunctionalityResponse] + ErrorsList | FunctionalityResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateFunctionality, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific functionality by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateFunctionality): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, FunctionalityResponse]] + Response[ErrorsList | FunctionalityResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateFunctionality, @@ -168,7 +171,7 @@ async def asyncio( Update a specific functionality by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateFunctionality): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, FunctionalityResponse] + ErrorsList | FunctionalityResponse """ return ( diff --git a/rootly_sdk/api/heartbeats/create_heartbeat.py b/rootly_sdk/api/heartbeats/create_heartbeat.py index 04e60cb0..c03eed95 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[Union[ErrorsList, HeartbeatResponse]] + Response[ErrorsList | HeartbeatResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, HeartbeatResponse] + 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[Union[ErrorsList, HeartbeatResponse]] + Response[ErrorsList | HeartbeatResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, HeartbeatResponse] + ErrorsList | HeartbeatResponse """ return ( diff --git a/rootly_sdk/api/heartbeats/delete_heartbeat.py b/rootly_sdk/api/heartbeats/delete_heartbeat.py index 2e74ade2..674106f9 100644 --- a/rootly_sdk/api/heartbeats/delete_heartbeat.py +++ b/rootly_sdk/api/heartbeats/delete_heartbeat.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/heartbeats/{id}", + "url": "/v1/heartbeats/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | HeartbeatResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific heartbeat by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, HeartbeatResponse]] + Response[ErrorsList | HeartbeatResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | HeartbeatResponse | None: @@ -93,14 +97,14 @@ def sync( Delete a specific heartbeat by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, HeartbeatResponse] + ErrorsList | HeartbeatResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | HeartbeatResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific heartbeat by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, HeartbeatResponse]] + Response[ErrorsList | HeartbeatResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | HeartbeatResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific heartbeat by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, HeartbeatResponse] + ErrorsList | HeartbeatResponse """ return ( diff --git a/rootly_sdk/api/heartbeats/get_heartbeat.py b/rootly_sdk/api/heartbeats/get_heartbeat.py index a18d703d..8ab9ac45 100644 --- a/rootly_sdk/api/heartbeats/get_heartbeat.py +++ b/rootly_sdk/api/heartbeats/get_heartbeat.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/heartbeats/{id}", + "url": "/v1/heartbeats/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | HeartbeatResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific heartbeat by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, HeartbeatResponse]] + Response[ErrorsList | HeartbeatResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | HeartbeatResponse | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific heartbeat by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, HeartbeatResponse] + ErrorsList | HeartbeatResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | HeartbeatResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific heartbeat by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, HeartbeatResponse]] + Response[ErrorsList | HeartbeatResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | HeartbeatResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific heartbeat by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, HeartbeatResponse] + ErrorsList | HeartbeatResponse """ return ( diff --git a/rootly_sdk/api/heartbeats/list_heartbeats.py b/rootly_sdk/api/heartbeats/list_heartbeats.py index 585c0f32..19af7d67 100644 --- a/rootly_sdk/api/heartbeats/list_heartbeats.py +++ b/rootly_sdk/api/heartbeats/list_heartbeats.py @@ -11,17 +11,18 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -79,32 +80,32 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[HeartbeatList]: """List heartbeats List heartbeats Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -137,32 +138,32 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> HeartbeatList | None: """List heartbeats List heartbeats Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -190,32 +191,32 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[HeartbeatList]: """List heartbeats List heartbeats Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -246,32 +247,32 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> HeartbeatList | None: """List heartbeats List heartbeats Args: - 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]): + 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): 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 557cc949..786ca9cc 100644 --- a/rootly_sdk/api/heartbeats/ping_heartbeat.py +++ b/rootly_sdk/api/heartbeats/ping_heartbeat.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( heartbeat_id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/heartbeats/{heartbeat_id}/ping", + "url": "/v1/heartbeats/{heartbeat_id}/ping".format( + heartbeat_id=quote(str(heartbeat_id), safe=""), + ), } return _kwargs @@ -62,7 +66,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ErrorsList]] + Response[Any | ErrorsList] """ kwargs = _get_kwargs( @@ -93,7 +97,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ErrorsList] + Any | ErrorsList """ return sync_detailed( @@ -119,7 +123,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ErrorsList]] + Response[Any | ErrorsList] """ kwargs = _get_kwargs( @@ -148,7 +152,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ErrorsList] + Any | ErrorsList """ return ( diff --git a/rootly_sdk/api/heartbeats/update_heartbeat.py b/rootly_sdk/api/heartbeats/update_heartbeat.py index 76cd6f90..533b0dfb 100644 --- a/rootly_sdk/api/heartbeats/update_heartbeat.py +++ b/rootly_sdk/api/heartbeats/update_heartbeat.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateHeartbeat, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/heartbeats/{id}", + "url": "/v1/heartbeats/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -68,7 +71,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateHeartbeat, @@ -78,7 +81,7 @@ def sync_detailed( Update a specific heartbeat by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateHeartbeat): Raises: @@ -86,7 +89,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, HeartbeatResponse]] + Response[ErrorsList | HeartbeatResponse] """ kwargs = _get_kwargs( @@ -102,7 +105,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateHeartbeat, @@ -112,7 +115,7 @@ def sync( Update a specific heartbeat by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateHeartbeat): Raises: @@ -120,7 +123,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, HeartbeatResponse] + ErrorsList | HeartbeatResponse """ return sync_detailed( @@ -131,7 +134,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateHeartbeat, @@ -141,7 +144,7 @@ async def asyncio_detailed( Update a specific heartbeat by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateHeartbeat): Raises: @@ -149,7 +152,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, HeartbeatResponse]] + Response[ErrorsList | HeartbeatResponse] """ kwargs = _get_kwargs( @@ -163,7 +166,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateHeartbeat, @@ -173,7 +176,7 @@ async def asyncio( Update a specific heartbeat by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateHeartbeat): Raises: @@ -181,7 +184,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, HeartbeatResponse] + 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 a8e52752..8eefa46c 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/incidents/{incident_id}/action_items", + "url": "/v1/incidents/{incident_id}/action_items".format( + incident_id=quote(str(incident_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentActionItemResponse]] + Response[ErrorsList | IncidentActionItemResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentActionItemResponse] + ErrorsList | IncidentActionItemResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentActionItemResponse]] + Response[ErrorsList | IncidentActionItemResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentActionItemResponse] + 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 2ed1c40a..3c58343a 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/action_items/{id}", + "url": "/v1/action_items/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentActionItemResponse]] + Response[ErrorsList | IncidentActionItemResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentActionItemResponse] + ErrorsList | IncidentActionItemResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentActionItemResponse]] + Response[ErrorsList | IncidentActionItemResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentActionItemResponse] + 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 6dd4bc1c..978d0899 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/action_items/{id}", + "url": "/v1/action_items/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentActionItemResponse]] + Response[ErrorsList | IncidentActionItemResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentActionItemResponse] + ErrorsList | IncidentActionItemResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentActionItemResponse]] + Response[ErrorsList | IncidentActionItemResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentActionItemResponse] + 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 0b566a8d..9fdcf45a 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,43 +11,44 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -159,84 +160,84 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[IncidentActionItemList]: """List all action items for an organization List all action items for an organization Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -295,84 +296,84 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> IncidentActionItemList | None: """List all action items for an organization List all action items for an organization Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -426,84 +427,84 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[IncidentActionItemList]: """List all action items for an organization List all action items for an organization Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -560,84 +561,84 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> IncidentActionItemList | None: """List all action items for an organization List all action items for an organization Args: - 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]): + 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): 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 9ea3c16e..da0cf81e 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( incident_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incidents/{incident_id}/action_items", + "url": "/v1/incidents/{incident_id}/action_items".format( + incident_id=quote(str(incident_id), safe=""), + ), "params": params, } @@ -62,9 +66,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[IncidentActionItemList]: """List incident action items @@ -72,9 +76,9 @@ def sync_detailed( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -102,9 +106,9 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> IncidentActionItemList | None: """List incident action items @@ -112,9 +116,9 @@ def sync( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -137,9 +141,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[IncidentActionItemList]: """List incident action items @@ -147,9 +151,9 @@ async def asyncio_detailed( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -175,9 +179,9 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> IncidentActionItemList | None: """List incident action items @@ -185,9 +189,9 @@ async def asyncio( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 9c0b7bbf..709c5962 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/action_items/{id}", + "url": "/v1/action_items/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentActionItemResponse]] + Response[ErrorsList | IncidentActionItemResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentActionItemResponse] + ErrorsList | IncidentActionItemResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentActionItemResponse]] + Response[ErrorsList | IncidentActionItemResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentActionItemResponse] + 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 736aae39..44067ca5 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/events/{incident_event_id}/functionalities", + "url": "/v1/events/{incident_event_id}/functionalities".format( + incident_event_id=quote(str(incident_event_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] + Response[ErrorsList | IncidentEventFunctionalityResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventFunctionalityResponse] + ErrorsList | IncidentEventFunctionalityResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] + Response[ErrorsList | IncidentEventFunctionalityResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventFunctionalityResponse] + 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 fa9b8b75..31be22c6 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/incident_event_functionalities/{id}", + "url": "/v1/incident_event_functionalities/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] + Response[ErrorsList | IncidentEventFunctionalityResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventFunctionalityResponse] + ErrorsList | IncidentEventFunctionalityResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] + Response[ErrorsList | IncidentEventFunctionalityResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventFunctionalityResponse] + 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 bcbd76ae..5b698657 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incident_event_functionalities/{id}", + "url": "/v1/incident_event_functionalities/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] + Response[ErrorsList | IncidentEventFunctionalityResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventFunctionalityResponse] + ErrorsList | IncidentEventFunctionalityResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] + Response[ErrorsList | IncidentEventFunctionalityResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventFunctionalityResponse] + 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 3676b424..805eeb7a 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( incident_event_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/events/{incident_event_id}/functionalities", + "url": "/v1/events/{incident_event_id}/functionalities".format( + incident_event_id=quote(str(incident_event_id), safe=""), + ), "params": params, } @@ -64,9 +68,9 @@ def sync_detailed( incident_event_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[IncidentEventFunctionalityList]: """List incident event functionalities @@ -74,9 +78,9 @@ def sync_detailed( Args: incident_event_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +108,9 @@ def sync( incident_event_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> IncidentEventFunctionalityList | None: """List incident event functionalities @@ -114,9 +118,9 @@ def sync( Args: incident_event_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +143,9 @@ async def asyncio_detailed( incident_event_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[IncidentEventFunctionalityList]: """List incident event functionalities @@ -149,9 +153,9 @@ async def asyncio_detailed( Args: incident_event_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +181,9 @@ async def asyncio( incident_event_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> IncidentEventFunctionalityList | None: """List incident event functionalities @@ -187,9 +191,9 @@ async def asyncio( Args: incident_event_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 09b0e16e..3f2bf2b7 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incident_event_functionalities/{id}", + "url": "/v1/incident_event_functionalities/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] + Response[ErrorsList | IncidentEventFunctionalityResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventFunctionalityResponse] + ErrorsList | IncidentEventFunctionalityResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventFunctionalityResponse]] + Response[ErrorsList | IncidentEventFunctionalityResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventFunctionalityResponse] + 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 8cbda389..e1b7f48f 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/events/{incident_event_id}/services", + "url": "/v1/events/{incident_event_id}/services".format( + incident_event_id=quote(str(incident_event_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventServiceResponse]] + Response[ErrorsList | IncidentEventServiceResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventServiceResponse] + ErrorsList | IncidentEventServiceResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventServiceResponse]] + Response[ErrorsList | IncidentEventServiceResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventServiceResponse] + 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 ae2f92e5..e4ce309c 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/incident_event_services/{id}", + "url": "/v1/incident_event_services/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventServiceResponse]] + Response[ErrorsList | IncidentEventServiceResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventServiceResponse] + ErrorsList | IncidentEventServiceResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventServiceResponse]] + Response[ErrorsList | IncidentEventServiceResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventServiceResponse] + 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 fc9396a8..83c948c2 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incident_event_services/{id}", + "url": "/v1/incident_event_services/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventServiceResponse]] + Response[ErrorsList | IncidentEventServiceResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventServiceResponse] + ErrorsList | IncidentEventServiceResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventServiceResponse]] + Response[ErrorsList | IncidentEventServiceResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventServiceResponse] + 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 2301da6a..5087b62e 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( incident_event_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/events/{incident_event_id}/services", + "url": "/v1/events/{incident_event_id}/services".format( + incident_event_id=quote(str(incident_event_id), safe=""), + ), "params": params, } @@ -64,9 +68,9 @@ def sync_detailed( incident_event_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[IncidentEventServiceList]: """List incident event services @@ -74,9 +78,9 @@ def sync_detailed( Args: incident_event_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +108,9 @@ def sync( incident_event_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> IncidentEventServiceList | None: """List incident event services @@ -114,9 +118,9 @@ def sync( Args: incident_event_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +143,9 @@ async def asyncio_detailed( incident_event_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[IncidentEventServiceList]: """List incident event services @@ -149,9 +153,9 @@ async def asyncio_detailed( Args: incident_event_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +181,9 @@ async def asyncio( incident_event_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> IncidentEventServiceList | None: """List incident event services @@ -187,9 +191,9 @@ async def asyncio( Args: incident_event_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 be5fe06a..11e2528f 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incident_event_services/{id}", + "url": "/v1/incident_event_services/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventServiceResponse]] + Response[ErrorsList | IncidentEventServiceResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventServiceResponse] + ErrorsList | IncidentEventServiceResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventServiceResponse]] + Response[ErrorsList | IncidentEventServiceResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventServiceResponse] + 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 218606b0..443576f9 100644 --- a/rootly_sdk/api/incident_events/create_incident_event.py +++ b/rootly_sdk/api/incident_events/create_incident_event.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/incidents/{incident_id}/events", + "url": "/v1/incidents/{incident_id}/events".format( + incident_id=quote(str(incident_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventResponse]] + Response[ErrorsList | IncidentEventResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventResponse] + ErrorsList | IncidentEventResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventResponse]] + Response[ErrorsList | IncidentEventResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventResponse] + 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 9fda3db4..906602f5 100644 --- a/rootly_sdk/api/incident_events/delete_incident_event.py +++ b/rootly_sdk/api/incident_events/delete_incident_event.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/events/{id}", + "url": "/v1/events/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventResponse]] + Response[ErrorsList | IncidentEventResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventResponse] + ErrorsList | IncidentEventResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventResponse]] + Response[ErrorsList | IncidentEventResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventResponse] + 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 df761f0d..092a2816 100644 --- a/rootly_sdk/api/incident_events/get_incident_events.py +++ b/rootly_sdk/api/incident_events/get_incident_events.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/events/{id}", + "url": "/v1/events/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventResponse]] + Response[ErrorsList | IncidentEventResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventResponse] + ErrorsList | IncidentEventResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventResponse]] + Response[ErrorsList | IncidentEventResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventResponse] + 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 84b2c44f..ddd02177 100644 --- a/rootly_sdk/api/incident_events/list_incident_events.py +++ b/rootly_sdk/api/incident_events/list_incident_events.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( incident_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incidents/{incident_id}/events", + "url": "/v1/incidents/{incident_id}/events".format( + incident_id=quote(str(incident_id), safe=""), + ), "params": params, } @@ -60,9 +64,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[IncidentEventList]: """List incident events @@ -70,9 +74,9 @@ def sync_detailed( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -100,9 +104,9 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> IncidentEventList | None: """List incident events @@ -110,9 +114,9 @@ def sync( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -135,9 +139,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[IncidentEventList]: """List incident events @@ -145,9 +149,9 @@ async def asyncio_detailed( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -173,9 +177,9 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> IncidentEventList | None: """List incident events @@ -183,9 +187,9 @@ async def asyncio( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 bc6dd20a..6e364970 100644 --- a/rootly_sdk/api/incident_events/update_incident_event.py +++ b/rootly_sdk/api/incident_events/update_incident_event.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/events/{id}", + "url": "/v1/events/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventResponse]] + Response[ErrorsList | IncidentEventResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventResponse] + ErrorsList | IncidentEventResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentEventResponse]] + Response[ErrorsList | IncidentEventResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentEventResponse] + 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 6b3767bd..3a29fbc2 100644 --- a/rootly_sdk/api/incident_feedbacks/create_incident_feedback.py +++ b/rootly_sdk/api/incident_feedbacks/create_incident_feedback.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/incidents/{incident_id}/feedbacks", + "url": "/v1/incidents/{incident_id}/feedbacks".format( + incident_id=quote(str(incident_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentFeedbackResponse]] + Response[ErrorsList | IncidentFeedbackResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentFeedbackResponse] + ErrorsList | IncidentFeedbackResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentFeedbackResponse]] + Response[ErrorsList | IncidentFeedbackResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentFeedbackResponse] + 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 8e53814d..6c834602 100644 --- a/rootly_sdk/api/incident_feedbacks/get_incident_feedbacks.py +++ b/rootly_sdk/api/incident_feedbacks/get_incident_feedbacks.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/feedbacks/{id}", + "url": "/v1/feedbacks/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentFeedbackResponse]] + Response[ErrorsList | IncidentFeedbackResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentFeedbackResponse] + ErrorsList | IncidentFeedbackResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentFeedbackResponse]] + Response[ErrorsList | IncidentFeedbackResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentFeedbackResponse] + 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 3efafc21..e9606100 100644 --- a/rootly_sdk/api/incident_feedbacks/list_incident_feedbacks.py +++ b/rootly_sdk/api/incident_feedbacks/list_incident_feedbacks.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( incident_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incidents/{incident_id}/feedbacks", + "url": "/v1/incidents/{incident_id}/feedbacks".format( + incident_id=quote(str(incident_id), safe=""), + ), "params": params, } @@ -62,9 +66,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[IncidentFeedbackList]: """List incident feedbacks @@ -72,9 +76,9 @@ def sync_detailed( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -102,9 +106,9 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> IncidentFeedbackList | None: """List incident feedbacks @@ -112,9 +116,9 @@ def sync( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -137,9 +141,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[IncidentFeedbackList]: """List incident feedbacks @@ -147,9 +151,9 @@ async def asyncio_detailed( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -175,9 +179,9 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> IncidentFeedbackList | None: """List incident feedbacks @@ -185,9 +189,9 @@ async def asyncio( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 e23f16ea..95e97705 100644 --- a/rootly_sdk/api/incident_feedbacks/update_incident_feedback.py +++ b/rootly_sdk/api/incident_feedbacks/update_incident_feedback.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/feedbacks/{id}", + "url": "/v1/feedbacks/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentFeedbackResponse]] + Response[ErrorsList | IncidentFeedbackResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentFeedbackResponse] + ErrorsList | IncidentFeedbackResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentFeedbackResponse]] + Response[ErrorsList | IncidentFeedbackResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentFeedbackResponse] + 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 acce98af..a24a4d0c 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/incidents/{incident_id}/form_field_selections", + "url": "/v1/incidents/{incident_id}/form_field_selections".format( + incident_id=quote(str(incident_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] + Response[ErrorsList | IncidentFormFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentFormFieldSelectionResponse] + ErrorsList | IncidentFormFieldSelectionResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] + Response[ErrorsList | IncidentFormFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentFormFieldSelectionResponse] + 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 657ef26a..e1158bcf 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/incident_form_field_selections/{id}", + "url": "/v1/incident_form_field_selections/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] + Response[ErrorsList | IncidentFormFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentFormFieldSelectionResponse] + ErrorsList | IncidentFormFieldSelectionResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] + Response[ErrorsList | IncidentFormFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentFormFieldSelectionResponse] + 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 73f16e1f..7649c119 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incident_form_field_selections/{id}", + "url": "/v1/incident_form_field_selections/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] + Response[ErrorsList | IncidentFormFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentFormFieldSelectionResponse] + ErrorsList | IncidentFormFieldSelectionResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] + Response[ErrorsList | IncidentFormFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentFormFieldSelectionResponse] + 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 2cc3ecde..8da161a7 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( incident_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incidents/{incident_id}/form_field_selections", + "url": "/v1/incidents/{incident_id}/form_field_selections".format( + incident_id=quote(str(incident_id), safe=""), + ), "params": params, } @@ -64,9 +68,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[IncidentFormFieldSelectionList]: """List incident form field selections @@ -74,9 +78,9 @@ def sync_detailed( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +108,9 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> IncidentFormFieldSelectionList | None: """List incident form field selections @@ -114,9 +118,9 @@ def sync( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +143,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[IncidentFormFieldSelectionList]: """List incident form field selections @@ -149,9 +153,9 @@ async def asyncio_detailed( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +181,9 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> IncidentFormFieldSelectionList | None: """List incident form field selections @@ -187,9 +191,9 @@ async def asyncio( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 bf3ff766..8d933d3b 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incident_form_field_selections/{id}", + "url": "/v1/incident_form_field_selections/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] + Response[ErrorsList | IncidentFormFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentFormFieldSelectionResponse] + ErrorsList | IncidentFormFieldSelectionResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentFormFieldSelectionResponse]] + Response[ErrorsList | IncidentFormFieldSelectionResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentFormFieldSelectionResponse] + 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 5ef2ca88..b2923285 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/incident_permission_sets/{incident_permission_set_id}/booleans", + "url": "/v1/incident_permission_sets/{incident_permission_set_id}/booleans".format( + incident_permission_set_id=quote(str(incident_permission_set_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] + Response[ErrorsList | IncidentPermissionSetBooleanResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetBooleanResponse] + ErrorsList | IncidentPermissionSetBooleanResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] + Response[ErrorsList | IncidentPermissionSetBooleanResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetBooleanResponse] + 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 d9af5506..2597380c 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/incident_permission_set_booleans/{id}", + "url": "/v1/incident_permission_set_booleans/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] + Response[ErrorsList | IncidentPermissionSetBooleanResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetBooleanResponse] + ErrorsList | IncidentPermissionSetBooleanResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] + Response[ErrorsList | IncidentPermissionSetBooleanResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetBooleanResponse] + 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 3d982670..fd412645 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incident_permission_set_booleans/{id}", + "url": "/v1/incident_permission_set_booleans/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] + Response[ErrorsList | IncidentPermissionSetBooleanResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetBooleanResponse] + ErrorsList | IncidentPermissionSetBooleanResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] + Response[ErrorsList | IncidentPermissionSetBooleanResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetBooleanResponse] + 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 19f86eaa..4f640b28 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,16 +13,17 @@ def _get_kwargs( incident_permission_set_id: str, *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -46,7 +48,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incident_permission_sets/{incident_permission_set_id}/booleans", + "url": "/v1/incident_permission_sets/{incident_permission_set_id}/booleans".format( + incident_permission_set_id=quote(str(incident_permission_set_id), safe=""), + ), "params": params, } @@ -82,15 +86,15 @@ def sync_detailed( incident_permission_set_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> Response[IncidentPermissionSetBooleanList]: """List incident_permission_set_booleans @@ -98,15 +102,15 @@ def sync_detailed( Args: incident_permission_set_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -140,15 +144,15 @@ def sync( incident_permission_set_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> IncidentPermissionSetBooleanList | None: """List incident_permission_set_booleans @@ -156,15 +160,15 @@ def sync( Args: incident_permission_set_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -193,15 +197,15 @@ async def asyncio_detailed( incident_permission_set_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> Response[IncidentPermissionSetBooleanList]: """List incident_permission_set_booleans @@ -209,15 +213,15 @@ async def asyncio_detailed( Args: incident_permission_set_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -249,15 +253,15 @@ async def asyncio( incident_permission_set_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> IncidentPermissionSetBooleanList | None: """List incident_permission_set_booleans @@ -265,15 +269,15 @@ async def asyncio( Args: incident_permission_set_id (str): - 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]): + 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): 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 dfb06a52..cd4630de 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incident_permission_set_booleans/{id}", + "url": "/v1/incident_permission_set_booleans/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] + Response[ErrorsList | IncidentPermissionSetBooleanResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetBooleanResponse] + ErrorsList | IncidentPermissionSetBooleanResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPermissionSetBooleanResponse]] + Response[ErrorsList | IncidentPermissionSetBooleanResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetBooleanResponse] + 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 eed644e9..1c90322b 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/incident_permission_sets/{incident_permission_set_id}/resources", + "url": "/v1/incident_permission_sets/{incident_permission_set_id}/resources".format( + incident_permission_set_id=quote(str(incident_permission_set_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] + Response[ErrorsList | IncidentPermissionSetResourceResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetResourceResponse] + ErrorsList | IncidentPermissionSetResourceResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] + Response[ErrorsList | IncidentPermissionSetResourceResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetResourceResponse] + 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 509b5486..b0df5cea 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/incident_permission_set_resources/{id}", + "url": "/v1/incident_permission_set_resources/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] + Response[ErrorsList | IncidentPermissionSetResourceResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetResourceResponse] + ErrorsList | IncidentPermissionSetResourceResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] + Response[ErrorsList | IncidentPermissionSetResourceResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetResourceResponse] + 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 95a6d9f9..3ecc6bcb 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incident_permission_set_resources/{id}", + "url": "/v1/incident_permission_set_resources/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] + Response[ErrorsList | IncidentPermissionSetResourceResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetResourceResponse] + ErrorsList | IncidentPermissionSetResourceResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] + Response[ErrorsList | IncidentPermissionSetResourceResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetResourceResponse] + 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 d3468228..7be18300 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,16 +13,17 @@ def _get_kwargs( incident_permission_set_id: str, *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -46,7 +48,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incident_permission_sets/{incident_permission_set_id}/resources", + "url": "/v1/incident_permission_sets/{incident_permission_set_id}/resources".format( + incident_permission_set_id=quote(str(incident_permission_set_id), safe=""), + ), "params": params, } @@ -82,15 +86,15 @@ def sync_detailed( incident_permission_set_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> Response[IncidentPermissionSetResourceList]: """List incident_permission_set_resources @@ -98,15 +102,15 @@ def sync_detailed( Args: incident_permission_set_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -140,15 +144,15 @@ def sync( incident_permission_set_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> IncidentPermissionSetResourceList | None: """List incident_permission_set_resources @@ -156,15 +160,15 @@ def sync( Args: incident_permission_set_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -193,15 +197,15 @@ async def asyncio_detailed( incident_permission_set_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> Response[IncidentPermissionSetResourceList]: """List incident_permission_set_resources @@ -209,15 +213,15 @@ async def asyncio_detailed( Args: incident_permission_set_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -249,15 +253,15 @@ async def asyncio( incident_permission_set_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> IncidentPermissionSetResourceList | None: """List incident_permission_set_resources @@ -265,15 +269,15 @@ async def asyncio( Args: incident_permission_set_id (str): - 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]): + 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): 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 836110ab..9448553c 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incident_permission_set_resources/{id}", + "url": "/v1/incident_permission_set_resources/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] + Response[ErrorsList | IncidentPermissionSetResourceResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetResourceResponse] + ErrorsList | IncidentPermissionSetResourceResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPermissionSetResourceResponse]] + Response[ErrorsList | IncidentPermissionSetResourceResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetResourceResponse] + 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 3ca7465c..72ee39ce 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[Union[ErrorsList, IncidentPermissionSetResponse]] + Response[ErrorsList | IncidentPermissionSetResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetResponse] + 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[Union[ErrorsList, IncidentPermissionSetResponse]] + Response[ErrorsList | IncidentPermissionSetResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetResponse] + 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 c918492e..e4a987ec 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/incident_permission_sets/{id}", + "url": "/v1/incident_permission_sets/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentPermissionSetResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific incident_permission_set by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, IncidentPermissionSetResponse]] + Response[ErrorsList | IncidentPermissionSetResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentPermissionSetResponse | None: @@ -93,14 +97,14 @@ def sync( Delete a specific incident_permission_set by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, IncidentPermissionSetResponse] + ErrorsList | IncidentPermissionSetResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentPermissionSetResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific incident_permission_set by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, IncidentPermissionSetResponse]] + Response[ErrorsList | IncidentPermissionSetResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentPermissionSetResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific incident_permission_set by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, IncidentPermissionSetResponse] + 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 b04192d0..6ceccff2 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incident_permission_sets/{id}", + "url": "/v1/incident_permission_sets/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentPermissionSetResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific incident_permission_set by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, IncidentPermissionSetResponse]] + Response[ErrorsList | IncidentPermissionSetResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentPermissionSetResponse | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific incident_permission_set by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, IncidentPermissionSetResponse] + ErrorsList | IncidentPermissionSetResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentPermissionSetResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific incident_permission_set by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, IncidentPermissionSetResponse]] + Response[ErrorsList | IncidentPermissionSetResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentPermissionSetResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific incident_permission_set by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, IncidentPermissionSetResponse] + 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 6d7617d7..cd7a2c18 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,18 +11,19 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -86,34 +87,34 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[IncidentPermissionSetList]: """List incident_permission_sets List incident_permission_sets Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -147,34 +148,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> IncidentPermissionSetList | None: """List incident_permission_sets List incident_permission_sets Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -203,34 +204,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[IncidentPermissionSetList]: """List incident_permission_sets List incident_permission_sets Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -262,34 +263,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> IncidentPermissionSetList | None: """List incident_permission_sets List incident_permission_sets Args: - 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]): + 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): 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 c3e19cac..32f42235 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateIncidentPermissionSet, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incident_permission_sets/{id}", + "url": "/v1/incident_permission_sets/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncidentPermissionSet, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific incident_permission_set by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncidentPermissionSet): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPermissionSetResponse]] + Response[ErrorsList | IncidentPermissionSetResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncidentPermissionSet, @@ -107,7 +110,7 @@ def sync( Update a specific incident_permission_set by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncidentPermissionSet): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetResponse] + ErrorsList | IncidentPermissionSetResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncidentPermissionSet, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific incident_permission_set by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncidentPermissionSet): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPermissionSetResponse]] + Response[ErrorsList | IncidentPermissionSetResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncidentPermissionSet, @@ -168,7 +171,7 @@ async def asyncio( Update a specific incident_permission_set by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncidentPermissionSet): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPermissionSetResponse] + 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 f9ea28aa..ab0153d1 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incident_retrospective_steps/{id}", + "url": "/v1/incident_retrospective_steps/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]] + Response[ErrorsList | IncidentRetrospectiveStepResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentRetrospectiveStepResponse] + ErrorsList | IncidentRetrospectiveStepResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]] + Response[ErrorsList | IncidentRetrospectiveStepResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentRetrospectiveStepResponse] + 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 12aec1a9..8956c7c5 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incident_retrospective_steps/{id}", + "url": "/v1/incident_retrospective_steps/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]] + Response[ErrorsList | IncidentRetrospectiveStepResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentRetrospectiveStepResponse] + ErrorsList | IncidentRetrospectiveStepResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentRetrospectiveStepResponse]] + Response[ErrorsList | IncidentRetrospectiveStepResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentRetrospectiveStepResponse] + 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 8aa4c16c..1c183c5c 100644 --- a/rootly_sdk/api/incident_retrospectives/list_incident_post_mortems.py +++ b/rootly_sdk/api/incident_retrospectives/list_incident_post_mortems.py @@ -11,44 +11,45 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -162,86 +163,86 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[IncidentPostMortemList]: """List incident retrospectives List incident retrospectives Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -301,86 +302,86 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> IncidentPostMortemList | None: """List incident retrospectives List incident retrospectives Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -435,86 +436,86 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[IncidentPostMortemList]: """List incident retrospectives List incident retrospectives Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -572,86 +573,86 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> IncidentPostMortemList | None: """List incident retrospectives List incident retrospectives Args: - 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]): + 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): 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 44d0276b..0914afba 100644 --- a/rootly_sdk/api/incident_retrospectives/list_incident_postmortem.py +++ b/rootly_sdk/api/incident_retrospectives/list_incident_postmortem.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/post_mortems/{id}", + "url": "/v1/post_mortems/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentPostMortemResponse]: @@ -62,14 +66,14 @@ def sync_detailed( List incidents retrospectives Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, IncidentPostMortemResponse]] + Response[ErrorsList | IncidentPostMortemResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentPostMortemResponse | None: @@ -93,14 +97,14 @@ def sync( List incidents retrospectives Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, IncidentPostMortemResponse] + ErrorsList | IncidentPostMortemResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentPostMortemResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( List incidents retrospectives Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, IncidentPostMortemResponse]] + Response[ErrorsList | IncidentPostMortemResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentPostMortemResponse | None: @@ -148,14 +152,14 @@ async def asyncio( List incidents retrospectives Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, IncidentPostMortemResponse] + 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 7eb66270..ab44f336 100644 --- a/rootly_sdk/api/incident_retrospectives/update_incident_postmortem.py +++ b/rootly_sdk/api/incident_retrospectives/update_incident_postmortem.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateIncidentPostMortem, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/post_mortems/{id}", + "url": "/v1/post_mortems/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -45,6 +48,16 @@ def _parse_response( return response_404 + if response.status_code == 409: + response_409 = ErrorsList.from_dict(response.json()) + + return response_409 + + if response.status_code == 503: + response_503 = ErrorsList.from_dict(response.json()) + + return response_503 + if client.raise_on_unexpected_status: raise errors.UnexpectedStatus(response.status_code, response.content) else: @@ -63,17 +76,21 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncidentPostMortem, ) -> Response[ErrorsList | IncidentPostMortemResponse]: """Update an incident retrospective - Update a specific incident retrospective by id + Update a specific incident retrospective by id. The body may be written as `content` (or its alias + `smart_content`) and is sanitized to the tags the retrospective editor supports. When no `title` is + sent and the body opens with an `

`, that heading becomes the retrospective title, matching the + editor. Once a retrospective has been opened in the collaborative editor that editor owns the body, + and body writes are rejected with a 409. Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncidentPostMortem): Raises: @@ -81,7 +98,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPostMortemResponse]] + Response[ErrorsList | IncidentPostMortemResponse] """ kwargs = _get_kwargs( @@ -97,17 +114,21 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncidentPostMortem, ) -> ErrorsList | IncidentPostMortemResponse | None: """Update an incident retrospective - Update a specific incident retrospective by id + Update a specific incident retrospective by id. The body may be written as `content` (or its alias + `smart_content`) and is sanitized to the tags the retrospective editor supports. When no `title` is + sent and the body opens with an `

`, that heading becomes the retrospective title, matching the + editor. Once a retrospective has been opened in the collaborative editor that editor owns the body, + and body writes are rejected with a 409. Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncidentPostMortem): Raises: @@ -115,7 +136,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPostMortemResponse] + ErrorsList | IncidentPostMortemResponse """ return sync_detailed( @@ -126,17 +147,21 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncidentPostMortem, ) -> Response[ErrorsList | IncidentPostMortemResponse]: """Update an incident retrospective - Update a specific incident retrospective by id + Update a specific incident retrospective by id. The body may be written as `content` (or its alias + `smart_content`) and is sanitized to the tags the retrospective editor supports. When no `title` is + sent and the body opens with an `

`, that heading becomes the retrospective title, matching the + editor. Once a retrospective has been opened in the collaborative editor that editor owns the body, + and body writes are rejected with a 409. Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncidentPostMortem): Raises: @@ -144,7 +169,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentPostMortemResponse]] + Response[ErrorsList | IncidentPostMortemResponse] """ kwargs = _get_kwargs( @@ -158,17 +183,21 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncidentPostMortem, ) -> ErrorsList | IncidentPostMortemResponse | None: """Update an incident retrospective - Update a specific incident retrospective by id + Update a specific incident retrospective by id. The body may be written as `content` (or its alias + `smart_content`) and is sanitized to the tags the retrospective editor supports. When no `title` is + sent and the body opens with an `

`, that heading becomes the retrospective title, matching the + editor. Once a retrospective has been opened in the collaborative editor that editor owns the body, + and body writes are rejected with a 409. Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncidentPostMortem): Raises: @@ -176,7 +205,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentPostMortemResponse] + 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 855f016c..ee4e706e 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/incident_roles/{incident_role_id}/incident_role_tasks", + "url": "/v1/incident_roles/{incident_role_id}/incident_role_tasks".format( + incident_role_id=quote(str(incident_role_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentRoleTaskResponse]] + Response[ErrorsList | IncidentRoleTaskResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentRoleTaskResponse] + ErrorsList | IncidentRoleTaskResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentRoleTaskResponse]] + Response[ErrorsList | IncidentRoleTaskResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentRoleTaskResponse] + 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 9fb114a0..d4271588 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/incident_role_tasks/{id}", + "url": "/v1/incident_role_tasks/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentRoleTaskResponse]] + Response[ErrorsList | IncidentRoleTaskResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentRoleTaskResponse] + ErrorsList | IncidentRoleTaskResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentRoleTaskResponse]] + Response[ErrorsList | IncidentRoleTaskResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentRoleTaskResponse] + 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 76609b7c..8c240008 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incident_role_tasks/{id}", + "url": "/v1/incident_role_tasks/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentRoleTaskResponse]] + Response[ErrorsList | IncidentRoleTaskResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentRoleTaskResponse] + ErrorsList | IncidentRoleTaskResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentRoleTaskResponse]] + Response[ErrorsList | IncidentRoleTaskResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentRoleTaskResponse] + 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 610fa1ef..c5d8a805 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( incident_role_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incident_roles/{incident_role_id}/incident_role_tasks", + "url": "/v1/incident_roles/{incident_role_id}/incident_role_tasks".format( + incident_role_id=quote(str(incident_role_id), safe=""), + ), "params": params, } @@ -62,9 +66,9 @@ def sync_detailed( incident_role_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[IncidentRoleTaskList]: """List incident role tasks @@ -72,9 +76,9 @@ def sync_detailed( Args: incident_role_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -102,9 +106,9 @@ def sync( incident_role_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> IncidentRoleTaskList | None: """List incident role tasks @@ -112,9 +116,9 @@ def sync( Args: incident_role_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -137,9 +141,9 @@ async def asyncio_detailed( incident_role_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[IncidentRoleTaskList]: """List incident role tasks @@ -147,9 +151,9 @@ async def asyncio_detailed( Args: incident_role_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -175,9 +179,9 @@ async def asyncio( incident_role_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> IncidentRoleTaskList | None: """List incident role tasks @@ -185,9 +189,9 @@ async def asyncio( Args: incident_role_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 0ac5e71f..0ab3fb0a 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incident_role_tasks/{id}", + "url": "/v1/incident_role_tasks/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentRoleTaskResponse]] + Response[ErrorsList | IncidentRoleTaskResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentRoleTaskResponse] + ErrorsList | IncidentRoleTaskResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentRoleTaskResponse]] + Response[ErrorsList | IncidentRoleTaskResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentRoleTaskResponse] + 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 a3244bb6..6b747e39 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[Union[ErrorsList, IncidentRoleResponse]] + Response[ErrorsList | IncidentRoleResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentRoleResponse] + 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[Union[ErrorsList, IncidentRoleResponse]] + Response[ErrorsList | IncidentRoleResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentRoleResponse] + 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 36721535..82e614df 100644 --- a/rootly_sdk/api/incident_roles/delete_incident_role.py +++ b/rootly_sdk/api/incident_roles/delete_incident_role.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/incident_roles/{id}", + "url": "/v1/incident_roles/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentRoleResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific incident_role by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, IncidentRoleResponse]] + Response[ErrorsList | IncidentRoleResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentRoleResponse | None: @@ -93,14 +97,14 @@ def sync( Delete a specific incident_role by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, IncidentRoleResponse] + ErrorsList | IncidentRoleResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentRoleResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific incident_role by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, IncidentRoleResponse]] + Response[ErrorsList | IncidentRoleResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentRoleResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific incident_role by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, IncidentRoleResponse] + 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 8ec86036..17763838 100644 --- a/rootly_sdk/api/incident_roles/get_incident_role.py +++ b/rootly_sdk/api/incident_roles/get_incident_role.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incident_roles/{id}", + "url": "/v1/incident_roles/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentRoleResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific incident_role by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, IncidentRoleResponse]] + Response[ErrorsList | IncidentRoleResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentRoleResponse | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific incident_role by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, IncidentRoleResponse] + ErrorsList | IncidentRoleResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentRoleResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific incident_role by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, IncidentRoleResponse]] + Response[ErrorsList | IncidentRoleResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentRoleResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific incident_role by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, IncidentRoleResponse] + 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 b3b19baa..3d27e9e4 100644 --- a/rootly_sdk/api/incident_roles/list_incident_roles.py +++ b/rootly_sdk/api/incident_roles/list_incident_roles.py @@ -11,30 +11,31 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -118,58 +119,58 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[IncidentRoleList]: """List incident roles List incident roles Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -215,58 +216,58 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> IncidentRoleList | None: """List incident roles List incident roles Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -307,58 +308,58 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[IncidentRoleList]: """List incident roles List incident roles Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -402,58 +403,58 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> IncidentRoleList | None: """List incident roles List incident roles Args: - 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]): + 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): 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 d65d7d9c..e9c102f3 100644 --- a/rootly_sdk/api/incident_roles/update_incident_role.py +++ b/rootly_sdk/api/incident_roles/update_incident_role.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateIncidentRole, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incident_roles/{id}", + "url": "/v1/incident_roles/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncidentRole, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific incident_role by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncidentRole): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentRoleResponse]] + Response[ErrorsList | IncidentRoleResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncidentRole, @@ -107,7 +110,7 @@ def sync( Update a specific incident_role by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncidentRole): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentRoleResponse] + ErrorsList | IncidentRoleResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncidentRole, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific incident_role by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncidentRole): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentRoleResponse]] + Response[ErrorsList | IncidentRoleResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncidentRole, @@ -168,7 +171,7 @@ async def asyncio( Update a specific incident_role by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncidentRole): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentRoleResponse] + 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 f046af4c..8372e2da 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/incidents/{incident_id}/status-page-events", + "url": "/v1/incidents/{incident_id}/status-page-events".format( + incident_id=quote(str(incident_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentStatusPageEventResponse]] + Response[ErrorsList | IncidentStatusPageEventResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentStatusPageEventResponse] + ErrorsList | IncidentStatusPageEventResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentStatusPageEventResponse]] + Response[ErrorsList | IncidentStatusPageEventResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentStatusPageEventResponse] + 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 36058d66..8dd1c6e7 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/status-page-events/{id}", + "url": "/v1/status-page-events/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentStatusPageEventResponse]] + Response[ErrorsList | IncidentStatusPageEventResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentStatusPageEventResponse] + ErrorsList | IncidentStatusPageEventResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentStatusPageEventResponse]] + Response[ErrorsList | IncidentStatusPageEventResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentStatusPageEventResponse] + 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 eb52a159..d7df3eea 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/status-page-events/{id}", + "url": "/v1/status-page-events/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentStatusPageEventResponse]] + Response[ErrorsList | IncidentStatusPageEventResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentStatusPageEventResponse] + ErrorsList | IncidentStatusPageEventResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentStatusPageEventResponse]] + Response[ErrorsList | IncidentStatusPageEventResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentStatusPageEventResponse] + 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 104d288b..e247949f 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( incident_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incidents/{incident_id}/status-page-events", + "url": "/v1/incidents/{incident_id}/status-page-events".format( + incident_id=quote(str(incident_id), safe=""), + ), "params": params, } @@ -64,9 +68,9 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[IncidentStatusPageEventList]: """List incident status page events @@ -74,9 +78,9 @@ def sync_detailed( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +108,9 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> IncidentStatusPageEventList | None: """List incident status page events @@ -114,9 +118,9 @@ def sync( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +143,9 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[IncidentStatusPageEventList]: """List incident status page events @@ -149,9 +153,9 @@ async def asyncio_detailed( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +181,9 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> IncidentStatusPageEventList | None: """List incident status page events @@ -187,9 +191,9 @@ async def asyncio( Args: incident_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 6b544116..01912ff4 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/status-page-events/{id}", + "url": "/v1/status-page-events/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -44,6 +47,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: @@ -80,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentStatusPageEventResponse]] + Response[ErrorsList | IncidentStatusPageEventResponse] """ kwargs = _get_kwargs( @@ -114,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentStatusPageEventResponse] + ErrorsList | IncidentStatusPageEventResponse """ return sync_detailed( @@ -143,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentStatusPageEventResponse]] + Response[ErrorsList | IncidentStatusPageEventResponse] """ kwargs = _get_kwargs( @@ -175,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentStatusPageEventResponse] + 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 eff7cccb..005343b0 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/incidents/{incident_id}/sub_statuses", + "url": "/v1/incidents/{incident_id}/sub_statuses".format( + incident_id=quote(str(incident_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentSubStatusResponse]] + Response[ErrorsList | IncidentSubStatusResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentSubStatusResponse] + ErrorsList | IncidentSubStatusResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentSubStatusResponse]] + Response[ErrorsList | IncidentSubStatusResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentSubStatusResponse] + 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 a0050da0..d0ede7b9 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/incident_sub_statuses/{id}", + "url": "/v1/incident_sub_statuses/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentSubStatusResponse]] + Response[ErrorsList | IncidentSubStatusResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentSubStatusResponse] + ErrorsList | IncidentSubStatusResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentSubStatusResponse]] + Response[ErrorsList | IncidentSubStatusResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentSubStatusResponse] + 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 e08c4dd9..8c79545a 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,11 +14,12 @@ def _get_kwargs( id: str, *, - include: Unset | GetIncidentSubStatusInclude = UNSET, + include: GetIncidentSubStatusInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -27,7 +29,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incident_sub_statuses/{id}", + "url": "/v1/incident_sub_statuses/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -63,7 +67,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetIncidentSubStatusInclude = UNSET, + include: GetIncidentSubStatusInclude | Unset = UNSET, ) -> Response[IncidentSubStatusResponse]: """Retrieves incident_sub_status @@ -71,7 +75,7 @@ def sync_detailed( Args: id (str): - include (Union[Unset, GetIncidentSubStatusInclude]): + include (GetIncidentSubStatusInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -97,7 +101,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Unset | GetIncidentSubStatusInclude = UNSET, + include: GetIncidentSubStatusInclude | Unset = UNSET, ) -> IncidentSubStatusResponse | None: """Retrieves incident_sub_status @@ -105,7 +109,7 @@ def sync( Args: id (str): - include (Union[Unset, GetIncidentSubStatusInclude]): + include (GetIncidentSubStatusInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -126,7 +130,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetIncidentSubStatusInclude = UNSET, + include: GetIncidentSubStatusInclude | Unset = UNSET, ) -> Response[IncidentSubStatusResponse]: """Retrieves incident_sub_status @@ -134,7 +138,7 @@ async def asyncio_detailed( Args: id (str): - include (Union[Unset, GetIncidentSubStatusInclude]): + include (GetIncidentSubStatusInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -158,7 +162,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Unset | GetIncidentSubStatusInclude = UNSET, + include: GetIncidentSubStatusInclude | Unset = UNSET, ) -> IncidentSubStatusResponse | None: """Retrieves incident_sub_status @@ -166,7 +170,7 @@ async def asyncio( Args: id (str): - include (Union[Unset, GetIncidentSubStatusInclude]): + include (GetIncidentSubStatusInclude | Unset): 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 fb6483d6..9baf07e2 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -16,25 +17,26 @@ def _get_kwargs( incident_id: str, *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Unset | str = UNSET + json_sort: str | Unset = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -58,7 +60,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incidents/{incident_id}/sub_statuses", + "url": "/v1/incidents/{incident_id}/sub_statuses".format( + incident_id=quote(str(incident_id), safe=""), + ), "params": params, } @@ -92,15 +96,15 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> Response[IncidentSubStatusList]: """List incident_sub_statuses @@ -108,15 +112,15 @@ def sync_detailed( Args: incident_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -150,15 +154,15 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> IncidentSubStatusList | None: """List incident_sub_statuses @@ -166,15 +170,15 @@ def sync( Args: incident_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -203,15 +207,15 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> Response[IncidentSubStatusList]: """List incident_sub_statuses @@ -219,15 +223,15 @@ async def asyncio_detailed( Args: incident_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -259,15 +263,15 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> IncidentSubStatusList | None: """List incident_sub_statuses @@ -275,15 +279,15 @@ async def asyncio( Args: incident_id (str): - 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]): + 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): 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 767df1f8..a2e84f7f 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -19,7 +20,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incident_sub_statuses/{id}", + "url": "/v1/incident_sub_statuses/{id}".format( + id=quote(str(id), safe=""), + ), } _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 850d7886..d54679eb 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[Union[ErrorsList, IncidentTypeResponse]] + Response[ErrorsList | IncidentTypeResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentTypeResponse] + 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[Union[ErrorsList, IncidentTypeResponse]] + Response[ErrorsList | IncidentTypeResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentTypeResponse] + 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 2f4aed56..7a8b50ab 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[Union[CatalogPropertyResponse, ErrorsList]] + Response[CatalogPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogPropertyResponse, ErrorsList] + 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[Union[CatalogPropertyResponse, ErrorsList]] + Response[CatalogPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogPropertyResponse, ErrorsList] + 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 5318328f..c6f0addd 100644 --- a/rootly_sdk/api/incident_types/delete_incident_type.py +++ b/rootly_sdk/api/incident_types/delete_incident_type.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/incident_types/{id}", + "url": "/v1/incident_types/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentTypeResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific incident_type by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, IncidentTypeResponse]] + Response[ErrorsList | IncidentTypeResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentTypeResponse | None: @@ -93,14 +97,14 @@ def sync( Delete a specific incident_type by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, IncidentTypeResponse] + ErrorsList | IncidentTypeResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentTypeResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific incident_type by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, IncidentTypeResponse]] + Response[ErrorsList | IncidentTypeResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentTypeResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific incident_type by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, IncidentTypeResponse] + 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 48476201..598b47e2 100644 --- a/rootly_sdk/api/incident_types/get_incident_type.py +++ b/rootly_sdk/api/incident_types/get_incident_type.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incident_types/{id}", + "url": "/v1/incident_types/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentTypeResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific incident_type by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, IncidentTypeResponse]] + Response[ErrorsList | IncidentTypeResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentTypeResponse | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific incident_type by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, IncidentTypeResponse] + ErrorsList | IncidentTypeResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentTypeResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific incident_type by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, IncidentTypeResponse]] + Response[ErrorsList | IncidentTypeResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentTypeResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific incident_type by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, IncidentTypeResponse] + 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 b102ba96..322d4536 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,27 +17,28 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Unset | str = UNSET + json_sort: str | Unset = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -96,34 +97,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogPropertyList]: """List Catalog Properties List IncidentType Catalog Properties Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -157,34 +158,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogPropertyList | None: """List Catalog Properties List IncidentType Catalog Properties Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -213,34 +214,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogPropertyList]: """List Catalog Properties List IncidentType Catalog Properties Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -272,34 +273,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogPropertyList | None: """List Catalog Properties List IncidentType Catalog Properties Args: - 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]): + 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): 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 461425b8..ba2eeaf3 100644 --- a/rootly_sdk/api/incident_types/list_incident_types.py +++ b/rootly_sdk/api/incident_types/list_incident_types.py @@ -11,30 +11,31 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -118,58 +119,58 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[IncidentTypeList]: """List incident types List incident types Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -215,58 +216,58 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> IncidentTypeList | None: """List incident types List incident types Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -307,58 +308,58 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[IncidentTypeList]: """List incident types List incident types Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -402,58 +403,58 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> IncidentTypeList | None: """List incident types List incident types Args: - 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]): + 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): 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 ba3f07cd..3df712c1 100644 --- a/rootly_sdk/api/incident_types/update_incident_type.py +++ b/rootly_sdk/api/incident_types/update_incident_type.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateIncidentType, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incident_types/{id}", + "url": "/v1/incident_types/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncidentType, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific incident_type by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncidentType): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentTypeResponse]] + Response[ErrorsList | IncidentTypeResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncidentType, @@ -107,7 +110,7 @@ def sync( Update a specific incident_type by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncidentType): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentTypeResponse] + ErrorsList | IncidentTypeResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncidentType, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific incident_type by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncidentType): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentTypeResponse]] + Response[ErrorsList | IncidentTypeResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncidentType, @@ -168,7 +171,7 @@ async def asyncio( Update a specific incident_type by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncidentType): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentTypeResponse] + 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 28cc4647..d652ab8a 100644 --- a/rootly_sdk/api/incidents/add_subscribers_to_incident.py +++ b/rootly_sdk/api/incidents/add_subscribers_to_incident.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: AddSubscribers, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/incidents/{id}/add_subscribers", + "url": "/v1/incidents/{id}/add_subscribers".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: AddSubscribers, @@ -73,7 +76,7 @@ def sync_detailed( Add subscribers to incident Args: - id (Union[UUID, str]): + id (str | UUID): body (AddSubscribers): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: AddSubscribers, @@ -107,7 +110,7 @@ def sync( Add subscribers to incident Args: - id (Union[UUID, str]): + id (str | UUID): body (AddSubscribers): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: AddSubscribers, @@ -136,7 +139,7 @@ async def asyncio_detailed( Add subscribers to incident Args: - id (Union[UUID, str]): + id (str | UUID): body (AddSubscribers): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: AddSubscribers, @@ -168,7 +171,7 @@ async def asyncio( Add subscribers to incident Args: - id (Union[UUID, str]): + id (str | UUID): body (AddSubscribers): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + 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 85f5d763..183ed7ec 100644 --- a/rootly_sdk/api/incidents/assign_user_to_incident.py +++ b/rootly_sdk/api/incidents/assign_user_to_incident.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: AssignRoleToUser, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/incidents/{id}/assign_role_to_user", + "url": "/v1/incidents/{id}/assign_role_to_user".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: AssignRoleToUser, @@ -73,7 +76,7 @@ def sync_detailed( Assign user to incident Args: - id (Union[UUID, str]): + id (str | UUID): body (AssignRoleToUser): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: AssignRoleToUser, @@ -107,7 +110,7 @@ def sync( Assign user to incident Args: - id (Union[UUID, str]): + id (str | UUID): body (AssignRoleToUser): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: AssignRoleToUser, @@ -136,7 +139,7 @@ async def asyncio_detailed( Assign user to incident Args: - id (Union[UUID, str]): + id (str | UUID): body (AssignRoleToUser): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: AssignRoleToUser, @@ -168,7 +171,7 @@ async def asyncio( Assign user to incident Args: - id (Union[UUID, str]): + id (str | UUID): body (AssignRoleToUser): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return ( diff --git a/rootly_sdk/api/incidents/cancel_incident.py b/rootly_sdk/api/incidents/cancel_incident.py index 127e505a..acdcb056 100644 --- a/rootly_sdk/api/incidents/cancel_incident.py +++ b/rootly_sdk/api/incidents/cancel_incident.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: CancelIncident, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incidents/{id}/cancel", + "url": "/v1/incidents/{id}/cancel".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: CancelIncident, @@ -73,7 +76,7 @@ def sync_detailed( Cancel a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (CancelIncident): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: CancelIncident, @@ -107,7 +110,7 @@ def sync( Cancel a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (CancelIncident): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: CancelIncident, @@ -136,7 +139,7 @@ async def asyncio_detailed( Cancel a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (CancelIncident): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: CancelIncident, @@ -168,7 +171,7 @@ async def asyncio( Cancel a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (CancelIncident): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return ( diff --git a/rootly_sdk/api/incidents/create_incident.py b/rootly_sdk/api/incidents/create_incident.py index 8150ea17..7f0d92bc 100644 --- a/rootly_sdk/api/incidents/create_incident.py +++ b/rootly_sdk/api/incidents/create_incident.py @@ -8,14 +8,17 @@ from ...models.errors_list import ErrorsList from ...models.incident_response import IncidentResponse from ...models.new_incident import NewIncident -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( *, body: NewIncident, + idempotency_key: str | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} + if not isinstance(idempotency_key, Unset): + headers["Idempotency-Key"] = idempotency_key _kwargs: dict[str, Any] = { "method": "post", @@ -33,6 +36,11 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response ) -> ErrorsList | IncidentResponse | None: + if response.status_code == 200: + response_200 = IncidentResponse.from_dict(response.json()) + + return response_200 + if response.status_code == 201: response_201 = IncidentResponse.from_dict(response.json()) @@ -69,12 +77,14 @@ def sync_detailed( *, client: AuthenticatedClient, body: NewIncident, + idempotency_key: str | Unset = UNSET, ) -> Response[ErrorsList | IncidentResponse]: """Creates an incident Creates a new incident from provided data Args: + idempotency_key (str | Unset): body (NewIncident): Raises: @@ -82,11 +92,12 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( body=body, + idempotency_key=idempotency_key, ) response = client.get_httpx_client().request( @@ -100,12 +111,14 @@ def sync( *, client: AuthenticatedClient, body: NewIncident, + idempotency_key: str | Unset = UNSET, ) -> ErrorsList | IncidentResponse | None: """Creates an incident Creates a new incident from provided data Args: + idempotency_key (str | Unset): body (NewIncident): Raises: @@ -113,12 +126,13 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return sync_detailed( client=client, body=body, + idempotency_key=idempotency_key, ).parsed @@ -126,12 +140,14 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: NewIncident, + idempotency_key: str | Unset = UNSET, ) -> Response[ErrorsList | IncidentResponse]: """Creates an incident Creates a new incident from provided data Args: + idempotency_key (str | Unset): body (NewIncident): Raises: @@ -139,11 +155,12 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( body=body, + idempotency_key=idempotency_key, ) response = await client.get_async_httpx_client().request(**kwargs) @@ -155,12 +172,14 @@ async def asyncio( *, client: AuthenticatedClient, body: NewIncident, + idempotency_key: str | Unset = UNSET, ) -> ErrorsList | IncidentResponse | None: """Creates an incident Creates a new incident from provided data Args: + idempotency_key (str | Unset): body (NewIncident): Raises: @@ -168,12 +187,13 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return ( await asyncio_detailed( client=client, body=body, + idempotency_key=idempotency_key, ) ).parsed diff --git a/rootly_sdk/api/incidents/delete_incident.py b/rootly_sdk/api/incidents/delete_incident.py index b39d249e..93326984 100644 --- a/rootly_sdk/api/incidents/delete_incident.py +++ b/rootly_sdk/api/incidents/delete_incident.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/incidents/{id}", + "url": "/v1/incidents/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific incident by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentResponse | None: @@ -93,14 +97,14 @@ def sync( Delete a specific incident by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | IncidentResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific incident by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | IncidentResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific incident by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, IncidentResponse] + 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 071c3b5a..97f2e681 100644 --- a/rootly_sdk/api/incidents/detach_from_parent_incident.py +++ b/rootly_sdk/api/incidents/detach_from_parent_incident.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incidents/{id}/detach_from_parent", + "url": "/v1/incidents/{id}/detach_from_parent".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -57,7 +61,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[Any | ErrorsList | IncidentResponse]: @@ -66,14 +70,14 @@ def sync_detailed( Detach a sub-incident from its parent incident Args: - id (Union[UUID, str]): + id (str | 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[Union[Any, ErrorsList, IncidentResponse]] + Response[Any | ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -88,7 +92,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Any | ErrorsList | IncidentResponse | None: @@ -97,14 +101,14 @@ def sync( Detach a sub-incident from its parent incident Args: - id (Union[UUID, str]): + id (str | 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: - Union[Any, ErrorsList, IncidentResponse] + Any | ErrorsList | IncidentResponse """ return sync_detailed( @@ -114,7 +118,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[Any | ErrorsList | IncidentResponse]: @@ -123,14 +127,14 @@ async def asyncio_detailed( Detach a sub-incident from its parent incident Args: - id (Union[UUID, str]): + id (str | 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[Union[Any, ErrorsList, IncidentResponse]] + Response[Any | ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -143,7 +147,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Any | ErrorsList | IncidentResponse | None: @@ -152,14 +156,14 @@ async def asyncio( Detach a sub-incident from its parent incident Args: - id (Union[UUID, str]): + id (str | 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: - Union[Any, ErrorsList, IncidentResponse] + Any | ErrorsList | IncidentResponse """ return ( diff --git a/rootly_sdk/api/incidents/get_incident.py b/rootly_sdk/api/incidents/get_incident.py index 86bea102..60b93b84 100644 --- a/rootly_sdk/api/incidents/get_incident.py +++ b/rootly_sdk/api/incidents/get_incident.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,13 +14,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, - include: Unset | GetIncidentInclude = UNSET, + include: GetIncidentInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -29,7 +31,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incidents/{id}", + "url": "/v1/incidents/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -67,25 +71,25 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetIncidentInclude = UNSET, + include: GetIncidentInclude | Unset = UNSET, ) -> Response[ErrorsList | IncidentResponse]: """Retrieves an incident Retrieves a specific incident by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetIncidentInclude]): + id (str | UUID): + include (GetIncidentInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -101,25 +105,25 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetIncidentInclude = UNSET, + include: GetIncidentInclude | Unset = UNSET, ) -> ErrorsList | IncidentResponse | None: """Retrieves an incident Retrieves a specific incident by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetIncidentInclude]): + id (str | UUID): + include (GetIncidentInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return sync_detailed( @@ -130,25 +134,25 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetIncidentInclude = UNSET, + include: GetIncidentInclude | Unset = UNSET, ) -> Response[ErrorsList | IncidentResponse]: """Retrieves an incident Retrieves a specific incident by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetIncidentInclude]): + id (str | UUID): + include (GetIncidentInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -162,25 +166,25 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetIncidentInclude = UNSET, + include: GetIncidentInclude | Unset = UNSET, ) -> ErrorsList | IncidentResponse | None: """Retrieves an incident Retrieves a specific incident by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetIncidentInclude]): + id (str | UUID): + include (GetIncidentInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return ( diff --git a/rootly_sdk/api/incidents/list_incidents.py b/rootly_sdk/api/incidents/list_incidents.py index d6bc8f16..f320a9cc 100644 --- a/rootly_sdk/api/incidents/list_incidents.py +++ b/rootly_sdk/api/incidents/list_incidents.py @@ -14,170 +14,171 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["page[after]"] = pageafter @@ -502,13 +503,13 @@ def _get_kwargs( params["filter[team_names][not_in]"] = filterteam_namesnot_in - json_sort: Unset | str = UNSET + json_sort: str | Unset = UNSET if not isinstance(sort, Unset): json_sort = sort params["sort"] = json_sort - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -558,345 +559,345 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[ErrorsList | IncidentList]: """List incidents List incidents Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns 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, IncidentList]] + Response[ErrorsList | IncidentList] """ kwargs = _get_kwargs( @@ -1075,345 +1076,345 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> ErrorsList | IncidentList | None: """List incidents List incidents Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server 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, IncidentList] + ErrorsList | IncidentList """ return sync_detailed( @@ -1587,345 +1588,345 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[ErrorsList | IncidentList]: """List incidents List incidents Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns 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, IncidentList]] + Response[ErrorsList | IncidentList] """ kwargs = _get_kwargs( @@ -2102,345 +2103,345 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> ErrorsList | IncidentList | None: """List incidents List incidents Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server 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, IncidentList] + 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 d6ed447d..e93e2b46 100644 --- a/rootly_sdk/api/incidents/mark_as_duplicate_incident.py +++ b/rootly_sdk/api/incidents/mark_as_duplicate_incident.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: ResolveIncident, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incidents/{id}/duplicate", + "url": "/v1/incidents/{id}/duplicate".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: ResolveIncident, @@ -73,7 +76,7 @@ def sync_detailed( Mark an incident as a duplicate Args: - id (Union[UUID, str]): + id (str | UUID): body (ResolveIncident): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: ResolveIncident, @@ -107,7 +110,7 @@ def sync( Mark an incident as a duplicate Args: - id (Union[UUID, str]): + id (str | UUID): body (ResolveIncident): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: ResolveIncident, @@ -136,7 +139,7 @@ async def asyncio_detailed( Mark an incident as a duplicate Args: - id (Union[UUID, str]): + id (str | UUID): body (ResolveIncident): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: ResolveIncident, @@ -168,7 +171,7 @@ async def asyncio( Mark an incident as a duplicate Args: - id (Union[UUID, str]): + id (str | UUID): body (ResolveIncident): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return ( diff --git a/rootly_sdk/api/incidents/mitigate_incident.py b/rootly_sdk/api/incidents/mitigate_incident.py index efb44525..4c713578 100644 --- a/rootly_sdk/api/incidents/mitigate_incident.py +++ b/rootly_sdk/api/incidents/mitigate_incident.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: MitigateIncident, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incidents/{id}/mitigate", + "url": "/v1/incidents/{id}/mitigate".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: MitigateIncident, @@ -73,7 +76,7 @@ def sync_detailed( Mitigate a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (MitigateIncident): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: MitigateIncident, @@ -107,7 +110,7 @@ def sync( Mitigate a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (MitigateIncident): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: MitigateIncident, @@ -136,7 +139,7 @@ async def asyncio_detailed( Mitigate a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (MitigateIncident): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: MitigateIncident, @@ -168,7 +171,7 @@ async def asyncio( Mitigate a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (MitigateIncident): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + 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 ae393430..c86e1ec4 100644 --- a/rootly_sdk/api/incidents/remove_assigned_user_from_incident.py +++ b/rootly_sdk/api/incidents/remove_assigned_user_from_incident.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UnassignRoleFromUser, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/incidents/{id}/unassign_role_from_user", + "url": "/v1/incidents/{id}/unassign_role_from_user".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UnassignRoleFromUser, @@ -73,7 +76,7 @@ def sync_detailed( Remove assigned user from incident Args: - id (Union[UUID, str]): + id (str | UUID): body (UnassignRoleFromUser): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UnassignRoleFromUser, @@ -107,7 +110,7 @@ def sync( Remove assigned user from incident Args: - id (Union[UUID, str]): + id (str | UUID): body (UnassignRoleFromUser): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UnassignRoleFromUser, @@ -136,7 +139,7 @@ async def asyncio_detailed( Remove assigned user from incident Args: - id (Union[UUID, str]): + id (str | UUID): body (UnassignRoleFromUser): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UnassignRoleFromUser, @@ -168,7 +171,7 @@ async def asyncio( Remove assigned user from incident Args: - id (Union[UUID, str]): + id (str | UUID): body (UnassignRoleFromUser): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + 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 ba5666eb..0be005da 100644 --- a/rootly_sdk/api/incidents/remove_subscribers_to_incident.py +++ b/rootly_sdk/api/incidents/remove_subscribers_to_incident.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: RemoveSubscribers, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/incidents/{id}/remove_subscribers", + "url": "/v1/incidents/{id}/remove_subscribers".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: RemoveSubscribers, @@ -73,7 +76,7 @@ def sync_detailed( Remove subscribers to incident Args: - id (Union[UUID, str]): + id (str | UUID): body (RemoveSubscribers): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: RemoveSubscribers, @@ -107,7 +110,7 @@ def sync( Remove subscribers to incident Args: - id (Union[UUID, str]): + id (str | UUID): body (RemoveSubscribers): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: RemoveSubscribers, @@ -136,7 +139,7 @@ async def asyncio_detailed( Remove subscribers to incident Args: - id (Union[UUID, str]): + id (str | UUID): body (RemoveSubscribers): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: RemoveSubscribers, @@ -168,7 +171,7 @@ async def asyncio( Remove subscribers to incident Args: - id (Union[UUID, str]): + id (str | UUID): body (RemoveSubscribers): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return ( diff --git a/rootly_sdk/api/incidents/resolve_incident.py b/rootly_sdk/api/incidents/resolve_incident.py index 690fa270..094ca943 100644 --- a/rootly_sdk/api/incidents/resolve_incident.py +++ b/rootly_sdk/api/incidents/resolve_incident.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: ResolveIncident, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incidents/{id}/resolve", + "url": "/v1/incidents/{id}/resolve".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: ResolveIncident, @@ -73,7 +76,7 @@ def sync_detailed( Resolve a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (ResolveIncident): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: ResolveIncident, @@ -107,7 +110,7 @@ def sync( Resolve a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (ResolveIncident): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: ResolveIncident, @@ -136,7 +139,7 @@ async def asyncio_detailed( Resolve a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (ResolveIncident): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: ResolveIncident, @@ -168,7 +171,7 @@ async def asyncio( Resolve a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (ResolveIncident): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return ( diff --git a/rootly_sdk/api/incidents/restart_incident.py b/rootly_sdk/api/incidents/restart_incident.py index 7ff3aaca..45953fc9 100644 --- a/rootly_sdk/api/incidents/restart_incident.py +++ b/rootly_sdk/api/incidents/restart_incident.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: RestartIncident, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incidents/{id}/restart", + "url": "/v1/incidents/{id}/restart".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: RestartIncident, @@ -73,7 +76,7 @@ def sync_detailed( Restart a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (RestartIncident): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: RestartIncident, @@ -107,7 +110,7 @@ def sync( Restart a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (RestartIncident): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: RestartIncident, @@ -136,7 +139,7 @@ async def asyncio_detailed( Restart a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (RestartIncident): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: RestartIncident, @@ -168,7 +171,7 @@ async def asyncio( Restart a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (RestartIncident): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return ( diff --git a/rootly_sdk/api/incidents/triage_incident.py b/rootly_sdk/api/incidents/triage_incident.py index b70ba562..819bedd0 100644 --- a/rootly_sdk/api/incidents/triage_incident.py +++ b/rootly_sdk/api/incidents/triage_incident.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: InTriageIncident, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incidents/{id}/in_triage", + "url": "/v1/incidents/{id}/in_triage".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: InTriageIncident, @@ -73,7 +76,7 @@ def sync_detailed( Set a specific incident by ID to triage state Args: - id (Union[UUID, str]): + id (str | UUID): body (InTriageIncident): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: InTriageIncident, @@ -107,7 +110,7 @@ def sync( Set a specific incident by ID to triage state Args: - id (Union[UUID, str]): + id (str | UUID): body (InTriageIncident): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: InTriageIncident, @@ -136,7 +139,7 @@ async def asyncio_detailed( Set a specific incident by ID to triage state Args: - id (Union[UUID, str]): + id (str | UUID): body (InTriageIncident): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: InTriageIncident, @@ -168,7 +171,7 @@ async def asyncio( Set a specific incident by ID to triage state Args: - id (Union[UUID, str]): + id (str | UUID): body (InTriageIncident): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + 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 3d1d9822..d5a053f8 100644 --- a/rootly_sdk/api/incidents/unmark_as_duplicate_incident.py +++ b/rootly_sdk/api/incidents/unmark_as_duplicate_incident.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incidents/{id}/unmark_as_duplicate", + "url": "/v1/incidents/{id}/unmark_as_duplicate".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -57,7 +61,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[Any | ErrorsList | IncidentResponse]: @@ -66,14 +70,14 @@ def sync_detailed( Remove the duplicate marking from an incident Args: - id (Union[UUID, str]): + id (str | 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[Union[Any, ErrorsList, IncidentResponse]] + Response[Any | ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -88,7 +92,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Any | ErrorsList | IncidentResponse | None: @@ -97,14 +101,14 @@ def sync( Remove the duplicate marking from an incident Args: - id (Union[UUID, str]): + id (str | 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: - Union[Any, ErrorsList, IncidentResponse] + Any | ErrorsList | IncidentResponse """ return sync_detailed( @@ -114,7 +118,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[Any | ErrorsList | IncidentResponse]: @@ -123,14 +127,14 @@ async def asyncio_detailed( Remove the duplicate marking from an incident Args: - id (Union[UUID, str]): + id (str | 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[Union[Any, ErrorsList, IncidentResponse]] + Response[Any | ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -143,7 +147,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Any | ErrorsList | IncidentResponse | None: @@ -152,14 +156,14 @@ async def asyncio( Remove the duplicate marking from an incident Args: - id (Union[UUID, str]): + id (str | 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: - Union[Any, ErrorsList, IncidentResponse] + Any | ErrorsList | IncidentResponse """ return ( diff --git a/rootly_sdk/api/incidents/update_incident.py b/rootly_sdk/api/incidents/update_incident.py index 00521b61..470c044e 100644 --- a/rootly_sdk/api/incidents/update_incident.py +++ b/rootly_sdk/api/incidents/update_incident.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateIncident, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/incidents/{id}", + "url": "/v1/incidents/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncident, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncident): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncident, @@ -107,7 +110,7 @@ def sync( Update a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncident): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + ErrorsList | IncidentResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncident, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncident): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentResponse]] + Response[ErrorsList | IncidentResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateIncident, @@ -168,7 +171,7 @@ async def asyncio( Update a specific incident by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateIncident): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentResponse] + 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 de282bf7..1c8c7d81 100644 --- a/rootly_sdk/api/ip_ranges/get_ip_ranges.py +++ b/rootly_sdk/api/ip_ranges/get_ip_ranges.py @@ -10,6 +10,7 @@ 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 e34f474e..3411697b 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[Union[ErrorsList, LiveCallRouterResponse]] + Response[ErrorsList | LiveCallRouterResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, LiveCallRouterResponse] + 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[Union[ErrorsList, LiveCallRouterResponse]] + Response[ErrorsList | LiveCallRouterResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, LiveCallRouterResponse] + 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 c4c1e7cc..599d3193 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/live_call_routers/{id}", + "url": "/v1/live_call_routers/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, LiveCallRouterResponse]] + Response[ErrorsList | LiveCallRouterResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, LiveCallRouterResponse] + ErrorsList | LiveCallRouterResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, LiveCallRouterResponse]] + Response[ErrorsList | LiveCallRouterResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, LiveCallRouterResponse] + 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 405a91e4..f9a03d53 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,6 +20,7 @@ def _get_kwargs( country_code: GeneratePhoneNumberLiveCallRouterCountryCode, phone_type: GeneratePhoneNumberLiveCallRouterPhoneType, ) -> dict[str, Any]: + params: dict[str, Any] = {} json_country_code: str = country_code @@ -83,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ErrorsList]] + Response[Any | ErrorsList] """ kwargs = _get_kwargs( @@ -117,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ErrorsList] + Any | ErrorsList """ return sync_detailed( @@ -146,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ErrorsList]] + Response[Any | ErrorsList] """ kwargs = _get_kwargs( @@ -178,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ErrorsList] + 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 477a4a36..df6f8458 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/live_call_routers/{id}", + "url": "/v1/live_call_routers/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, LiveCallRouterResponse]] + Response[ErrorsList | LiveCallRouterResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, LiveCallRouterResponse] + ErrorsList | LiveCallRouterResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, LiveCallRouterResponse]] + Response[ErrorsList | LiveCallRouterResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, LiveCallRouterResponse] + 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 3725a19e..fe5ad768 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,18 +11,19 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -82,34 +83,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[LiveCallRouterList]: """List Live Call Routers List Live Call Routers Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,34 +144,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> LiveCallRouterList | None: """List Live Call Routers List Live Call Routers Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -199,34 +200,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[LiveCallRouterList]: """List Live Call Routers List Live Call Routers Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -258,34 +259,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> LiveCallRouterList | None: """List Live Call Routers List Live Call Routers Args: - 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]): + 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): 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 41e988ce..8fd9e6f4 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/live_call_routers/{id}", + "url": "/v1/live_call_routers/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, LiveCallRouterResponse]] + Response[ErrorsList | LiveCallRouterResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, LiveCallRouterResponse] + ErrorsList | LiveCallRouterResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, LiveCallRouterResponse]] + Response[ErrorsList | LiveCallRouterResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, LiveCallRouterResponse] + 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 bf134334..567609c4 100644 --- a/rootly_sdk/api/meeting_recordings/create_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/create_meeting_recording.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote import httpx @@ -15,11 +16,12 @@ def _get_kwargs( incident_id: str, *, - platform: Unset | CreateMeetingRecordingPlatform = UNSET, + platform: CreateMeetingRecordingPlatform | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_platform: Unset | str = UNSET + json_platform: str | Unset = UNSET if not isinstance(platform, Unset): json_platform = platform @@ -29,7 +31,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/incidents/{incident_id}/meeting_recordings", + "url": "/v1/incidents/{incident_id}/meeting_recordings".format( + incident_id=quote(str(incident_id), safe=""), + ), "params": params, } @@ -69,7 +73,7 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - platform: Unset | CreateMeetingRecordingPlatform = UNSET, + platform: CreateMeetingRecordingPlatform | Unset = UNSET, ) -> Response[Any | MeetingRecordingResponse]: """Create meeting recording @@ -79,14 +83,14 @@ def sync_detailed( Args: incident_id (str): - platform (Union[Unset, CreateMeetingRecordingPlatform]): + platform (CreateMeetingRecordingPlatform | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingResponse]] + Response[Any | MeetingRecordingResponse] """ kwargs = _get_kwargs( @@ -105,7 +109,7 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - platform: Unset | CreateMeetingRecordingPlatform = UNSET, + platform: CreateMeetingRecordingPlatform | Unset = UNSET, ) -> Any | MeetingRecordingResponse | None: """Create meeting recording @@ -115,14 +119,14 @@ def sync( Args: incident_id (str): - platform (Union[Unset, CreateMeetingRecordingPlatform]): + platform (CreateMeetingRecordingPlatform | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingResponse] + Any | MeetingRecordingResponse """ return sync_detailed( @@ -136,7 +140,7 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - platform: Unset | CreateMeetingRecordingPlatform = UNSET, + platform: CreateMeetingRecordingPlatform | Unset = UNSET, ) -> Response[Any | MeetingRecordingResponse]: """Create meeting recording @@ -146,14 +150,14 @@ async def asyncio_detailed( Args: incident_id (str): - platform (Union[Unset, CreateMeetingRecordingPlatform]): + platform (CreateMeetingRecordingPlatform | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingResponse]] + Response[Any | MeetingRecordingResponse] """ kwargs = _get_kwargs( @@ -170,7 +174,7 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - platform: Unset | CreateMeetingRecordingPlatform = UNSET, + platform: CreateMeetingRecordingPlatform | Unset = UNSET, ) -> Any | MeetingRecordingResponse | None: """Create meeting recording @@ -180,14 +184,14 @@ async def asyncio( Args: incident_id (str): - platform (Union[Unset, CreateMeetingRecordingPlatform]): + platform (CreateMeetingRecordingPlatform | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingResponse] + 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 80104322..d1b80dd8 100644 --- a/rootly_sdk/api/meeting_recordings/delete_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/delete_meeting_recording.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/meeting_recordings/{id}", + "url": "/v1/meeting_recordings/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -67,7 +71,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingResponse]] + Response[Any | MeetingRecordingResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingResponse] + Any | MeetingRecordingResponse """ return sync_detailed( @@ -126,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingResponse]] + Response[Any | MeetingRecordingResponse] """ kwargs = _get_kwargs( @@ -156,7 +160,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingResponse] + 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 eb3a7026..b673907a 100644 --- a/rootly_sdk/api/meeting_recordings/delete_meeting_recording_video.py +++ b/rootly_sdk/api/meeting_recordings/delete_meeting_recording_video.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/meeting_recordings/{id}/delete_video", + "url": "/v1/meeting_recordings/{id}/delete_video".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -67,7 +71,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingResponse]] + Response[Any | MeetingRecordingResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingResponse] + Any | MeetingRecordingResponse """ return sync_detailed( @@ -126,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingResponse]] + Response[Any | MeetingRecordingResponse] """ kwargs = _get_kwargs( @@ -156,7 +160,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingResponse] + 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 7b359c18..92892c14 100644 --- a/rootly_sdk/api/meeting_recordings/delete_standalone_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/delete_standalone_meeting_recording.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -11,9 +12,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/meeting_recordings/{id}/delete_session", + "url": "/v1/meeting_recordings/{id}/delete_session".format( + id=quote(str(id), safe=""), + ), } 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 c6427f71..a32f12ff 100644 --- a/rootly_sdk/api/meeting_recordings/get_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/get_meeting_recording.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote import httpx @@ -13,11 +14,12 @@ def _get_kwargs( id: str, *, - include: Unset | GetMeetingRecordingInclude = UNSET, + include: GetMeetingRecordingInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -27,7 +29,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/meeting_recordings/{id}", + "url": "/v1/meeting_recordings/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -67,7 +71,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetMeetingRecordingInclude = UNSET, + include: GetMeetingRecordingInclude | Unset = UNSET, ) -> Response[Any | MeetingRecordingResponse]: """Get a meeting recording @@ -76,14 +80,14 @@ def sync_detailed( Args: id (str): - include (Union[Unset, GetMeetingRecordingInclude]): + include (GetMeetingRecordingInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingResponse]] + Response[Any | MeetingRecordingResponse] """ kwargs = _get_kwargs( @@ -102,7 +106,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Unset | GetMeetingRecordingInclude = UNSET, + include: GetMeetingRecordingInclude | Unset = UNSET, ) -> Any | MeetingRecordingResponse | None: """Get a meeting recording @@ -111,14 +115,14 @@ def sync( Args: id (str): - include (Union[Unset, GetMeetingRecordingInclude]): + include (GetMeetingRecordingInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingResponse] + Any | MeetingRecordingResponse """ return sync_detailed( @@ -132,7 +136,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetMeetingRecordingInclude = UNSET, + include: GetMeetingRecordingInclude | Unset = UNSET, ) -> Response[Any | MeetingRecordingResponse]: """Get a meeting recording @@ -141,14 +145,14 @@ async def asyncio_detailed( Args: id (str): - include (Union[Unset, GetMeetingRecordingInclude]): + include (GetMeetingRecordingInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingResponse]] + Response[Any | MeetingRecordingResponse] """ kwargs = _get_kwargs( @@ -165,7 +169,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Unset | GetMeetingRecordingInclude = UNSET, + include: GetMeetingRecordingInclude | Unset = UNSET, ) -> Any | MeetingRecordingResponse | None: """Get a meeting recording @@ -174,14 +178,14 @@ async def asyncio( Args: id (str): - include (Union[Unset, GetMeetingRecordingInclude]): + include (GetMeetingRecordingInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingResponse] + 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 2eac11ac..121345b4 100644 --- a/rootly_sdk/api/meeting_recordings/import_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/import_meeting_recording.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote import httpx @@ -7,22 +8,25 @@ from ...client import AuthenticatedClient, Client from ...models.import_meeting_recording import ImportMeetingRecording from ...models.meeting_recording_response import MeetingRecordingResponse -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( incident_id: str, *, - body: ImportMeetingRecording, + body: ImportMeetingRecording | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/incidents/{incident_id}/meeting_recordings/import", + "url": "/v1/incidents/{incident_id}/meeting_recordings/import".format( + incident_id=quote(str(incident_id), safe=""), + ), } - _kwargs["json"] = body.to_dict() + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -63,7 +67,7 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - body: ImportMeetingRecording, + body: ImportMeetingRecording | Unset = UNSET, ) -> Response[Any | MeetingRecordingResponse]: """Import a meeting recording @@ -74,14 +78,14 @@ def sync_detailed( Args: incident_id (str): - body (ImportMeetingRecording): + body (ImportMeetingRecording | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingResponse]] + Response[Any | MeetingRecordingResponse] """ kwargs = _get_kwargs( @@ -100,7 +104,7 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - body: ImportMeetingRecording, + body: ImportMeetingRecording | Unset = UNSET, ) -> Any | MeetingRecordingResponse | None: """Import a meeting recording @@ -111,14 +115,14 @@ def sync( Args: incident_id (str): - body (ImportMeetingRecording): + body (ImportMeetingRecording | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingResponse] + Any | MeetingRecordingResponse """ return sync_detailed( @@ -132,7 +136,7 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - body: ImportMeetingRecording, + body: ImportMeetingRecording | Unset = UNSET, ) -> Response[Any | MeetingRecordingResponse]: """Import a meeting recording @@ -143,14 +147,14 @@ async def asyncio_detailed( Args: incident_id (str): - body (ImportMeetingRecording): + body (ImportMeetingRecording | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingResponse]] + Response[Any | MeetingRecordingResponse] """ kwargs = _get_kwargs( @@ -167,7 +171,7 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - body: ImportMeetingRecording, + body: ImportMeetingRecording | Unset = UNSET, ) -> Any | MeetingRecordingResponse | None: """Import a meeting recording @@ -178,14 +182,14 @@ async def asyncio( Args: incident_id (str): - body (ImportMeetingRecording): + body (ImportMeetingRecording | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingResponse] + 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 a1766945..1e6a2067 100644 --- a/rootly_sdk/api/meeting_recordings/leave_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/leave_meeting_recording.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/meeting_recordings/{id}/leave", + "url": "/v1/meeting_recordings/{id}/leave".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingResponse]] + Response[Any | MeetingRecordingResponse] """ kwargs = _get_kwargs( @@ -101,7 +105,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingResponse] + Any | MeetingRecordingResponse """ return sync_detailed( @@ -129,7 +133,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingResponse]] + Response[Any | MeetingRecordingResponse] """ kwargs = _get_kwargs( @@ -160,7 +164,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingResponse] + 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 728c67b1..65341cd2 100644 --- a/rootly_sdk/api/meeting_recordings/list_all_meeting_recordings.py +++ b/rootly_sdk/api/meeting_recordings/list_all_meeting_recordings.py @@ -11,10 +11,11 @@ def _get_kwargs( *, - status: Unset | str = UNSET, - platform: Unset | str = UNSET, - created_by: Unset | str = UNSET, + status: str | Unset = UNSET, + platform: str | Unset = UNSET, + created_by: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["status"] = status @@ -60,9 +61,9 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - status: Unset | str = UNSET, - platform: Unset | str = UNSET, - created_by: Unset | str = UNSET, + status: str | Unset = UNSET, + platform: str | Unset = UNSET, + created_by: str | Unset = UNSET, ) -> Response[MeetingRecordingList]: """List all meeting recordings @@ -71,9 +72,9 @@ def sync_detailed( created_by. Args: - status (Union[Unset, str]): - platform (Union[Unset, str]): - created_by (Union[Unset, str]): + status (str | Unset): + platform (str | Unset): + created_by (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -99,9 +100,9 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - status: Unset | str = UNSET, - platform: Unset | str = UNSET, - created_by: Unset | str = UNSET, + status: str | Unset = UNSET, + platform: str | Unset = UNSET, + created_by: str | Unset = UNSET, ) -> MeetingRecordingList | None: """List all meeting recordings @@ -110,9 +111,9 @@ def sync( created_by. Args: - status (Union[Unset, str]): - platform (Union[Unset, str]): - created_by (Union[Unset, str]): + status (str | Unset): + platform (str | Unset): + created_by (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -133,9 +134,9 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - status: Unset | str = UNSET, - platform: Unset | str = UNSET, - created_by: Unset | str = UNSET, + status: str | Unset = UNSET, + platform: str | Unset = UNSET, + created_by: str | Unset = UNSET, ) -> Response[MeetingRecordingList]: """List all meeting recordings @@ -144,9 +145,9 @@ async def asyncio_detailed( created_by. Args: - status (Union[Unset, str]): - platform (Union[Unset, str]): - created_by (Union[Unset, str]): + status (str | Unset): + platform (str | Unset): + created_by (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -170,9 +171,9 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - status: Unset | str = UNSET, - platform: Unset | str = UNSET, - created_by: Unset | str = UNSET, + status: str | Unset = UNSET, + platform: str | Unset = UNSET, + created_by: str | Unset = UNSET, ) -> MeetingRecordingList | None: """List all meeting recordings @@ -181,9 +182,9 @@ async def asyncio( created_by. Args: - status (Union[Unset, str]): - platform (Union[Unset, str]): - created_by (Union[Unset, str]): + status (str | Unset): + platform (str | Unset): + created_by (str | Unset): 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 834d62fc..891b4d58 100644 --- a/rootly_sdk/api/meeting_recordings/list_meeting_recordings.py +++ b/rootly_sdk/api/meeting_recordings/list_meeting_recordings.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote import httpx @@ -12,9 +13,10 @@ def _get_kwargs( incident_id: str, *, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -25,7 +27,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/incidents/{incident_id}/meeting_recordings", + "url": "/v1/incidents/{incident_id}/meeting_recordings".format( + incident_id=quote(str(incident_id), safe=""), + ), "params": params, } @@ -65,8 +69,8 @@ def sync_detailed( incident_id: str, *, client: AuthenticatedClient, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[Any | MeetingRecordingList]: """List meeting recordings @@ -75,15 +79,15 @@ def sync_detailed( Args: incident_id (str): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingList]] + Response[Any | MeetingRecordingList] """ kwargs = _get_kwargs( @@ -103,8 +107,8 @@ def sync( incident_id: str, *, client: AuthenticatedClient, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Any | MeetingRecordingList | None: """List meeting recordings @@ -113,15 +117,15 @@ def sync( Args: incident_id (str): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingList] + Any | MeetingRecordingList """ return sync_detailed( @@ -136,8 +140,8 @@ async def asyncio_detailed( incident_id: str, *, client: AuthenticatedClient, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[Any | MeetingRecordingList]: """List meeting recordings @@ -146,15 +150,15 @@ async def asyncio_detailed( Args: incident_id (str): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingList]] + Response[Any | MeetingRecordingList] """ kwargs = _get_kwargs( @@ -172,8 +176,8 @@ async def asyncio( incident_id: str, *, client: AuthenticatedClient, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Any | MeetingRecordingList | None: """List meeting recordings @@ -182,15 +186,15 @@ async def asyncio( Args: incident_id (str): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingList] + 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 85dce15f..ad7f07dc 100644 --- a/rootly_sdk/api/meeting_recordings/pause_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/pause_meeting_recording.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/meeting_recordings/{id}/pause", + "url": "/v1/meeting_recordings/{id}/pause".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -67,7 +71,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingResponse]] + Response[Any | MeetingRecordingResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingResponse] + Any | MeetingRecordingResponse """ return sync_detailed( @@ -126,7 +130,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingResponse]] + Response[Any | MeetingRecordingResponse] """ kwargs = _get_kwargs( @@ -156,7 +160,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingResponse] + 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 f1370763..867ec697 100644 --- a/rootly_sdk/api/meeting_recordings/resume_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/resume_meeting_recording.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/meeting_recordings/{id}/resume", + "url": "/v1/meeting_recordings/{id}/resume".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -66,7 +70,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingResponse]] + Response[Any | MeetingRecordingResponse] """ kwargs = _get_kwargs( @@ -97,7 +101,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingResponse] + Any | MeetingRecordingResponse """ return sync_detailed( @@ -123,7 +127,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingResponse]] + Response[Any | MeetingRecordingResponse] """ kwargs = _get_kwargs( @@ -152,7 +156,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingResponse] + 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 0c4149b1..21addcf5 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 Response +from ...types import UNSET, Response, Unset def _get_kwargs( *, - body: StartSessionRequest, + body: StartSessionRequest | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -21,7 +21,8 @@ def _get_kwargs( "url": "/v1/meeting_recordings/start_session", } - _kwargs["json"] = body.to_dict() + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -61,7 +62,7 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - body: StartSessionRequest, + body: StartSessionRequest | Unset = UNSET, ) -> Response[Any | StartSessionResponse]: """Start a recording session @@ -70,14 +71,14 @@ def sync_detailed( client. Args: - body (StartSessionRequest): + body (StartSessionRequest | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, StartSessionResponse]] + Response[Any | StartSessionResponse] """ kwargs = _get_kwargs( @@ -94,7 +95,7 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: StartSessionRequest, + body: StartSessionRequest | Unset = UNSET, ) -> Any | StartSessionResponse | None: """Start a recording session @@ -103,14 +104,14 @@ def sync( client. Args: - body (StartSessionRequest): + body (StartSessionRequest | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, StartSessionResponse] + Any | StartSessionResponse """ return sync_detailed( @@ -122,7 +123,7 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: StartSessionRequest, + body: StartSessionRequest | Unset = UNSET, ) -> Response[Any | StartSessionResponse]: """Start a recording session @@ -131,14 +132,14 @@ async def asyncio_detailed( client. Args: - body (StartSessionRequest): + body (StartSessionRequest | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, StartSessionResponse]] + Response[Any | StartSessionResponse] """ kwargs = _get_kwargs( @@ -153,7 +154,7 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: StartSessionRequest, + body: StartSessionRequest | Unset = UNSET, ) -> Any | StartSessionResponse | None: """Start a recording session @@ -162,14 +163,14 @@ async def asyncio( client. Args: - body (StartSessionRequest): + body (StartSessionRequest | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, StartSessionResponse] + 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 6254c41e..4b59b83a 100644 --- a/rootly_sdk/api/meeting_recordings/stop_meeting_recording.py +++ b/rootly_sdk/api/meeting_recordings/stop_meeting_recording.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/meeting_recordings/{id}/stop", + "url": "/v1/meeting_recordings/{id}/stop".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingResponse]] + Response[Any | MeetingRecordingResponse] """ kwargs = _get_kwargs( @@ -101,7 +105,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingResponse] + Any | MeetingRecordingResponse """ return sync_detailed( @@ -129,7 +133,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, MeetingRecordingResponse]] + Response[Any | MeetingRecordingResponse] """ kwargs = _get_kwargs( @@ -160,7 +164,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, MeetingRecordingResponse] + 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 983d83f1..cf078832 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[Union[ErrorsList, OnCallPayReportResponse]] + Response[ErrorsList | OnCallPayReportResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallPayReportResponse] + 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[Union[ErrorsList, OnCallPayReportResponse]] + Response[ErrorsList | OnCallPayReportResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallPayReportResponse] + 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 99a0722e..e367d8f4 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,8 +14,9 @@ def _get_kwargs( id: str, *, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -23,7 +25,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/on_call_pay_reports/{id}", + "url": "/v1/on_call_pay_reports/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -64,7 +68,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> Response[ErrorsList | OnCallPayReportResponse]: """Retrieves an On-Call Pay Report @@ -72,14 +76,14 @@ def sync_detailed( Args: id (str): - include (Union[Unset, str]): + include (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallPayReportResponse]] + Response[ErrorsList | OnCallPayReportResponse] """ kwargs = _get_kwargs( @@ -98,7 +102,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> ErrorsList | OnCallPayReportResponse | None: """Retrieves an On-Call Pay Report @@ -106,14 +110,14 @@ def sync( Args: id (str): - include (Union[Unset, str]): + include (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallPayReportResponse] + ErrorsList | OnCallPayReportResponse """ return sync_detailed( @@ -127,7 +131,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> Response[ErrorsList | OnCallPayReportResponse]: """Retrieves an On-Call Pay Report @@ -135,14 +139,14 @@ async def asyncio_detailed( Args: id (str): - include (Union[Unset, str]): + include (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallPayReportResponse]] + Response[ErrorsList | OnCallPayReportResponse] """ kwargs = _get_kwargs( @@ -159,7 +163,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> ErrorsList | OnCallPayReportResponse | None: """Retrieves an On-Call Pay Report @@ -167,14 +171,14 @@ async def asyncio( Args: id (str): - include (Union[Unset, str]): + include (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallPayReportResponse] + 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 787eb8cf..b365e4b4 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,15 +11,16 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -73,28 +74,28 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[OnCallPayReportList]: """List On-Call Pay Reports List on-call pay reports Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -125,28 +126,28 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> OnCallPayReportList | None: """List On-Call Pay Reports List on-call pay reports Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -172,28 +173,28 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[OnCallPayReportList]: """List On-Call Pay Reports List on-call pay reports Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -222,28 +223,28 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> OnCallPayReportList | None: """List On-Call Pay Reports List on-call pay reports Args: - 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]): + 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): 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 759b2879..a1d72c27 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/on_call_pay_reports/{id}/regenerate", + "url": "/v1/on_call_pay_reports/{id}/regenerate".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallPayReportResponse]] + Response[ErrorsList | OnCallPayReportResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallPayReportResponse] + ErrorsList | OnCallPayReportResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallPayReportResponse]] + Response[ErrorsList | OnCallPayReportResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallPayReportResponse] + 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 b65dc22c..7939e005 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/on_call_pay_reports/{id}", + "url": "/v1/on_call_pay_reports/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallPayReportResponse]] + Response[ErrorsList | OnCallPayReportResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallPayReportResponse] + ErrorsList | OnCallPayReportResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallPayReportResponse]] + Response[ErrorsList | OnCallPayReportResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallPayReportResponse] + 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 5ad769b9..322f9107 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[Union[ErrorsList, OnCallRoleResponse]] + Response[ErrorsList | OnCallRoleResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallRoleResponse] + 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[Union[ErrorsList, OnCallRoleResponse]] + Response[ErrorsList | OnCallRoleResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallRoleResponse] + 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 e01d7f37..3fe85371 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/on_call_roles/{id}", + "url": "/v1/on_call_roles/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallRoleResponse]] + Response[ErrorsList | OnCallRoleResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallRoleResponse] + ErrorsList | OnCallRoleResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallRoleResponse]] + Response[ErrorsList | OnCallRoleResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallRoleResponse] + 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 c796b0f9..b58a3457 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/on_call_roles/{id}", + "url": "/v1/on_call_roles/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallRoleResponse]] + Response[ErrorsList | OnCallRoleResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallRoleResponse] + ErrorsList | OnCallRoleResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallRoleResponse]] + Response[ErrorsList | OnCallRoleResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallRoleResponse] + 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 8b175ca8..cee91de5 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,18 +11,19 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -82,34 +83,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[OnCallRoleList]: """List On-Call Roles List On-Call Roles Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,34 +144,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> OnCallRoleList | None: """List On-Call Roles List On-Call Roles Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -199,34 +200,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[OnCallRoleList]: """List On-Call Roles List On-Call Roles Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -258,34 +259,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> OnCallRoleList | None: """List On-Call Roles List On-Call Roles Args: - 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]): + 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): 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 97cfb572..9fc73101 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/on_call_roles/{id}", + "url": "/v1/on_call_roles/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallRoleResponse]] + Response[ErrorsList | OnCallRoleResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallRoleResponse] + ErrorsList | OnCallRoleResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallRoleResponse]] + Response[ErrorsList | OnCallRoleResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallRoleResponse] + 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 06292c4b..e1038ade 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/schedules/{schedule_id}/on_call_shadows", + "url": "/v1/schedules/{schedule_id}/on_call_shadows".format( + schedule_id=quote(str(schedule_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallShadowResponse]] + Response[ErrorsList | OnCallShadowResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallShadowResponse] + ErrorsList | OnCallShadowResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallShadowResponse]] + Response[ErrorsList | OnCallShadowResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallShadowResponse] + 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 33c9d5e0..3892b844 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/on_call_shadows/{id}", + "url": "/v1/on_call_shadows/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallShadowResponse]] + Response[ErrorsList | OnCallShadowResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallShadowResponse] + ErrorsList | OnCallShadowResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallShadowResponse]] + Response[ErrorsList | OnCallShadowResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallShadowResponse] + 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 4f6a4101..310cdcf4 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( schedule_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/schedules/{schedule_id}/on_call_shadows", + "url": "/v1/schedules/{schedule_id}/on_call_shadows".format( + schedule_id=quote(str(schedule_id), safe=""), + ), "params": params, } @@ -60,9 +64,9 @@ def sync_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[OnCallShadowsList]: """List On Call Shadows for Shift @@ -70,9 +74,9 @@ def sync_detailed( Args: schedule_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -100,9 +104,9 @@ def sync( schedule_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> OnCallShadowsList | None: """List On Call Shadows for Shift @@ -110,9 +114,9 @@ def sync( Args: schedule_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -135,9 +139,9 @@ async def asyncio_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[OnCallShadowsList]: """List On Call Shadows for Shift @@ -145,9 +149,9 @@ async def asyncio_detailed( Args: schedule_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -173,9 +177,9 @@ async def asyncio( schedule_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> OnCallShadowsList | None: """List On Call Shadows for Shift @@ -183,9 +187,9 @@ async def asyncio( Args: schedule_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 c053d8a2..cbaeedb7 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/on_call_shadows/{id}", + "url": "/v1/on_call_shadows/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallShadowResponse]] + Response[ErrorsList | OnCallShadowResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallShadowResponse] + ErrorsList | OnCallShadowResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallShadowResponse]] + Response[ErrorsList | OnCallShadowResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallShadowResponse] + ErrorsList | OnCallShadowResponse """ return ( diff --git a/rootly_sdk/api/on_calls/list_oncalls.py b/rootly_sdk/api/on_calls/list_oncalls.py index 3429aedd..4d9fca2e 100644 --- a/rootly_sdk/api/on_calls/list_oncalls.py +++ b/rootly_sdk/api/on_calls/list_oncalls.py @@ -13,21 +13,22 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -102,17 +103,17 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[ErrorsList | OncallList]: """List on-calls @@ -120,24 +121,24 @@ def sync_detailed( Returns on-call entries grouped by escalation policy level. Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns 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, OncallList]] + Response[ErrorsList | OncallList] """ kwargs = _get_kwargs( @@ -164,17 +165,17 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> ErrorsList | OncallList | None: """List on-calls @@ -182,24 +183,24 @@ def sync( Returns on-call entries grouped by escalation policy level. Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server 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, OncallList] + ErrorsList | OncallList """ return sync_detailed( @@ -221,17 +222,17 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[ErrorsList | OncallList]: """List on-calls @@ -239,24 +240,24 @@ async def asyncio_detailed( Returns on-call entries grouped by escalation policy level. Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns 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, OncallList]] + Response[ErrorsList | OncallList] """ kwargs = _get_kwargs( @@ -281,17 +282,17 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> ErrorsList | OncallList | None: """List on-calls @@ -299,24 +300,24 @@ async def asyncio( Returns on-call entries grouped by escalation policy level. Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server 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, OncallList] + 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 53a40917..ec336dd4 100644 --- a/rootly_sdk/api/override_shifts/create_override_shift.py +++ b/rootly_sdk/api/override_shifts/create_override_shift.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/schedules/{schedule_id}/override_shifts", + "url": "/v1/schedules/{schedule_id}/override_shifts".format( + schedule_id=quote(str(schedule_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -93,7 +96,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OverrideShiftResponse]] + Response[ErrorsList | OverrideShiftResponse] """ kwargs = _get_kwargs( @@ -130,7 +133,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OverrideShiftResponse] + ErrorsList | OverrideShiftResponse """ return sync_detailed( @@ -162,7 +165,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OverrideShiftResponse]] + Response[ErrorsList | OverrideShiftResponse] """ kwargs = _get_kwargs( @@ -197,7 +200,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OverrideShiftResponse] + 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 5c08cc93..ee1f2e0d 100644 --- a/rootly_sdk/api/override_shifts/delete_on_call_shadow.py +++ b/rootly_sdk/api/override_shifts/delete_on_call_shadow.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/on_call_shadows/{id}", + "url": "/v1/on_call_shadows/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -74,7 +78,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallShadowResponse]] + Response[ErrorsList | OnCallShadowResponse] """ kwargs = _get_kwargs( @@ -106,7 +110,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallShadowResponse] + ErrorsList | OnCallShadowResponse """ return sync_detailed( @@ -133,7 +137,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OnCallShadowResponse]] + Response[ErrorsList | OnCallShadowResponse] """ kwargs = _get_kwargs( @@ -163,7 +167,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OnCallShadowResponse] + 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 cb4a3e9c..200bc1a1 100644 --- a/rootly_sdk/api/override_shifts/delete_override_shift.py +++ b/rootly_sdk/api/override_shifts/delete_override_shift.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/override_shifts/{id}", + "url": "/v1/override_shifts/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OverrideShiftResponse]] + Response[ErrorsList | OverrideShiftResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OverrideShiftResponse] + ErrorsList | OverrideShiftResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OverrideShiftResponse]] + Response[ErrorsList | OverrideShiftResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OverrideShiftResponse] + 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 945033d2..1116f33d 100644 --- a/rootly_sdk/api/override_shifts/get_override_shift.py +++ b/rootly_sdk/api/override_shifts/get_override_shift.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/override_shifts/{id}", + "url": "/v1/override_shifts/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OverrideShiftResponse]] + Response[ErrorsList | OverrideShiftResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OverrideShiftResponse] + ErrorsList | OverrideShiftResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OverrideShiftResponse]] + Response[ErrorsList | OverrideShiftResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OverrideShiftResponse] + 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 778a806c..8370ff93 100644 --- a/rootly_sdk/api/override_shifts/list_override_shifts.py +++ b/rootly_sdk/api/override_shifts/list_override_shifts.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( schedule_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/schedules/{schedule_id}/override_shifts", + "url": "/v1/schedules/{schedule_id}/override_shifts".format( + schedule_id=quote(str(schedule_id), safe=""), + ), "params": params, } @@ -60,9 +64,9 @@ def sync_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[OverrideShiftList]: """List override shifts @@ -70,9 +74,9 @@ def sync_detailed( Args: schedule_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -100,9 +104,9 @@ def sync( schedule_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> OverrideShiftList | None: """List override shifts @@ -110,9 +114,9 @@ def sync( Args: schedule_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -135,9 +139,9 @@ async def asyncio_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[OverrideShiftList]: """List override shifts @@ -145,9 +149,9 @@ async def asyncio_detailed( Args: schedule_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -173,9 +177,9 @@ async def asyncio( schedule_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> OverrideShiftList | None: """List override shifts @@ -183,9 +187,9 @@ async def asyncio( Args: schedule_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 1d51fe99..3f692427 100644 --- a/rootly_sdk/api/override_shifts/update_override_shift.py +++ b/rootly_sdk/api/override_shifts/update_override_shift.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/override_shifts/{id}", + "url": "/v1/override_shifts/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OverrideShiftResponse]] + Response[ErrorsList | OverrideShiftResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OverrideShiftResponse] + ErrorsList | OverrideShiftResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, OverrideShiftResponse]] + Response[ErrorsList | OverrideShiftResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, OverrideShiftResponse] + 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 1d183cf4..4589a663 100644 --- a/rootly_sdk/api/playbook_tasks/create_playbook_task.py +++ b/rootly_sdk/api/playbook_tasks/create_playbook_task.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/playbooks/{playbook_id}/playbook_tasks", + "url": "/v1/playbooks/{playbook_id}/playbook_tasks".format( + playbook_id=quote(str(playbook_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PlaybookTaskResponse]] + Response[ErrorsList | PlaybookTaskResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PlaybookTaskResponse] + ErrorsList | PlaybookTaskResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PlaybookTaskResponse]] + Response[ErrorsList | PlaybookTaskResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PlaybookTaskResponse] + 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 6b25e8b3..9c9328d4 100644 --- a/rootly_sdk/api/playbook_tasks/delete_playbook_task.py +++ b/rootly_sdk/api/playbook_tasks/delete_playbook_task.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/playbook_tasks/{id}", + "url": "/v1/playbook_tasks/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PlaybookTaskResponse]] + Response[ErrorsList | PlaybookTaskResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PlaybookTaskResponse] + ErrorsList | PlaybookTaskResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PlaybookTaskResponse]] + Response[ErrorsList | PlaybookTaskResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PlaybookTaskResponse] + 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 1caa8d23..415605da 100644 --- a/rootly_sdk/api/playbook_tasks/get_playbook_task.py +++ b/rootly_sdk/api/playbook_tasks/get_playbook_task.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/playbook_tasks/{id}", + "url": "/v1/playbook_tasks/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PlaybookTaskResponse]] + Response[ErrorsList | PlaybookTaskResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PlaybookTaskResponse] + ErrorsList | PlaybookTaskResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PlaybookTaskResponse]] + Response[ErrorsList | PlaybookTaskResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PlaybookTaskResponse] + 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 7c9aad1c..cc9e0fa2 100644 --- a/rootly_sdk/api/playbook_tasks/list_playbook_tasks.py +++ b/rootly_sdk/api/playbook_tasks/list_playbook_tasks.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( playbook_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/playbooks/{playbook_id}/playbook_tasks", + "url": "/v1/playbooks/{playbook_id}/playbook_tasks".format( + playbook_id=quote(str(playbook_id), safe=""), + ), "params": params, } @@ -60,9 +64,9 @@ def sync_detailed( playbook_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[PlaybookTaskList]: """List playbook tasks @@ -70,9 +74,9 @@ def sync_detailed( Args: playbook_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -100,9 +104,9 @@ def sync( playbook_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> PlaybookTaskList | None: """List playbook tasks @@ -110,9 +114,9 @@ def sync( Args: playbook_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -135,9 +139,9 @@ async def asyncio_detailed( playbook_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[PlaybookTaskList]: """List playbook tasks @@ -145,9 +149,9 @@ async def asyncio_detailed( Args: playbook_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -173,9 +177,9 @@ async def asyncio( playbook_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> PlaybookTaskList | None: """List playbook tasks @@ -183,9 +187,9 @@ async def asyncio( Args: playbook_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 11903b62..b84699b6 100644 --- a/rootly_sdk/api/playbook_tasks/update_playbook_task.py +++ b/rootly_sdk/api/playbook_tasks/update_playbook_task.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/playbook_tasks/{id}", + "url": "/v1/playbook_tasks/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PlaybookTaskResponse]] + Response[ErrorsList | PlaybookTaskResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PlaybookTaskResponse] + ErrorsList | PlaybookTaskResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PlaybookTaskResponse]] + Response[ErrorsList | PlaybookTaskResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PlaybookTaskResponse] + ErrorsList | PlaybookTaskResponse """ return ( diff --git a/rootly_sdk/api/playbooks/create_playbook.py b/rootly_sdk/api/playbooks/create_playbook.py index ca3ebc8c..cee3273e 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[Union[ErrorsList, PlaybookResponse]] + Response[ErrorsList | PlaybookResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PlaybookResponse] + 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[Union[ErrorsList, PlaybookResponse]] + Response[ErrorsList | PlaybookResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PlaybookResponse] + ErrorsList | PlaybookResponse """ return ( diff --git a/rootly_sdk/api/playbooks/delete_playbook.py b/rootly_sdk/api/playbooks/delete_playbook.py index 5ef76845..f666eef3 100644 --- a/rootly_sdk/api/playbooks/delete_playbook.py +++ b/rootly_sdk/api/playbooks/delete_playbook.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/playbooks/{id}", + "url": "/v1/playbooks/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PlaybookResponse]] + Response[ErrorsList | PlaybookResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PlaybookResponse] + ErrorsList | PlaybookResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PlaybookResponse]] + Response[ErrorsList | PlaybookResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PlaybookResponse] + ErrorsList | PlaybookResponse """ return ( diff --git a/rootly_sdk/api/playbooks/get_playbook.py b/rootly_sdk/api/playbooks/get_playbook.py index 8d8dcb9c..7faea0c0 100644 --- a/rootly_sdk/api/playbooks/get_playbook.py +++ b/rootly_sdk/api/playbooks/get_playbook.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -14,11 +15,12 @@ def _get_kwargs( id: str, *, - include: Unset | GetPlaybookInclude = UNSET, + include: GetPlaybookInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/playbooks/{id}", + "url": "/v1/playbooks/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -69,7 +73,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetPlaybookInclude = UNSET, + include: GetPlaybookInclude | Unset = UNSET, ) -> Response[ErrorsList | PlaybookResponse]: """Retrieves a playbook @@ -77,14 +81,14 @@ def sync_detailed( Args: id (str): - include (Union[Unset, GetPlaybookInclude]): + include (GetPlaybookInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PlaybookResponse]] + Response[ErrorsList | PlaybookResponse] """ kwargs = _get_kwargs( @@ -103,7 +107,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Unset | GetPlaybookInclude = UNSET, + include: GetPlaybookInclude | Unset = UNSET, ) -> ErrorsList | PlaybookResponse | None: """Retrieves a playbook @@ -111,14 +115,14 @@ def sync( Args: id (str): - include (Union[Unset, GetPlaybookInclude]): + include (GetPlaybookInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PlaybookResponse] + ErrorsList | PlaybookResponse """ return sync_detailed( @@ -132,7 +136,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetPlaybookInclude = UNSET, + include: GetPlaybookInclude | Unset = UNSET, ) -> Response[ErrorsList | PlaybookResponse]: """Retrieves a playbook @@ -140,14 +144,14 @@ async def asyncio_detailed( Args: id (str): - include (Union[Unset, GetPlaybookInclude]): + include (GetPlaybookInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PlaybookResponse]] + Response[ErrorsList | PlaybookResponse] """ kwargs = _get_kwargs( @@ -164,7 +168,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Unset | GetPlaybookInclude = UNSET, + include: GetPlaybookInclude | Unset = UNSET, ) -> ErrorsList | PlaybookResponse | None: """Retrieves a playbook @@ -172,14 +176,14 @@ async def asyncio( Args: id (str): - include (Union[Unset, GetPlaybookInclude]): + include (GetPlaybookInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PlaybookResponse] + ErrorsList | PlaybookResponse """ return ( diff --git a/rootly_sdk/api/playbooks/list_playbooks.py b/rootly_sdk/api/playbooks/list_playbooks.py index e7ba8cb3..0326a21d 100644 --- a/rootly_sdk/api/playbooks/list_playbooks.py +++ b/rootly_sdk/api/playbooks/list_playbooks.py @@ -12,13 +12,14 @@ def _get_kwargs( *, - include: Unset | ListPlaybooksInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListPlaybooksInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -63,18 +64,18 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: Unset | ListPlaybooksInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListPlaybooksInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[PlaybookList]: """List playbooks List playbooks Args: - include (Union[Unset, ListPlaybooksInclude]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (ListPlaybooksInclude | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -100,18 +101,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Unset | ListPlaybooksInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListPlaybooksInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> PlaybookList | None: """List playbooks List playbooks Args: - include (Union[Unset, ListPlaybooksInclude]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (ListPlaybooksInclude | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -132,18 +133,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Unset | ListPlaybooksInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListPlaybooksInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[PlaybookList]: """List playbooks List playbooks Args: - include (Union[Unset, ListPlaybooksInclude]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (ListPlaybooksInclude | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -167,18 +168,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Unset | ListPlaybooksInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListPlaybooksInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> PlaybookList | None: """List playbooks List playbooks Args: - include (Union[Unset, ListPlaybooksInclude]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (ListPlaybooksInclude | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 06bf4a5e..9fe8a131 100644 --- a/rootly_sdk/api/playbooks/update_playbook.py +++ b/rootly_sdk/api/playbooks/update_playbook.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/playbooks/{id}", + "url": "/v1/playbooks/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PlaybookResponse]] + Response[ErrorsList | PlaybookResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PlaybookResponse] + ErrorsList | PlaybookResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PlaybookResponse]] + Response[ErrorsList | PlaybookResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PlaybookResponse] + ErrorsList | PlaybookResponse """ return ( diff --git a/rootly_sdk/api/private_agents/__init__.py b/rootly_sdk/api/private_agents/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/rootly_sdk/api/private_agents/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/rootly_sdk/api/private_agents/create_private_agent_enrollment_token.py b/rootly_sdk/api/private_agents/create_private_agent_enrollment_token.py new file mode 100644 index 00000000..fe5e214c --- /dev/null +++ b/rootly_sdk/api/private_agents/create_private_agent_enrollment_token.py @@ -0,0 +1,160 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.private_agent_enrollment_token_response import PrivateAgentEnrollmentTokenResponse +from ...types import Response + + +def _get_kwargs() -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/private_agents/enrollment_tokens", + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | PrivateAgentEnrollmentTokenResponse | None: + if response.status_code == 201: + response_201 = PrivateAgentEnrollmentTokenResponse.from_dict(response.json()) + + return response_201 + + if response.status_code == 401: + response_401 = cast(Any, None) + return response_401 + + if response.status_code == 404: + response_404 = cast(Any, None) + 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[Any | PrivateAgentEnrollmentTokenResponse]: + 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[Any | PrivateAgentEnrollmentTokenResponse]: + """Create a one-time token for agent enrollment + + Issue a one-time token valid for 24 hours. No request body is required. Requires Private Agent + management permission plus the Private Agents and AI SRE features. The agent uses this token for + gRPC Enroll; the agent record is created on enrollment, not by this request. The plaintext is + returned only here and is not recoverable. Repeated requests issue distinct tokens; this endpoint is + not idempotent. + + Raises: + errors.UnexpectedStatus: If the server returns 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 | PrivateAgentEnrollmentTokenResponse] + """ + + kwargs = _get_kwargs() + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, +) -> Any | PrivateAgentEnrollmentTokenResponse | None: + """Create a one-time token for agent enrollment + + Issue a one-time token valid for 24 hours. No request body is required. Requires Private Agent + management permission plus the Private Agents and AI SRE features. The agent uses this token for + gRPC Enroll; the agent record is created on enrollment, not by this request. The plaintext is + returned only here and is not recoverable. Repeated requests issue distinct tokens; this endpoint is + not idempotent. + + Raises: + errors.UnexpectedStatus: If the server 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 | PrivateAgentEnrollmentTokenResponse + """ + + return sync_detailed( + client=client, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, +) -> Response[Any | PrivateAgentEnrollmentTokenResponse]: + """Create a one-time token for agent enrollment + + Issue a one-time token valid for 24 hours. No request body is required. Requires Private Agent + management permission plus the Private Agents and AI SRE features. The agent uses this token for + gRPC Enroll; the agent record is created on enrollment, not by this request. The plaintext is + returned only here and is not recoverable. Repeated requests issue distinct tokens; this endpoint is + not idempotent. + + Raises: + errors.UnexpectedStatus: If the server returns 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 | PrivateAgentEnrollmentTokenResponse] + """ + + kwargs = _get_kwargs() + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, +) -> Any | PrivateAgentEnrollmentTokenResponse | None: + """Create a one-time token for agent enrollment + + Issue a one-time token valid for 24 hours. No request body is required. Requires Private Agent + management permission plus the Private Agents and AI SRE features. The agent uses this token for + gRPC Enroll; the agent record is created on enrollment, not by this request. The plaintext is + returned only here and is not recoverable. Repeated requests issue distinct tokens; this endpoint is + not idempotent. + + Raises: + errors.UnexpectedStatus: If the server 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 | PrivateAgentEnrollmentTokenResponse + """ + + return ( + await asyncio_detailed( + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/private_agents/get_private_agent.py b/rootly_sdk/api/private_agents/get_private_agent.py new file mode 100644 index 00000000..3895925e --- /dev/null +++ b/rootly_sdk/api/private_agents/get_private_agent.py @@ -0,0 +1,180 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.private_agent_response import PrivateAgentResponse +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/private_agents/{id}".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | PrivateAgentResponse | None: + if response.status_code == 200: + response_200 = PrivateAgentResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 401: + response_401 = cast(Any, None) + return response_401 + + if response.status_code == 404: + response_404 = cast(Any, None) + 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[Any | PrivateAgentResponse]: + 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: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any | PrivateAgentResponse]: + """Get private agent + + Return provider inventory and last-reported health for one agent. Requires Private Agent read + permission plus the Private Agents and AI SRE features. Credentials and capability schemas are never + returned. + + Args: + id (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[Any | PrivateAgentResponse] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, +) -> Any | PrivateAgentResponse | None: + """Get private agent + + Return provider inventory and last-reported health for one agent. Requires Private Agent read + permission plus the Private Agents and AI SRE features. Credentials and capability schemas are never + returned. + + Args: + id (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: + Any | PrivateAgentResponse + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any | PrivateAgentResponse]: + """Get private agent + + Return provider inventory and last-reported health for one agent. Requires Private Agent read + permission plus the Private Agents and AI SRE features. Credentials and capability schemas are never + returned. + + Args: + id (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[Any | PrivateAgentResponse] + """ + + 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: UUID, + *, + client: AuthenticatedClient, +) -> Any | PrivateAgentResponse | None: + """Get private agent + + Return provider inventory and last-reported health for one agent. Requires Private Agent read + permission plus the Private Agents and AI SRE features. Credentials and capability schemas are never + returned. + + Args: + id (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: + Any | PrivateAgentResponse + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/private_agents/list_private_agents.py b/rootly_sdk/api/private_agents/list_private_agents.py new file mode 100644 index 00000000..1b6f5e60 --- /dev/null +++ b/rootly_sdk/api/private_agents/list_private_agents.py @@ -0,0 +1,197 @@ +from http import HTTPStatus +from typing import Any, cast + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.private_agent_list import PrivateAgentList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = 50, +) -> 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/private_agents", + "params": params, + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> Any | PrivateAgentList | None: + if response.status_code == 200: + response_200 = PrivateAgentList.from_dict(response.json()) + + return response_200 + + if response.status_code == 401: + response_401 = cast(Any, None) + return response_401 + + 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 | PrivateAgentList]: + 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: int | Unset = UNSET, + pagesize: int | Unset = 50, +) -> Response[Any | PrivateAgentList]: + """List private agents + + List this tenant's agents, including revoked and offline agents. Inventory pages omit provider + snapshots to bound database and response costs; use Get private agent for provider inventory and + last-reported health. Requires Private Agent management access plus the Private Agents and AI SRE + features. Credentials and capability schemas are never returned. + + Args: + pagenumber (int | Unset): + pagesize (int | Unset): Default: 50. + + Raises: + errors.UnexpectedStatus: If the server returns 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 | PrivateAgentList] + """ + + 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: int | Unset = UNSET, + pagesize: int | Unset = 50, +) -> Any | PrivateAgentList | None: + """List private agents + + List this tenant's agents, including revoked and offline agents. Inventory pages omit provider + snapshots to bound database and response costs; use Get private agent for provider inventory and + last-reported health. Requires Private Agent management access plus the Private Agents and AI SRE + features. Credentials and capability schemas are never returned. + + Args: + pagenumber (int | Unset): + pagesize (int | Unset): Default: 50. + + Raises: + errors.UnexpectedStatus: If the server 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 | PrivateAgentList + """ + + return sync_detailed( + client=client, + pagenumber=pagenumber, + pagesize=pagesize, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = 50, +) -> Response[Any | PrivateAgentList]: + """List private agents + + List this tenant's agents, including revoked and offline agents. Inventory pages omit provider + snapshots to bound database and response costs; use Get private agent for provider inventory and + last-reported health. Requires Private Agent management access plus the Private Agents and AI SRE + features. Credentials and capability schemas are never returned. + + Args: + pagenumber (int | Unset): + pagesize (int | Unset): Default: 50. + + Raises: + errors.UnexpectedStatus: If the server returns 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 | PrivateAgentList] + """ + + 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: int | Unset = UNSET, + pagesize: int | Unset = 50, +) -> Any | PrivateAgentList | None: + """List private agents + + List this tenant's agents, including revoked and offline agents. Inventory pages omit provider + snapshots to bound database and response costs; use Get private agent for provider inventory and + last-reported health. Requires Private Agent management access plus the Private Agents and AI SRE + features. Credentials and capability schemas are never returned. + + Args: + pagenumber (int | Unset): + pagesize (int | Unset): Default: 50. + + Raises: + errors.UnexpectedStatus: If the server 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 | PrivateAgentList + """ + + return ( + await asyncio_detailed( + client=client, + pagenumber=pagenumber, + pagesize=pagesize, + ) + ).parsed diff --git a/rootly_sdk/api/private_agents/revoke_private_agent.py b/rootly_sdk/api/private_agents/revoke_private_agent.py new file mode 100644 index 00000000..1f388174 --- /dev/null +++ b/rootly_sdk/api/private_agents/revoke_private_agent.py @@ -0,0 +1,184 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.private_agent_response import PrivateAgentResponse +from ...types import Response + + +def _get_kwargs( + id: UUID, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/private_agents/{id}/revoke".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Any | PrivateAgentResponse | None: + if response.status_code == 200: + response_200 = PrivateAgentResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 401: + response_401 = cast(Any, None) + return response_401 + + if response.status_code == 404: + response_404 = cast(Any, None) + 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[Any | PrivateAgentResponse]: + 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: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any | PrivateAgentResponse]: + """Revoke private agent + + Invalidate access and refresh credentials and remove provider routing registrations. Requires + Private Agent delete permission plus the Private Agents and AI SRE features. Retains the agent and + invocation history. Repeated revocation is safe. An executing customer-side operation is not + guaranteed to stop immediately. Use a new enrollment token to re-enroll a revoked installation. + + Args: + id (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[Any | PrivateAgentResponse] + """ + + kwargs = _get_kwargs( + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, +) -> Any | PrivateAgentResponse | None: + """Revoke private agent + + Invalidate access and refresh credentials and remove provider routing registrations. Requires + Private Agent delete permission plus the Private Agents and AI SRE features. Retains the agent and + invocation history. Repeated revocation is safe. An executing customer-side operation is not + guaranteed to stop immediately. Use a new enrollment token to re-enroll a revoked installation. + + Args: + id (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: + Any | PrivateAgentResponse + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, +) -> Response[Any | PrivateAgentResponse]: + """Revoke private agent + + Invalidate access and refresh credentials and remove provider routing registrations. Requires + Private Agent delete permission plus the Private Agents and AI SRE features. Retains the agent and + invocation history. Repeated revocation is safe. An executing customer-side operation is not + guaranteed to stop immediately. Use a new enrollment token to re-enroll a revoked installation. + + Args: + id (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[Any | PrivateAgentResponse] + """ + + 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: UUID, + *, + client: AuthenticatedClient, +) -> Any | PrivateAgentResponse | None: + """Revoke private agent + + Invalidate access and refresh credentials and remove provider routing registrations. Requires + Private Agent delete permission plus the Private Agents and AI SRE features. Retains the agent and + invocation history. Repeated revocation is safe. An executing customer-side operation is not + guaranteed to stop immediately. Use a new enrollment token to re-enroll a revoked installation. + + Args: + id (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: + Any | PrivateAgentResponse + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/private_agents/update_private_agent.py b/rootly_sdk/api/private_agents/update_private_agent.py new file mode 100644 index 00000000..ea048960 --- /dev/null +++ b/rootly_sdk/api/private_agents/update_private_agent.py @@ -0,0 +1,201 @@ +from http import HTTPStatus +from typing import Any, cast +from urllib.parse import quote +from uuid import UUID + +import httpx + +from ... import errors +from ...client import AuthenticatedClient, Client +from ...models.errors_list import ErrorsList +from ...models.private_agent_update import PrivateAgentUpdate +from ...types import Response + + +def _get_kwargs( + id: UUID, + *, + body: PrivateAgentUpdate, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "patch", + "url": "/v1/private_agents/{id}".format( + id=quote(str(id), safe=""), + ), + } + + _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) -> Any | ErrorsList | None: + if response.status_code == 204: + response_204 = cast(Any, None) + return response_204 + + if response.status_code == 401: + response_401 = cast(Any, None) + return response_401 + + if response.status_code == 404: + response_404 = cast(Any, None) + return response_404 + + if response.status_code == 409: + response_409 = ErrorsList.from_dict(response.json()) + + return response_409 + + if response.status_code == 422: + response_422 = cast(Any, None) + 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[Any | 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( + id: UUID, + *, + client: AuthenticatedClient, + body: PrivateAgentUpdate, +) -> Response[Any | ErrorsList]: + """Update private agent metadata + + Update routing metadata or pause tool execution without disconnecting the agent. The agent UUID and + provider IDs remain the execution identities. Requires Private Agent update permission. + + Args: + id (UUID): + body (PrivateAgentUpdate): + + Raises: + errors.UnexpectedStatus: If the server returns 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] + """ + + kwargs = _get_kwargs( + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: UUID, + *, + client: AuthenticatedClient, + body: PrivateAgentUpdate, +) -> Any | ErrorsList | None: + """Update private agent metadata + + Update routing metadata or pause tool execution without disconnecting the agent. The agent UUID and + provider IDs remain the execution identities. Requires Private Agent update permission. + + Args: + id (UUID): + body (PrivateAgentUpdate): + + Raises: + errors.UnexpectedStatus: If the server 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 + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: UUID, + *, + client: AuthenticatedClient, + body: PrivateAgentUpdate, +) -> Response[Any | ErrorsList]: + """Update private agent metadata + + Update routing metadata or pause tool execution without disconnecting the agent. The agent UUID and + provider IDs remain the execution identities. Requires Private Agent update permission. + + Args: + id (UUID): + body (PrivateAgentUpdate): + + Raises: + errors.UnexpectedStatus: If the server returns 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] + """ + + 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: UUID, + *, + client: AuthenticatedClient, + body: PrivateAgentUpdate, +) -> Any | ErrorsList | None: + """Update private agent metadata + + Update routing metadata or pause tool execution without disconnecting the agent. The agent UUID and + provider IDs remain the execution identities. Requires Private Agent update permission. + + Args: + id (UUID): + body (PrivateAgentUpdate): + + Raises: + errors.UnexpectedStatus: If the server 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 + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/problem_action_items/__init__.py b/rootly_sdk/api/problem_action_items/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/rootly_sdk/api/problem_action_items/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/rootly_sdk/api/problem_action_items/create_problem_action_item.py b/rootly_sdk/api/problem_action_items/create_problem_action_item.py new file mode 100644 index 00000000..eba7056e --- /dev/null +++ b/rootly_sdk/api/problem_action_items/create_problem_action_item.py @@ -0,0 +1,195 @@ +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.new_problem_action_item import NewProblemActionItem +from ...models.problem_action_item_response import ProblemActionItemResponse +from ...types import Response + + +def _get_kwargs( + problem_id: str, + *, + body: NewProblemActionItem, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/problems/{problem_id}/action_items".format( + problem_id=quote(str(problem_id), safe=""), + ), + } + + _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 | ProblemActionItemResponse | None: + if response.status_code == 201: + response_201 = ProblemActionItemResponse.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 | ProblemActionItemResponse]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + problem_id: str, + *, + client: AuthenticatedClient, + body: NewProblemActionItem, +) -> Response[ErrorsList | ProblemActionItemResponse]: + """Creates a problem action item + + Creates a new action item on a problem from provided data + + Args: + problem_id (str): + body (NewProblemActionItem): + + Raises: + errors.UnexpectedStatus: If the server returns 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 | ProblemActionItemResponse] + """ + + kwargs = _get_kwargs( + problem_id=problem_id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + problem_id: str, + *, + client: AuthenticatedClient, + body: NewProblemActionItem, +) -> ErrorsList | ProblemActionItemResponse | None: + """Creates a problem action item + + Creates a new action item on a problem from provided data + + Args: + problem_id (str): + body (NewProblemActionItem): + + Raises: + errors.UnexpectedStatus: If the server 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 | ProblemActionItemResponse + """ + + return sync_detailed( + problem_id=problem_id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + problem_id: str, + *, + client: AuthenticatedClient, + body: NewProblemActionItem, +) -> Response[ErrorsList | ProblemActionItemResponse]: + """Creates a problem action item + + Creates a new action item on a problem from provided data + + Args: + problem_id (str): + body (NewProblemActionItem): + + Raises: + errors.UnexpectedStatus: If the server returns 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 | ProblemActionItemResponse] + """ + + kwargs = _get_kwargs( + problem_id=problem_id, + body=body, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + problem_id: str, + *, + client: AuthenticatedClient, + body: NewProblemActionItem, +) -> ErrorsList | ProblemActionItemResponse | None: + """Creates a problem action item + + Creates a new action item on a problem from provided data + + Args: + problem_id (str): + body (NewProblemActionItem): + + Raises: + errors.UnexpectedStatus: If the server 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 | ProblemActionItemResponse + """ + + return ( + await asyncio_detailed( + problem_id=problem_id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/problem_action_items/delete_problem_action_item.py b/rootly_sdk/api/problem_action_items/delete_problem_action_item.py new file mode 100644 index 00000000..4634efa1 --- /dev/null +++ b/rootly_sdk/api/problem_action_items/delete_problem_action_item.py @@ -0,0 +1,169 @@ +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.problem_action_item_response import ProblemActionItemResponse +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v1/problem_action_items/{id}".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ProblemActionItemResponse | None: + if response.status_code == 200: + response_200 = ProblemActionItemResponse.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 | ProblemActionItemResponse]: + 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 | ProblemActionItemResponse]: + """Deletes a problem action item + + Deletes a problem action item + + 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[ErrorsList | ProblemActionItemResponse] + """ + + 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 | ProblemActionItemResponse | None: + """Deletes a problem action item + + Deletes a problem action item + + 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: + ErrorsList | ProblemActionItemResponse + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorsList | ProblemActionItemResponse]: + """Deletes a problem action item + + Deletes a problem action item + + 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[ErrorsList | ProblemActionItemResponse] + """ + + 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 | ProblemActionItemResponse | None: + """Deletes a problem action item + + Deletes a problem action item + + 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: + ErrorsList | ProblemActionItemResponse + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/problem_action_items/get_problem_action_item.py b/rootly_sdk/api/problem_action_items/get_problem_action_item.py new file mode 100644 index 00000000..a30b7f79 --- /dev/null +++ b/rootly_sdk/api/problem_action_items/get_problem_action_item.py @@ -0,0 +1,169 @@ +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.problem_action_item_response import ProblemActionItemResponse +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/problem_action_items/{id}".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ProblemActionItemResponse | None: + if response.status_code == 200: + response_200 = ProblemActionItemResponse.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 | ProblemActionItemResponse]: + 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 | ProblemActionItemResponse]: + """Retrieves a problem action item + + Retrieves a specific problem action item 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[ErrorsList | ProblemActionItemResponse] + """ + + 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 | ProblemActionItemResponse | None: + """Retrieves a problem action item + + Retrieves a specific problem action item 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: + ErrorsList | ProblemActionItemResponse + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorsList | ProblemActionItemResponse]: + """Retrieves a problem action item + + Retrieves a specific problem action item 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[ErrorsList | ProblemActionItemResponse] + """ + + 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 | ProblemActionItemResponse | None: + """Retrieves a problem action item + + Retrieves a specific problem action item 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: + ErrorsList | ProblemActionItemResponse + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/problem_action_items/list_all_problem_action_items.py b/rootly_sdk/api/problem_action_items/list_all_problem_action_items.py new file mode 100644 index 00000000..ce4ee15e --- /dev/null +++ b/rootly_sdk/api/problem_action_items/list_all_problem_action_items.py @@ -0,0 +1,538 @@ +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.problem_action_item_list import ProblemActionItemList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, + problem_id: str | Unset = UNSET, + filtersearch: 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, + filterstatuseq: str | Unset = UNSET, + filterstatusnot_eq: str | Unset = UNSET, + filterstatusin: str | Unset = UNSET, + filterstatusnot_in: str | Unset = UNSET, + filterpriorityeq: str | Unset = UNSET, + filterprioritynot_eq: str | Unset = UNSET, + filterpriorityin: str | Unset = UNSET, + filterprioritynot_in: str | Unset = UNSET, + filterassigned_to_user_ideq: str | Unset = UNSET, + filterassigned_to_user_idnot_eq: str | Unset = UNSET, + filterassigned_to_user_idin: str | Unset = UNSET, + filterassigned_to_user_idnot_in: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["page[number]"] = pagenumber + + params["page[size]"] = pagesize + + params["sort"] = sort + + params["problem_id"] = problem_id + + params["filter[search]"] = filtersearch + + params["filter[due_date][gt]"] = filterdue_dategt + + params["filter[due_date][gte]"] = filterdue_dategte + + params["filter[due_date][lt]"] = filterdue_datelt + + params["filter[due_date][lte]"] = filterdue_datelte + + params["filter[created_at][gt]"] = filtercreated_atgt + + params["filter[created_at][gte]"] = filtercreated_atgte + + params["filter[created_at][lt]"] = filtercreated_atlt + + params["filter[created_at][lte]"] = filtercreated_atlte + + params["filter[status][eq]"] = filterstatuseq + + params["filter[status][not_eq]"] = filterstatusnot_eq + + params["filter[status][in]"] = filterstatusin + + params["filter[status][not_in]"] = filterstatusnot_in + + params["filter[priority][eq]"] = filterpriorityeq + + params["filter[priority][not_eq]"] = filterprioritynot_eq + + params["filter[priority][in]"] = filterpriorityin + + params["filter[priority][not_in]"] = filterprioritynot_in + + params["filter[assigned_to_user_id][eq]"] = filterassigned_to_user_ideq + + params["filter[assigned_to_user_id][not_eq]"] = filterassigned_to_user_idnot_eq + + params["filter[assigned_to_user_id][in]"] = filterassigned_to_user_idin + + params["filter[assigned_to_user_id][not_in]"] = filterassigned_to_user_idnot_in + + 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/problem_action_items", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ProblemActionItemList | None: + if response.status_code == 200: + response_200 = ProblemActionItemList.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 | ProblemActionItemList]: + 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: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, + problem_id: str | Unset = UNSET, + filtersearch: 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, + filterstatuseq: str | Unset = UNSET, + filterstatusnot_eq: str | Unset = UNSET, + filterstatusin: str | Unset = UNSET, + filterstatusnot_in: str | Unset = UNSET, + filterpriorityeq: str | Unset = UNSET, + filterprioritynot_eq: str | Unset = UNSET, + filterpriorityin: str | Unset = UNSET, + filterprioritynot_in: str | Unset = UNSET, + filterassigned_to_user_ideq: str | Unset = UNSET, + filterassigned_to_user_idnot_eq: str | Unset = UNSET, + filterassigned_to_user_idin: str | Unset = UNSET, + filterassigned_to_user_idnot_in: str | Unset = UNSET, +) -> Response[ErrorsList | ProblemActionItemList]: + """List all problem action items + + List all problem action items the caller can access across the team, with filter, sort and + pagination support + + Args: + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): + problem_id (str | Unset): + filtersearch (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): + filterstatuseq (str | Unset): + filterstatusnot_eq (str | Unset): + filterstatusin (str | Unset): + filterstatusnot_in (str | Unset): + filterpriorityeq (str | Unset): + filterprioritynot_eq (str | Unset): + filterpriorityin (str | Unset): + filterprioritynot_in (str | Unset): + filterassigned_to_user_ideq (str | Unset): + filterassigned_to_user_idnot_eq (str | Unset): + filterassigned_to_user_idin (str | Unset): + filterassigned_to_user_idnot_in (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorsList | ProblemActionItemList] + """ + + kwargs = _get_kwargs( + pagenumber=pagenumber, + pagesize=pagesize, + sort=sort, + problem_id=problem_id, + filtersearch=filtersearch, + filterdue_dategt=filterdue_dategt, + filterdue_dategte=filterdue_dategte, + filterdue_datelt=filterdue_datelt, + filterdue_datelte=filterdue_datelte, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterstatuseq=filterstatuseq, + filterstatusnot_eq=filterstatusnot_eq, + filterstatusin=filterstatusin, + filterstatusnot_in=filterstatusnot_in, + filterpriorityeq=filterpriorityeq, + filterprioritynot_eq=filterprioritynot_eq, + filterpriorityin=filterpriorityin, + filterprioritynot_in=filterprioritynot_in, + filterassigned_to_user_ideq=filterassigned_to_user_ideq, + filterassigned_to_user_idnot_eq=filterassigned_to_user_idnot_eq, + filterassigned_to_user_idin=filterassigned_to_user_idin, + filterassigned_to_user_idnot_in=filterassigned_to_user_idnot_in, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, + problem_id: str | Unset = UNSET, + filtersearch: 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, + filterstatuseq: str | Unset = UNSET, + filterstatusnot_eq: str | Unset = UNSET, + filterstatusin: str | Unset = UNSET, + filterstatusnot_in: str | Unset = UNSET, + filterpriorityeq: str | Unset = UNSET, + filterprioritynot_eq: str | Unset = UNSET, + filterpriorityin: str | Unset = UNSET, + filterprioritynot_in: str | Unset = UNSET, + filterassigned_to_user_ideq: str | Unset = UNSET, + filterassigned_to_user_idnot_eq: str | Unset = UNSET, + filterassigned_to_user_idin: str | Unset = UNSET, + filterassigned_to_user_idnot_in: str | Unset = UNSET, +) -> ErrorsList | ProblemActionItemList | None: + """List all problem action items + + List all problem action items the caller can access across the team, with filter, sort and + pagination support + + Args: + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): + problem_id (str | Unset): + filtersearch (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): + filterstatuseq (str | Unset): + filterstatusnot_eq (str | Unset): + filterstatusin (str | Unset): + filterstatusnot_in (str | Unset): + filterpriorityeq (str | Unset): + filterprioritynot_eq (str | Unset): + filterpriorityin (str | Unset): + filterprioritynot_in (str | Unset): + filterassigned_to_user_ideq (str | Unset): + filterassigned_to_user_idnot_eq (str | Unset): + filterassigned_to_user_idin (str | Unset): + filterassigned_to_user_idnot_in (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorsList | ProblemActionItemList + """ + + return sync_detailed( + client=client, + pagenumber=pagenumber, + pagesize=pagesize, + sort=sort, + problem_id=problem_id, + filtersearch=filtersearch, + filterdue_dategt=filterdue_dategt, + filterdue_dategte=filterdue_dategte, + filterdue_datelt=filterdue_datelt, + filterdue_datelte=filterdue_datelte, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterstatuseq=filterstatuseq, + filterstatusnot_eq=filterstatusnot_eq, + filterstatusin=filterstatusin, + filterstatusnot_in=filterstatusnot_in, + filterpriorityeq=filterpriorityeq, + filterprioritynot_eq=filterprioritynot_eq, + filterpriorityin=filterpriorityin, + filterprioritynot_in=filterprioritynot_in, + filterassigned_to_user_ideq=filterassigned_to_user_ideq, + filterassigned_to_user_idnot_eq=filterassigned_to_user_idnot_eq, + filterassigned_to_user_idin=filterassigned_to_user_idin, + filterassigned_to_user_idnot_in=filterassigned_to_user_idnot_in, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, + problem_id: str | Unset = UNSET, + filtersearch: 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, + filterstatuseq: str | Unset = UNSET, + filterstatusnot_eq: str | Unset = UNSET, + filterstatusin: str | Unset = UNSET, + filterstatusnot_in: str | Unset = UNSET, + filterpriorityeq: str | Unset = UNSET, + filterprioritynot_eq: str | Unset = UNSET, + filterpriorityin: str | Unset = UNSET, + filterprioritynot_in: str | Unset = UNSET, + filterassigned_to_user_ideq: str | Unset = UNSET, + filterassigned_to_user_idnot_eq: str | Unset = UNSET, + filterassigned_to_user_idin: str | Unset = UNSET, + filterassigned_to_user_idnot_in: str | Unset = UNSET, +) -> Response[ErrorsList | ProblemActionItemList]: + """List all problem action items + + List all problem action items the caller can access across the team, with filter, sort and + pagination support + + Args: + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): + problem_id (str | Unset): + filtersearch (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): + filterstatuseq (str | Unset): + filterstatusnot_eq (str | Unset): + filterstatusin (str | Unset): + filterstatusnot_in (str | Unset): + filterpriorityeq (str | Unset): + filterprioritynot_eq (str | Unset): + filterpriorityin (str | Unset): + filterprioritynot_in (str | Unset): + filterassigned_to_user_ideq (str | Unset): + filterassigned_to_user_idnot_eq (str | Unset): + filterassigned_to_user_idin (str | Unset): + filterassigned_to_user_idnot_in (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorsList | ProblemActionItemList] + """ + + kwargs = _get_kwargs( + pagenumber=pagenumber, + pagesize=pagesize, + sort=sort, + problem_id=problem_id, + filtersearch=filtersearch, + filterdue_dategt=filterdue_dategt, + filterdue_dategte=filterdue_dategte, + filterdue_datelt=filterdue_datelt, + filterdue_datelte=filterdue_datelte, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterstatuseq=filterstatuseq, + filterstatusnot_eq=filterstatusnot_eq, + filterstatusin=filterstatusin, + filterstatusnot_in=filterstatusnot_in, + filterpriorityeq=filterpriorityeq, + filterprioritynot_eq=filterprioritynot_eq, + filterpriorityin=filterpriorityin, + filterprioritynot_in=filterprioritynot_in, + filterassigned_to_user_ideq=filterassigned_to_user_ideq, + filterassigned_to_user_idnot_eq=filterassigned_to_user_idnot_eq, + filterassigned_to_user_idin=filterassigned_to_user_idin, + filterassigned_to_user_idnot_in=filterassigned_to_user_idnot_in, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, + problem_id: str | Unset = UNSET, + filtersearch: 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, + filterstatuseq: str | Unset = UNSET, + filterstatusnot_eq: str | Unset = UNSET, + filterstatusin: str | Unset = UNSET, + filterstatusnot_in: str | Unset = UNSET, + filterpriorityeq: str | Unset = UNSET, + filterprioritynot_eq: str | Unset = UNSET, + filterpriorityin: str | Unset = UNSET, + filterprioritynot_in: str | Unset = UNSET, + filterassigned_to_user_ideq: str | Unset = UNSET, + filterassigned_to_user_idnot_eq: str | Unset = UNSET, + filterassigned_to_user_idin: str | Unset = UNSET, + filterassigned_to_user_idnot_in: str | Unset = UNSET, +) -> ErrorsList | ProblemActionItemList | None: + """List all problem action items + + List all problem action items the caller can access across the team, with filter, sort and + pagination support + + Args: + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): + problem_id (str | Unset): + filtersearch (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): + filterstatuseq (str | Unset): + filterstatusnot_eq (str | Unset): + filterstatusin (str | Unset): + filterstatusnot_in (str | Unset): + filterpriorityeq (str | Unset): + filterprioritynot_eq (str | Unset): + filterpriorityin (str | Unset): + filterprioritynot_in (str | Unset): + filterassigned_to_user_ideq (str | Unset): + filterassigned_to_user_idnot_eq (str | Unset): + filterassigned_to_user_idin (str | Unset): + filterassigned_to_user_idnot_in (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorsList | ProblemActionItemList + """ + + return ( + await asyncio_detailed( + client=client, + pagenumber=pagenumber, + pagesize=pagesize, + sort=sort, + problem_id=problem_id, + filtersearch=filtersearch, + filterdue_dategt=filterdue_dategt, + filterdue_dategte=filterdue_dategte, + filterdue_datelt=filterdue_datelt, + filterdue_datelte=filterdue_datelte, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterstatuseq=filterstatuseq, + filterstatusnot_eq=filterstatusnot_eq, + filterstatusin=filterstatusin, + filterstatusnot_in=filterstatusnot_in, + filterpriorityeq=filterpriorityeq, + filterprioritynot_eq=filterprioritynot_eq, + filterpriorityin=filterpriorityin, + filterprioritynot_in=filterprioritynot_in, + filterassigned_to_user_ideq=filterassigned_to_user_ideq, + filterassigned_to_user_idnot_eq=filterassigned_to_user_idnot_eq, + filterassigned_to_user_idin=filterassigned_to_user_idin, + filterassigned_to_user_idnot_in=filterassigned_to_user_idnot_in, + ) + ).parsed diff --git a/rootly_sdk/api/problem_action_items/list_problem_action_items.py b/rootly_sdk/api/problem_action_items/list_problem_action_items.py new file mode 100644 index 00000000..10a346b9 --- /dev/null +++ b/rootly_sdk/api/problem_action_items/list_problem_action_items.py @@ -0,0 +1,527 @@ +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.problem_action_item_list import ProblemActionItemList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + problem_id: str, + *, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, + filtersearch: 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, + filterstatuseq: str | Unset = UNSET, + filterstatusnot_eq: str | Unset = UNSET, + filterstatusin: str | Unset = UNSET, + filterstatusnot_in: str | Unset = UNSET, + filterpriorityeq: str | Unset = UNSET, + filterprioritynot_eq: str | Unset = UNSET, + filterpriorityin: str | Unset = UNSET, + filterprioritynot_in: str | Unset = UNSET, + filterassigned_to_user_ideq: str | Unset = UNSET, + filterassigned_to_user_idnot_eq: str | Unset = UNSET, + filterassigned_to_user_idin: str | Unset = UNSET, + filterassigned_to_user_idnot_in: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["page[number]"] = pagenumber + + params["page[size]"] = pagesize + + params["sort"] = sort + + params["filter[search]"] = filtersearch + + params["filter[due_date][gt]"] = filterdue_dategt + + params["filter[due_date][gte]"] = filterdue_dategte + + params["filter[due_date][lt]"] = filterdue_datelt + + params["filter[due_date][lte]"] = filterdue_datelte + + params["filter[created_at][gt]"] = filtercreated_atgt + + params["filter[created_at][gte]"] = filtercreated_atgte + + params["filter[created_at][lt]"] = filtercreated_atlt + + params["filter[created_at][lte]"] = filtercreated_atlte + + params["filter[status][eq]"] = filterstatuseq + + params["filter[status][not_eq]"] = filterstatusnot_eq + + params["filter[status][in]"] = filterstatusin + + params["filter[status][not_in]"] = filterstatusnot_in + + params["filter[priority][eq]"] = filterpriorityeq + + params["filter[priority][not_eq]"] = filterprioritynot_eq + + params["filter[priority][in]"] = filterpriorityin + + params["filter[priority][not_in]"] = filterprioritynot_in + + params["filter[assigned_to_user_id][eq]"] = filterassigned_to_user_ideq + + params["filter[assigned_to_user_id][not_eq]"] = filterassigned_to_user_idnot_eq + + params["filter[assigned_to_user_id][in]"] = filterassigned_to_user_idin + + params["filter[assigned_to_user_id][not_in]"] = filterassigned_to_user_idnot_in + + 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/problems/{problem_id}/action_items".format( + problem_id=quote(str(problem_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> ProblemActionItemList | None: + if response.status_code == 200: + response_200 = ProblemActionItemList.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[ProblemActionItemList]: + return Response( + status_code=HTTPStatus(response.status_code), + content=response.content, + headers=response.headers, + parsed=_parse_response(client=client, response=response), + ) + + +def sync_detailed( + problem_id: str, + *, + client: AuthenticatedClient, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, + filtersearch: 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, + filterstatuseq: str | Unset = UNSET, + filterstatusnot_eq: str | Unset = UNSET, + filterstatusin: str | Unset = UNSET, + filterstatusnot_in: str | Unset = UNSET, + filterpriorityeq: str | Unset = UNSET, + filterprioritynot_eq: str | Unset = UNSET, + filterpriorityin: str | Unset = UNSET, + filterprioritynot_in: str | Unset = UNSET, + filterassigned_to_user_ideq: str | Unset = UNSET, + filterassigned_to_user_idnot_eq: str | Unset = UNSET, + filterassigned_to_user_idin: str | Unset = UNSET, + filterassigned_to_user_idnot_in: str | Unset = UNSET, +) -> Response[ProblemActionItemList]: + """List a problem's action items + + List action items belonging to a problem, with filter, sort and pagination support + + Args: + problem_id (str): + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): + filtersearch (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): + filterstatuseq (str | Unset): + filterstatusnot_eq (str | Unset): + filterstatusin (str | Unset): + filterstatusnot_in (str | Unset): + filterpriorityeq (str | Unset): + filterprioritynot_eq (str | Unset): + filterpriorityin (str | Unset): + filterprioritynot_in (str | Unset): + filterassigned_to_user_ideq (str | Unset): + filterassigned_to_user_idnot_eq (str | Unset): + filterassigned_to_user_idin (str | Unset): + filterassigned_to_user_idnot_in (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ProblemActionItemList] + """ + + kwargs = _get_kwargs( + problem_id=problem_id, + pagenumber=pagenumber, + pagesize=pagesize, + sort=sort, + filtersearch=filtersearch, + filterdue_dategt=filterdue_dategt, + filterdue_dategte=filterdue_dategte, + filterdue_datelt=filterdue_datelt, + filterdue_datelte=filterdue_datelte, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterstatuseq=filterstatuseq, + filterstatusnot_eq=filterstatusnot_eq, + filterstatusin=filterstatusin, + filterstatusnot_in=filterstatusnot_in, + filterpriorityeq=filterpriorityeq, + filterprioritynot_eq=filterprioritynot_eq, + filterpriorityin=filterpriorityin, + filterprioritynot_in=filterprioritynot_in, + filterassigned_to_user_ideq=filterassigned_to_user_ideq, + filterassigned_to_user_idnot_eq=filterassigned_to_user_idnot_eq, + filterassigned_to_user_idin=filterassigned_to_user_idin, + filterassigned_to_user_idnot_in=filterassigned_to_user_idnot_in, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + problem_id: str, + *, + client: AuthenticatedClient, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, + filtersearch: 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, + filterstatuseq: str | Unset = UNSET, + filterstatusnot_eq: str | Unset = UNSET, + filterstatusin: str | Unset = UNSET, + filterstatusnot_in: str | Unset = UNSET, + filterpriorityeq: str | Unset = UNSET, + filterprioritynot_eq: str | Unset = UNSET, + filterpriorityin: str | Unset = UNSET, + filterprioritynot_in: str | Unset = UNSET, + filterassigned_to_user_ideq: str | Unset = UNSET, + filterassigned_to_user_idnot_eq: str | Unset = UNSET, + filterassigned_to_user_idin: str | Unset = UNSET, + filterassigned_to_user_idnot_in: str | Unset = UNSET, +) -> ProblemActionItemList | None: + """List a problem's action items + + List action items belonging to a problem, with filter, sort and pagination support + + Args: + problem_id (str): + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): + filtersearch (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): + filterstatuseq (str | Unset): + filterstatusnot_eq (str | Unset): + filterstatusin (str | Unset): + filterstatusnot_in (str | Unset): + filterpriorityeq (str | Unset): + filterprioritynot_eq (str | Unset): + filterpriorityin (str | Unset): + filterprioritynot_in (str | Unset): + filterassigned_to_user_ideq (str | Unset): + filterassigned_to_user_idnot_eq (str | Unset): + filterassigned_to_user_idin (str | Unset): + filterassigned_to_user_idnot_in (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ProblemActionItemList + """ + + return sync_detailed( + problem_id=problem_id, + client=client, + pagenumber=pagenumber, + pagesize=pagesize, + sort=sort, + filtersearch=filtersearch, + filterdue_dategt=filterdue_dategt, + filterdue_dategte=filterdue_dategte, + filterdue_datelt=filterdue_datelt, + filterdue_datelte=filterdue_datelte, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterstatuseq=filterstatuseq, + filterstatusnot_eq=filterstatusnot_eq, + filterstatusin=filterstatusin, + filterstatusnot_in=filterstatusnot_in, + filterpriorityeq=filterpriorityeq, + filterprioritynot_eq=filterprioritynot_eq, + filterpriorityin=filterpriorityin, + filterprioritynot_in=filterprioritynot_in, + filterassigned_to_user_ideq=filterassigned_to_user_ideq, + filterassigned_to_user_idnot_eq=filterassigned_to_user_idnot_eq, + filterassigned_to_user_idin=filterassigned_to_user_idin, + filterassigned_to_user_idnot_in=filterassigned_to_user_idnot_in, + ).parsed + + +async def asyncio_detailed( + problem_id: str, + *, + client: AuthenticatedClient, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, + filtersearch: 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, + filterstatuseq: str | Unset = UNSET, + filterstatusnot_eq: str | Unset = UNSET, + filterstatusin: str | Unset = UNSET, + filterstatusnot_in: str | Unset = UNSET, + filterpriorityeq: str | Unset = UNSET, + filterprioritynot_eq: str | Unset = UNSET, + filterpriorityin: str | Unset = UNSET, + filterprioritynot_in: str | Unset = UNSET, + filterassigned_to_user_ideq: str | Unset = UNSET, + filterassigned_to_user_idnot_eq: str | Unset = UNSET, + filterassigned_to_user_idin: str | Unset = UNSET, + filterassigned_to_user_idnot_in: str | Unset = UNSET, +) -> Response[ProblemActionItemList]: + """List a problem's action items + + List action items belonging to a problem, with filter, sort and pagination support + + Args: + problem_id (str): + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): + filtersearch (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): + filterstatuseq (str | Unset): + filterstatusnot_eq (str | Unset): + filterstatusin (str | Unset): + filterstatusnot_in (str | Unset): + filterpriorityeq (str | Unset): + filterprioritynot_eq (str | Unset): + filterpriorityin (str | Unset): + filterprioritynot_in (str | Unset): + filterassigned_to_user_ideq (str | Unset): + filterassigned_to_user_idnot_eq (str | Unset): + filterassigned_to_user_idin (str | Unset): + filterassigned_to_user_idnot_in (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ProblemActionItemList] + """ + + kwargs = _get_kwargs( + problem_id=problem_id, + pagenumber=pagenumber, + pagesize=pagesize, + sort=sort, + filtersearch=filtersearch, + filterdue_dategt=filterdue_dategt, + filterdue_dategte=filterdue_dategte, + filterdue_datelt=filterdue_datelt, + filterdue_datelte=filterdue_datelte, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterstatuseq=filterstatuseq, + filterstatusnot_eq=filterstatusnot_eq, + filterstatusin=filterstatusin, + filterstatusnot_in=filterstatusnot_in, + filterpriorityeq=filterpriorityeq, + filterprioritynot_eq=filterprioritynot_eq, + filterpriorityin=filterpriorityin, + filterprioritynot_in=filterprioritynot_in, + filterassigned_to_user_ideq=filterassigned_to_user_ideq, + filterassigned_to_user_idnot_eq=filterassigned_to_user_idnot_eq, + filterassigned_to_user_idin=filterassigned_to_user_idin, + filterassigned_to_user_idnot_in=filterassigned_to_user_idnot_in, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + problem_id: str, + *, + client: AuthenticatedClient, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, + filtersearch: 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, + filterstatuseq: str | Unset = UNSET, + filterstatusnot_eq: str | Unset = UNSET, + filterstatusin: str | Unset = UNSET, + filterstatusnot_in: str | Unset = UNSET, + filterpriorityeq: str | Unset = UNSET, + filterprioritynot_eq: str | Unset = UNSET, + filterpriorityin: str | Unset = UNSET, + filterprioritynot_in: str | Unset = UNSET, + filterassigned_to_user_ideq: str | Unset = UNSET, + filterassigned_to_user_idnot_eq: str | Unset = UNSET, + filterassigned_to_user_idin: str | Unset = UNSET, + filterassigned_to_user_idnot_in: str | Unset = UNSET, +) -> ProblemActionItemList | None: + """List a problem's action items + + List action items belonging to a problem, with filter, sort and pagination support + + Args: + problem_id (str): + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): + filtersearch (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): + filterstatuseq (str | Unset): + filterstatusnot_eq (str | Unset): + filterstatusin (str | Unset): + filterstatusnot_in (str | Unset): + filterpriorityeq (str | Unset): + filterprioritynot_eq (str | Unset): + filterpriorityin (str | Unset): + filterprioritynot_in (str | Unset): + filterassigned_to_user_ideq (str | Unset): + filterassigned_to_user_idnot_eq (str | Unset): + filterassigned_to_user_idin (str | Unset): + filterassigned_to_user_idnot_in (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ProblemActionItemList + """ + + return ( + await asyncio_detailed( + problem_id=problem_id, + client=client, + pagenumber=pagenumber, + pagesize=pagesize, + sort=sort, + filtersearch=filtersearch, + filterdue_dategt=filterdue_dategt, + filterdue_dategte=filterdue_dategte, + filterdue_datelt=filterdue_datelt, + filterdue_datelte=filterdue_datelte, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterstatuseq=filterstatuseq, + filterstatusnot_eq=filterstatusnot_eq, + filterstatusin=filterstatusin, + filterstatusnot_in=filterstatusnot_in, + filterpriorityeq=filterpriorityeq, + filterprioritynot_eq=filterprioritynot_eq, + filterpriorityin=filterpriorityin, + filterprioritynot_in=filterprioritynot_in, + filterassigned_to_user_ideq=filterassigned_to_user_ideq, + filterassigned_to_user_idnot_eq=filterassigned_to_user_idnot_eq, + filterassigned_to_user_idin=filterassigned_to_user_idin, + filterassigned_to_user_idnot_in=filterassigned_to_user_idnot_in, + ) + ).parsed diff --git a/rootly_sdk/api/alert_retrigger_rules/update_alert_retrigger_rule.py b/rootly_sdk/api/problem_action_items/update_problem_action_item.py similarity index 69% rename from rootly_sdk/api/alert_retrigger_rules/update_alert_retrigger_rule.py rename to rootly_sdk/api/problem_action_items/update_problem_action_item.py index a2f98da6..3ec4d0e0 100644 --- a/rootly_sdk/api/alert_retrigger_rules/update_alert_retrigger_rule.py +++ b/rootly_sdk/api/problem_action_items/update_problem_action_item.py @@ -1,25 +1,28 @@ 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.alert_retrigger_rule_response import AlertRetriggerRuleResponse -from ...models.update_alert_retrigger_rule import UpdateAlertRetriggerRule +from ...models.problem_action_item_response import ProblemActionItemResponse +from ...models.update_problem_action_item import UpdateProblemActionItem from ...types import Response def _get_kwargs( id: str, *, - body: UpdateAlertRetriggerRule, + body: UpdateProblemActionItem, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/alert_retrigger_rules/{id}", + "url": "/v1/problem_action_items/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -32,9 +35,9 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertRetriggerRuleResponse | None: +) -> ProblemActionItemResponse | None: if response.status_code == 200: - response_200 = AlertRetriggerRuleResponse.from_dict(response.json()) + response_200 = ProblemActionItemResponse.from_dict(response.json()) return response_200 @@ -46,7 +49,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertRetriggerRuleResponse]: +) -> Response[ProblemActionItemResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -59,20 +62,22 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateAlertRetriggerRule, -) -> Response[AlertRetriggerRuleResponse]: - """Updates an alert re-trigger rule + body: UpdateProblemActionItem, +) -> Response[ProblemActionItemResponse]: + """Update a problem action item + + Updates a problem action item Args: id (str): - body (UpdateAlertRetriggerRule): + body (UpdateProblemActionItem): Raises: errors.UnexpectedStatus: If the server returns 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] + Response[ProblemActionItemResponse] """ kwargs = _get_kwargs( @@ -91,20 +96,22 @@ def sync( id: str, *, client: AuthenticatedClient, - body: UpdateAlertRetriggerRule, -) -> AlertRetriggerRuleResponse | None: - """Updates an alert re-trigger rule + body: UpdateProblemActionItem, +) -> ProblemActionItemResponse | None: + """Update a problem action item + + Updates a problem action item Args: id (str): - body (UpdateAlertRetriggerRule): + body (UpdateProblemActionItem): Raises: errors.UnexpectedStatus: If the server 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 + ProblemActionItemResponse """ return sync_detailed( @@ -118,20 +125,22 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateAlertRetriggerRule, -) -> Response[AlertRetriggerRuleResponse]: - """Updates an alert re-trigger rule + body: UpdateProblemActionItem, +) -> Response[ProblemActionItemResponse]: + """Update a problem action item + + Updates a problem action item Args: id (str): - body (UpdateAlertRetriggerRule): + body (UpdateProblemActionItem): Raises: errors.UnexpectedStatus: If the server returns 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] + Response[ProblemActionItemResponse] """ kwargs = _get_kwargs( @@ -148,20 +157,22 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: UpdateAlertRetriggerRule, -) -> AlertRetriggerRuleResponse | None: - """Updates an alert re-trigger rule + body: UpdateProblemActionItem, +) -> ProblemActionItemResponse | None: + """Update a problem action item + + Updates a problem action item Args: id (str): - body (UpdateAlertRetriggerRule): + body (UpdateProblemActionItem): Raises: errors.UnexpectedStatus: If the server 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 + ProblemActionItemResponse """ return ( diff --git a/rootly_sdk/api/problems/__init__.py b/rootly_sdk/api/problems/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/rootly_sdk/api/problems/__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/problems/create_problem.py similarity index 70% rename from rootly_sdk/api/alert_retrigger_rules/create_alert_retrigger_rule.py rename to rootly_sdk/api/problems/create_problem.py index 46ebb90c..c147184b 100644 --- a/rootly_sdk/api/alert_retrigger_rules/create_alert_retrigger_rule.py +++ b/rootly_sdk/api/problems/create_problem.py @@ -5,21 +5,21 @@ 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 ...models.new_problem import NewProblem +from ...models.problem_response import ProblemResponse from ...types import Response def _get_kwargs( *, - body: NewAlertRetriggerRule, + body: NewProblem, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "post", - "url": "/v1/alert_retrigger_rules", + "url": "/v1/problems", } _kwargs["json"] = body.to_dict() @@ -32,12 +32,17 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertRetriggerRuleResponse | ErrorsList | None: +) -> ErrorsList | ProblemResponse | None: if response.status_code == 201: - response_201 = AlertRetriggerRuleResponse.from_dict(response.json()) + response_201 = ProblemResponse.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()) @@ -51,7 +56,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertRetriggerRuleResponse | ErrorsList]: +) -> Response[ErrorsList | ProblemResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -63,19 +68,21 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - body: NewAlertRetriggerRule, -) -> Response[AlertRetriggerRuleResponse | ErrorsList]: - """Creates an alert re-trigger rule + body: NewProblem, +) -> Response[ErrorsList | ProblemResponse]: + """Creates a problem + + Creates a new problem from provided data Args: - body (NewAlertRetriggerRule): + body (NewProblem): Raises: errors.UnexpectedStatus: If the server returns 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]] + Response[ErrorsList | ProblemResponse] """ kwargs = _get_kwargs( @@ -92,19 +99,21 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: NewAlertRetriggerRule, -) -> AlertRetriggerRuleResponse | ErrorsList | None: - """Creates an alert re-trigger rule + body: NewProblem, +) -> ErrorsList | ProblemResponse | None: + """Creates a problem + + Creates a new problem from provided data Args: - body (NewAlertRetriggerRule): + body (NewProblem): Raises: errors.UnexpectedStatus: If the server 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] + ErrorsList | ProblemResponse """ return sync_detailed( @@ -116,19 +125,21 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: NewAlertRetriggerRule, -) -> Response[AlertRetriggerRuleResponse | ErrorsList]: - """Creates an alert re-trigger rule + body: NewProblem, +) -> Response[ErrorsList | ProblemResponse]: + """Creates a problem + + Creates a new problem from provided data Args: - body (NewAlertRetriggerRule): + body (NewProblem): Raises: errors.UnexpectedStatus: If the server returns 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]] + Response[ErrorsList | ProblemResponse] """ kwargs = _get_kwargs( @@ -143,19 +154,21 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: NewAlertRetriggerRule, -) -> AlertRetriggerRuleResponse | ErrorsList | None: - """Creates an alert re-trigger rule + body: NewProblem, +) -> ErrorsList | ProblemResponse | None: + """Creates a problem + + Creates a new problem from provided data Args: - body (NewAlertRetriggerRule): + body (NewProblem): Raises: errors.UnexpectedStatus: If the server 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] + ErrorsList | ProblemResponse """ return ( diff --git a/rootly_sdk/api/alert_retrigger_rules/get_alert_retrigger_rule.py b/rootly_sdk/api/problems/delete_problem.py similarity index 72% rename from rootly_sdk/api/alert_retrigger_rules/get_alert_retrigger_rule.py rename to rootly_sdk/api/problems/delete_problem.py index b5b0f5f7..20fe501a 100644 --- a/rootly_sdk/api/alert_retrigger_rules/get_alert_retrigger_rule.py +++ b/rootly_sdk/api/problems/delete_problem.py @@ -1,20 +1,25 @@ 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.alert_retrigger_rule_response import AlertRetriggerRuleResponse +from ...models.errors_list import ErrorsList +from ...models.problem_response import ProblemResponse 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}", + "method": "delete", + "url": "/v1/problems/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -22,12 +27,17 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> AlertRetriggerRuleResponse | None: +) -> ErrorsList | ProblemResponse | None: if response.status_code == 200: - response_200 = AlertRetriggerRuleResponse.from_dict(response.json()) + response_200 = ProblemResponse.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: @@ -36,7 +46,7 @@ def _parse_response( def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[AlertRetriggerRuleResponse]: +) -> Response[ErrorsList | ProblemResponse]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -49,8 +59,10 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AlertRetriggerRuleResponse]: - """Retrieves an alert re-trigger rule +) -> Response[ErrorsList | ProblemResponse]: + """Deletes a problem + + Soft-deletes a problem Args: id (str): @@ -60,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRetriggerRuleResponse] + Response[ErrorsList | ProblemResponse] """ kwargs = _get_kwargs( @@ -78,8 +90,10 @@ def sync( id: str, *, client: AuthenticatedClient, -) -> AlertRetriggerRuleResponse | None: - """Retrieves an alert re-trigger rule +) -> ErrorsList | ProblemResponse | None: + """Deletes a problem + + Soft-deletes a problem Args: id (str): @@ -89,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRetriggerRuleResponse + ErrorsList | ProblemResponse """ return sync_detailed( @@ -102,8 +116,10 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, -) -> Response[AlertRetriggerRuleResponse]: - """Retrieves an alert re-trigger rule +) -> Response[ErrorsList | ProblemResponse]: + """Deletes a problem + + Soft-deletes a problem Args: id (str): @@ -113,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[AlertRetriggerRuleResponse] + Response[ErrorsList | ProblemResponse] """ kwargs = _get_kwargs( @@ -129,8 +145,10 @@ async def asyncio( id: str, *, client: AuthenticatedClient, -) -> AlertRetriggerRuleResponse | None: - """Retrieves an alert re-trigger rule +) -> ErrorsList | ProblemResponse | None: + """Deletes a problem + + Soft-deletes a problem Args: id (str): @@ -140,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - AlertRetriggerRuleResponse + ErrorsList | ProblemResponse """ return ( diff --git a/rootly_sdk/api/problems/get_problem.py b/rootly_sdk/api/problems/get_problem.py new file mode 100644 index 00000000..3d9cc5b5 --- /dev/null +++ b/rootly_sdk/api/problems/get_problem.py @@ -0,0 +1,173 @@ +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.problem_response import ProblemResponse +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/problems/{id}".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ProblemResponse | None: + if response.status_code == 200: + response_200 = ProblemResponse.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 | ProblemResponse]: + 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 | ProblemResponse]: + """Retrieves a problem + + API callers lacking access to the problem's team receive an error. The API deliberately returns 404 + rather than 403 so existence is not leaked. + + 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[ErrorsList | ProblemResponse] + """ + + 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 | ProblemResponse | None: + """Retrieves a problem + + API callers lacking access to the problem's team receive an error. The API deliberately returns 404 + rather than 403 so existence is not leaked. + + 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: + ErrorsList | ProblemResponse + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorsList | ProblemResponse]: + """Retrieves a problem + + API callers lacking access to the problem's team receive an error. The API deliberately returns 404 + rather than 403 so existence is not leaked. + + 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[ErrorsList | ProblemResponse] + """ + + 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 | ProblemResponse | None: + """Retrieves a problem + + API callers lacking access to the problem's team receive an error. The API deliberately returns 404 + rather than 403 so existence is not leaked. + + 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: + ErrorsList | ProblemResponse + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/problems/link_problem_incidents.py b/rootly_sdk/api/problems/link_problem_incidents.py new file mode 100644 index 00000000..f3032a1b --- /dev/null +++ b/rootly_sdk/api/problems/link_problem_incidents.py @@ -0,0 +1,195 @@ +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.link_incidents import LinkIncidents +from ...models.problem_response import ProblemResponse +from ...types import Response + + +def _get_kwargs( + id: str, + *, + body: LinkIncidents, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/problems/{id}/incidents".format( + id=quote(str(id), safe=""), + ), + } + + _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 | ProblemResponse | None: + if response.status_code == 200: + response_200 = ProblemResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ErrorsList.from_dict(response.json()) + + return response_400 + + 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 | ProblemResponse]: + 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: LinkIncidents, +) -> Response[ErrorsList | ProblemResponse]: + """Links incidents to a problem + + Links one or more incidents to a problem. Accepts `incident_id` (single) or `incident_ids` (array). + + Args: + id (str): + body (LinkIncidents): + + Raises: + errors.UnexpectedStatus: If the server returns 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 | ProblemResponse] + """ + + 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: LinkIncidents, +) -> ErrorsList | ProblemResponse | None: + """Links incidents to a problem + + Links one or more incidents to a problem. Accepts `incident_id` (single) or `incident_ids` (array). + + Args: + id (str): + body (LinkIncidents): + + Raises: + errors.UnexpectedStatus: If the server 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 | ProblemResponse + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, + body: LinkIncidents, +) -> Response[ErrorsList | ProblemResponse]: + """Links incidents to a problem + + Links one or more incidents to a problem. Accepts `incident_id` (single) or `incident_ids` (array). + + Args: + id (str): + body (LinkIncidents): + + Raises: + errors.UnexpectedStatus: If the server returns 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 | ProblemResponse] + """ + + 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: LinkIncidents, +) -> ErrorsList | ProblemResponse | None: + """Links incidents to a problem + + Links one or more incidents to a problem. Accepts `incident_id` (single) or `incident_ids` (array). + + Args: + id (str): + body (LinkIncidents): + + Raises: + errors.UnexpectedStatus: If the server 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 | ProblemResponse + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/problems/list_problems.py b/rootly_sdk/api/problems/list_problems.py new file mode 100644 index 00000000..3635ea6b --- /dev/null +++ b/rootly_sdk/api/problems/list_problems.py @@ -0,0 +1,513 @@ +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.problem_list import ProblemList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + *, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, + filtersearch: str | Unset = UNSET, + filterowner_user_id: int | Unset = UNSET, + filterowner_group_id: str | Unset = UNSET, + filtercreated_by_user_id: int | Unset = UNSET, + filtercreated_atgt: str | Unset = UNSET, + filtercreated_atgte: str | Unset = UNSET, + filtercreated_atlt: str | Unset = UNSET, + filtercreated_atlte: str | Unset = UNSET, + filterdue_dategt: str | Unset = UNSET, + filterdue_dategte: str | Unset = UNSET, + filterdue_datelt: str | Unset = UNSET, + filterdue_datelte: str | Unset = UNSET, + filterstatuseq: str | Unset = UNSET, + filterstatusnot_eq: str | Unset = UNSET, + filterstatusin: str | Unset = UNSET, + filterstatusnot_in: str | Unset = UNSET, + filterpriorityeq: str | Unset = UNSET, + filterprioritynot_eq: str | Unset = UNSET, + filterpriorityin: str | Unset = UNSET, + filterprioritynot_in: str | Unset = UNSET, +) -> dict[str, Any]: + + params: dict[str, Any] = {} + + params["page[number]"] = pagenumber + + params["page[size]"] = pagesize + + params["sort"] = sort + + params["filter[search]"] = filtersearch + + params["filter[owner_user_id]"] = filterowner_user_id + + params["filter[owner_group_id]"] = filterowner_group_id + + params["filter[created_by_user_id]"] = filtercreated_by_user_id + + params["filter[created_at][gt]"] = filtercreated_atgt + + params["filter[created_at][gte]"] = filtercreated_atgte + + params["filter[created_at][lt]"] = filtercreated_atlt + + params["filter[created_at][lte]"] = filtercreated_atlte + + params["filter[due_date][gt]"] = filterdue_dategt + + params["filter[due_date][gte]"] = filterdue_dategte + + params["filter[due_date][lt]"] = filterdue_datelt + + params["filter[due_date][lte]"] = filterdue_datelte + + params["filter[status][eq]"] = filterstatuseq + + params["filter[status][not_eq]"] = filterstatusnot_eq + + params["filter[status][in]"] = filterstatusin + + params["filter[status][not_in]"] = filterstatusnot_in + + params["filter[priority][eq]"] = filterpriorityeq + + params["filter[priority][not_eq]"] = filterprioritynot_eq + + params["filter[priority][in]"] = filterpriorityin + + params["filter[priority][not_in]"] = filterprioritynot_in + + 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/problems", + "params": params, + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ProblemList | None: + if response.status_code == 200: + response_200 = ProblemList.from_dict(response.json()) + + return response_200 + + if response.status_code == 400: + response_400 = ErrorsList.from_dict(response.json()) + + return response_400 + + 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 | ProblemList]: + 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: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, + filtersearch: str | Unset = UNSET, + filterowner_user_id: int | Unset = UNSET, + filterowner_group_id: str | Unset = UNSET, + filtercreated_by_user_id: int | Unset = UNSET, + filtercreated_atgt: str | Unset = UNSET, + filtercreated_atgte: str | Unset = UNSET, + filtercreated_atlt: str | Unset = UNSET, + filtercreated_atlte: str | Unset = UNSET, + filterdue_dategt: str | Unset = UNSET, + filterdue_dategte: str | Unset = UNSET, + filterdue_datelt: str | Unset = UNSET, + filterdue_datelte: str | Unset = UNSET, + filterstatuseq: str | Unset = UNSET, + filterstatusnot_eq: str | Unset = UNSET, + filterstatusin: str | Unset = UNSET, + filterstatusnot_in: str | Unset = UNSET, + filterpriorityeq: str | Unset = UNSET, + filterprioritynot_eq: str | Unset = UNSET, + filterpriorityin: str | Unset = UNSET, + filterprioritynot_in: str | Unset = UNSET, +) -> Response[ErrorsList | ProblemList]: + """List problems + + Sorting by incidents_count would let callers without incident read infer relative hidden incident + counts, so it is rejected. + + Args: + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): + filtersearch (str | Unset): + filterowner_user_id (int | Unset): + filterowner_group_id (str | Unset): + filtercreated_by_user_id (int | Unset): + filtercreated_atgt (str | Unset): + filtercreated_atgte (str | Unset): + filtercreated_atlt (str | Unset): + filtercreated_atlte (str | Unset): + filterdue_dategt (str | Unset): + filterdue_dategte (str | Unset): + filterdue_datelt (str | Unset): + filterdue_datelte (str | Unset): + filterstatuseq (str | Unset): + filterstatusnot_eq (str | Unset): + filterstatusin (str | Unset): + filterstatusnot_in (str | Unset): + filterpriorityeq (str | Unset): + filterprioritynot_eq (str | Unset): + filterpriorityin (str | Unset): + filterprioritynot_in (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorsList | ProblemList] + """ + + kwargs = _get_kwargs( + pagenumber=pagenumber, + pagesize=pagesize, + sort=sort, + filtersearch=filtersearch, + filterowner_user_id=filterowner_user_id, + filterowner_group_id=filterowner_group_id, + filtercreated_by_user_id=filtercreated_by_user_id, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterdue_dategt=filterdue_dategt, + filterdue_dategte=filterdue_dategte, + filterdue_datelt=filterdue_datelt, + filterdue_datelte=filterdue_datelte, + filterstatuseq=filterstatuseq, + filterstatusnot_eq=filterstatusnot_eq, + filterstatusin=filterstatusin, + filterstatusnot_in=filterstatusnot_in, + filterpriorityeq=filterpriorityeq, + filterprioritynot_eq=filterprioritynot_eq, + filterpriorityin=filterpriorityin, + filterprioritynot_in=filterprioritynot_in, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + *, + client: AuthenticatedClient, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, + filtersearch: str | Unset = UNSET, + filterowner_user_id: int | Unset = UNSET, + filterowner_group_id: str | Unset = UNSET, + filtercreated_by_user_id: int | Unset = UNSET, + filtercreated_atgt: str | Unset = UNSET, + filtercreated_atgte: str | Unset = UNSET, + filtercreated_atlt: str | Unset = UNSET, + filtercreated_atlte: str | Unset = UNSET, + filterdue_dategt: str | Unset = UNSET, + filterdue_dategte: str | Unset = UNSET, + filterdue_datelt: str | Unset = UNSET, + filterdue_datelte: str | Unset = UNSET, + filterstatuseq: str | Unset = UNSET, + filterstatusnot_eq: str | Unset = UNSET, + filterstatusin: str | Unset = UNSET, + filterstatusnot_in: str | Unset = UNSET, + filterpriorityeq: str | Unset = UNSET, + filterprioritynot_eq: str | Unset = UNSET, + filterpriorityin: str | Unset = UNSET, + filterprioritynot_in: str | Unset = UNSET, +) -> ErrorsList | ProblemList | None: + """List problems + + Sorting by incidents_count would let callers without incident read infer relative hidden incident + counts, so it is rejected. + + Args: + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): + filtersearch (str | Unset): + filterowner_user_id (int | Unset): + filterowner_group_id (str | Unset): + filtercreated_by_user_id (int | Unset): + filtercreated_atgt (str | Unset): + filtercreated_atgte (str | Unset): + filtercreated_atlt (str | Unset): + filtercreated_atlte (str | Unset): + filterdue_dategt (str | Unset): + filterdue_dategte (str | Unset): + filterdue_datelt (str | Unset): + filterdue_datelte (str | Unset): + filterstatuseq (str | Unset): + filterstatusnot_eq (str | Unset): + filterstatusin (str | Unset): + filterstatusnot_in (str | Unset): + filterpriorityeq (str | Unset): + filterprioritynot_eq (str | Unset): + filterpriorityin (str | Unset): + filterprioritynot_in (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorsList | ProblemList + """ + + return sync_detailed( + client=client, + pagenumber=pagenumber, + pagesize=pagesize, + sort=sort, + filtersearch=filtersearch, + filterowner_user_id=filterowner_user_id, + filterowner_group_id=filterowner_group_id, + filtercreated_by_user_id=filtercreated_by_user_id, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterdue_dategt=filterdue_dategt, + filterdue_dategte=filterdue_dategte, + filterdue_datelt=filterdue_datelt, + filterdue_datelte=filterdue_datelte, + filterstatuseq=filterstatuseq, + filterstatusnot_eq=filterstatusnot_eq, + filterstatusin=filterstatusin, + filterstatusnot_in=filterstatusnot_in, + filterpriorityeq=filterpriorityeq, + filterprioritynot_eq=filterprioritynot_eq, + filterpriorityin=filterpriorityin, + filterprioritynot_in=filterprioritynot_in, + ).parsed + + +async def asyncio_detailed( + *, + client: AuthenticatedClient, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, + filtersearch: str | Unset = UNSET, + filterowner_user_id: int | Unset = UNSET, + filterowner_group_id: str | Unset = UNSET, + filtercreated_by_user_id: int | Unset = UNSET, + filtercreated_atgt: str | Unset = UNSET, + filtercreated_atgte: str | Unset = UNSET, + filtercreated_atlt: str | Unset = UNSET, + filtercreated_atlte: str | Unset = UNSET, + filterdue_dategt: str | Unset = UNSET, + filterdue_dategte: str | Unset = UNSET, + filterdue_datelt: str | Unset = UNSET, + filterdue_datelte: str | Unset = UNSET, + filterstatuseq: str | Unset = UNSET, + filterstatusnot_eq: str | Unset = UNSET, + filterstatusin: str | Unset = UNSET, + filterstatusnot_in: str | Unset = UNSET, + filterpriorityeq: str | Unset = UNSET, + filterprioritynot_eq: str | Unset = UNSET, + filterpriorityin: str | Unset = UNSET, + filterprioritynot_in: str | Unset = UNSET, +) -> Response[ErrorsList | ProblemList]: + """List problems + + Sorting by incidents_count would let callers without incident read infer relative hidden incident + counts, so it is rejected. + + Args: + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): + filtersearch (str | Unset): + filterowner_user_id (int | Unset): + filterowner_group_id (str | Unset): + filtercreated_by_user_id (int | Unset): + filtercreated_atgt (str | Unset): + filtercreated_atgte (str | Unset): + filtercreated_atlt (str | Unset): + filtercreated_atlte (str | Unset): + filterdue_dategt (str | Unset): + filterdue_dategte (str | Unset): + filterdue_datelt (str | Unset): + filterdue_datelte (str | Unset): + filterstatuseq (str | Unset): + filterstatusnot_eq (str | Unset): + filterstatusin (str | Unset): + filterstatusnot_in (str | Unset): + filterpriorityeq (str | Unset): + filterprioritynot_eq (str | Unset): + filterpriorityin (str | Unset): + filterprioritynot_in (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[ErrorsList | ProblemList] + """ + + kwargs = _get_kwargs( + pagenumber=pagenumber, + pagesize=pagesize, + sort=sort, + filtersearch=filtersearch, + filterowner_user_id=filterowner_user_id, + filterowner_group_id=filterowner_group_id, + filtercreated_by_user_id=filtercreated_by_user_id, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterdue_dategt=filterdue_dategt, + filterdue_dategte=filterdue_dategte, + filterdue_datelt=filterdue_datelt, + filterdue_datelte=filterdue_datelte, + filterstatuseq=filterstatuseq, + filterstatusnot_eq=filterstatusnot_eq, + filterstatusin=filterstatusin, + filterstatusnot_in=filterstatusnot_in, + filterpriorityeq=filterpriorityeq, + filterprioritynot_eq=filterprioritynot_eq, + filterpriorityin=filterpriorityin, + filterprioritynot_in=filterprioritynot_in, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + *, + client: AuthenticatedClient, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, + filtersearch: str | Unset = UNSET, + filterowner_user_id: int | Unset = UNSET, + filterowner_group_id: str | Unset = UNSET, + filtercreated_by_user_id: int | Unset = UNSET, + filtercreated_atgt: str | Unset = UNSET, + filtercreated_atgte: str | Unset = UNSET, + filtercreated_atlt: str | Unset = UNSET, + filtercreated_atlte: str | Unset = UNSET, + filterdue_dategt: str | Unset = UNSET, + filterdue_dategte: str | Unset = UNSET, + filterdue_datelt: str | Unset = UNSET, + filterdue_datelte: str | Unset = UNSET, + filterstatuseq: str | Unset = UNSET, + filterstatusnot_eq: str | Unset = UNSET, + filterstatusin: str | Unset = UNSET, + filterstatusnot_in: str | Unset = UNSET, + filterpriorityeq: str | Unset = UNSET, + filterprioritynot_eq: str | Unset = UNSET, + filterpriorityin: str | Unset = UNSET, + filterprioritynot_in: str | Unset = UNSET, +) -> ErrorsList | ProblemList | None: + """List problems + + Sorting by incidents_count would let callers without incident read infer relative hidden incident + counts, so it is rejected. + + Args: + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): + filtersearch (str | Unset): + filterowner_user_id (int | Unset): + filterowner_group_id (str | Unset): + filtercreated_by_user_id (int | Unset): + filtercreated_atgt (str | Unset): + filtercreated_atgte (str | Unset): + filtercreated_atlt (str | Unset): + filtercreated_atlte (str | Unset): + filterdue_dategt (str | Unset): + filterdue_dategte (str | Unset): + filterdue_datelt (str | Unset): + filterdue_datelte (str | Unset): + filterstatuseq (str | Unset): + filterstatusnot_eq (str | Unset): + filterstatusin (str | Unset): + filterstatusnot_in (str | Unset): + filterpriorityeq (str | Unset): + filterprioritynot_eq (str | Unset): + filterpriorityin (str | Unset): + filterprioritynot_in (str | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + ErrorsList | ProblemList + """ + + return ( + await asyncio_detailed( + client=client, + pagenumber=pagenumber, + pagesize=pagesize, + sort=sort, + filtersearch=filtersearch, + filterowner_user_id=filterowner_user_id, + filterowner_group_id=filterowner_group_id, + filtercreated_by_user_id=filtercreated_by_user_id, + filtercreated_atgt=filtercreated_atgt, + filtercreated_atgte=filtercreated_atgte, + filtercreated_atlt=filtercreated_atlt, + filtercreated_atlte=filtercreated_atlte, + filterdue_dategt=filterdue_dategt, + filterdue_dategte=filterdue_dategte, + filterdue_datelt=filterdue_datelt, + filterdue_datelte=filterdue_datelte, + filterstatuseq=filterstatuseq, + filterstatusnot_eq=filterstatusnot_eq, + filterstatusin=filterstatusin, + filterstatusnot_in=filterstatusnot_in, + filterpriorityeq=filterpriorityeq, + filterprioritynot_eq=filterprioritynot_eq, + filterpriorityin=filterpriorityin, + filterprioritynot_in=filterprioritynot_in, + ) + ).parsed diff --git a/rootly_sdk/api/problems/unlink_problem_incident.py b/rootly_sdk/api/problems/unlink_problem_incident.py new file mode 100644 index 00000000..1df6dc79 --- /dev/null +++ b/rootly_sdk/api/problems/unlink_problem_incident.py @@ -0,0 +1,183 @@ +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.problem_response import ProblemResponse +from ...types import Response + + +def _get_kwargs( + id: str, + incident_id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v1/problems/{id}/incidents/{incident_id}".format( + id=quote(str(id), safe=""), + incident_id=quote(str(incident_id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | ProblemResponse | None: + if response.status_code == 200: + response_200 = ProblemResponse.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 | ProblemResponse]: + 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, + incident_id: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorsList | ProblemResponse]: + """Unlinks an incident from a problem + + Unlinks an incident from a problem + + Args: + id (str): + incident_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[ErrorsList | ProblemResponse] + """ + + kwargs = _get_kwargs( + id=id, + incident_id=incident_id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + id: str, + incident_id: str, + *, + client: AuthenticatedClient, +) -> ErrorsList | ProblemResponse | None: + """Unlinks an incident from a problem + + Unlinks an incident from a problem + + Args: + id (str): + incident_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: + ErrorsList | ProblemResponse + """ + + return sync_detailed( + id=id, + incident_id=incident_id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + incident_id: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorsList | ProblemResponse]: + """Unlinks an incident from a problem + + Unlinks an incident from a problem + + Args: + id (str): + incident_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[ErrorsList | ProblemResponse] + """ + + kwargs = _get_kwargs( + id=id, + incident_id=incident_id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + id: str, + incident_id: str, + *, + client: AuthenticatedClient, +) -> ErrorsList | ProblemResponse | None: + """Unlinks an incident from a problem + + Unlinks an incident from a problem + + Args: + id (str): + incident_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: + ErrorsList | ProblemResponse + """ + + return ( + await asyncio_detailed( + id=id, + incident_id=incident_id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/problems/update_problem.py b/rootly_sdk/api/problems/update_problem.py new file mode 100644 index 00000000..d91c6414 --- /dev/null +++ b/rootly_sdk/api/problems/update_problem.py @@ -0,0 +1,195 @@ +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.problem_response import ProblemResponse +from ...models.update_problem import UpdateProblem +from ...types import Response + + +def _get_kwargs( + id: str, + *, + body: UpdateProblem, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/problems/{id}".format( + id=quote(str(id), safe=""), + ), + } + + _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 | ProblemResponse | None: + if response.status_code == 200: + response_200 = ProblemResponse.from_dict(response.json()) + + return response_200 + + if response.status_code == 404: + response_404 = ErrorsList.from_dict(response.json()) + + 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: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | ProblemResponse]: + 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: UpdateProblem, +) -> Response[ErrorsList | ProblemResponse]: + """Update a problem + + When a status transition fails validation, accompanying field updates roll back with it. + + Args: + id (str): + body (UpdateProblem): + + Raises: + errors.UnexpectedStatus: If the server returns 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 | ProblemResponse] + """ + + 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: UpdateProblem, +) -> ErrorsList | ProblemResponse | None: + """Update a problem + + When a status transition fails validation, accompanying field updates roll back with it. + + Args: + id (str): + body (UpdateProblem): + + Raises: + errors.UnexpectedStatus: If the server 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 | ProblemResponse + """ + + return sync_detailed( + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, + body: UpdateProblem, +) -> Response[ErrorsList | ProblemResponse]: + """Update a problem + + When a status transition fails validation, accompanying field updates roll back with it. + + Args: + id (str): + body (UpdateProblem): + + Raises: + errors.UnexpectedStatus: If the server returns 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 | ProblemResponse] + """ + + 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: UpdateProblem, +) -> ErrorsList | ProblemResponse | None: + """Update a problem + + When a status transition fails validation, accompanying field updates roll back with it. + + Args: + id (str): + body (UpdateProblem): + + Raises: + errors.UnexpectedStatus: If the server 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 | ProblemResponse + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/pulses/create_pulse.py b/rootly_sdk/api/pulses/create_pulse.py index a54eb50b..30b82b81 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[Union[ErrorsList, PulseResponse]] + Response[ErrorsList | PulseResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PulseResponse] + 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[Union[ErrorsList, PulseResponse]] + Response[ErrorsList | PulseResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PulseResponse] + ErrorsList | PulseResponse """ return ( diff --git a/rootly_sdk/api/pulses/get_pulse.py b/rootly_sdk/api/pulses/get_pulse.py index 66769553..1d751fd4 100644 --- a/rootly_sdk/api/pulses/get_pulse.py +++ b/rootly_sdk/api/pulses/get_pulse.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/pulses/{id}", + "url": "/v1/pulses/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PulseResponse]] + Response[ErrorsList | PulseResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PulseResponse] + ErrorsList | PulseResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PulseResponse]] + Response[ErrorsList | PulseResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PulseResponse] + ErrorsList | PulseResponse """ return ( diff --git a/rootly_sdk/api/pulses/list_pulses.py b/rootly_sdk/api/pulses/list_pulses.py index c03b1e5f..1603a528 100644 --- a/rootly_sdk/api/pulses/list_pulses.py +++ b/rootly_sdk/api/pulses/list_pulses.py @@ -11,47 +11,48 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -169,92 +170,92 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[PulseList]: """List pulses List pulses Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -317,92 +318,92 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> PulseList | None: """List pulses List pulses Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -460,92 +461,92 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[PulseList]: """List pulses List pulses Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -606,92 +607,92 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> PulseList | None: """List pulses List pulses Args: - 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]): + 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): 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 2364915a..38022933 100644 --- a/rootly_sdk/api/pulses/update_pulse.py +++ b/rootly_sdk/api/pulses/update_pulse.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/pulses/{id}", + "url": "/v1/pulses/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PulseResponse]] + Response[ErrorsList | PulseResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PulseResponse] + ErrorsList | PulseResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PulseResponse]] + Response[ErrorsList | PulseResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PulseResponse] + 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 c9e25ba8..a198248f 100644 --- a/rootly_sdk/api/retrospective_configurations/get_retrospective_configuration.py +++ b/rootly_sdk/api/retrospective_configurations/get_retrospective_configuration.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -16,11 +17,12 @@ def _get_kwargs( id: str, *, - include: Unset | GetRetrospectiveConfigurationInclude = UNSET, + include: GetRetrospectiveConfigurationInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -30,7 +32,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/retrospective_configurations/{id}", + "url": "/v1/retrospective_configurations/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -71,7 +75,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetRetrospectiveConfigurationInclude = UNSET, + include: GetRetrospectiveConfigurationInclude | Unset = UNSET, ) -> Response[ErrorsList | RetrospectiveConfigurationResponse]: """Retrieves a Retrospective Configuration @@ -79,14 +83,14 @@ def sync_detailed( Args: id (str): - include (Union[Unset, GetRetrospectiveConfigurationInclude]): + include (GetRetrospectiveConfigurationInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveConfigurationResponse]] + Response[ErrorsList | RetrospectiveConfigurationResponse] """ kwargs = _get_kwargs( @@ -105,7 +109,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Unset | GetRetrospectiveConfigurationInclude = UNSET, + include: GetRetrospectiveConfigurationInclude | Unset = UNSET, ) -> ErrorsList | RetrospectiveConfigurationResponse | None: """Retrieves a Retrospective Configuration @@ -113,14 +117,14 @@ def sync( Args: id (str): - include (Union[Unset, GetRetrospectiveConfigurationInclude]): + include (GetRetrospectiveConfigurationInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveConfigurationResponse] + ErrorsList | RetrospectiveConfigurationResponse """ return sync_detailed( @@ -134,7 +138,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetRetrospectiveConfigurationInclude = UNSET, + include: GetRetrospectiveConfigurationInclude | Unset = UNSET, ) -> Response[ErrorsList | RetrospectiveConfigurationResponse]: """Retrieves a Retrospective Configuration @@ -142,14 +146,14 @@ async def asyncio_detailed( Args: id (str): - include (Union[Unset, GetRetrospectiveConfigurationInclude]): + include (GetRetrospectiveConfigurationInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveConfigurationResponse]] + Response[ErrorsList | RetrospectiveConfigurationResponse] """ kwargs = _get_kwargs( @@ -166,7 +170,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Unset | GetRetrospectiveConfigurationInclude = UNSET, + include: GetRetrospectiveConfigurationInclude | Unset = UNSET, ) -> ErrorsList | RetrospectiveConfigurationResponse | None: """Retrieves a Retrospective Configuration @@ -174,14 +178,14 @@ async def asyncio( Args: id (str): - include (Union[Unset, GetRetrospectiveConfigurationInclude]): + include (GetRetrospectiveConfigurationInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveConfigurationResponse] + 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 219d509d..41494cab 100644 --- a/rootly_sdk/api/retrospective_configurations/list_retrospective_configurations.py +++ b/rootly_sdk/api/retrospective_configurations/list_retrospective_configurations.py @@ -14,14 +14,15 @@ def _get_kwargs( *, - include: Unset | ListRetrospectiveConfigurationsInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterkind: Unset | str = UNSET, + include: ListRetrospectiveConfigurationsInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterkind: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -72,20 +73,20 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Unset | ListRetrospectiveConfigurationsInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterkind: Unset | str = UNSET, + include: ListRetrospectiveConfigurationsInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterkind: str | Unset = UNSET, ) -> Response[RetrospectiveConfigurationList]: """List retrospective configurations List retrospective configurations Args: - include (Union[Unset, ListRetrospectiveConfigurationsInclude]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterkind (Union[Unset, str]): + include (ListRetrospectiveConfigurationsInclude | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterkind (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -112,20 +113,20 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Unset | ListRetrospectiveConfigurationsInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterkind: Unset | str = UNSET, + include: ListRetrospectiveConfigurationsInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterkind: str | Unset = UNSET, ) -> RetrospectiveConfigurationList | None: """List retrospective configurations List retrospective configurations Args: - include (Union[Unset, ListRetrospectiveConfigurationsInclude]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterkind (Union[Unset, str]): + include (ListRetrospectiveConfigurationsInclude | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterkind (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -147,20 +148,20 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Unset | ListRetrospectiveConfigurationsInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterkind: Unset | str = UNSET, + include: ListRetrospectiveConfigurationsInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterkind: str | Unset = UNSET, ) -> Response[RetrospectiveConfigurationList]: """List retrospective configurations List retrospective configurations Args: - include (Union[Unset, ListRetrospectiveConfigurationsInclude]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterkind (Union[Unset, str]): + include (ListRetrospectiveConfigurationsInclude | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterkind (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -185,20 +186,20 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Unset | ListRetrospectiveConfigurationsInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterkind: Unset | str = UNSET, + include: ListRetrospectiveConfigurationsInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterkind: str | Unset = UNSET, ) -> RetrospectiveConfigurationList | None: """List retrospective configurations List retrospective configurations Args: - include (Union[Unset, ListRetrospectiveConfigurationsInclude]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterkind (Union[Unset, str]): + include (ListRetrospectiveConfigurationsInclude | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterkind (str | Unset): 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 0947dc5e..ceb35adb 100644 --- a/rootly_sdk/api/retrospective_configurations/update_retrospective_configuration.py +++ b/rootly_sdk/api/retrospective_configurations/update_retrospective_configuration.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/retrospective_configurations/{id}", + "url": "/v1/retrospective_configurations/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveConfigurationResponse]] + Response[ErrorsList | RetrospectiveConfigurationResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveConfigurationResponse] + ErrorsList | RetrospectiveConfigurationResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveConfigurationResponse]] + Response[ErrorsList | RetrospectiveConfigurationResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveConfigurationResponse] + 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 fc44bf43..2284fedd 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/retrospective_process_groups/{retrospective_process_group_id}/steps", + "url": "/v1/retrospective_process_groups/{retrospective_process_group_id}/steps".format( + retrospective_process_group_id=quote(str(retrospective_process_group_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]] + Response[ErrorsList | RetrospectiveProcessGroupStepResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveProcessGroupStepResponse] + ErrorsList | RetrospectiveProcessGroupStepResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]] + Response[ErrorsList | RetrospectiveProcessGroupStepResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveProcessGroupStepResponse] + 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 f3a4c85f..e49707dd 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/retrospective_process_group_steps/{id}", + "url": "/v1/retrospective_process_group_steps/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]] + Response[ErrorsList | RetrospectiveProcessGroupStepResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveProcessGroupStepResponse] + ErrorsList | RetrospectiveProcessGroupStepResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveProcessGroupStepResponse]] + Response[ErrorsList | RetrospectiveProcessGroupStepResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveProcessGroupStepResponse] + 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 769b164e..7cb7eca6 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/retrospective_process_group_steps/{id}", + "url": "/v1/retrospective_process_group_steps/{id}".format( + id=quote(str(id), safe=""), + ), } 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 2c7ec67e..71508e1f 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,15 +13,16 @@ def _get_kwargs( retrospective_process_group_id: str, *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -43,7 +45,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/retrospective_process_groups/{retrospective_process_group_id}/steps", + "url": "/v1/retrospective_process_groups/{retrospective_process_group_id}/steps".format( + retrospective_process_group_id=quote(str(retrospective_process_group_id), safe=""), + ), "params": params, } @@ -79,14 +83,14 @@ def sync_detailed( retrospective_process_group_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> Response[RetrospectiveProcessGroupStepList]: """List RetrospectiveProcessGroup Steps @@ -94,14 +98,14 @@ def sync_detailed( Args: retrospective_process_group_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -134,14 +138,14 @@ def sync( retrospective_process_group_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> RetrospectiveProcessGroupStepList | None: """List RetrospectiveProcessGroup Steps @@ -149,14 +153,14 @@ def sync( Args: retrospective_process_group_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -184,14 +188,14 @@ async def asyncio_detailed( retrospective_process_group_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> Response[RetrospectiveProcessGroupStepList]: """List RetrospectiveProcessGroup Steps @@ -199,14 +203,14 @@ async def asyncio_detailed( Args: retrospective_process_group_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -237,14 +241,14 @@ async def asyncio( retrospective_process_group_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> RetrospectiveProcessGroupStepList | None: """List RetrospectiveProcessGroup Steps @@ -252,14 +256,14 @@ async def asyncio( Args: retrospective_process_group_id (str): - 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]): + 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): 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 db601b68..6672af62 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -19,7 +20,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/retrospective_process_group_steps/{id}", + "url": "/v1/retrospective_process_group_steps/{id}".format( + id=quote(str(id), safe=""), + ), } _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 b2593167..5d7feb3c 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/retrospective_processes/{retrospective_process_id}/groups", + "url": "/v1/retrospective_processes/{retrospective_process_id}/groups".format( + retrospective_process_id=quote(str(retrospective_process_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]] + Response[ErrorsList | RetrospectiveProcessGroupResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveProcessGroupResponse] + ErrorsList | RetrospectiveProcessGroupResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]] + Response[ErrorsList | RetrospectiveProcessGroupResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveProcessGroupResponse] + 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 e5af35fc..ffa0bd00 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/retrospective_process_groups/{id}", + "url": "/v1/retrospective_process_groups/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]] + Response[ErrorsList | RetrospectiveProcessGroupResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveProcessGroupResponse] + ErrorsList | RetrospectiveProcessGroupResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveProcessGroupResponse]] + Response[ErrorsList | RetrospectiveProcessGroupResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveProcessGroupResponse] + 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 02bd0f1b..a1f3483d 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -15,11 +16,12 @@ def _get_kwargs( id: str, *, - include: Unset | GetRetrospectiveProcessGroupInclude = UNSET, + include: GetRetrospectiveProcessGroupInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -29,7 +31,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/retrospective_process_groups/{id}", + "url": "/v1/retrospective_process_groups/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -65,7 +69,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetRetrospectiveProcessGroupInclude = UNSET, + include: GetRetrospectiveProcessGroupInclude | Unset = UNSET, ) -> Response[RetrospectiveProcessGroupResponse]: """Retrieves a Retrospective Process Group @@ -73,7 +77,7 @@ def sync_detailed( Args: id (str): - include (Union[Unset, GetRetrospectiveProcessGroupInclude]): + include (GetRetrospectiveProcessGroupInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -99,7 +103,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Unset | GetRetrospectiveProcessGroupInclude = UNSET, + include: GetRetrospectiveProcessGroupInclude | Unset = UNSET, ) -> RetrospectiveProcessGroupResponse | None: """Retrieves a Retrospective Process Group @@ -107,7 +111,7 @@ def sync( Args: id (str): - include (Union[Unset, GetRetrospectiveProcessGroupInclude]): + include (GetRetrospectiveProcessGroupInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -128,7 +132,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetRetrospectiveProcessGroupInclude = UNSET, + include: GetRetrospectiveProcessGroupInclude | Unset = UNSET, ) -> Response[RetrospectiveProcessGroupResponse]: """Retrieves a Retrospective Process Group @@ -136,7 +140,7 @@ async def asyncio_detailed( Args: id (str): - include (Union[Unset, GetRetrospectiveProcessGroupInclude]): + include (GetRetrospectiveProcessGroupInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -160,7 +164,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Unset | GetRetrospectiveProcessGroupInclude = UNSET, + include: GetRetrospectiveProcessGroupInclude | Unset = UNSET, ) -> RetrospectiveProcessGroupResponse | None: """Retrieves a Retrospective Process Group @@ -168,7 +172,7 @@ async def asyncio( Args: id (str): - include (Union[Unset, GetRetrospectiveProcessGroupInclude]): + include (GetRetrospectiveProcessGroupInclude | Unset): 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 364e8a03..a2ace0f8 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -18,25 +19,26 @@ def _get_kwargs( retrospective_process_id: str, *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Unset | str = UNSET + json_sort: str | Unset = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -60,7 +62,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/retrospective_processes/{retrospective_process_id}/groups", + "url": "/v1/retrospective_processes/{retrospective_process_id}/groups".format( + retrospective_process_id=quote(str(retrospective_process_id), safe=""), + ), "params": params, } @@ -96,15 +100,15 @@ def sync_detailed( retrospective_process_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> Response[RetrospectiveProcessGroupList]: """List Retrospective Process Groups @@ -112,15 +116,15 @@ def sync_detailed( Args: retrospective_process_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -154,15 +158,15 @@ def sync( retrospective_process_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> RetrospectiveProcessGroupList | None: """List Retrospective Process Groups @@ -170,15 +174,15 @@ def sync( Args: retrospective_process_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -207,15 +211,15 @@ async def asyncio_detailed( retrospective_process_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> Response[RetrospectiveProcessGroupList]: """List Retrospective Process Groups @@ -223,15 +227,15 @@ async def asyncio_detailed( Args: retrospective_process_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -263,15 +267,15 @@ async def asyncio( retrospective_process_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> RetrospectiveProcessGroupList | None: """List Retrospective Process Groups @@ -279,15 +283,15 @@ async def asyncio( Args: retrospective_process_id (str): - 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]): + 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): 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 0960115f..025b6851 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -19,7 +20,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/retrospective_process_groups/{id}", + "url": "/v1/retrospective_process_groups/{id}".format( + id=quote(str(id), safe=""), + ), } _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 80fdaa15..958b54e7 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[Union[ErrorsList, RetrospectiveProcessResponse]] + Response[ErrorsList | RetrospectiveProcessResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveProcessResponse] + 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[Union[ErrorsList, RetrospectiveProcessResponse]] + Response[ErrorsList | RetrospectiveProcessResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveProcessResponse] + 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 8c3808e0..cb4c54f8 100644 --- a/rootly_sdk/api/retrospective_processes/delete_retrospective_process.py +++ b/rootly_sdk/api/retrospective_processes/delete_retrospective_process.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/retrospective_processes/{id}", + "url": "/v1/retrospective_processes/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveProcessResponse]] + Response[ErrorsList | RetrospectiveProcessResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveProcessResponse] + ErrorsList | RetrospectiveProcessResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveProcessResponse]] + Response[ErrorsList | RetrospectiveProcessResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveProcessResponse] + 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 f86ca3de..f88cfd09 100644 --- a/rootly_sdk/api/retrospective_processes/get_retrospective_process.py +++ b/rootly_sdk/api/retrospective_processes/get_retrospective_process.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -16,11 +17,12 @@ def _get_kwargs( id: str, *, - include: Unset | GetRetrospectiveProcessInclude = UNSET, + include: GetRetrospectiveProcessInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -30,7 +32,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/retrospective_processes/{id}", + "url": "/v1/retrospective_processes/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -71,7 +75,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetRetrospectiveProcessInclude = UNSET, + include: GetRetrospectiveProcessInclude | Unset = UNSET, ) -> Response[ErrorsList | RetrospectiveProcessResponse]: """Retrieves a retrospective process @@ -79,14 +83,14 @@ def sync_detailed( Args: id (str): - include (Union[Unset, GetRetrospectiveProcessInclude]): + include (GetRetrospectiveProcessInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveProcessResponse]] + Response[ErrorsList | RetrospectiveProcessResponse] """ kwargs = _get_kwargs( @@ -105,7 +109,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Unset | GetRetrospectiveProcessInclude = UNSET, + include: GetRetrospectiveProcessInclude | Unset = UNSET, ) -> ErrorsList | RetrospectiveProcessResponse | None: """Retrieves a retrospective process @@ -113,14 +117,14 @@ def sync( Args: id (str): - include (Union[Unset, GetRetrospectiveProcessInclude]): + include (GetRetrospectiveProcessInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveProcessResponse] + ErrorsList | RetrospectiveProcessResponse """ return sync_detailed( @@ -134,7 +138,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetRetrospectiveProcessInclude = UNSET, + include: GetRetrospectiveProcessInclude | Unset = UNSET, ) -> Response[ErrorsList | RetrospectiveProcessResponse]: """Retrieves a retrospective process @@ -142,14 +146,14 @@ async def asyncio_detailed( Args: id (str): - include (Union[Unset, GetRetrospectiveProcessInclude]): + include (GetRetrospectiveProcessInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveProcessResponse]] + Response[ErrorsList | RetrospectiveProcessResponse] """ kwargs = _get_kwargs( @@ -166,7 +170,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Unset | GetRetrospectiveProcessInclude = UNSET, + include: GetRetrospectiveProcessInclude | Unset = UNSET, ) -> ErrorsList | RetrospectiveProcessResponse | None: """Retrieves a retrospective process @@ -174,14 +178,14 @@ async def asyncio( Args: id (str): - include (Union[Unset, GetRetrospectiveProcessInclude]): + include (GetRetrospectiveProcessInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveProcessResponse] + 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 b2fbd7b2..a106a418 100644 --- a/rootly_sdk/api/retrospective_processes/list_retrospective_processes.py +++ b/rootly_sdk/api/retrospective_processes/list_retrospective_processes.py @@ -14,13 +14,14 @@ def _get_kwargs( *, - include: Unset | ListRetrospectiveProcessesInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListRetrospectiveProcessesInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -69,18 +70,18 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Unset | ListRetrospectiveProcessesInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListRetrospectiveProcessesInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[RetrospectiveProcessList]: """List retrospective processes List retrospective processes Args: - include (Union[Unset, ListRetrospectiveProcessesInclude]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (ListRetrospectiveProcessesInclude | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -106,18 +107,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Unset | ListRetrospectiveProcessesInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListRetrospectiveProcessesInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> RetrospectiveProcessList | None: """List retrospective processes List retrospective processes Args: - include (Union[Unset, ListRetrospectiveProcessesInclude]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (ListRetrospectiveProcessesInclude | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -138,18 +139,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Unset | ListRetrospectiveProcessesInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListRetrospectiveProcessesInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[RetrospectiveProcessList]: """List retrospective processes List retrospective processes Args: - include (Union[Unset, ListRetrospectiveProcessesInclude]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (ListRetrospectiveProcessesInclude | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -173,18 +174,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Unset | ListRetrospectiveProcessesInclude = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: ListRetrospectiveProcessesInclude | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> RetrospectiveProcessList | None: """List retrospective processes List retrospective processes Args: - include (Union[Unset, ListRetrospectiveProcessesInclude]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (ListRetrospectiveProcessesInclude | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 8afeb077..d290ed1b 100644 --- a/rootly_sdk/api/retrospective_processes/update_retrospective_process.py +++ b/rootly_sdk/api/retrospective_processes/update_retrospective_process.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/retrospective_processes/{id}", + "url": "/v1/retrospective_processes/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveProcessResponse]] + Response[ErrorsList | RetrospectiveProcessResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveProcessResponse] + ErrorsList | RetrospectiveProcessResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveProcessResponse]] + Response[ErrorsList | RetrospectiveProcessResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveProcessResponse] + 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 8c370ff6..92dfb6e8 100644 --- a/rootly_sdk/api/retrospective_steps/create_retrospective_step.py +++ b/rootly_sdk/api/retrospective_steps/create_retrospective_step.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/retrospective_processes/{retrospective_process_id}/retrospective_steps", + "url": "/v1/retrospective_processes/{retrospective_process_id}/retrospective_steps".format( + retrospective_process_id=quote(str(retrospective_process_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveStepResponse]] + Response[ErrorsList | RetrospectiveStepResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveStepResponse] + ErrorsList | RetrospectiveStepResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveStepResponse]] + Response[ErrorsList | RetrospectiveStepResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveStepResponse] + 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 5988c137..51361c85 100644 --- a/rootly_sdk/api/retrospective_steps/delete_retrospective_step.py +++ b/rootly_sdk/api/retrospective_steps/delete_retrospective_step.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/retrospective_steps/{id}", + "url": "/v1/retrospective_steps/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveStepResponse]] + Response[ErrorsList | RetrospectiveStepResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveStepResponse] + ErrorsList | RetrospectiveStepResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveStepResponse]] + Response[ErrorsList | RetrospectiveStepResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveStepResponse] + 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 52b64de5..416a641b 100644 --- a/rootly_sdk/api/retrospective_steps/get_retrospective_step.py +++ b/rootly_sdk/api/retrospective_steps/get_retrospective_step.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/retrospective_steps/{id}", + "url": "/v1/retrospective_steps/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveStepResponse]] + Response[ErrorsList | RetrospectiveStepResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveStepResponse] + ErrorsList | RetrospectiveStepResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveStepResponse]] + Response[ErrorsList | RetrospectiveStepResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveStepResponse] + 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 11922444..d611a9e0 100644 --- a/rootly_sdk/api/retrospective_steps/list_retrospective_steps.py +++ b/rootly_sdk/api/retrospective_steps/list_retrospective_steps.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,11 +13,12 @@ def _get_kwargs( retrospective_process_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - sort: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -31,7 +33,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/retrospective_processes/{retrospective_process_id}/retrospective_steps", + "url": "/v1/retrospective_processes/{retrospective_process_id}/retrospective_steps".format( + retrospective_process_id=quote(str(retrospective_process_id), safe=""), + ), "params": params, } @@ -65,10 +69,10 @@ def sync_detailed( retrospective_process_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - sort: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, ) -> Response[RetrospectiveStepList]: """List retrospective steps @@ -76,10 +80,10 @@ def sync_detailed( Args: retrospective_process_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - sort (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,10 +112,10 @@ def sync( retrospective_process_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - sort: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, ) -> RetrospectiveStepList | None: """List retrospective steps @@ -119,10 +123,10 @@ def sync( Args: retrospective_process_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - sort (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -146,10 +150,10 @@ async def asyncio_detailed( retrospective_process_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - sort: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, ) -> Response[RetrospectiveStepList]: """List retrospective steps @@ -157,10 +161,10 @@ async def asyncio_detailed( Args: retrospective_process_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - sort (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -187,10 +191,10 @@ async def asyncio( retrospective_process_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - sort: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, ) -> RetrospectiveStepList | None: """List retrospective steps @@ -198,10 +202,10 @@ async def asyncio( Args: retrospective_process_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - sort (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): 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 553bd75e..004aa760 100644 --- a/rootly_sdk/api/retrospective_steps/update_retrospective_step.py +++ b/rootly_sdk/api/retrospective_steps/update_retrospective_step.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/retrospective_steps/{id}", + "url": "/v1/retrospective_steps/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveStepResponse]] + Response[ErrorsList | RetrospectiveStepResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveStepResponse] + ErrorsList | RetrospectiveStepResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RetrospectiveStepResponse]] + Response[ErrorsList | RetrospectiveStepResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RetrospectiveStepResponse] + 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 854b6889..a45d193d 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[Union[ErrorsList, PostMortemTemplateResponse]] + Response[ErrorsList | PostMortemTemplateResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PostMortemTemplateResponse] + 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[Union[ErrorsList, PostMortemTemplateResponse]] + Response[ErrorsList | PostMortemTemplateResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PostMortemTemplateResponse] + 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 b88c5b8d..aafa6848 100644 --- a/rootly_sdk/api/retrospective_templates/delete_postmortem_template.py +++ b/rootly_sdk/api/retrospective_templates/delete_postmortem_template.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/post_mortem_templates/{id}", + "url": "/v1/post_mortem_templates/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | PostMortemTemplateResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific Retrospective Template by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, PostMortemTemplateResponse]] + Response[ErrorsList | PostMortemTemplateResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | PostMortemTemplateResponse | None: @@ -93,14 +97,14 @@ def sync( Delete a specific Retrospective Template by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, PostMortemTemplateResponse] + ErrorsList | PostMortemTemplateResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | PostMortemTemplateResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific Retrospective Template by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, PostMortemTemplateResponse]] + Response[ErrorsList | PostMortemTemplateResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | PostMortemTemplateResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific Retrospective Template by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, PostMortemTemplateResponse] + 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 b4484263..20fda05d 100644 --- a/rootly_sdk/api/retrospective_templates/get_postmortem_template.py +++ b/rootly_sdk/api/retrospective_templates/get_postmortem_template.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/post_mortem_templates/{id}", + "url": "/v1/post_mortem_templates/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | PostMortemTemplateResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific Retrospective Template by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, PostMortemTemplateResponse]] + Response[ErrorsList | PostMortemTemplateResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | PostMortemTemplateResponse | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific Retrospective Template by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, PostMortemTemplateResponse] + ErrorsList | PostMortemTemplateResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | PostMortemTemplateResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific Retrospective Template by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, PostMortemTemplateResponse]] + Response[ErrorsList | PostMortemTemplateResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | PostMortemTemplateResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific Retrospective Template by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, PostMortemTemplateResponse] + 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 4bd711cb..a85e9595 100644 --- a/rootly_sdk/api/retrospective_templates/list_postmortem_templates.py +++ b/rootly_sdk/api/retrospective_templates/list_postmortem_templates.py @@ -11,10 +11,11 @@ def _get_kwargs( *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -60,18 +61,18 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[PostMortemTemplateList]: """List Retrospective Templates List Retrospective Templates Args: - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -97,18 +98,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> PostMortemTemplateList | None: """List Retrospective Templates List Retrospective Templates Args: - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -129,18 +130,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[PostMortemTemplateList]: """List Retrospective Templates List Retrospective Templates Args: - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -164,18 +165,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> PostMortemTemplateList | None: """List Retrospective Templates List Retrospective Templates Args: - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 c3d78abf..32d1be7f 100644 --- a/rootly_sdk/api/retrospective_templates/update_postmortem_template.py +++ b/rootly_sdk/api/retrospective_templates/update_postmortem_template.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdatePostMortemTemplate, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/post_mortem_templates/{id}", + "url": "/v1/post_mortem_templates/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdatePostMortemTemplate, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific Retrospective Template by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdatePostMortemTemplate): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PostMortemTemplateResponse]] + Response[ErrorsList | PostMortemTemplateResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdatePostMortemTemplate, @@ -107,7 +110,7 @@ def sync( Update a specific Retrospective Template by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdatePostMortemTemplate): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PostMortemTemplateResponse] + ErrorsList | PostMortemTemplateResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdatePostMortemTemplate, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific Retrospective Template by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdatePostMortemTemplate): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, PostMortemTemplateResponse]] + Response[ErrorsList | PostMortemTemplateResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdatePostMortemTemplate, @@ -168,7 +171,7 @@ async def asyncio( Update a specific Retrospective Template by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdatePostMortemTemplate): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, PostMortemTemplateResponse] + ErrorsList | PostMortemTemplateResponse """ return ( diff --git a/rootly_sdk/api/roles/create_role.py b/rootly_sdk/api/roles/create_role.py index cc05aa9d..14a23064 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[Union[ErrorsList, RoleResponse]] + Response[ErrorsList | RoleResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RoleResponse] + 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[Union[ErrorsList, RoleResponse]] + Response[ErrorsList | RoleResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RoleResponse] + ErrorsList | RoleResponse """ return ( diff --git a/rootly_sdk/api/roles/delete_role.py b/rootly_sdk/api/roles/delete_role.py index c4103b98..72c04400 100644 --- a/rootly_sdk/api/roles/delete_role.py +++ b/rootly_sdk/api/roles/delete_role.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/roles/{id}", + "url": "/v1/roles/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | RoleResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific role by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, RoleResponse]] + Response[ErrorsList | RoleResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | RoleResponse | None: @@ -93,14 +97,14 @@ def sync( Delete a specific role by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, RoleResponse] + ErrorsList | RoleResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | RoleResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific role by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, RoleResponse]] + Response[ErrorsList | RoleResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | RoleResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific role by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, RoleResponse] + ErrorsList | RoleResponse """ return ( diff --git a/rootly_sdk/api/roles/get_role.py b/rootly_sdk/api/roles/get_role.py index fa5e147f..ec32d7ee 100644 --- a/rootly_sdk/api/roles/get_role.py +++ b/rootly_sdk/api/roles/get_role.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/roles/{id}", + "url": "/v1/roles/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | RoleResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific role by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, RoleResponse]] + Response[ErrorsList | RoleResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | RoleResponse | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific role by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, RoleResponse] + ErrorsList | RoleResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | RoleResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific role by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, RoleResponse]] + Response[ErrorsList | RoleResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | RoleResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific role by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, RoleResponse] + ErrorsList | RoleResponse """ return ( diff --git a/rootly_sdk/api/roles/list_roles.py b/rootly_sdk/api/roles/list_roles.py index 92958f7c..fd378970 100644 --- a/rootly_sdk/api/roles/list_roles.py +++ b/rootly_sdk/api/roles/list_roles.py @@ -11,18 +11,19 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -82,34 +83,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[RoleList]: """List roles List roles Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -143,34 +144,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> RoleList | None: """List roles List roles Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -199,34 +200,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[RoleList]: """List roles List roles Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -258,34 +259,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> RoleList | None: """List roles List roles Args: - 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]): + 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): 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 2aae9b98..a0e1e4cd 100644 --- a/rootly_sdk/api/roles/update_role.py +++ b/rootly_sdk/api/roles/update_role.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateRole, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/roles/{id}", + "url": "/v1/roles/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateRole, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific role by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateRole): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RoleResponse]] + Response[ErrorsList | RoleResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateRole, @@ -107,7 +110,7 @@ def sync( Update a specific role by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateRole): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RoleResponse] + ErrorsList | RoleResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateRole, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific role by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateRole): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, RoleResponse]] + Response[ErrorsList | RoleResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateRole, @@ -168,7 +171,7 @@ async def asyncio( Update a specific role by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateRole): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, RoleResponse] + 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 c107f416..8bb86f5f 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_active_days", + "url": "/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_active_days".format( + schedule_rotation_id=quote(str(schedule_rotation_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] + Response[ErrorsList | ScheduleRotationActiveDayResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationActiveDayResponse] + ErrorsList | ScheduleRotationActiveDayResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] + Response[ErrorsList | ScheduleRotationActiveDayResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationActiveDayResponse] + 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 8e688f7c..a98550d8 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/schedule_rotation_active_days/{id}", + "url": "/v1/schedule_rotation_active_days/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] + Response[ErrorsList | ScheduleRotationActiveDayResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationActiveDayResponse] + ErrorsList | ScheduleRotationActiveDayResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] + Response[ErrorsList | ScheduleRotationActiveDayResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationActiveDayResponse] + 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 e0458be5..fa2947c6 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/schedule_rotation_active_days/{id}", + "url": "/v1/schedule_rotation_active_days/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] + Response[ErrorsList | ScheduleRotationActiveDayResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationActiveDayResponse] + ErrorsList | ScheduleRotationActiveDayResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] + Response[ErrorsList | ScheduleRotationActiveDayResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationActiveDayResponse] + 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 1e54c8a5..17ccecb6 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( schedule_rotation_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_active_days", + "url": "/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_active_days".format( + schedule_rotation_id=quote(str(schedule_rotation_id), safe=""), + ), "params": params, } @@ -64,9 +68,9 @@ def sync_detailed( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[ScheduleRotationActiveDayList]: """List schedule rotation active days @@ -74,9 +78,9 @@ def sync_detailed( Args: schedule_rotation_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +108,9 @@ def sync( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> ScheduleRotationActiveDayList | None: """List schedule rotation active days @@ -114,9 +118,9 @@ def sync( Args: schedule_rotation_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +143,9 @@ async def asyncio_detailed( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[ScheduleRotationActiveDayList]: """List schedule rotation active days @@ -149,9 +153,9 @@ async def asyncio_detailed( Args: schedule_rotation_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +181,9 @@ async def asyncio( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> ScheduleRotationActiveDayList | None: """List schedule rotation active days @@ -187,9 +191,9 @@ async def asyncio( Args: schedule_rotation_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 4b87bbda..b6446600 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/schedule_rotation_active_days/{id}", + "url": "/v1/schedule_rotation_active_days/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] + Response[ErrorsList | ScheduleRotationActiveDayResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationActiveDayResponse] + ErrorsList | ScheduleRotationActiveDayResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationActiveDayResponse]] + Response[ErrorsList | ScheduleRotationActiveDayResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationActiveDayResponse] + 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 b87c2ed5..87733a8a 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_users", + "url": "/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_users".format( + schedule_rotation_id=quote(str(schedule_rotation_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationUserResponse]] + Response[ErrorsList | ScheduleRotationUserResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationUserResponse] + ErrorsList | ScheduleRotationUserResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationUserResponse]] + Response[ErrorsList | ScheduleRotationUserResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationUserResponse] + 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 f7fe1339..77221b81 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/schedule_rotation_users/{id}", + "url": "/v1/schedule_rotation_users/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationUserResponse]] + Response[ErrorsList | ScheduleRotationUserResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationUserResponse] + ErrorsList | ScheduleRotationUserResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationUserResponse]] + Response[ErrorsList | ScheduleRotationUserResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationUserResponse] + 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 d1e6b151..bf1a538b 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/schedule_rotation_users/{id}", + "url": "/v1/schedule_rotation_users/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationUserResponse]] + Response[ErrorsList | ScheduleRotationUserResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationUserResponse] + ErrorsList | ScheduleRotationUserResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationUserResponse]] + Response[ErrorsList | ScheduleRotationUserResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationUserResponse] + 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 21d8f869..a217745f 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( schedule_rotation_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_users", + "url": "/v1/schedule_rotations/{schedule_rotation_id}/schedule_rotation_users".format( + schedule_rotation_id=quote(str(schedule_rotation_id), safe=""), + ), "params": params, } @@ -64,17 +68,17 @@ def sync_detailed( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[ScheduleRotationUserList]: """List schedule rotation users Args: schedule_rotation_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -102,17 +106,17 @@ def sync( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> ScheduleRotationUserList | None: """List schedule rotation users Args: schedule_rotation_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -135,17 +139,17 @@ async def asyncio_detailed( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[ScheduleRotationUserList]: """List schedule rotation users Args: schedule_rotation_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -171,17 +175,17 @@ async def asyncio( schedule_rotation_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> ScheduleRotationUserList | None: """List schedule rotation users Args: schedule_rotation_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 85250a89..c8dbb34b 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/schedule_rotation_users/{id}", + "url": "/v1/schedule_rotation_users/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationUserResponse]] + Response[ErrorsList | ScheduleRotationUserResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationUserResponse] + ErrorsList | ScheduleRotationUserResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationUserResponse]] + Response[ErrorsList | ScheduleRotationUserResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationUserResponse] + 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 9e113ece..61069e24 100644 --- a/rootly_sdk/api/schedule_rotations/create_schedule_rotation.py +++ b/rootly_sdk/api/schedule_rotations/create_schedule_rotation.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/schedules/{schedule_id}/schedule_rotations", + "url": "/v1/schedules/{schedule_id}/schedule_rotations".format( + schedule_id=quote(str(schedule_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationResponse]] + Response[ErrorsList | ScheduleRotationResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationResponse] + ErrorsList | ScheduleRotationResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationResponse]] + Response[ErrorsList | ScheduleRotationResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationResponse] + 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 0bd9ab54..441f2ff1 100644 --- a/rootly_sdk/api/schedule_rotations/delete_schedule_rotation.py +++ b/rootly_sdk/api/schedule_rotations/delete_schedule_rotation.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/schedule_rotations/{id}", + "url": "/v1/schedule_rotations/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationResponse]] + Response[ErrorsList | ScheduleRotationResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationResponse] + ErrorsList | ScheduleRotationResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationResponse]] + Response[ErrorsList | ScheduleRotationResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationResponse] + 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 7cb6f77b..09f83172 100644 --- a/rootly_sdk/api/schedule_rotations/get_schedule_rotation.py +++ b/rootly_sdk/api/schedule_rotations/get_schedule_rotation.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/schedule_rotations/{id}", + "url": "/v1/schedule_rotations/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationResponse]] + Response[ErrorsList | ScheduleRotationResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationResponse] + ErrorsList | ScheduleRotationResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationResponse]] + Response[ErrorsList | ScheduleRotationResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationResponse] + 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 1cc7afbf..80ad5986 100644 --- a/rootly_sdk/api/schedule_rotations/list_schedule_rotations.py +++ b/rootly_sdk/api/schedule_rotations/list_schedule_rotations.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,11 +13,12 @@ def _get_kwargs( schedule_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - sort: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -31,7 +33,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/schedules/{schedule_id}/schedule_rotations", + "url": "/v1/schedules/{schedule_id}/schedule_rotations".format( + schedule_id=quote(str(schedule_id), safe=""), + ), "params": params, } @@ -65,10 +69,10 @@ def sync_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - sort: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, ) -> Response[ScheduleRotationList]: """List schedule rotations @@ -76,10 +80,10 @@ def sync_detailed( Args: schedule_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - sort (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -108,10 +112,10 @@ def sync( schedule_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - sort: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, ) -> ScheduleRotationList | None: """List schedule rotations @@ -119,10 +123,10 @@ def sync( Args: schedule_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - sort (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -146,10 +150,10 @@ async def asyncio_detailed( schedule_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - sort: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, ) -> Response[ScheduleRotationList]: """List schedule rotations @@ -157,10 +161,10 @@ async def asyncio_detailed( Args: schedule_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - sort (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -187,10 +191,10 @@ async def asyncio( schedule_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - sort: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, ) -> ScheduleRotationList | None: """List schedule rotations @@ -198,10 +202,10 @@ async def asyncio( Args: schedule_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - sort (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): 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 5ec8c3c3..2016f193 100644 --- a/rootly_sdk/api/schedule_rotations/update_schedule_rotation.py +++ b/rootly_sdk/api/schedule_rotations/update_schedule_rotation.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/schedule_rotations/{id}", + "url": "/v1/schedule_rotations/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationResponse]] + Response[ErrorsList | ScheduleRotationResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationResponse] + ErrorsList | ScheduleRotationResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleRotationResponse]] + Response[ErrorsList | ScheduleRotationResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleRotationResponse] + ErrorsList | ScheduleRotationResponse """ return ( diff --git a/rootly_sdk/api/schedules/create_schedule.py b/rootly_sdk/api/schedules/create_schedule.py index 41dd8104..fe6cb78c 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[Union[ErrorsList, ScheduleResponse]] + Response[ErrorsList | ScheduleResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleResponse] + 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[Union[ErrorsList, ScheduleResponse]] + Response[ErrorsList | ScheduleResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleResponse] + ErrorsList | ScheduleResponse """ return ( diff --git a/rootly_sdk/api/schedules/delete_schedule.py b/rootly_sdk/api/schedules/delete_schedule.py index 83c1016e..1d4d73ba 100644 --- a/rootly_sdk/api/schedules/delete_schedule.py +++ b/rootly_sdk/api/schedules/delete_schedule.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/schedules/{id}", + "url": "/v1/schedules/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleResponse]] + Response[ErrorsList | ScheduleResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleResponse] + ErrorsList | ScheduleResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleResponse]] + Response[ErrorsList | ScheduleResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleResponse] + ErrorsList | ScheduleResponse """ return ( diff --git a/rootly_sdk/api/schedules/get_schedule.py b/rootly_sdk/api/schedules/get_schedule.py index 5449e85a..254e51f6 100644 --- a/rootly_sdk/api/schedules/get_schedule.py +++ b/rootly_sdk/api/schedules/get_schedule.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/schedules/{id}", + "url": "/v1/schedules/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleResponse]] + Response[ErrorsList | ScheduleResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleResponse] + ErrorsList | ScheduleResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleResponse]] + Response[ErrorsList | ScheduleResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleResponse] + ErrorsList | ScheduleResponse """ return ( diff --git a/rootly_sdk/api/schedules/list_schedules.py b/rootly_sdk/api/schedules/list_schedules.py index 16a4ceca..62319fc5 100644 --- a/rootly_sdk/api/schedules/list_schedules.py +++ b/rootly_sdk/api/schedules/list_schedules.py @@ -11,25 +11,26 @@ def _get_kwargs( *, - 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, + include: str | 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -103,48 +104,48 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + include: str | 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, ) -> Response[ScheduleList]: """List schedules List schedules Args: - 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]): + include (str | 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -185,48 +186,48 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + include: str | 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, ) -> ScheduleList | None: """List schedules List schedules Args: - 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]): + include (str | 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -262,48 +263,48 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + include: str | 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, ) -> Response[ScheduleList]: """List schedules List schedules Args: - 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]): + include (str | 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -342,48 +343,48 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + include: str | 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, ) -> ScheduleList | None: """List schedules List schedules Args: - 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]): + include (str | 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): 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/schedules/update_schedule.py b/rootly_sdk/api/schedules/update_schedule.py index 0ba5b2b4..cc14d173 100644 --- a/rootly_sdk/api/schedules/update_schedule.py +++ b/rootly_sdk/api/schedules/update_schedule.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/schedules/{id}", + "url": "/v1/schedules/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleResponse]] + Response[ErrorsList | ScheduleResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleResponse] + ErrorsList | ScheduleResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ScheduleResponse]] + Response[ErrorsList | ScheduleResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ScheduleResponse] + ErrorsList | ScheduleResponse """ return ( diff --git a/rootly_sdk/api/secrets/create_secret.py b/rootly_sdk/api/secrets/create_secret.py index a28973eb..927e7547 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[Union[ErrorsList, SecretResponse]] + Response[ErrorsList | SecretResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SecretResponse] + 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[Union[ErrorsList, SecretResponse]] + Response[ErrorsList | SecretResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SecretResponse] + ErrorsList | SecretResponse """ return ( diff --git a/rootly_sdk/api/secrets/delete_secret.py b/rootly_sdk/api/secrets/delete_secret.py index aded439f..cab7f849 100644 --- a/rootly_sdk/api/secrets/delete_secret.py +++ b/rootly_sdk/api/secrets/delete_secret.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/secrets/{id}", + "url": "/v1/secrets/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, SecretResponse]] + Response[ErrorsList | SecretResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SecretResponse] + ErrorsList | SecretResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, SecretResponse]] + Response[ErrorsList | SecretResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SecretResponse] + ErrorsList | SecretResponse """ return ( diff --git a/rootly_sdk/api/secrets/get_secret.py b/rootly_sdk/api/secrets/get_secret.py index 4d1b134a..0a85cd44 100644 --- a/rootly_sdk/api/secrets/get_secret.py +++ b/rootly_sdk/api/secrets/get_secret.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/secrets/{id}", + "url": "/v1/secrets/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, SecretResponse]] + Response[ErrorsList | SecretResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SecretResponse] + ErrorsList | SecretResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, SecretResponse]] + Response[ErrorsList | SecretResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SecretResponse] + ErrorsList | SecretResponse """ return ( diff --git a/rootly_sdk/api/secrets/list_secrets.py b/rootly_sdk/api/secrets/list_secrets.py index 09aced5b..5763e6c0 100644 --- a/rootly_sdk/api/secrets/list_secrets.py +++ b/rootly_sdk/api/secrets/list_secrets.py @@ -11,10 +11,11 @@ def _get_kwargs( *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -58,18 +59,18 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[SecretList]: """List secrets List secrets Args: - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -95,18 +96,18 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> SecretList | None: """List secrets List secrets Args: - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -127,18 +128,18 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[SecretList]: """List secrets List secrets Args: - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -162,18 +163,18 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> SecretList | None: """List secrets List secrets Args: - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 b6c122d6..41fe293e 100644 --- a/rootly_sdk/api/secrets/update_secret.py +++ b/rootly_sdk/api/secrets/update_secret.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/secrets/{id}", + "url": "/v1/secrets/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, SecretResponse]] + Response[ErrorsList | SecretResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SecretResponse] + ErrorsList | SecretResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, SecretResponse]] + Response[ErrorsList | SecretResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SecretResponse] + ErrorsList | SecretResponse """ return ( diff --git a/rootly_sdk/api/services/bulk_delete_services.py b/rootly_sdk/api/services/bulk_delete_services.py index a0b10bc5..cb45739c 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, Union +from typing import Any import httpx @@ -14,7 +14,7 @@ def _get_kwargs( *, - body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], + body: BulkDestroyServicesType0 | BulkDestroyServicesType1, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -23,7 +23,6 @@ def _get_kwargs( "url": "/v1/services/bulk_delete", } - _kwargs["json"]: dict[str, Any] if isinstance(body, BulkDestroyServicesType0): _kwargs["json"] = body.to_dict() else: @@ -37,7 +36,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkDestroyServicesResponse | ErrorsList | Union["BulkDestroyServicesResponse", "ErrorsList"] | None: +) -> BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList | None: if response.status_code == 200: response_200 = BulkDestroyServicesResponse.from_dict(response.json()) @@ -50,14 +49,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> Union["BulkDestroyServicesResponse", "ErrorsList"]: + def _parse_response_422(data: object) -> BulkDestroyServicesResponse | ErrorsList: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -77,7 +76,7 @@ def _parse_response_422(data: object) -> Union["BulkDestroyServicesResponse", "E def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkDestroyServicesResponse | ErrorsList | Union["BulkDestroyServicesResponse", "ErrorsList"]]: +) -> Response[BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -89,23 +88,23 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], -) -> Response[BulkDestroyServicesResponse | ErrorsList | Union["BulkDestroyServicesResponse", "ErrorsList"]]: + body: BulkDestroyServicesType0 | BulkDestroyServicesType1, +) -> Response[BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList]: """Bulk delete Services Delete services by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - 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). + 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). Raises: errors.UnexpectedStatus: If the server returns 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[BulkDestroyServicesResponse, ErrorsList, Union['BulkDestroyServicesResponse', 'ErrorsList']]] + Response[BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList] """ kwargs = _get_kwargs( @@ -122,23 +121,23 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], -) -> BulkDestroyServicesResponse | ErrorsList | Union["BulkDestroyServicesResponse", "ErrorsList"] | None: + body: BulkDestroyServicesType0 | BulkDestroyServicesType1, +) -> BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList | None: """Bulk delete Services Delete services by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - 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). + 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). Raises: errors.UnexpectedStatus: If the server 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[BulkDestroyServicesResponse, ErrorsList, Union['BulkDestroyServicesResponse', 'ErrorsList']] + BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList """ return sync_detailed( @@ -150,23 +149,23 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], -) -> Response[BulkDestroyServicesResponse | ErrorsList | Union["BulkDestroyServicesResponse", "ErrorsList"]]: + body: BulkDestroyServicesType0 | BulkDestroyServicesType1, +) -> Response[BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList]: """Bulk delete Services Delete services by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - 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). + 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). Raises: errors.UnexpectedStatus: If the server returns 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[BulkDestroyServicesResponse, ErrorsList, Union['BulkDestroyServicesResponse', 'ErrorsList']]] + Response[BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList] """ kwargs = _get_kwargs( @@ -181,23 +180,23 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: Union["BulkDestroyServicesType0", "BulkDestroyServicesType1"], -) -> BulkDestroyServicesResponse | ErrorsList | Union["BulkDestroyServicesResponse", "ErrorsList"] | None: + body: BulkDestroyServicesType0 | BulkDestroyServicesType1, +) -> BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList | None: """Bulk delete Services Delete services by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - 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). + 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). Raises: errors.UnexpectedStatus: If the server 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[BulkDestroyServicesResponse, ErrorsList, Union['BulkDestroyServicesResponse', 'ErrorsList']] + BulkDestroyServicesResponse | BulkDestroyServicesResponse | ErrorsList | ErrorsList """ return ( diff --git a/rootly_sdk/api/services/bulk_upsert_services.py b/rootly_sdk/api/services/bulk_upsert_services.py index 8acfaa05..c1aaa566 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, Union +from typing import Any import httpx @@ -33,7 +33,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkUpsertServicesResponse | ErrorsList | Union["BulkUpsertServicesError", "ErrorsList"] | None: +) -> BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | 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) -> Union["BulkUpsertServicesError", "ErrorsList"]: + def _parse_response_422(data: object) -> BulkUpsertServicesError | ErrorsList: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -73,7 +73,7 @@ def _parse_response_422(data: object) -> Union["BulkUpsertServicesError", "Error def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkUpsertServicesResponse | ErrorsList | Union["BulkUpsertServicesError", "ErrorsList"]]: +) -> Response[BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +86,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertServices, -) -> Response[BulkUpsertServicesResponse | ErrorsList | Union["BulkUpsertServicesError", "ErrorsList"]]: +) -> Response[BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | 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[Union[BulkUpsertServicesResponse, ErrorsList, Union['BulkUpsertServicesError', 'ErrorsList']]] + Response[BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -121,7 +121,7 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertServices, -) -> BulkUpsertServicesResponse | ErrorsList | Union["BulkUpsertServicesError", "ErrorsList"] | None: +) -> BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | 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: - Union[BulkUpsertServicesResponse, ErrorsList, Union['BulkUpsertServicesError', 'ErrorsList']] + BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList """ return sync_detailed( @@ -151,7 +151,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertServices, -) -> Response[BulkUpsertServicesResponse | ErrorsList | Union["BulkUpsertServicesError", "ErrorsList"]]: +) -> Response[BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | 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[Union[BulkUpsertServicesResponse, ErrorsList, Union['BulkUpsertServicesError', 'ErrorsList']]] + Response[BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -184,7 +184,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertServices, -) -> BulkUpsertServicesResponse | ErrorsList | Union["BulkUpsertServicesError", "ErrorsList"] | None: +) -> BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | 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: - Union[BulkUpsertServicesResponse, ErrorsList, Union['BulkUpsertServicesError', 'ErrorsList']] + BulkUpsertServicesError | ErrorsList | BulkUpsertServicesResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/services/create_service.py b/rootly_sdk/api/services/create_service.py index 56e5f79c..fcd786db 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[Union[ErrorsList, ServiceResponse]] + Response[ErrorsList | ServiceResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ServiceResponse] + 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[Union[ErrorsList, ServiceResponse]] + Response[ErrorsList | ServiceResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ServiceResponse] + 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 10022b29..3c61dc54 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[Union[CatalogPropertyResponse, ErrorsList]] + Response[CatalogPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogPropertyResponse, ErrorsList] + 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[Union[CatalogPropertyResponse, ErrorsList]] + Response[CatalogPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogPropertyResponse, ErrorsList] + CatalogPropertyResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/services/delete_service.py b/rootly_sdk/api/services/delete_service.py index e4761a6c..52fc6e7d 100644 --- a/rootly_sdk/api/services/delete_service.py +++ b/rootly_sdk/api/services/delete_service.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/services/{id}", + "url": "/v1/services/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | ServiceResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific service by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, ServiceResponse]] + Response[ErrorsList | ServiceResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | ServiceResponse | None: @@ -93,14 +97,14 @@ def sync( Delete a specific service by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, ServiceResponse] + ErrorsList | ServiceResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | ServiceResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific service by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, ServiceResponse]] + Response[ErrorsList | ServiceResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | ServiceResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific service by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, ServiceResponse] + ErrorsList | ServiceResponse """ return ( diff --git a/rootly_sdk/api/services/get_service.py b/rootly_sdk/api/services/get_service.py index eea3f3c3..17d3ef16 100644 --- a/rootly_sdk/api/services/get_service.py +++ b/rootly_sdk/api/services/get_service.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/services/{id}", + "url": "/v1/services/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | ServiceResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific service by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, ServiceResponse]] + Response[ErrorsList | ServiceResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | ServiceResponse | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific service by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, ServiceResponse] + ErrorsList | ServiceResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | ServiceResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific service by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, ServiceResponse]] + Response[ErrorsList | ServiceResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | ServiceResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific service by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, ServiceResponse] + 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 499f72b2..7a881811 100644 --- a/rootly_sdk/api/services/get_service_incidents_chart.py +++ b/rootly_sdk/api/services/get_service_incidents_chart.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,10 +13,11 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, period: str, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["period"] = period @@ -24,7 +26,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/services/{id}/incidents_chart", + "url": "/v1/services/{id}/incidents_chart".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -62,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, period: str, @@ -72,7 +76,7 @@ def sync_detailed( Get service incidents chart Args: - id (Union[UUID, str]): + id (str | UUID): period (str): Raises: @@ -80,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentsChartResponse]] + Response[ErrorsList | IncidentsChartResponse] """ kwargs = _get_kwargs( @@ -96,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, period: str, @@ -106,7 +110,7 @@ def sync( Get service incidents chart Args: - id (Union[UUID, str]): + id (str | UUID): period (str): Raises: @@ -114,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentsChartResponse] + ErrorsList | IncidentsChartResponse """ return sync_detailed( @@ -125,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, period: str, @@ -135,7 +139,7 @@ async def asyncio_detailed( Get service incidents chart Args: - id (Union[UUID, str]): + id (str | UUID): period (str): Raises: @@ -143,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentsChartResponse]] + Response[ErrorsList | IncidentsChartResponse] """ kwargs = _get_kwargs( @@ -157,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, period: str, @@ -167,7 +171,7 @@ async def asyncio( Get service incidents chart Args: - id (Union[UUID, str]): + id (str | UUID): period (str): Raises: @@ -175,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentsChartResponse] + 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 7efba8d2..1976e560 100644 --- a/rootly_sdk/api/services/get_service_uptime_chart.py +++ b/rootly_sdk/api/services/get_service_uptime_chart.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,10 +13,11 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, - period: Unset | str = UNSET, + period: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["period"] = period @@ -24,7 +26,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/services/{id}/uptime_chart", + "url": "/v1/services/{id}/uptime_chart".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -62,25 +66,25 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - period: Unset | str = UNSET, + period: str | Unset = UNSET, ) -> Response[ErrorsList | UptimeChartResponse]: """Get service uptime chart Get service uptime chart Args: - id (Union[UUID, str]): - period (Union[Unset, str]): + id (str | UUID): + period (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UptimeChartResponse]] + Response[ErrorsList | UptimeChartResponse] """ kwargs = _get_kwargs( @@ -96,25 +100,25 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - period: Unset | str = UNSET, + period: str | Unset = UNSET, ) -> ErrorsList | UptimeChartResponse | None: """Get service uptime chart Get service uptime chart Args: - id (Union[UUID, str]): - period (Union[Unset, str]): + id (str | UUID): + period (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UptimeChartResponse] + ErrorsList | UptimeChartResponse """ return sync_detailed( @@ -125,25 +129,25 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - period: Unset | str = UNSET, + period: str | Unset = UNSET, ) -> Response[ErrorsList | UptimeChartResponse]: """Get service uptime chart Get service uptime chart Args: - id (Union[UUID, str]): - period (Union[Unset, str]): + id (str | UUID): + period (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UptimeChartResponse]] + Response[ErrorsList | UptimeChartResponse] """ kwargs = _get_kwargs( @@ -157,25 +161,25 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - period: Unset | str = UNSET, + period: str | Unset = UNSET, ) -> ErrorsList | UptimeChartResponse | None: """Get service uptime chart Get service uptime chart Args: - id (Union[UUID, str]): - period (Union[Unset, str]): + id (str | UUID): + period (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UptimeChartResponse] + 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 85a6e5c7..54b4e887 100644 --- a/rootly_sdk/api/services/list_service_catalog_properties.py +++ b/rootly_sdk/api/services/list_service_catalog_properties.py @@ -17,27 +17,28 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Unset | str = UNSET + json_sort: str | Unset = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -96,34 +97,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Service Catalog Properties Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -157,34 +158,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogPropertyList | None: """List Catalog Properties List Service Catalog Properties Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -213,34 +214,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Service Catalog Properties Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -272,34 +273,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogPropertyList | None: """List Catalog Properties List Service Catalog Properties Args: - 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]): + 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): 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 f691c5c3..0bec2c70 100644 --- a/rootly_sdk/api/services/list_services.py +++ b/rootly_sdk/api/services/list_services.py @@ -11,40 +11,41 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -148,78 +149,78 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[ServiceList]: """List services List services Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -275,78 +276,78 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> ServiceList | None: """List services List services Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -397,78 +398,78 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[ServiceList]: """List services List services Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -522,78 +523,78 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> ServiceList | None: """List services List services Args: - 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]): + 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): 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 23521465..5ba68ee9 100644 --- a/rootly_sdk/api/services/update_service.py +++ b/rootly_sdk/api/services/update_service.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateService, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/services/{id}", + "url": "/v1/services/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateService, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific service by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateService): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ServiceResponse]] + Response[ErrorsList | ServiceResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateService, @@ -107,7 +110,7 @@ def sync( Update a specific service by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateService): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ServiceResponse] + ErrorsList | ServiceResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateService, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific service by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateService): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ServiceResponse]] + Response[ErrorsList | ServiceResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateService, @@ -168,7 +171,7 @@ async def asyncio( Update a specific service by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateService): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ServiceResponse] + ErrorsList | ServiceResponse """ return ( diff --git a/rootly_sdk/api/severities/create_severity.py b/rootly_sdk/api/severities/create_severity.py index 5282399a..ac3b5494 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[Union[ErrorsList, SeverityResponse]] + Response[ErrorsList | SeverityResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SeverityResponse] + 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[Union[ErrorsList, SeverityResponse]] + Response[ErrorsList | SeverityResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SeverityResponse] + ErrorsList | SeverityResponse """ return ( diff --git a/rootly_sdk/api/severities/delete_severity.py b/rootly_sdk/api/severities/delete_severity.py index 53aa6ffe..466626a3 100644 --- a/rootly_sdk/api/severities/delete_severity.py +++ b/rootly_sdk/api/severities/delete_severity.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/severities/{id}", + "url": "/v1/severities/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | SeverityResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific severity by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, SeverityResponse]] + Response[ErrorsList | SeverityResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | SeverityResponse | None: @@ -93,14 +97,14 @@ def sync( Delete a specific severity by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, SeverityResponse] + ErrorsList | SeverityResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | SeverityResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific severity by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, SeverityResponse]] + Response[ErrorsList | SeverityResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | SeverityResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific severity by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, SeverityResponse] + ErrorsList | SeverityResponse """ return ( diff --git a/rootly_sdk/api/severities/get_severity.py b/rootly_sdk/api/severities/get_severity.py index cf85c9b3..f36d72b9 100644 --- a/rootly_sdk/api/severities/get_severity.py +++ b/rootly_sdk/api/severities/get_severity.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/severities/{id}", + "url": "/v1/severities/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | SeverityResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific severity by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, SeverityResponse]] + Response[ErrorsList | SeverityResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | SeverityResponse | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific severity by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, SeverityResponse] + ErrorsList | SeverityResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | SeverityResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific severity by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, SeverityResponse]] + Response[ErrorsList | SeverityResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | SeverityResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific severity by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, SeverityResponse] + ErrorsList | SeverityResponse """ return ( diff --git a/rootly_sdk/api/severities/list_severities.py b/rootly_sdk/api/severities/list_severities.py index 221516df..8102f620 100644 --- a/rootly_sdk/api/severities/list_severities.py +++ b/rootly_sdk/api/severities/list_severities.py @@ -11,36 +11,37 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -136,70 +137,70 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[SeverityList]: """List severities List severities Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -251,70 +252,70 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> SeverityList | None: """List severities List severities Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -361,70 +362,70 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[SeverityList]: """List severities List severities Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -474,70 +475,70 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> SeverityList | None: """List severities List severities Args: - 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]): + 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): 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 552576b1..d1794033 100644 --- a/rootly_sdk/api/severities/update_severity.py +++ b/rootly_sdk/api/severities/update_severity.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateSeverity, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/severities/{id}", + "url": "/v1/severities/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateSeverity, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific severity by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateSeverity): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, SeverityResponse]] + Response[ErrorsList | SeverityResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateSeverity, @@ -107,7 +110,7 @@ def sync( Update a specific severity by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateSeverity): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SeverityResponse] + ErrorsList | SeverityResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateSeverity, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific severity by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateSeverity): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, SeverityResponse]] + Response[ErrorsList | SeverityResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateSeverity, @@ -168,7 +171,7 @@ async def asyncio( Update a specific severity by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateSeverity): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SeverityResponse] + 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 7c89bc56..92239e9f 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/schedules/{schedule_id}/shift_coverage_requests", + "url": "/v1/schedules/{schedule_id}/shift_coverage_requests".format( + schedule_id=quote(str(schedule_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -72,7 +75,8 @@ def sync_detailed( Creates coverage requests for the shifts overlapping the requested time range. A range can span multiple consecutive shifts (e.g. across a handoff), so one or more coverage requests may be created; the response is always a list. A coverage request broadcasts to schedule members so someone - can volunteer to cover the shift. + can volunteer to cover the shift, or targets recipient_user_ids when targeted-shift-coverage is + enabled. Args: schedule_id (str): @@ -83,7 +87,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ShiftCoverageRequestList]] + Response[ErrorsList | ShiftCoverageRequestList] """ kwargs = _get_kwargs( @@ -109,7 +113,8 @@ def sync( Creates coverage requests for the shifts overlapping the requested time range. A range can span multiple consecutive shifts (e.g. across a handoff), so one or more coverage requests may be created; the response is always a list. A coverage request broadcasts to schedule members so someone - can volunteer to cover the shift. + can volunteer to cover the shift, or targets recipient_user_ids when targeted-shift-coverage is + enabled. Args: schedule_id (str): @@ -120,7 +125,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ShiftCoverageRequestList] + ErrorsList | ShiftCoverageRequestList """ return sync_detailed( @@ -141,7 +146,8 @@ async def asyncio_detailed( Creates coverage requests for the shifts overlapping the requested time range. A range can span multiple consecutive shifts (e.g. across a handoff), so one or more coverage requests may be created; the response is always a list. A coverage request broadcasts to schedule members so someone - can volunteer to cover the shift. + can volunteer to cover the shift, or targets recipient_user_ids when targeted-shift-coverage is + enabled. Args: schedule_id (str): @@ -152,7 +158,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ShiftCoverageRequestList]] + Response[ErrorsList | ShiftCoverageRequestList] """ kwargs = _get_kwargs( @@ -176,7 +182,8 @@ async def asyncio( Creates coverage requests for the shifts overlapping the requested time range. A range can span multiple consecutive shifts (e.g. across a handoff), so one or more coverage requests may be created; the response is always a list. A coverage request broadcasts to schedule members so someone - can volunteer to cover the shift. + can volunteer to cover the shift, or targets recipient_user_ids when targeted-shift-coverage is + enabled. Args: schedule_id (str): @@ -187,7 +194,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ShiftCoverageRequestList] + 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 bd91309d..af89d0d5 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/shift_coverage_requests/{id}", + "url": "/v1/shift_coverage_requests/{id}".format( + id=quote(str(id), safe=""), + ), } 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 b2ef0c39..b841df57 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/shift_coverage_requests/{id}", + "url": "/v1/shift_coverage_requests/{id}".format( + id=quote(str(id), safe=""), + ), } 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 8f2a905e..62355c3a 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( schedule_id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/schedules/{schedule_id}/shift_coverage_requests", + "url": "/v1/schedules/{schedule_id}/shift_coverage_requests".format( + schedule_id=quote(str(schedule_id), safe=""), + ), } return _kwargs diff --git a/rootly_sdk/api/shifts/get_schedule_shifts.py b/rootly_sdk/api/shifts/get_schedule_shifts.py index baf5f6bb..e263871a 100644 --- a/rootly_sdk/api/shifts/get_schedule_shifts.py +++ b/rootly_sdk/api/shifts/get_schedule_shifts.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,10 @@ def _get_kwargs( id: str, *, - to: Unset | str = UNSET, - from_: Unset | str = UNSET, + to: str | Unset = UNSET, + from_: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["to"] = to @@ -26,7 +28,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/schedules/{id}/shifts", + "url": "/v1/schedules/{id}/shifts".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -65,8 +69,8 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - to: Unset | str = UNSET, - from_: Unset | str = UNSET, + to: str | Unset = UNSET, + from_: str | Unset = UNSET, ) -> Response[ErrorsList | ShiftList]: """Retrieves a schedule shifts @@ -74,15 +78,15 @@ def sync_detailed( Args: id (str): - to (Union[Unset, str]): - from_ (Union[Unset, str]): + to (str | Unset): + from_ (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ShiftList]] + Response[ErrorsList | ShiftList] """ kwargs = _get_kwargs( @@ -102,8 +106,8 @@ def sync( id: str, *, client: AuthenticatedClient, - to: Unset | str = UNSET, - from_: Unset | str = UNSET, + to: str | Unset = UNSET, + from_: str | Unset = UNSET, ) -> ErrorsList | ShiftList | None: """Retrieves a schedule shifts @@ -111,15 +115,15 @@ def sync( Args: id (str): - to (Union[Unset, str]): - from_ (Union[Unset, str]): + to (str | Unset): + from_ (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ShiftList] + ErrorsList | ShiftList """ return sync_detailed( @@ -134,8 +138,8 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - to: Unset | str = UNSET, - from_: Unset | str = UNSET, + to: str | Unset = UNSET, + from_: str | Unset = UNSET, ) -> Response[ErrorsList | ShiftList]: """Retrieves a schedule shifts @@ -143,15 +147,15 @@ async def asyncio_detailed( Args: id (str): - to (Union[Unset, str]): - from_ (Union[Unset, str]): + to (str | Unset): + from_ (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, ShiftList]] + Response[ErrorsList | ShiftList] """ kwargs = _get_kwargs( @@ -169,8 +173,8 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - to: Unset | str = UNSET, - from_: Unset | str = UNSET, + to: str | Unset = UNSET, + from_: str | Unset = UNSET, ) -> ErrorsList | ShiftList | None: """Retrieves a schedule shifts @@ -178,15 +182,15 @@ async def asyncio( Args: id (str): - to (Union[Unset, str]): - from_ (Union[Unset, str]): + to (str | Unset): + from_ (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, ShiftList] + ErrorsList | ShiftList """ return ( diff --git a/rootly_sdk/api/shifts/list_shifts.py b/rootly_sdk/api/shifts/list_shifts.py index 6ee43619..33fbd52d 100644 --- a/rootly_sdk/api/shifts/list_shifts.py +++ b/rootly_sdk/api/shifts/list_shifts.py @@ -13,17 +13,18 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -33,13 +34,13 @@ def _get_kwargs( params["to"] = to - json_user_ids: Unset | list[int] = UNSET + json_user_ids: list[int] | Unset = UNSET if not isinstance(user_ids, Unset): json_user_ids = user_ids params["user_ids[]"] = json_user_ids - json_schedule_ids: Unset | list[str] = UNSET + json_schedule_ids: list[str] | Unset = UNSET if not isinstance(schedule_ids, Unset): json_schedule_ids = schedule_ids @@ -91,33 +92,33 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[ErrorsList | ShiftList]: """List shifts List shifts Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns 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, ShiftList]] + Response[ErrorsList | ShiftList] """ kwargs = _get_kwargs( @@ -140,33 +141,33 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> ErrorsList | ShiftList | None: """List shifts List shifts Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server 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, ShiftList] + ErrorsList | ShiftList """ return sync_detailed( @@ -184,33 +185,33 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[ErrorsList | ShiftList]: """List shifts List shifts Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns 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, ShiftList]] + Response[ErrorsList | ShiftList] """ kwargs = _get_kwargs( @@ -231,33 +232,33 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> ErrorsList | ShiftList | None: """List shifts List shifts Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server 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, ShiftList] + ErrorsList | ShiftList """ return ( diff --git a/rootly_sdk/api/sl_as/create_sla.py b/rootly_sdk/api/sl_as/create_sla.py index 338f3be4..578b60d8 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[Union[ErrorsList, SlaResponse]] + Response[ErrorsList | SlaResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SlaResponse] + 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[Union[ErrorsList, SlaResponse]] + Response[ErrorsList | SlaResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SlaResponse] + ErrorsList | SlaResponse """ return ( diff --git a/rootly_sdk/api/sl_as/delete_sla.py b/rootly_sdk/api/sl_as/delete_sla.py index 97174330..19b1e4eb 100644 --- a/rootly_sdk/api/sl_as/delete_sla.py +++ b/rootly_sdk/api/sl_as/delete_sla.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/slas/{id}", + "url": "/v1/slas/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, SlaResponse]] + Response[ErrorsList | SlaResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SlaResponse] + ErrorsList | SlaResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, SlaResponse]] + Response[ErrorsList | SlaResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SlaResponse] + ErrorsList | SlaResponse """ return ( diff --git a/rootly_sdk/api/sl_as/get_sla.py b/rootly_sdk/api/sl_as/get_sla.py index 8cf0f064..b2dcad6d 100644 --- a/rootly_sdk/api/sl_as/get_sla.py +++ b/rootly_sdk/api/sl_as/get_sla.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/slas/{id}", + "url": "/v1/slas/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, SlaResponse]] + Response[ErrorsList | SlaResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SlaResponse] + ErrorsList | SlaResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, SlaResponse]] + Response[ErrorsList | SlaResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SlaResponse] + 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 25cca503..d7f57b0a 100644 --- a/rootly_sdk/api/sl_as/list_sl_as.py +++ b/rootly_sdk/api/sl_as/list_sl_as.py @@ -11,25 +11,26 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -103,48 +104,48 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[SlaList]: """List SLAs List SLAs Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -185,48 +186,48 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> SlaList | None: """List SLAs List SLAs Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -262,48 +263,48 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[SlaList]: """List SLAs List SLAs Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -342,48 +343,48 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> SlaList | None: """List SLAs List SLAs Args: - 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]): + 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): 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 25d81a75..f168bfc9 100644 --- a/rootly_sdk/api/sl_as/update_sla.py +++ b/rootly_sdk/api/sl_as/update_sla.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/slas/{id}", + "url": "/v1/slas/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, SlaResponse]] + Response[ErrorsList | SlaResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SlaResponse] + ErrorsList | SlaResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, SlaResponse]] + Response[ErrorsList | SlaResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SlaResponse] + ErrorsList | SlaResponse """ return ( 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 index c15ef8e3..68896553 100644 --- a/rootly_sdk/api/status_page_announcements/create_status_page_announcement.py +++ b/rootly_sdk/api/status_page_announcements/create_status_page_announcement.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/status-pages/{status_page_id}/announcements", + "url": "/v1/status-pages/{status_page_id}/announcements".format( + status_page_id=quote(str(status_page_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -86,7 +89,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageAnnouncementResponse]] + Response[ErrorsList | StatusPageAnnouncementResponse] """ kwargs = _get_kwargs( @@ -121,7 +124,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageAnnouncementResponse] + ErrorsList | StatusPageAnnouncementResponse """ return sync_detailed( @@ -151,7 +154,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageAnnouncementResponse]] + Response[ErrorsList | StatusPageAnnouncementResponse] """ kwargs = _get_kwargs( @@ -184,7 +187,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageAnnouncementResponse] + ErrorsList | StatusPageAnnouncementResponse """ return ( 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 index 1314cc77..9bf76dea 100644 --- a/rootly_sdk/api/status_page_announcements/delete_status_page_announcement.py +++ b/rootly_sdk/api/status_page_announcements/delete_status_page_announcement.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/announcements/{id}", + "url": "/v1/announcements/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageAnnouncementResponse]] + Response[ErrorsList | StatusPageAnnouncementResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageAnnouncementResponse] + ErrorsList | StatusPageAnnouncementResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageAnnouncementResponse]] + Response[ErrorsList | StatusPageAnnouncementResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageAnnouncementResponse] + ErrorsList | StatusPageAnnouncementResponse """ return ( 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 index bc616232..bb3d1b93 100644 --- a/rootly_sdk/api/status_page_announcements/get_status_page_announcement.py +++ b/rootly_sdk/api/status_page_announcements/get_status_page_announcement.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/announcements/{id}", + "url": "/v1/announcements/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageAnnouncementResponse]] + Response[ErrorsList | StatusPageAnnouncementResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageAnnouncementResponse] + ErrorsList | StatusPageAnnouncementResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageAnnouncementResponse]] + Response[ErrorsList | StatusPageAnnouncementResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageAnnouncementResponse] + ErrorsList | StatusPageAnnouncementResponse """ return ( 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 index 2bc98e02..4bd510be 100644 --- a/rootly_sdk/api/status_page_announcements/list_status_page_announcements.py +++ b/rootly_sdk/api/status_page_announcements/list_status_page_announcements.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( status_page_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/status-pages/{status_page_id}/announcements", + "url": "/v1/status-pages/{status_page_id}/announcements".format( + status_page_id=quote(str(status_page_id), safe=""), + ), "params": params, } @@ -64,9 +68,9 @@ def sync_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[StatusPageAnnouncementList]: """List status page announcements @@ -74,9 +78,9 @@ def sync_detailed( Args: status_page_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +108,9 @@ def sync( status_page_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> StatusPageAnnouncementList | None: """List status page announcements @@ -114,9 +118,9 @@ def sync( Args: status_page_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +143,9 @@ async def asyncio_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[StatusPageAnnouncementList]: """List status page announcements @@ -149,9 +153,9 @@ async def asyncio_detailed( Args: status_page_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +181,9 @@ async def asyncio( status_page_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> StatusPageAnnouncementList | None: """List status page announcements @@ -187,9 +191,9 @@ async def asyncio( Args: status_page_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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_announcements/update_status_page_announcement.py b/rootly_sdk/api/status_page_announcements/update_status_page_announcement.py index 85139011..44892765 100644 --- a/rootly_sdk/api/status_page_announcements/update_status_page_announcement.py +++ b/rootly_sdk/api/status_page_announcements/update_status_page_announcement.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/announcements/{id}", + "url": "/v1/announcements/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageAnnouncementResponse]] + Response[ErrorsList | StatusPageAnnouncementResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageAnnouncementResponse] + ErrorsList | StatusPageAnnouncementResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageAnnouncementResponse]] + Response[ErrorsList | StatusPageAnnouncementResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageAnnouncementResponse] + ErrorsList | StatusPageAnnouncementResponse """ return ( 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 index 62f8a188..5b94bb9f 100644 --- 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 @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/status-pages/{status_page_id}/component-groups", + "url": "/v1/status-pages/{status_page_id}/component-groups".format( + status_page_id=quote(str(status_page_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageComponentGroupResponse]] + Response[ErrorsList | StatusPageComponentGroupResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageComponentGroupResponse] + ErrorsList | StatusPageComponentGroupResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageComponentGroupResponse]] + Response[ErrorsList | StatusPageComponentGroupResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageComponentGroupResponse] + ErrorsList | StatusPageComponentGroupResponse """ return ( 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 index 8c5021bc..e286aff1 100644 --- 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 @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -11,9 +12,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/component-groups/{id}", + "url": "/v1/component-groups/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs 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 index 2539c21b..7ccfa498 100644 --- 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 @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,8 +14,9 @@ def _get_kwargs( id: str, *, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -23,7 +25,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/component-groups/{id}", + "url": "/v1/component-groups/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -64,7 +68,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> Response[ErrorsList | StatusPageComponentGroupResponse]: """Retrieves a status page component group @@ -72,14 +76,14 @@ def sync_detailed( Args: id (str): - include (Union[Unset, str]): + include (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageComponentGroupResponse]] + Response[ErrorsList | StatusPageComponentGroupResponse] """ kwargs = _get_kwargs( @@ -98,7 +102,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> ErrorsList | StatusPageComponentGroupResponse | None: """Retrieves a status page component group @@ -106,14 +110,14 @@ def sync( Args: id (str): - include (Union[Unset, str]): + include (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageComponentGroupResponse] + ErrorsList | StatusPageComponentGroupResponse """ return sync_detailed( @@ -127,7 +131,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> Response[ErrorsList | StatusPageComponentGroupResponse]: """Retrieves a status page component group @@ -135,14 +139,14 @@ async def asyncio_detailed( Args: id (str): - include (Union[Unset, str]): + include (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageComponentGroupResponse]] + Response[ErrorsList | StatusPageComponentGroupResponse] """ kwargs = _get_kwargs( @@ -159,7 +163,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> ErrorsList | StatusPageComponentGroupResponse | None: """Retrieves a status page component group @@ -167,14 +171,14 @@ async def asyncio( Args: id (str): - include (Union[Unset, str]): + include (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageComponentGroupResponse] + ErrorsList | StatusPageComponentGroupResponse """ return ( 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 index a78bcc4a..e363dba5 100644 --- 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 @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( status_page_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/status-pages/{status_page_id}/component-groups", + "url": "/v1/status-pages/{status_page_id}/component-groups".format( + status_page_id=quote(str(status_page_id), safe=""), + ), "params": params, } @@ -64,9 +68,9 @@ def sync_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[StatusPageComponentGroupList]: """List status page component groups @@ -74,9 +78,9 @@ def sync_detailed( Args: status_page_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +108,9 @@ def sync( status_page_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> StatusPageComponentGroupList | None: """List status page component groups @@ -114,9 +118,9 @@ def sync( Args: status_page_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +143,9 @@ async def asyncio_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[StatusPageComponentGroupList]: """List status page component groups @@ -149,9 +153,9 @@ async def asyncio_detailed( Args: status_page_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +181,9 @@ async def asyncio( status_page_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> StatusPageComponentGroupList | None: """List status page component groups @@ -187,9 +191,9 @@ async def asyncio( Args: status_page_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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_component_groups/update_status_page_component_group.py b/rootly_sdk/api/status_page_component_groups/update_status_page_component_group.py index a416ba29..5d756dc2 100644 --- 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 @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/component-groups/{id}", + "url": "/v1/component-groups/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageComponentGroupResponse]] + Response[ErrorsList | StatusPageComponentGroupResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageComponentGroupResponse] + ErrorsList | StatusPageComponentGroupResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageComponentGroupResponse]] + Response[ErrorsList | StatusPageComponentGroupResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageComponentGroupResponse] + ErrorsList | StatusPageComponentGroupResponse """ return ( 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 index 9b026f90..f2beac74 100644 --- a/rootly_sdk/api/status_page_components/create_status_page_component.py +++ b/rootly_sdk/api/status_page_components/create_status_page_component.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/status-pages/{status_page_id}/components", + "url": "/v1/status-pages/{status_page_id}/components".format( + status_page_id=quote(str(status_page_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageComponentResponse]] + Response[ErrorsList | StatusPageComponentResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageComponentResponse] + ErrorsList | StatusPageComponentResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageComponentResponse]] + Response[ErrorsList | StatusPageComponentResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageComponentResponse] + ErrorsList | StatusPageComponentResponse """ return ( 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 index e362005d..aed9e133 100644 --- a/rootly_sdk/api/status_page_components/delete_status_page_component.py +++ b/rootly_sdk/api/status_page_components/delete_status_page_component.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -11,9 +12,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/components/{id}", + "url": "/v1/components/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs 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 index b89508ec..8c190f56 100644 --- a/rootly_sdk/api/status_page_components/get_status_page_component.py +++ b/rootly_sdk/api/status_page_components/get_status_page_component.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,8 +14,9 @@ def _get_kwargs( id: str, *, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -23,7 +25,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/components/{id}", + "url": "/v1/components/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -64,7 +68,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> Response[ErrorsList | StatusPageComponentResponse]: """Retrieves a status page component @@ -72,14 +76,14 @@ def sync_detailed( Args: id (str): - include (Union[Unset, str]): + include (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageComponentResponse]] + Response[ErrorsList | StatusPageComponentResponse] """ kwargs = _get_kwargs( @@ -98,7 +102,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> ErrorsList | StatusPageComponentResponse | None: """Retrieves a status page component @@ -106,14 +110,14 @@ def sync( Args: id (str): - include (Union[Unset, str]): + include (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageComponentResponse] + ErrorsList | StatusPageComponentResponse """ return sync_detailed( @@ -127,7 +131,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> Response[ErrorsList | StatusPageComponentResponse]: """Retrieves a status page component @@ -135,14 +139,14 @@ async def asyncio_detailed( Args: id (str): - include (Union[Unset, str]): + include (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageComponentResponse]] + Response[ErrorsList | StatusPageComponentResponse] """ kwargs = _get_kwargs( @@ -159,7 +163,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, + include: str | Unset = UNSET, ) -> ErrorsList | StatusPageComponentResponse | None: """Retrieves a status page component @@ -167,14 +171,14 @@ async def asyncio( Args: id (str): - include (Union[Unset, str]): + include (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageComponentResponse] + ErrorsList | StatusPageComponentResponse """ return ( 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 index 575d4e2b..f035194f 100644 --- a/rootly_sdk/api/status_page_components/list_status_page_components.py +++ b/rootly_sdk/api/status_page_components/list_status_page_components.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( status_page_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/status-pages/{status_page_id}/components", + "url": "/v1/status-pages/{status_page_id}/components".format( + status_page_id=quote(str(status_page_id), safe=""), + ), "params": params, } @@ -64,9 +68,9 @@ def sync_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[StatusPageComponentList]: """List status page components @@ -74,9 +78,9 @@ def sync_detailed( Args: status_page_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +108,9 @@ def sync( status_page_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> StatusPageComponentList | None: """List status page components @@ -114,9 +118,9 @@ def sync( Args: status_page_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +143,9 @@ async def asyncio_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[StatusPageComponentList]: """List status page components @@ -149,9 +153,9 @@ async def asyncio_detailed( Args: status_page_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +181,9 @@ async def asyncio( status_page_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> StatusPageComponentList | None: """List status page components @@ -187,9 +191,9 @@ async def asyncio( Args: status_page_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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_components/update_status_page_component.py b/rootly_sdk/api/status_page_components/update_status_page_component.py index e049a15f..43f1abfa 100644 --- a/rootly_sdk/api/status_page_components/update_status_page_component.py +++ b/rootly_sdk/api/status_page_components/update_status_page_component.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/components/{id}", + "url": "/v1/components/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageComponentResponse]] + Response[ErrorsList | StatusPageComponentResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageComponentResponse] + ErrorsList | StatusPageComponentResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageComponentResponse]] + Response[ErrorsList | StatusPageComponentResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageComponentResponse] + ErrorsList | StatusPageComponentResponse """ return ( diff --git a/rootly_sdk/api/status_page_teams/__init__.py b/rootly_sdk/api/status_page_teams/__init__.py new file mode 100644 index 00000000..2d7c0b23 --- /dev/null +++ b/rootly_sdk/api/status_page_teams/__init__.py @@ -0,0 +1 @@ +"""Contains endpoint functions for accessing the API""" diff --git a/rootly_sdk/api/status_page_teams/create_status_page_team.py b/rootly_sdk/api/status_page_teams/create_status_page_team.py new file mode 100644 index 00000000..a2f748b9 --- /dev/null +++ b/rootly_sdk/api/status_page_teams/create_status_page_team.py @@ -0,0 +1,204 @@ +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.new_status_page_team import NewStatusPageTeam +from ...models.status_page_team_response import StatusPageTeamResponse +from ...types import Response + + +def _get_kwargs( + status_page_id: str, + *, + body: NewStatusPageTeam, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/status-pages/{status_page_id}/teams".format( + status_page_id=quote(str(status_page_id), safe=""), + ), + } + + _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 | StatusPageTeamResponse | None: + if response.status_code == 201: + response_201 = StatusPageTeamResponse.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 == 404: + response_404 = ErrorsList.from_dict(response.json()) + + 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: + return None + + +def _build_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> Response[ErrorsList | StatusPageTeamResponse]: + 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: NewStatusPageTeam, +) -> Response[ErrorsList | StatusPageTeamResponse]: + """Grants a team access to a status page + + Assigns a team to a status page. Members of the team get the chosen permission level on that page in + addition to their role. Requires an owner or admin role. + + Args: + status_page_id (str): + body (NewStatusPageTeam): + + Raises: + errors.UnexpectedStatus: If the server returns 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 | StatusPageTeamResponse] + """ + + 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: NewStatusPageTeam, +) -> ErrorsList | StatusPageTeamResponse | None: + """Grants a team access to a status page + + Assigns a team to a status page. Members of the team get the chosen permission level on that page in + addition to their role. Requires an owner or admin role. + + Args: + status_page_id (str): + body (NewStatusPageTeam): + + Raises: + errors.UnexpectedStatus: If the server 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 | StatusPageTeamResponse + """ + + 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: NewStatusPageTeam, +) -> Response[ErrorsList | StatusPageTeamResponse]: + """Grants a team access to a status page + + Assigns a team to a status page. Members of the team get the chosen permission level on that page in + addition to their role. Requires an owner or admin role. + + Args: + status_page_id (str): + body (NewStatusPageTeam): + + Raises: + errors.UnexpectedStatus: If the server returns 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 | StatusPageTeamResponse] + """ + + 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: NewStatusPageTeam, +) -> ErrorsList | StatusPageTeamResponse | None: + """Grants a team access to a status page + + Assigns a team to a status page. Members of the team get the chosen permission level on that page in + addition to their role. Requires an owner or admin role. + + Args: + status_page_id (str): + body (NewStatusPageTeam): + + Raises: + errors.UnexpectedStatus: If the server 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 | StatusPageTeamResponse + """ + + return ( + await asyncio_detailed( + status_page_id=status_page_id, + client=client, + body=body, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_teams/delete_status_page_team.py b/rootly_sdk/api/status_page_teams/delete_status_page_team.py new file mode 100644 index 00000000..c4b9107e --- /dev/null +++ b/rootly_sdk/api/status_page_teams/delete_status_page_team.py @@ -0,0 +1,187 @@ +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.status_page_team_response import StatusPageTeamResponse +from ...types import Response + + +def _get_kwargs( + status_page_id: str, + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "delete", + "url": "/v1/status-pages/{status_page_id}/teams/{id}".format( + status_page_id=quote(str(status_page_id), safe=""), + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageTeamResponse | None: + if response.status_code == 200: + response_200 = StatusPageTeamResponse.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 | StatusPageTeamResponse]: + 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, + id: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorsList | StatusPageTeamResponse]: + """Removes a team's access to a status page + + Removes a team from a status page. Its members lose the page access the assignment granted on their + next request. Requires an owner or admin role. + + Args: + status_page_id (str): + 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[ErrorsList | StatusPageTeamResponse] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + status_page_id: str, + id: str, + *, + client: AuthenticatedClient, +) -> ErrorsList | StatusPageTeamResponse | None: + """Removes a team's access to a status page + + Removes a team from a status page. Its members lose the page access the assignment granted on their + next request. Requires an owner or admin role. + + Args: + status_page_id (str): + 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: + ErrorsList | StatusPageTeamResponse + """ + + return sync_detailed( + status_page_id=status_page_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + status_page_id: str, + id: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorsList | StatusPageTeamResponse]: + """Removes a team's access to a status page + + Removes a team from a status page. Its members lose the page access the assignment granted on their + next request. Requires an owner or admin role. + + Args: + status_page_id (str): + 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[ErrorsList | StatusPageTeamResponse] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + status_page_id: str, + id: str, + *, + client: AuthenticatedClient, +) -> ErrorsList | StatusPageTeamResponse | None: + """Removes a team's access to a status page + + Removes a team from a status page. Its members lose the page access the assignment granted on their + next request. Requires an owner or admin role. + + Args: + status_page_id (str): + 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: + ErrorsList | StatusPageTeamResponse + """ + + return ( + await asyncio_detailed( + status_page_id=status_page_id, + id=id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_teams/get_status_page_team.py b/rootly_sdk/api/status_page_teams/get_status_page_team.py new file mode 100644 index 00000000..87f3ffa8 --- /dev/null +++ b/rootly_sdk/api/status_page_teams/get_status_page_team.py @@ -0,0 +1,183 @@ +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.status_page_team_response import StatusPageTeamResponse +from ...types import Response + + +def _get_kwargs( + status_page_id: str, + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "get", + "url": "/v1/status-pages/{status_page_id}/teams/{id}".format( + status_page_id=quote(str(status_page_id), safe=""), + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ErrorsList | StatusPageTeamResponse | None: + if response.status_code == 200: + response_200 = StatusPageTeamResponse.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 | StatusPageTeamResponse]: + 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, + id: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorsList | StatusPageTeamResponse]: + """Retrieves a status page team assignment + + Retrieves a specific status page team assignment by id + + Args: + status_page_id (str): + 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[ErrorsList | StatusPageTeamResponse] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + id=id, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + status_page_id: str, + id: str, + *, + client: AuthenticatedClient, +) -> ErrorsList | StatusPageTeamResponse | None: + """Retrieves a status page team assignment + + Retrieves a specific status page team assignment by id + + Args: + status_page_id (str): + 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: + ErrorsList | StatusPageTeamResponse + """ + + return sync_detailed( + status_page_id=status_page_id, + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + status_page_id: str, + id: str, + *, + client: AuthenticatedClient, +) -> Response[ErrorsList | StatusPageTeamResponse]: + """Retrieves a status page team assignment + + Retrieves a specific status page team assignment by id + + Args: + status_page_id (str): + 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[ErrorsList | StatusPageTeamResponse] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + id=id, + ) + + response = await client.get_async_httpx_client().request(**kwargs) + + return _build_response(client=client, response=response) + + +async def asyncio( + status_page_id: str, + id: str, + *, + client: AuthenticatedClient, +) -> ErrorsList | StatusPageTeamResponse | None: + """Retrieves a status page team assignment + + Retrieves a specific status page team assignment by id + + Args: + status_page_id (str): + 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: + ErrorsList | StatusPageTeamResponse + """ + + return ( + await asyncio_detailed( + status_page_id=status_page_id, + id=id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/status_page_teams/list_status_page_teams.py b/rootly_sdk/api/status_page_teams/list_status_page_teams.py new file mode 100644 index 00000000..8cfefe87 --- /dev/null +++ b/rootly_sdk/api/status_page_teams/list_status_page_teams.py @@ -0,0 +1,210 @@ +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.status_page_team_list import StatusPageTeamList +from ...types import UNSET, Response, Unset + + +def _get_kwargs( + status_page_id: str, + *, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = 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": "/v1/status-pages/{status_page_id}/teams".format( + status_page_id=quote(str(status_page_id), safe=""), + ), + "params": params, + } + + return _kwargs + + +def _parse_response(*, client: AuthenticatedClient | Client, response: httpx.Response) -> StatusPageTeamList | None: + if response.status_code == 200: + response_200 = StatusPageTeamList.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[StatusPageTeamList]: + 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: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, +) -> Response[StatusPageTeamList]: + """Lists the teams with access to a status page + + Lists the teams assigned to a status page, oldest first + + Args: + status_page_id (str): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StatusPageTeamList] + """ + + 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: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, +) -> StatusPageTeamList | None: + """Lists the teams with access to a status page + + Lists the teams assigned to a status page, oldest first + + Args: + status_page_id (str): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StatusPageTeamList + """ + + 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: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, +) -> Response[StatusPageTeamList]: + """Lists the teams with access to a status page + + Lists the teams assigned to a status page, oldest first + + Args: + status_page_id (str): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + Response[StatusPageTeamList] + """ + + 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: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, +) -> StatusPageTeamList | None: + """Lists the teams with access to a status page + + Lists the teams assigned to a status page, oldest first + + Args: + status_page_id (str): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + + Raises: + errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. + httpx.TimeoutException: If the request takes longer than Client.timeout. + + Returns: + StatusPageTeamList + """ + + 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_teams/update_status_page_team.py b/rootly_sdk/api/status_page_teams/update_status_page_team.py new file mode 100644 index 00000000..7200d85f --- /dev/null +++ b/rootly_sdk/api/status_page_teams/update_status_page_team.py @@ -0,0 +1,208 @@ +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.status_page_team_response import StatusPageTeamResponse +from ...models.update_status_page_team import UpdateStatusPageTeam +from ...types import Response + + +def _get_kwargs( + status_page_id: str, + id: str, + *, + body: UpdateStatusPageTeam, +) -> dict[str, Any]: + headers: dict[str, Any] = {} + + _kwargs: dict[str, Any] = { + "method": "put", + "url": "/v1/status-pages/{status_page_id}/teams/{id}".format( + status_page_id=quote(str(status_page_id), safe=""), + id=quote(str(id), safe=""), + ), + } + + _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 | StatusPageTeamResponse | None: + if response.status_code == 200: + response_200 = StatusPageTeamResponse.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 | StatusPageTeamResponse]: + 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, + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageTeam, +) -> Response[ErrorsList | StatusPageTeamResponse]: + """Updates a status page team assignment + + Changes the permission level of a team on a status page. Requires an owner or admin role. To move + the grant to another team, delete it and create a new one. + + Args: + status_page_id (str): + id (str): + body (UpdateStatusPageTeam): + + Raises: + errors.UnexpectedStatus: If the server returns 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 | StatusPageTeamResponse] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + id=id, + body=body, + ) + + response = client.get_httpx_client().request( + **kwargs, + ) + + return _build_response(client=client, response=response) + + +def sync( + status_page_id: str, + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageTeam, +) -> ErrorsList | StatusPageTeamResponse | None: + """Updates a status page team assignment + + Changes the permission level of a team on a status page. Requires an owner or admin role. To move + the grant to another team, delete it and create a new one. + + Args: + status_page_id (str): + id (str): + body (UpdateStatusPageTeam): + + Raises: + errors.UnexpectedStatus: If the server 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 | StatusPageTeamResponse + """ + + return sync_detailed( + status_page_id=status_page_id, + id=id, + client=client, + body=body, + ).parsed + + +async def asyncio_detailed( + status_page_id: str, + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageTeam, +) -> Response[ErrorsList | StatusPageTeamResponse]: + """Updates a status page team assignment + + Changes the permission level of a team on a status page. Requires an owner or admin role. To move + the grant to another team, delete it and create a new one. + + Args: + status_page_id (str): + id (str): + body (UpdateStatusPageTeam): + + Raises: + errors.UnexpectedStatus: If the server returns 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 | StatusPageTeamResponse] + """ + + kwargs = _get_kwargs( + status_page_id=status_page_id, + id=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, + id: str, + *, + client: AuthenticatedClient, + body: UpdateStatusPageTeam, +) -> ErrorsList | StatusPageTeamResponse | None: + """Updates a status page team assignment + + Changes the permission level of a team on a status page. Requires an owner or admin role. To move + the grant to another team, delete it and create a new one. + + Args: + status_page_id (str): + id (str): + body (UpdateStatusPageTeam): + + Raises: + errors.UnexpectedStatus: If the server 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 | StatusPageTeamResponse + """ + + return ( + await asyncio_detailed( + status_page_id=status_page_id, + 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 b2f957dc..38428024 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/status-pages/{status_page_id}/templates", + "url": "/v1/status-pages/{status_page_id}/templates".format( + status_page_id=quote(str(status_page_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageTemplateResponse]] + Response[ErrorsList | StatusPageTemplateResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageTemplateResponse] + ErrorsList | StatusPageTemplateResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageTemplateResponse]] + Response[ErrorsList | StatusPageTemplateResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageTemplateResponse] + 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 161fa164..0fccfa58 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/templates/{id}", + "url": "/v1/templates/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageTemplateResponse]] + Response[ErrorsList | StatusPageTemplateResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageTemplateResponse] + ErrorsList | StatusPageTemplateResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageTemplateResponse]] + Response[ErrorsList | StatusPageTemplateResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageTemplateResponse] + 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 14fdfede..cd9c534c 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/templates/{id}", + "url": "/v1/templates/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageTemplateResponse]] + Response[ErrorsList | StatusPageTemplateResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageTemplateResponse] + ErrorsList | StatusPageTemplateResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageTemplateResponse]] + Response[ErrorsList | StatusPageTemplateResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageTemplateResponse] + 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 e3a79d97..806aef61 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( status_page_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/status-pages/{status_page_id}/templates", + "url": "/v1/status-pages/{status_page_id}/templates".format( + status_page_id=quote(str(status_page_id), safe=""), + ), "params": params, } @@ -62,9 +66,9 @@ def sync_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[StatusPageTemplateList]: """List status page templates @@ -72,9 +76,9 @@ def sync_detailed( Args: status_page_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -102,9 +106,9 @@ def sync( status_page_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> StatusPageTemplateList | None: """List status page templates @@ -112,9 +116,9 @@ def sync( Args: status_page_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -137,9 +141,9 @@ async def asyncio_detailed( status_page_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[StatusPageTemplateList]: """List status page templates @@ -147,9 +151,9 @@ async def asyncio_detailed( Args: status_page_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -175,9 +179,9 @@ async def asyncio( status_page_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> StatusPageTemplateList | None: """List status page templates @@ -185,9 +189,9 @@ async def asyncio( Args: status_page_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 88b755fa..e8f68a20 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/templates/{id}", + "url": "/v1/templates/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageTemplateResponse]] + Response[ErrorsList | StatusPageTemplateResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageTemplateResponse] + ErrorsList | StatusPageTemplateResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageTemplateResponse]] + Response[ErrorsList | StatusPageTemplateResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageTemplateResponse] + 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 9e7615a1..499bcdb8 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[Union[ErrorsList, StatusPageResponse]] + Response[ErrorsList | StatusPageResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageResponse] + 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[Union[ErrorsList, StatusPageResponse]] + Response[ErrorsList | StatusPageResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageResponse] + 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 ef7a14b6..fcb4150f 100644 --- a/rootly_sdk/api/status_pages/delete_status_page.py +++ b/rootly_sdk/api/status_pages/delete_status_page.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/status-pages/{id}", + "url": "/v1/status-pages/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | StatusPageResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific status page by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, StatusPageResponse]] + Response[ErrorsList | StatusPageResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | StatusPageResponse | None: @@ -93,14 +97,14 @@ def sync( Delete a specific status page by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, StatusPageResponse] + ErrorsList | StatusPageResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | StatusPageResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific status page by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, StatusPageResponse]] + Response[ErrorsList | StatusPageResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | StatusPageResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific status page by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, StatusPageResponse] + 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 5f12160f..d48c36a9 100644 --- a/rootly_sdk/api/status_pages/get_status_page.py +++ b/rootly_sdk/api/status_pages/get_status_page.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/status-pages/{id}", + "url": "/v1/status-pages/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | StatusPageResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific status page by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, StatusPageResponse]] + Response[ErrorsList | StatusPageResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | StatusPageResponse | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific status page by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, StatusPageResponse] + ErrorsList | StatusPageResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | StatusPageResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific status page by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, StatusPageResponse]] + Response[ErrorsList | StatusPageResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | StatusPageResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific status page by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, StatusPageResponse] + 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 abf15426..1e11a52a 100644 --- a/rootly_sdk/api/status_pages/list_status_pages.py +++ b/rootly_sdk/api/status_pages/list_status_pages.py @@ -11,26 +11,27 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -106,50 +107,50 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[StatusPageList]: """List status pages List status pages Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -191,50 +192,50 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> StatusPageList | None: """List status pages List status pages Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -271,50 +272,50 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[StatusPageList]: """List status pages List status pages Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -354,50 +355,50 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> StatusPageList | None: """List status pages List status pages Args: - 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]): + 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): 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 74ebf96f..a6136c7a 100644 --- a/rootly_sdk/api/status_pages/update_status_page.py +++ b/rootly_sdk/api/status_pages/update_status_page.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateStatusPage, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/status-pages/{id}", + "url": "/v1/status-pages/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -68,7 +71,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateStatusPage, @@ -78,7 +81,7 @@ def sync_detailed( Update a specific status page by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateStatusPage): Raises: @@ -86,7 +89,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageResponse]] + Response[ErrorsList | StatusPageResponse] """ kwargs = _get_kwargs( @@ -102,7 +105,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateStatusPage, @@ -112,7 +115,7 @@ def sync( Update a specific status page by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateStatusPage): Raises: @@ -120,7 +123,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageResponse] + ErrorsList | StatusPageResponse """ return sync_detailed( @@ -131,7 +134,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateStatusPage, @@ -141,7 +144,7 @@ async def asyncio_detailed( Update a specific status page by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateStatusPage): Raises: @@ -149,7 +152,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, StatusPageResponse]] + Response[ErrorsList | StatusPageResponse] """ kwargs = _get_kwargs( @@ -163,7 +166,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateStatusPage, @@ -173,7 +176,7 @@ async def asyncio( Update a specific status page by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateStatusPage): Raises: @@ -181,7 +184,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, StatusPageResponse] + ErrorsList | StatusPageResponse """ return ( diff --git a/rootly_sdk/api/statuses/get_status.py b/rootly_sdk/api/statuses/get_status.py index d10a7bc7..185a8694 100644 --- a/rootly_sdk/api/statuses/get_status.py +++ b/rootly_sdk/api/statuses/get_status.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/statuses/{id}", + "url": "/v1/statuses/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | StatusResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific Status by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, StatusResponse]] + Response[ErrorsList | StatusResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | StatusResponse | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific Status by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, StatusResponse] + ErrorsList | StatusResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | StatusResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific Status by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, StatusResponse]] + Response[ErrorsList | StatusResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | StatusResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific Status by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, StatusResponse] + ErrorsList | StatusResponse """ return ( diff --git a/rootly_sdk/api/statuses/list_statuses.py b/rootly_sdk/api/statuses/list_statuses.py index b2f4c035..d7ddd61a 100644 --- a/rootly_sdk/api/statuses/list_statuses.py +++ b/rootly_sdk/api/statuses/list_statuses.py @@ -12,17 +12,18 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -89,39 +90,39 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[ErrorsList | StatusList]: """List Statuses List Statuses Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns 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, StatusList]] + Response[ErrorsList | StatusList] """ kwargs = _get_kwargs( @@ -147,39 +148,39 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> ErrorsList | StatusList | None: """List Statuses List Statuses Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server 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, StatusList] + ErrorsList | StatusList """ return sync_detailed( @@ -200,39 +201,39 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[ErrorsList | StatusList]: """List Statuses List Statuses Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns 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, StatusList]] + Response[ErrorsList | StatusList] """ kwargs = _get_kwargs( @@ -256,39 +257,39 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> ErrorsList | StatusList | None: """List Statuses List Statuses Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server 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, StatusList] + 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 f34b6c2d..47b85e50 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[Union[ErrorsList, SubStatusResponse]] + Response[ErrorsList | SubStatusResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SubStatusResponse] + 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[Union[ErrorsList, SubStatusResponse]] + Response[ErrorsList | SubStatusResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SubStatusResponse] + 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 88af630e..4e323dfb 100644 --- a/rootly_sdk/api/sub_statuses/delete_sub_status.py +++ b/rootly_sdk/api/sub_statuses/delete_sub_status.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/sub_statuses/{id}", + "url": "/v1/sub_statuses/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | SubStatusResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific Sub-Status by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, SubStatusResponse]] + Response[ErrorsList | SubStatusResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | SubStatusResponse | None: @@ -93,14 +97,14 @@ def sync( Delete a specific Sub-Status by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, SubStatusResponse] + ErrorsList | SubStatusResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | SubStatusResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific Sub-Status by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, SubStatusResponse]] + Response[ErrorsList | SubStatusResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | SubStatusResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific Sub-Status by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, SubStatusResponse] + 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 a364bb50..74ea1a88 100644 --- a/rootly_sdk/api/sub_statuses/get_sub_status.py +++ b/rootly_sdk/api/sub_statuses/get_sub_status.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/sub_statuses/{id}", + "url": "/v1/sub_statuses/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | SubStatusResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Retrieves a specific Sub-Status by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, SubStatusResponse]] + Response[ErrorsList | SubStatusResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | SubStatusResponse | None: @@ -93,14 +97,14 @@ def sync( Retrieves a specific Sub-Status by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, SubStatusResponse] + ErrorsList | SubStatusResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | SubStatusResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Retrieves a specific Sub-Status by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, SubStatusResponse]] + Response[ErrorsList | SubStatusResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | SubStatusResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Retrieves a specific Sub-Status by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, SubStatusResponse] + 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 4bd03cdb..ecbe33ee 100644 --- a/rootly_sdk/api/sub_statuses/list_sub_statuses.py +++ b/rootly_sdk/api/sub_statuses/list_sub_statuses.py @@ -11,17 +11,18 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -79,32 +80,32 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[SubStatusList]: """List Sub-Statuses List Sub-Statuses Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -137,32 +138,32 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> SubStatusList | None: """List Sub-Statuses List Sub-Statuses Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -190,32 +191,32 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[SubStatusList]: """List Sub-Statuses List Sub-Statuses Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -246,32 +247,32 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> SubStatusList | None: """List Sub-Statuses List Sub-Statuses Args: - 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]): + 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): 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 684f59c8..290e2864 100644 --- a/rootly_sdk/api/sub_statuses/update_sub_status.py +++ b/rootly_sdk/api/sub_statuses/update_sub_status.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateSubStatus, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/sub_statuses/{id}", + "url": "/v1/sub_statuses/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -63,7 +66,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateSubStatus, @@ -73,7 +76,7 @@ def sync_detailed( Update a specific Sub-Status by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateSubStatus): Raises: @@ -81,7 +84,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, SubStatusResponse]] + Response[ErrorsList | SubStatusResponse] """ kwargs = _get_kwargs( @@ -97,7 +100,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateSubStatus, @@ -107,7 +110,7 @@ def sync( Update a specific Sub-Status by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateSubStatus): Raises: @@ -115,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SubStatusResponse] + ErrorsList | SubStatusResponse """ return sync_detailed( @@ -126,7 +129,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateSubStatus, @@ -136,7 +139,7 @@ async def asyncio_detailed( Update a specific Sub-Status by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateSubStatus): Raises: @@ -144,7 +147,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, SubStatusResponse]] + Response[ErrorsList | SubStatusResponse] """ kwargs = _get_kwargs( @@ -158,7 +161,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateSubStatus, @@ -168,7 +171,7 @@ async def asyncio( Update a specific Sub-Status by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateSubStatus): Raises: @@ -176,7 +179,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, SubStatusResponse] + ErrorsList | SubStatusResponse """ return ( diff --git a/rootly_sdk/api/teams/bulk_delete_groups.py b/rootly_sdk/api/teams/bulk_delete_groups.py index f748b5db..dc3ee765 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, Union +from typing import Any import httpx @@ -14,7 +14,7 @@ def _get_kwargs( *, - body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], + body: BulkDestroyTeamsType0 | BulkDestroyTeamsType1, ) -> dict[str, Any]: headers: dict[str, Any] = {} @@ -23,7 +23,6 @@ def _get_kwargs( "url": "/v1/teams/bulk_delete", } - _kwargs["json"]: dict[str, Any] if isinstance(body, BulkDestroyTeamsType0): _kwargs["json"] = body.to_dict() else: @@ -37,7 +36,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkDestroyTeamsResponse | ErrorsList | Union["BulkDestroyTeamsResponse", "ErrorsList"] | None: +) -> BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList | None: if response.status_code == 200: response_200 = BulkDestroyTeamsResponse.from_dict(response.json()) @@ -50,14 +49,14 @@ def _parse_response( if response.status_code == 422: - def _parse_response_422(data: object) -> Union["BulkDestroyTeamsResponse", "ErrorsList"]: + def _parse_response_422(data: object) -> BulkDestroyTeamsResponse | ErrorsList: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -77,7 +76,7 @@ def _parse_response_422(data: object) -> Union["BulkDestroyTeamsResponse", "Erro def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkDestroyTeamsResponse | ErrorsList | Union["BulkDestroyTeamsResponse", "ErrorsList"]]: +) -> Response[BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -89,23 +88,23 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], -) -> Response[BulkDestroyTeamsResponse | ErrorsList | Union["BulkDestroyTeamsResponse", "ErrorsList"]]: + body: BulkDestroyTeamsType0 | BulkDestroyTeamsType1, +) -> Response[BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList]: """Bulk delete Teams Delete teams by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - 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). + 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). Raises: errors.UnexpectedStatus: If the server returns 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[BulkDestroyTeamsResponse, ErrorsList, Union['BulkDestroyTeamsResponse', 'ErrorsList']]] + Response[BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList] """ kwargs = _get_kwargs( @@ -122,23 +121,23 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], -) -> BulkDestroyTeamsResponse | ErrorsList | Union["BulkDestroyTeamsResponse", "ErrorsList"] | None: + body: BulkDestroyTeamsType0 | BulkDestroyTeamsType1, +) -> BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList | None: """Bulk delete Teams Delete teams by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - 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). + 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). Raises: errors.UnexpectedStatus: If the server 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[BulkDestroyTeamsResponse, ErrorsList, Union['BulkDestroyTeamsResponse', 'ErrorsList']] + BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList """ return sync_detailed( @@ -150,23 +149,23 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], -) -> Response[BulkDestroyTeamsResponse | ErrorsList | Union["BulkDestroyTeamsResponse", "ErrorsList"]]: + body: BulkDestroyTeamsType0 | BulkDestroyTeamsType1, +) -> Response[BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList]: """Bulk delete Teams Delete teams by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - 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). + 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). Raises: errors.UnexpectedStatus: If the server returns 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[BulkDestroyTeamsResponse, ErrorsList, Union['BulkDestroyTeamsResponse', 'ErrorsList']]] + Response[BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList] """ kwargs = _get_kwargs( @@ -181,23 +180,23 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - body: Union["BulkDestroyTeamsType0", "BulkDestroyTeamsType1"], -) -> BulkDestroyTeamsResponse | ErrorsList | Union["BulkDestroyTeamsResponse", "ErrorsList"] | None: + body: BulkDestroyTeamsType0 | BulkDestroyTeamsType1, +) -> BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList | None: """Bulk delete Teams Delete teams by external_id list, or prune by managed_by source. Two mutually exclusive modes. Args: - 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). + 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). Raises: errors.UnexpectedStatus: If the server 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[BulkDestroyTeamsResponse, ErrorsList, Union['BulkDestroyTeamsResponse', 'ErrorsList']] + BulkDestroyTeamsResponse | BulkDestroyTeamsResponse | ErrorsList | ErrorsList """ return ( diff --git a/rootly_sdk/api/teams/bulk_upsert_groups.py b/rootly_sdk/api/teams/bulk_upsert_groups.py index 5a5a471a..4eb43f51 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, Union +from typing import Any import httpx @@ -33,7 +33,7 @@ def _get_kwargs( def _parse_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> BulkUpsertTeamsResponse | ErrorsList | Union["BulkUpsertTeamsError", "ErrorsList"] | None: +) -> BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList | None: if response.status_code == 200: response_200 = BulkUpsertTeamsResponse.from_dict(response.json()) @@ -44,16 +44,21 @@ def _parse_response( return response_401 + if response.status_code == 403: + response_403 = ErrorsList.from_dict(response.json()) + + return response_403 + if response.status_code == 422: - def _parse_response_422(data: object) -> Union["BulkUpsertTeamsError", "ErrorsList"]: + def _parse_response_422(data: object) -> BulkUpsertTeamsError | ErrorsList: try: if not isinstance(data, dict): raise TypeError() response_422_type_0 = ErrorsList.from_dict(data) return response_422_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -73,7 +78,7 @@ def _parse_response_422(data: object) -> Union["BulkUpsertTeamsError", "ErrorsLi def _build_response( *, client: AuthenticatedClient | Client, response: httpx.Response -) -> Response[BulkUpsertTeamsResponse | ErrorsList | Union["BulkUpsertTeamsError", "ErrorsList"]]: +) -> Response[BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList]: return Response( status_code=HTTPStatus(response.status_code), content=response.content, @@ -86,7 +91,7 @@ def sync_detailed( *, client: AuthenticatedClient, body: BulkUpsertTeams, -) -> Response[BulkUpsertTeamsResponse | ErrorsList | Union["BulkUpsertTeamsError", "ErrorsList"]]: +) -> Response[BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList]: """Bulk upsert Teams Create or update multiple teams by external_id. Only attributes present in the payload are written @@ -103,7 +108,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[BulkUpsertTeamsResponse, ErrorsList, Union['BulkUpsertTeamsError', 'ErrorsList']]] + Response[BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -121,7 +126,7 @@ def sync( *, client: AuthenticatedClient, body: BulkUpsertTeams, -) -> BulkUpsertTeamsResponse | ErrorsList | Union["BulkUpsertTeamsError", "ErrorsList"] | None: +) -> BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList | None: """Bulk upsert Teams Create or update multiple teams by external_id. Only attributes present in the payload are written @@ -138,7 +143,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[BulkUpsertTeamsResponse, ErrorsList, Union['BulkUpsertTeamsError', 'ErrorsList']] + BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList """ return sync_detailed( @@ -151,7 +156,7 @@ async def asyncio_detailed( *, client: AuthenticatedClient, body: BulkUpsertTeams, -) -> Response[BulkUpsertTeamsResponse | ErrorsList | Union["BulkUpsertTeamsError", "ErrorsList"]]: +) -> Response[BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList]: """Bulk upsert Teams Create or update multiple teams by external_id. Only attributes present in the payload are written @@ -168,7 +173,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[BulkUpsertTeamsResponse, ErrorsList, Union['BulkUpsertTeamsError', 'ErrorsList']]] + Response[BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -184,7 +189,7 @@ async def asyncio( *, client: AuthenticatedClient, body: BulkUpsertTeams, -) -> BulkUpsertTeamsResponse | ErrorsList | Union["BulkUpsertTeamsError", "ErrorsList"] | None: +) -> BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | ErrorsList | None: """Bulk upsert Teams Create or update multiple teams by external_id. Only attributes present in the payload are written @@ -201,7 +206,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[BulkUpsertTeamsResponse, ErrorsList, Union['BulkUpsertTeamsError', 'ErrorsList']] + BulkUpsertTeamsError | ErrorsList | BulkUpsertTeamsResponse | 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 d8f5620c..c3a7a4ef 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[Union[CatalogPropertyResponse, ErrorsList]] + Response[CatalogPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogPropertyResponse, ErrorsList] + 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[Union[CatalogPropertyResponse, ErrorsList]] + Response[CatalogPropertyResponse | ErrorsList] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[CatalogPropertyResponse, ErrorsList] + CatalogPropertyResponse | ErrorsList """ return ( diff --git a/rootly_sdk/api/teams/create_team.py b/rootly_sdk/api/teams/create_team.py index 17bbf1b8..4cda35ba 100644 --- a/rootly_sdk/api/teams/create_team.py +++ b/rootly_sdk/api/teams/create_team.py @@ -43,6 +43,11 @@ def _parse_response( return response_401 + if response.status_code == 403: + response_403 = ErrorsList.from_dict(response.json()) + + return response_403 + if response.status_code == 422: response_422 = ErrorsList.from_dict(response.json()) @@ -82,7 +87,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, TeamResponse]] + Response[ErrorsList | TeamResponse] """ kwargs = _get_kwargs( @@ -113,7 +118,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, TeamResponse] + ErrorsList | TeamResponse """ return sync_detailed( @@ -139,7 +144,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, TeamResponse]] + Response[ErrorsList | TeamResponse] """ kwargs = _get_kwargs( @@ -168,7 +173,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, TeamResponse] + ErrorsList | TeamResponse """ return ( diff --git a/rootly_sdk/api/teams/delete_team.py b/rootly_sdk/api/teams/delete_team.py index c9bb64fa..bd6221ce 100644 --- a/rootly_sdk/api/teams/delete_team.py +++ b/rootly_sdk/api/teams/delete_team.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/teams/{id}", + "url": "/v1/teams/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | TeamResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific team by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, TeamResponse]] + Response[ErrorsList | TeamResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | TeamResponse | None: @@ -93,14 +97,14 @@ def sync( Delete a specific team by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, TeamResponse] + ErrorsList | TeamResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | TeamResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific team by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, TeamResponse]] + Response[ErrorsList | TeamResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | TeamResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific team by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, TeamResponse] + ErrorsList | TeamResponse """ return ( diff --git a/rootly_sdk/api/teams/get_team.py b/rootly_sdk/api/teams/get_team.py index 154624c1..3c4c049d 100644 --- a/rootly_sdk/api/teams/get_team.py +++ b/rootly_sdk/api/teams/get_team.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,13 +14,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, - include: Unset | GetTeamInclude = UNSET, + include: GetTeamInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -29,7 +31,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/teams/{id}", + "url": "/v1/teams/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -67,25 +71,25 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetTeamInclude = UNSET, + include: GetTeamInclude | Unset = UNSET, ) -> Response[ErrorsList | TeamResponse]: """Retrieves a team Retrieves a specific team by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetTeamInclude]): + id (str | UUID): + include (GetTeamInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, TeamResponse]] + Response[ErrorsList | TeamResponse] """ kwargs = _get_kwargs( @@ -101,25 +105,25 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetTeamInclude = UNSET, + include: GetTeamInclude | Unset = UNSET, ) -> ErrorsList | TeamResponse | None: """Retrieves a team Retrieves a specific team by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetTeamInclude]): + id (str | UUID): + include (GetTeamInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, TeamResponse] + ErrorsList | TeamResponse """ return sync_detailed( @@ -130,25 +134,25 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetTeamInclude = UNSET, + include: GetTeamInclude | Unset = UNSET, ) -> Response[ErrorsList | TeamResponse]: """Retrieves a team Retrieves a specific team by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetTeamInclude]): + id (str | UUID): + include (GetTeamInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, TeamResponse]] + Response[ErrorsList | TeamResponse] """ kwargs = _get_kwargs( @@ -162,25 +166,25 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetTeamInclude = UNSET, + include: GetTeamInclude | Unset = UNSET, ) -> ErrorsList | TeamResponse | None: """Retrieves a team Retrieves a specific team by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetTeamInclude]): + id (str | UUID): + include (GetTeamInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, TeamResponse] + 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 46979aba..7f173bd8 100644 --- a/rootly_sdk/api/teams/get_team_incidents_chart.py +++ b/rootly_sdk/api/teams/get_team_incidents_chart.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -15,6 +16,7 @@ def _get_kwargs( *, period: str, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["period"] = period @@ -23,7 +25,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/teams/{id}/incidents_chart", + "url": "/v1/teams/{id}/incidents_chart".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -79,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentsChartResponse]] + Response[ErrorsList | IncidentsChartResponse] """ kwargs = _get_kwargs( @@ -113,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentsChartResponse] + ErrorsList | IncidentsChartResponse """ return sync_detailed( @@ -142,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, IncidentsChartResponse]] + Response[ErrorsList | IncidentsChartResponse] """ kwargs = _get_kwargs( @@ -174,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, IncidentsChartResponse] + 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 99dda92c..59d899d2 100644 --- a/rootly_sdk/api/teams/list_group_catalog_properties.py +++ b/rootly_sdk/api/teams/list_group_catalog_properties.py @@ -17,27 +17,28 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Unset | str = UNSET + json_sort: str | Unset = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -96,34 +97,34 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Group Catalog Properties Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -157,34 +158,34 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogPropertyList | None: """List Catalog Properties List Group Catalog Properties Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -213,34 +214,34 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[CatalogPropertyList]: """List Catalog Properties List Group Catalog Properties Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -272,34 +273,34 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> CatalogPropertyList | None: """List Catalog Properties List Group Catalog Properties Args: - 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]): + 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): 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 c31abb6b..8ae9cdb6 100644 --- a/rootly_sdk/api/teams/list_teams.py +++ b/rootly_sdk/api/teams/list_teams.py @@ -12,48 +12,49 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -168,88 +169,88 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[TeamList]: """List teams List teams Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -310,88 +311,88 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> TeamList | None: """List teams List teams Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -447,88 +448,88 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[TeamList]: """List teams List teams Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -587,88 +588,88 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> TeamList | None: """List teams List teams Args: - 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]): + 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): 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 92f9645a..eb2c3f6a 100644 --- a/rootly_sdk/api/teams/update_team.py +++ b/rootly_sdk/api/teams/update_team.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateTeam, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/teams/{id}", + "url": "/v1/teams/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -40,6 +43,11 @@ def _parse_response( return response_200 + if response.status_code == 403: + response_403 = ErrorsList.from_dict(response.json()) + + return response_403 + if response.status_code == 404: response_404 = ErrorsList.from_dict(response.json()) @@ -63,7 +71,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateTeam, @@ -73,7 +81,7 @@ def sync_detailed( Update a specific team by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateTeam): Raises: @@ -81,7 +89,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, TeamResponse]] + Response[ErrorsList | TeamResponse] """ kwargs = _get_kwargs( @@ -97,7 +105,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateTeam, @@ -107,7 +115,7 @@ def sync( Update a specific team by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateTeam): Raises: @@ -115,7 +123,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, TeamResponse] + ErrorsList | TeamResponse """ return sync_detailed( @@ -126,7 +134,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateTeam, @@ -136,7 +144,7 @@ async def asyncio_detailed( Update a specific team by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateTeam): Raises: @@ -144,7 +152,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, TeamResponse]] + Response[ErrorsList | TeamResponse] """ kwargs = _get_kwargs( @@ -158,7 +166,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateTeam, @@ -168,7 +176,7 @@ async def asyncio( Update a specific team by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateTeam): Raises: @@ -176,7 +184,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, TeamResponse] + 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 6abb0a4f..74446851 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/users/{user_id}/email_addresses", + "url": "/v1/users/{user_id}/email_addresses".format( + user_id=quote(str(user_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -90,7 +93,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserEmailAddressResponse]] + Response[ErrorsList | UserEmailAddressResponse] """ kwargs = _get_kwargs( @@ -124,7 +127,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserEmailAddressResponse] + ErrorsList | UserEmailAddressResponse """ return sync_detailed( @@ -153,7 +156,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserEmailAddressResponse]] + Response[ErrorsList | UserEmailAddressResponse] """ kwargs = _get_kwargs( @@ -185,7 +188,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserEmailAddressResponse] + 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 b33ed180..48fb3366 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/email_addresses/{id}", + "url": "/v1/email_addresses/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -73,7 +77,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserEmailAddressResponse]] + Response[ErrorsList | UserEmailAddressResponse] """ kwargs = _get_kwargs( @@ -104,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserEmailAddressResponse] + ErrorsList | UserEmailAddressResponse """ return sync_detailed( @@ -130,7 +134,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserEmailAddressResponse]] + Response[ErrorsList | UserEmailAddressResponse] """ kwargs = _get_kwargs( @@ -159,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserEmailAddressResponse] + 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 30837a61..1787502c 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( user_id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/users/{user_id}/email_addresses", + "url": "/v1/users/{user_id}/email_addresses".format( + user_id=quote(str(user_id), safe=""), + ), } return _kwargs @@ -73,7 +77,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserEmailAddressList]] + Response[ErrorsList | UserEmailAddressList] """ kwargs = _get_kwargs( @@ -104,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserEmailAddressList] + ErrorsList | UserEmailAddressList """ return sync_detailed( @@ -130,7 +134,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserEmailAddressList]] + Response[ErrorsList | UserEmailAddressList] """ kwargs = _get_kwargs( @@ -159,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserEmailAddressList] + 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 b7d03cf9..f2cffd4b 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/email_addresses/{id}/resend_verification", + "url": "/v1/email_addresses/{id}/resend_verification".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -73,7 +77,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserEmailAddressResponse]] + Response[ErrorsList | UserEmailAddressResponse] """ kwargs = _get_kwargs( @@ -104,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserEmailAddressResponse] + ErrorsList | UserEmailAddressResponse """ return sync_detailed( @@ -130,7 +134,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserEmailAddressResponse]] + Response[ErrorsList | UserEmailAddressResponse] """ kwargs = _get_kwargs( @@ -159,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserEmailAddressResponse] + 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 f350ab94..7d07adf5 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/email_addresses/{id}", + "url": "/v1/email_addresses/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -73,7 +77,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserEmailAddressResponse]] + Response[ErrorsList | UserEmailAddressResponse] """ kwargs = _get_kwargs( @@ -104,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserEmailAddressResponse] + ErrorsList | UserEmailAddressResponse """ return sync_detailed( @@ -130,7 +134,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserEmailAddressResponse]] + Response[ErrorsList | UserEmailAddressResponse] """ kwargs = _get_kwargs( @@ -159,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserEmailAddressResponse] + 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 e2af7b2c..2c5e414d 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/email_addresses/{id}", + "url": "/v1/email_addresses/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -90,7 +93,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserEmailAddressResponse]] + Response[ErrorsList | UserEmailAddressResponse] """ kwargs = _get_kwargs( @@ -124,7 +127,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserEmailAddressResponse] + ErrorsList | UserEmailAddressResponse """ return sync_detailed( @@ -153,7 +156,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserEmailAddressResponse]] + Response[ErrorsList | UserEmailAddressResponse] """ kwargs = _get_kwargs( @@ -185,7 +188,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserEmailAddressResponse] + 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 92667c75..87d89043 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -15,6 +16,7 @@ def _get_kwargs( *, token: str, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["token"] = token @@ -23,7 +25,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/email_addresses/{id}/verify", + "url": "/v1/email_addresses/{id}/verify".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -84,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserEmailAddressResponse]] + Response[ErrorsList | UserEmailAddressResponse] """ kwargs = _get_kwargs( @@ -118,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserEmailAddressResponse] + ErrorsList | UserEmailAddressResponse """ return sync_detailed( @@ -147,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserEmailAddressResponse]] + Response[ErrorsList | UserEmailAddressResponse] """ kwargs = _get_kwargs( @@ -179,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserEmailAddressResponse] + 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 d1400b94..38aa6b53 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/users/{user_id}/notification_rules", + "url": "/v1/users/{user_id}/notification_rules".format( + user_id=quote(str(user_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserNotificationRuleResponse]] + Response[ErrorsList | UserNotificationRuleResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserNotificationRuleResponse] + ErrorsList | UserNotificationRuleResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserNotificationRuleResponse]] + Response[ErrorsList | UserNotificationRuleResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserNotificationRuleResponse] + 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 8e6643d7..45a0a726 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/notification_rules/{id}", + "url": "/v1/notification_rules/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserNotificationRuleResponse]] + Response[ErrorsList | UserNotificationRuleResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserNotificationRuleResponse] + ErrorsList | UserNotificationRuleResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserNotificationRuleResponse]] + Response[ErrorsList | UserNotificationRuleResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserNotificationRuleResponse] + 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 3951c128..1c214c69 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/notification_rules/{id}", + "url": "/v1/notification_rules/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserNotificationRuleResponse]] + Response[ErrorsList | UserNotificationRuleResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserNotificationRuleResponse] + ErrorsList | UserNotificationRuleResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserNotificationRuleResponse]] + Response[ErrorsList | UserNotificationRuleResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserNotificationRuleResponse] + 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 15115e91..839b2ca9 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,11 +13,12 @@ def _get_kwargs( user_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - sort: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -31,7 +33,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/users/{user_id}/notification_rules", + "url": "/v1/users/{user_id}/notification_rules".format( + user_id=quote(str(user_id), safe=""), + ), "params": params, } @@ -67,10 +71,10 @@ def sync_detailed( user_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - sort: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, ) -> Response[UserNotificationRuleList]: """List user notification rules @@ -78,10 +82,10 @@ def sync_detailed( Args: user_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - sort (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -110,10 +114,10 @@ def sync( user_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - sort: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, ) -> UserNotificationRuleList | None: """List user notification rules @@ -121,10 +125,10 @@ def sync( Args: user_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - sort (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -148,10 +152,10 @@ async def asyncio_detailed( user_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - sort: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, ) -> Response[UserNotificationRuleList]: """List user notification rules @@ -159,10 +163,10 @@ async def asyncio_detailed( Args: user_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - sort (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -189,10 +193,10 @@ async def asyncio( user_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - sort: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + sort: str | Unset = UNSET, ) -> UserNotificationRuleList | None: """List user notification rules @@ -200,10 +204,10 @@ async def asyncio( Args: user_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - sort (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + sort (str | Unset): 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 267b399d..39e99b2b 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/notification_rules/{id}", + "url": "/v1/notification_rules/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserNotificationRuleResponse]] + Response[ErrorsList | UserNotificationRuleResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserNotificationRuleResponse] + ErrorsList | UserNotificationRuleResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserNotificationRuleResponse]] + Response[ErrorsList | UserNotificationRuleResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserNotificationRuleResponse] + 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 8064bd89..4e6fc622 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/users/{user_id}/phone_numbers", + "url": "/v1/users/{user_id}/phone_numbers".format( + user_id=quote(str(user_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -90,7 +93,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserPhoneNumberResponse]] + Response[ErrorsList | UserPhoneNumberResponse] """ kwargs = _get_kwargs( @@ -124,7 +127,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserPhoneNumberResponse] + ErrorsList | UserPhoneNumberResponse """ return sync_detailed( @@ -153,7 +156,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserPhoneNumberResponse]] + Response[ErrorsList | UserPhoneNumberResponse] """ kwargs = _get_kwargs( @@ -185,7 +188,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserPhoneNumberResponse] + 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 a0afefd8..0b556c98 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/phone_numbers/{id}", + "url": "/v1/phone_numbers/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -78,7 +82,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserPhoneNumberResponse]] + Response[ErrorsList | UserPhoneNumberResponse] """ kwargs = _get_kwargs( @@ -109,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserPhoneNumberResponse] + ErrorsList | UserPhoneNumberResponse """ return sync_detailed( @@ -135,7 +139,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserPhoneNumberResponse]] + Response[ErrorsList | UserPhoneNumberResponse] """ kwargs = _get_kwargs( @@ -164,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserPhoneNumberResponse] + 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 b31cba8f..7e8d2f71 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( user_id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/users/{user_id}/phone_numbers", + "url": "/v1/users/{user_id}/phone_numbers".format( + user_id=quote(str(user_id), safe=""), + ), } return _kwargs @@ -73,7 +77,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserPhoneNumberList]] + Response[ErrorsList | UserPhoneNumberList] """ kwargs = _get_kwargs( @@ -104,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserPhoneNumberList] + ErrorsList | UserPhoneNumberList """ return sync_detailed( @@ -130,7 +134,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserPhoneNumberList]] + Response[ErrorsList | UserPhoneNumberList] """ kwargs = _get_kwargs( @@ -159,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserPhoneNumberList] + ErrorsList | UserPhoneNumberList """ return ( diff --git a/rootly_sdk/api/user_phone_numbers/resend_verification_user_phone_number.py b/rootly_sdk/api/user_phone_numbers/resend_verification_user_phone_number.py new file mode 100644 index 00000000..5932362c --- /dev/null +++ b/rootly_sdk/api/user_phone_numbers/resend_verification_user_phone_number.py @@ -0,0 +1,177 @@ +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.resend_verification_user_phone_number_response_200 import ResendVerificationUserPhoneNumberResponse200 +from ...models.resend_verification_user_phone_number_response_429 import ResendVerificationUserPhoneNumberResponse429 +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/phone_numbers/{id}/resend_verification".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> ResendVerificationUserPhoneNumberResponse200 | ResendVerificationUserPhoneNumberResponse429 | None: + if response.status_code == 200: + response_200 = ResendVerificationUserPhoneNumberResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 429: + response_429 = ResendVerificationUserPhoneNumberResponse429.from_dict(response.json()) + + return response_429 + + 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[ResendVerificationUserPhoneNumberResponse200 | ResendVerificationUserPhoneNumberResponse429]: + 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[ResendVerificationUserPhoneNumberResponse200 | ResendVerificationUserPhoneNumberResponse429]: + """Resend verification code + + Resends a verification code to the phone number. SMS sends are limited per recipient to 3 per hour + and 5 per day. An application rate-limit 429 response includes Retry-After with the remaining wait + in seconds. + + 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[ResendVerificationUserPhoneNumberResponse200 | ResendVerificationUserPhoneNumberResponse429] + """ + + 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, +) -> ResendVerificationUserPhoneNumberResponse200 | ResendVerificationUserPhoneNumberResponse429 | None: + """Resend verification code + + Resends a verification code to the phone number. SMS sends are limited per recipient to 3 per hour + and 5 per day. An application rate-limit 429 response includes Retry-After with the remaining wait + in seconds. + + 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: + ResendVerificationUserPhoneNumberResponse200 | ResendVerificationUserPhoneNumberResponse429 + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[ResendVerificationUserPhoneNumberResponse200 | ResendVerificationUserPhoneNumberResponse429]: + """Resend verification code + + Resends a verification code to the phone number. SMS sends are limited per recipient to 3 per hour + and 5 per day. An application rate-limit 429 response includes Retry-After with the remaining wait + in seconds. + + 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[ResendVerificationUserPhoneNumberResponse200 | ResendVerificationUserPhoneNumberResponse429] + """ + + 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, +) -> ResendVerificationUserPhoneNumberResponse200 | ResendVerificationUserPhoneNumberResponse429 | None: + """Resend verification code + + Resends a verification code to the phone number. SMS sends are limited per recipient to 3 per hour + and 5 per day. An application rate-limit 429 response includes Retry-After with the remaining wait + in seconds. + + 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: + ResendVerificationUserPhoneNumberResponse200 | ResendVerificationUserPhoneNumberResponse429 + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed 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 462a38b1..6cfafbed 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/phone_numbers/{id}", + "url": "/v1/phone_numbers/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -73,7 +77,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserPhoneNumberResponse]] + Response[ErrorsList | UserPhoneNumberResponse] """ kwargs = _get_kwargs( @@ -104,7 +108,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserPhoneNumberResponse] + ErrorsList | UserPhoneNumberResponse """ return sync_detailed( @@ -130,7 +134,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserPhoneNumberResponse]] + Response[ErrorsList | UserPhoneNumberResponse] """ kwargs = _get_kwargs( @@ -159,7 +163,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserPhoneNumberResponse] + 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 5fc8306a..6dcffd23 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/phone_numbers/{id}", + "url": "/v1/phone_numbers/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -90,7 +93,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserPhoneNumberResponse]] + Response[ErrorsList | UserPhoneNumberResponse] """ kwargs = _get_kwargs( @@ -124,7 +127,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserPhoneNumberResponse] + ErrorsList | UserPhoneNumberResponse """ return sync_detailed( @@ -153,7 +156,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserPhoneNumberResponse]] + Response[ErrorsList | UserPhoneNumberResponse] """ kwargs = _get_kwargs( @@ -185,7 +188,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserPhoneNumberResponse] + ErrorsList | UserPhoneNumberResponse """ return ( diff --git a/rootly_sdk/api/user_phone_numbers/verify_user_phone_number.py b/rootly_sdk/api/user_phone_numbers/verify_user_phone_number.py new file mode 100644 index 00000000..94dd8b4c --- /dev/null +++ b/rootly_sdk/api/user_phone_numbers/verify_user_phone_number.py @@ -0,0 +1,183 @@ +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.verify_user_phone_number_response_200 import VerifyUserPhoneNumberResponse200 +from ...models.verify_user_phone_number_response_429 import VerifyUserPhoneNumberResponse429 +from ...models.verify_user_phone_number_response_503 import VerifyUserPhoneNumberResponse503 +from ...types import Response + + +def _get_kwargs( + id: str, +) -> dict[str, Any]: + + _kwargs: dict[str, Any] = { + "method": "post", + "url": "/v1/phone_numbers/{id}/verify".format( + id=quote(str(id), safe=""), + ), + } + + return _kwargs + + +def _parse_response( + *, client: AuthenticatedClient | Client, response: httpx.Response +) -> VerifyUserPhoneNumberResponse200 | VerifyUserPhoneNumberResponse429 | VerifyUserPhoneNumberResponse503 | None: + if response.status_code == 200: + response_200 = VerifyUserPhoneNumberResponse200.from_dict(response.json()) + + return response_200 + + if response.status_code == 429: + response_429 = VerifyUserPhoneNumberResponse429.from_dict(response.json()) + + return response_429 + + if response.status_code == 503: + response_503 = VerifyUserPhoneNumberResponse503.from_dict(response.json()) + + return response_503 + + 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[VerifyUserPhoneNumberResponse200 | VerifyUserPhoneNumberResponse429 | VerifyUserPhoneNumberResponse503]: + 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[VerifyUserPhoneNumberResponse200 | VerifyUserPhoneNumberResponse429 | VerifyUserPhoneNumberResponse503]: + """Send verification code + + Sends a verification code to the phone number. SMS sends are limited per recipient to 3 per hour and + 5 per day. An application rate-limit 429 response includes Retry-After with the remaining wait in + seconds. + + 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[VerifyUserPhoneNumberResponse200 | VerifyUserPhoneNumberResponse429 | VerifyUserPhoneNumberResponse503] + """ + + 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, +) -> VerifyUserPhoneNumberResponse200 | VerifyUserPhoneNumberResponse429 | VerifyUserPhoneNumberResponse503 | None: + """Send verification code + + Sends a verification code to the phone number. SMS sends are limited per recipient to 3 per hour and + 5 per day. An application rate-limit 429 response includes Retry-After with the remaining wait in + seconds. + + 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: + VerifyUserPhoneNumberResponse200 | VerifyUserPhoneNumberResponse429 | VerifyUserPhoneNumberResponse503 + """ + + return sync_detailed( + id=id, + client=client, + ).parsed + + +async def asyncio_detailed( + id: str, + *, + client: AuthenticatedClient, +) -> Response[VerifyUserPhoneNumberResponse200 | VerifyUserPhoneNumberResponse429 | VerifyUserPhoneNumberResponse503]: + """Send verification code + + Sends a verification code to the phone number. SMS sends are limited per recipient to 3 per hour and + 5 per day. An application rate-limit 429 response includes Retry-After with the remaining wait in + seconds. + + 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[VerifyUserPhoneNumberResponse200 | VerifyUserPhoneNumberResponse429 | VerifyUserPhoneNumberResponse503] + """ + + 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, +) -> VerifyUserPhoneNumberResponse200 | VerifyUserPhoneNumberResponse429 | VerifyUserPhoneNumberResponse503 | None: + """Send verification code + + Sends a verification code to the phone number. SMS sends are limited per recipient to 3 per hour and + 5 per day. An application rate-limit 429 response includes Retry-After with the remaining wait in + seconds. + + 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: + VerifyUserPhoneNumberResponse200 | VerifyUserPhoneNumberResponse429 | VerifyUserPhoneNumberResponse503 + """ + + return ( + await asyncio_detailed( + id=id, + client=client, + ) + ).parsed diff --git a/rootly_sdk/api/users/delete_user.py b/rootly_sdk/api/users/delete_user.py index 3aaeadb4..e0be4b19 100644 --- a/rootly_sdk/api/users/delete_user.py +++ b/rootly_sdk/api/users/delete_user.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/users/{id}", + "url": "/v1/users/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserResponse]] + Response[ErrorsList | UserResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserResponse] + ErrorsList | UserResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserResponse]] + Response[ErrorsList | UserResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserResponse] + ErrorsList | UserResponse """ return ( diff --git a/rootly_sdk/api/users/get_current_user.py b/rootly_sdk/api/users/get_current_user.py index 2a264abd..054c8451 100644 --- a/rootly_sdk/api/users/get_current_user.py +++ b/rootly_sdk/api/users/get_current_user.py @@ -11,6 +11,7 @@ def _get_kwargs() -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", "url": "/v1/users/me", @@ -62,7 +63,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserResponse]] + Response[ErrorsList | UserResponse] """ kwargs = _get_kwargs() @@ -87,7 +88,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserResponse] + ErrorsList | UserResponse """ return sync_detailed( @@ -108,7 +109,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserResponse]] + Response[ErrorsList | UserResponse] """ kwargs = _get_kwargs() @@ -131,7 +132,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserResponse] + ErrorsList | UserResponse """ return ( diff --git a/rootly_sdk/api/users/get_user.py b/rootly_sdk/api/users/get_user.py index b07da7fd..7000acf4 100644 --- a/rootly_sdk/api/users/get_user.py +++ b/rootly_sdk/api/users/get_user.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -14,11 +15,12 @@ def _get_kwargs( id: str, *, - include: Unset | GetUserInclude = UNSET, + include: GetUserInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/users/{id}", + "url": "/v1/users/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -69,7 +73,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetUserInclude = UNSET, + include: GetUserInclude | Unset = UNSET, ) -> Response[ErrorsList | UserResponse]: """Retrieves an user @@ -77,14 +81,14 @@ def sync_detailed( Args: id (str): - include (Union[Unset, GetUserInclude]): + include (GetUserInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserResponse]] + Response[ErrorsList | UserResponse] """ kwargs = _get_kwargs( @@ -103,7 +107,7 @@ def sync( id: str, *, client: AuthenticatedClient, - include: Unset | GetUserInclude = UNSET, + include: GetUserInclude | Unset = UNSET, ) -> ErrorsList | UserResponse | None: """Retrieves an user @@ -111,14 +115,14 @@ def sync( Args: id (str): - include (Union[Unset, GetUserInclude]): + include (GetUserInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserResponse] + ErrorsList | UserResponse """ return sync_detailed( @@ -132,7 +136,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - include: Unset | GetUserInclude = UNSET, + include: GetUserInclude | Unset = UNSET, ) -> Response[ErrorsList | UserResponse]: """Retrieves an user @@ -140,14 +144,14 @@ async def asyncio_detailed( Args: id (str): - include (Union[Unset, GetUserInclude]): + include (GetUserInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserResponse]] + Response[ErrorsList | UserResponse] """ kwargs = _get_kwargs( @@ -164,7 +168,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - include: Unset | GetUserInclude = UNSET, + include: GetUserInclude | Unset = UNSET, ) -> ErrorsList | UserResponse | None: """Retrieves an user @@ -172,14 +176,14 @@ async def asyncio( Args: id (str): - include (Union[Unset, GetUserInclude]): + include (GetUserInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserResponse] + ErrorsList | UserResponse """ return ( diff --git a/rootly_sdk/api/users/list_users.py b/rootly_sdk/api/users/list_users.py index 0c8ec7b0..7ef32a0b 100644 --- a/rootly_sdk/api/users/list_users.py +++ b/rootly_sdk/api/users/list_users.py @@ -14,17 +14,18 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -43,13 +44,13 @@ def _get_kwargs( params["filter[created_at][lte]"] = filtercreated_atlte - json_sort: Unset | str = UNSET + json_sort: str | Unset = UNSET if not isinstance(sort, Unset): json_sort = sort params["sort"] = json_sort - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -97,39 +98,39 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[ErrorsList | UserList]: """List users List users Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns 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, UserList]] + Response[ErrorsList | UserList] """ kwargs = _get_kwargs( @@ -155,39 +156,39 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> ErrorsList | UserList | None: """List users List users Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server 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, UserList] + ErrorsList | UserList """ return sync_detailed( @@ -208,39 +209,39 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[ErrorsList | UserList]: """List users List users Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns 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, UserList]] + Response[ErrorsList | UserList] """ kwargs = _get_kwargs( @@ -264,39 +265,39 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> ErrorsList | UserList | None: """List users List users Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server 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, UserList] + ErrorsList | UserList """ return ( diff --git a/rootly_sdk/api/users/update_user.py b/rootly_sdk/api/users/update_user.py index c02f9635..40ac5b44 100644 --- a/rootly_sdk/api/users/update_user.py +++ b/rootly_sdk/api/users/update_user.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -8,22 +9,25 @@ from ...models.errors_list import ErrorsList from ...models.update_user import UpdateUser from ...models.user_response import UserResponse -from ...types import Response +from ...types import UNSET, Response, Unset def _get_kwargs( id: str, *, - body: UpdateUser, + body: UpdateUser | Unset = UNSET, ) -> dict[str, Any]: headers: dict[str, Any] = {} _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/users/{id}", + "url": "/v1/users/{id}".format( + id=quote(str(id), safe=""), + ), } - _kwargs["json"] = body.to_dict() + if not isinstance(body, Unset): + _kwargs["json"] = body.to_dict() headers["Content-Type"] = "application/vnd.api+json" @@ -65,7 +69,7 @@ def sync_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateUser, + body: UpdateUser | Unset = UNSET, ) -> Response[ErrorsList | UserResponse]: """Update a user @@ -73,14 +77,14 @@ def sync_detailed( Args: id (str): - body (UpdateUser): + body (UpdateUser | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserResponse]] + Response[ErrorsList | UserResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( id: str, *, client: AuthenticatedClient, - body: UpdateUser, + body: UpdateUser | Unset = UNSET, ) -> ErrorsList | UserResponse | None: """Update a user @@ -107,14 +111,14 @@ def sync( Args: id (str): - body (UpdateUser): + body (UpdateUser | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserResponse] + ErrorsList | UserResponse """ return sync_detailed( @@ -128,7 +132,7 @@ async def asyncio_detailed( id: str, *, client: AuthenticatedClient, - body: UpdateUser, + body: UpdateUser | Unset = UNSET, ) -> Response[ErrorsList | UserResponse]: """Update a user @@ -136,14 +140,14 @@ async def asyncio_detailed( Args: id (str): - body (UpdateUser): + body (UpdateUser | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, UserResponse]] + Response[ErrorsList | UserResponse] """ kwargs = _get_kwargs( @@ -160,7 +164,7 @@ async def asyncio( id: str, *, client: AuthenticatedClient, - body: UpdateUser, + body: UpdateUser | Unset = UNSET, ) -> ErrorsList | UserResponse | None: """Update a user @@ -168,14 +172,14 @@ async def asyncio( Args: id (str): - body (UpdateUser): + body (UpdateUser | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, UserResponse] + ErrorsList | UserResponse """ return ( 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 index 26993025..4f842617 100644 --- a/rootly_sdk/api/verified_domains/delete_v1_verified_domains_id.py +++ b/rootly_sdk/api/verified_domains/delete_v1_verified_domains_id.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/verified_domains/{id}", + "url": "/v1/verified_domains/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs diff --git a/rootly_sdk/api/verified_domains/get_v1_verified_domains.py b/rootly_sdk/api/verified_domains/get_v1_verified_domains.py index 895c23d9..ae4dd36c 100644 --- a/rootly_sdk/api/verified_domains/get_v1_verified_domains.py +++ b/rootly_sdk/api/verified_domains/get_v1_verified_domains.py @@ -11,9 +11,10 @@ def _get_kwargs( *, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["page[number]"] = pagenumber @@ -55,14 +56,14 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[VerifiedDomainList]: """List verified domains Args: - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -87,14 +88,14 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> VerifiedDomainList | None: """List verified domains Args: - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -114,14 +115,14 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[VerifiedDomainList]: """List verified domains Args: - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -144,14 +145,14 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> VerifiedDomainList | None: """List verified domains Args: - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + pagenumber (int | Unset): + pagesize (int | Unset): 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/verified_domains/get_v1_verified_domains_id.py b/rootly_sdk/api/verified_domains/get_v1_verified_domains_id.py index bfeaf46e..0a268168 100644 --- a/rootly_sdk/api/verified_domains/get_v1_verified_domains_id.py +++ b/rootly_sdk/api/verified_domains/get_v1_verified_domains_id.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/verified_domains/{id}", + "url": "/v1/verified_domains/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs diff --git a/rootly_sdk/api/webhooks_deliveries/deliver_webhooks_delivery.py b/rootly_sdk/api/webhooks_deliveries/deliver_webhooks_delivery.py index 668768b5..4e61f403 100644 --- a/rootly_sdk/api/webhooks_deliveries/deliver_webhooks_delivery.py +++ b/rootly_sdk/api/webhooks_deliveries/deliver_webhooks_delivery.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,9 +13,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/webhooks/deliveries/{id}/deliver", + "url": "/v1/webhooks/deliveries/{id}/deliver".format( + id=quote(str(id), safe=""), + ), } 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 f2dd25c1..6bcff9b9 100644 --- a/rootly_sdk/api/webhooks_deliveries/get_webhooks_delivery.py +++ b/rootly_sdk/api/webhooks_deliveries/get_webhooks_delivery.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/webhooks/deliveries/{id}", + "url": "/v1/webhooks/deliveries/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WebhooksDeliveryResponse]] + Response[ErrorsList | WebhooksDeliveryResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WebhooksDeliveryResponse] + ErrorsList | WebhooksDeliveryResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WebhooksDeliveryResponse]] + Response[ErrorsList | WebhooksDeliveryResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WebhooksDeliveryResponse] + 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 406eb177..59ed47e4 100644 --- a/rootly_sdk/api/webhooks_deliveries/list_webhooks_deliveries.py +++ b/rootly_sdk/api/webhooks_deliveries/list_webhooks_deliveries.py @@ -1,6 +1,7 @@ import datetime from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -14,19 +15,20 @@ def _get_kwargs( endpoint_id: str, *, - 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, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterstatus: str | Unset = UNSET, + filtercreated_atgt: datetime.datetime | Unset = UNSET, + filtercreated_atgte: datetime.datetime | Unset = UNSET, + filtercreated_atlt: datetime.datetime | Unset = UNSET, + filtercreated_atlte: datetime.datetime | Unset = UNSET, + filterdelivered_atgt: datetime.datetime | Unset = UNSET, + filterdelivered_atgte: datetime.datetime | Unset = UNSET, + filterdelivered_atlt: datetime.datetime | Unset = UNSET, + filterdelivered_atlte: datetime.datetime | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -37,42 +39,42 @@ def _get_kwargs( params["filter[status]"] = filterstatus - json_filtercreated_atgt: Unset | str = UNSET + json_filtercreated_atgt: str | Unset = 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 + json_filtercreated_atgte: str | Unset = 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 + json_filtercreated_atlt: str | Unset = 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 + json_filtercreated_atlte: str | Unset = 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 + json_filterdelivered_atgt: str | Unset = 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 + json_filterdelivered_atgte: str | Unset = 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 + json_filterdelivered_atlt: str | Unset = 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 + json_filterdelivered_atlte: str | Unset = UNSET if not isinstance(filterdelivered_atlte, Unset): json_filterdelivered_atlte = filterdelivered_atlte.isoformat() params["filter[delivered_at][lte]"] = json_filterdelivered_atlte @@ -81,7 +83,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/webhooks/endpoints/{endpoint_id}/deliveries", + "url": "/v1/webhooks/endpoints/{endpoint_id}/deliveries".format( + endpoint_id=quote(str(endpoint_id), safe=""), + ), "params": params, } @@ -122,18 +126,18 @@ def sync_detailed( endpoint_id: str, *, client: AuthenticatedClient, - 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, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterstatus: str | Unset = UNSET, + filtercreated_atgt: datetime.datetime | Unset = UNSET, + filtercreated_atgte: datetime.datetime | Unset = UNSET, + filtercreated_atlt: datetime.datetime | Unset = UNSET, + filtercreated_atlte: datetime.datetime | Unset = UNSET, + filterdelivered_atgt: datetime.datetime | Unset = UNSET, + filterdelivered_atgte: datetime.datetime | Unset = UNSET, + filterdelivered_atlt: datetime.datetime | Unset = UNSET, + filterdelivered_atlte: datetime.datetime | Unset = UNSET, ) -> Response[ErrorsList | WebhooksDeliveryList]: """List webhook deliveries @@ -141,25 +145,25 @@ def sync_detailed( Args: endpoint_id (str): - 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]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterstatus (str | Unset): + filtercreated_atgt (datetime.datetime | Unset): + filtercreated_atgte (datetime.datetime | Unset): + filtercreated_atlt (datetime.datetime | Unset): + filtercreated_atlte (datetime.datetime | Unset): + filterdelivered_atgt (datetime.datetime | Unset): + filterdelivered_atgte (datetime.datetime | Unset): + filterdelivered_atlt (datetime.datetime | Unset): + filterdelivered_atlte (datetime.datetime | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WebhooksDeliveryList]] + Response[ErrorsList | WebhooksDeliveryList] """ kwargs = _get_kwargs( @@ -189,18 +193,18 @@ def sync( endpoint_id: str, *, client: AuthenticatedClient, - 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, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterstatus: str | Unset = UNSET, + filtercreated_atgt: datetime.datetime | Unset = UNSET, + filtercreated_atgte: datetime.datetime | Unset = UNSET, + filtercreated_atlt: datetime.datetime | Unset = UNSET, + filtercreated_atlte: datetime.datetime | Unset = UNSET, + filterdelivered_atgt: datetime.datetime | Unset = UNSET, + filterdelivered_atgte: datetime.datetime | Unset = UNSET, + filterdelivered_atlt: datetime.datetime | Unset = UNSET, + filterdelivered_atlte: datetime.datetime | Unset = UNSET, ) -> ErrorsList | WebhooksDeliveryList | None: """List webhook deliveries @@ -208,25 +212,25 @@ def sync( Args: endpoint_id (str): - 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]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterstatus (str | Unset): + filtercreated_atgt (datetime.datetime | Unset): + filtercreated_atgte (datetime.datetime | Unset): + filtercreated_atlt (datetime.datetime | Unset): + filtercreated_atlte (datetime.datetime | Unset): + filterdelivered_atgt (datetime.datetime | Unset): + filterdelivered_atgte (datetime.datetime | Unset): + filterdelivered_atlt (datetime.datetime | Unset): + filterdelivered_atlte (datetime.datetime | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WebhooksDeliveryList] + ErrorsList | WebhooksDeliveryList """ return sync_detailed( @@ -251,18 +255,18 @@ async def asyncio_detailed( endpoint_id: str, *, client: AuthenticatedClient, - 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, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterstatus: str | Unset = UNSET, + filtercreated_atgt: datetime.datetime | Unset = UNSET, + filtercreated_atgte: datetime.datetime | Unset = UNSET, + filtercreated_atlt: datetime.datetime | Unset = UNSET, + filtercreated_atlte: datetime.datetime | Unset = UNSET, + filterdelivered_atgt: datetime.datetime | Unset = UNSET, + filterdelivered_atgte: datetime.datetime | Unset = UNSET, + filterdelivered_atlt: datetime.datetime | Unset = UNSET, + filterdelivered_atlte: datetime.datetime | Unset = UNSET, ) -> Response[ErrorsList | WebhooksDeliveryList]: """List webhook deliveries @@ -270,25 +274,25 @@ async def asyncio_detailed( Args: endpoint_id (str): - 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]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterstatus (str | Unset): + filtercreated_atgt (datetime.datetime | Unset): + filtercreated_atgte (datetime.datetime | Unset): + filtercreated_atlt (datetime.datetime | Unset): + filtercreated_atlte (datetime.datetime | Unset): + filterdelivered_atgt (datetime.datetime | Unset): + filterdelivered_atgte (datetime.datetime | Unset): + filterdelivered_atlt (datetime.datetime | Unset): + filterdelivered_atlte (datetime.datetime | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WebhooksDeliveryList]] + Response[ErrorsList | WebhooksDeliveryList] """ kwargs = _get_kwargs( @@ -316,18 +320,18 @@ async def asyncio( endpoint_id: str, *, client: AuthenticatedClient, - 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, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterstatus: str | Unset = UNSET, + filtercreated_atgt: datetime.datetime | Unset = UNSET, + filtercreated_atgte: datetime.datetime | Unset = UNSET, + filtercreated_atlt: datetime.datetime | Unset = UNSET, + filtercreated_atlte: datetime.datetime | Unset = UNSET, + filterdelivered_atgt: datetime.datetime | Unset = UNSET, + filterdelivered_atgte: datetime.datetime | Unset = UNSET, + filterdelivered_atlt: datetime.datetime | Unset = UNSET, + filterdelivered_atlte: datetime.datetime | Unset = UNSET, ) -> ErrorsList | WebhooksDeliveryList | None: """List webhook deliveries @@ -335,25 +339,25 @@ async def asyncio( Args: endpoint_id (str): - 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]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterstatus (str | Unset): + filtercreated_atgt (datetime.datetime | Unset): + filtercreated_atgte (datetime.datetime | Unset): + filtercreated_atlt (datetime.datetime | Unset): + filtercreated_atlte (datetime.datetime | Unset): + filterdelivered_atgt (datetime.datetime | Unset): + filterdelivered_atgte (datetime.datetime | Unset): + filterdelivered_atlt (datetime.datetime | Unset): + filterdelivered_atlte (datetime.datetime | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WebhooksDeliveryList] + ErrorsList | WebhooksDeliveryList """ return ( diff --git a/rootly_sdk/api/webhooks_endpoints/create_webhooks_endpoint.py b/rootly_sdk/api/webhooks_endpoints/create_webhooks_endpoint.py index a17df666..cbe5aec3 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[Union[ErrorsList, WebhooksEndpointResponse]] + Response[ErrorsList | WebhooksEndpointResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WebhooksEndpointResponse] + 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[Union[ErrorsList, WebhooksEndpointResponse]] + Response[ErrorsList | WebhooksEndpointResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WebhooksEndpointResponse] + 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 05ed1579..080d170b 100644 --- a/rootly_sdk/api/webhooks_endpoints/delete_webhooks_endpoint.py +++ b/rootly_sdk/api/webhooks_endpoints/delete_webhooks_endpoint.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/webhooks/endpoints/{id}", + "url": "/v1/webhooks/endpoints/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WebhooksEndpointResponse]] + Response[ErrorsList | WebhooksEndpointResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WebhooksEndpointResponse] + ErrorsList | WebhooksEndpointResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WebhooksEndpointResponse]] + Response[ErrorsList | WebhooksEndpointResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WebhooksEndpointResponse] + 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 9030cf93..548a6545 100644 --- a/rootly_sdk/api/webhooks_endpoints/get_webhooks_endpoint.py +++ b/rootly_sdk/api/webhooks_endpoints/get_webhooks_endpoint.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/webhooks/endpoints/{id}", + "url": "/v1/webhooks/endpoints/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WebhooksEndpointResponse]] + Response[ErrorsList | WebhooksEndpointResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WebhooksEndpointResponse] + ErrorsList | WebhooksEndpointResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WebhooksEndpointResponse]] + Response[ErrorsList | WebhooksEndpointResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WebhooksEndpointResponse] + 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 b3665ca8..6db925f4 100644 --- a/rootly_sdk/api/webhooks_endpoints/list_webhooks_endpoints.py +++ b/rootly_sdk/api/webhooks_endpoints/list_webhooks_endpoints.py @@ -11,12 +11,13 @@ def _get_kwargs( *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterslug: Unset | str = UNSET, - filtername: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterslug: str | Unset = UNSET, + filtername: str | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -66,22 +67,22 @@ def _build_response( def sync_detailed( *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterslug: Unset | str = UNSET, - filtername: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterslug: str | Unset = UNSET, + filtername: str | Unset = UNSET, ) -> Response[WebhooksEndpointList]: """List webhook endpoints List webhook endpoints Args: - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterslug (Union[Unset, str]): - filtername (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterslug (str | Unset): + filtername (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -109,22 +110,22 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterslug: Unset | str = UNSET, - filtername: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterslug: str | Unset = UNSET, + filtername: str | Unset = UNSET, ) -> WebhooksEndpointList | None: """List webhook endpoints List webhook endpoints Args: - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterslug (Union[Unset, str]): - filtername (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterslug (str | Unset): + filtername (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -147,22 +148,22 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterslug: Unset | str = UNSET, - filtername: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterslug: str | Unset = UNSET, + filtername: str | Unset = UNSET, ) -> Response[WebhooksEndpointList]: """List webhook endpoints List webhook endpoints Args: - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterslug (Union[Unset, str]): - filtername (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterslug (str | Unset): + filtername (str | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -188,22 +189,22 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, - filterslug: Unset | str = UNSET, - filtername: Unset | str = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, + filterslug: str | Unset = UNSET, + filtername: str | Unset = UNSET, ) -> WebhooksEndpointList | None: """List webhook endpoints List webhook endpoints Args: - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): - filterslug (Union[Unset, str]): - filtername (Union[Unset, str]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): + filterslug (str | Unset): + filtername (str | Unset): 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 daeca8b2..e1d1f110 100644 --- a/rootly_sdk/api/webhooks_endpoints/update_webhooks_endpoint.py +++ b/rootly_sdk/api/webhooks_endpoints/update_webhooks_endpoint.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/webhooks/endpoints/{id}", + "url": "/v1/webhooks/endpoints/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WebhooksEndpointResponse]] + Response[ErrorsList | WebhooksEndpointResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WebhooksEndpointResponse] + ErrorsList | WebhooksEndpointResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WebhooksEndpointResponse]] + Response[ErrorsList | WebhooksEndpointResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WebhooksEndpointResponse] + 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 716282fc..6f1732ff 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,5 +1,6 @@ from http import HTTPStatus from typing import Any, cast +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/workflows/{workflow_id}/action_item_form_field_conditions", + "url": "/v1/workflows/{workflow_id}/action_item_form_field_conditions".format( + workflow_id=quote(str(workflow_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -89,7 +92,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse]] + Response[Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse] """ kwargs = _get_kwargs( @@ -123,7 +126,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse] + Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse """ return sync_detailed( @@ -152,7 +155,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse]] + Response[Any | ErrorsList | WorkflowActionItemFormFieldConditionResponse] """ kwargs = _get_kwargs( @@ -184,7 +187,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[Any, ErrorsList, WorkflowActionItemFormFieldConditionResponse] + 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 4e92ec96..fac3f287 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/workflow_action_item_form_field_conditions/{id}", + "url": "/v1/workflow_action_item_form_field_conditions/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]] + Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse] + ErrorsList | WorkflowActionItemFormFieldConditionResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]] + Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse] + 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 c1e9e0cc..b9d2d505 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/workflow_action_item_form_field_conditions/{id}", + "url": "/v1/workflow_action_item_form_field_conditions/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]] + Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse] + ErrorsList | WorkflowActionItemFormFieldConditionResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]] + Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse] + 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 e5cbae29..f1e23abb 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( workflow_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/workflows/{workflow_id}/action_item_form_field_conditions", + "url": "/v1/workflows/{workflow_id}/action_item_form_field_conditions".format( + workflow_id=quote(str(workflow_id), safe=""), + ), "params": params, } @@ -64,9 +68,9 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[WorkflowActionItemFormFieldConditionList]: """List workflow action item form field conditions @@ -74,9 +78,9 @@ def sync_detailed( Args: workflow_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +108,9 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> WorkflowActionItemFormFieldConditionList | None: """List workflow action item form field conditions @@ -114,9 +118,9 @@ def sync( Args: workflow_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +143,9 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[WorkflowActionItemFormFieldConditionList]: """List workflow action item form field conditions @@ -149,9 +153,9 @@ async def asyncio_detailed( Args: workflow_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +181,9 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> WorkflowActionItemFormFieldConditionList | None: """List workflow action item form field conditions @@ -187,9 +191,9 @@ async def asyncio( Args: workflow_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 44851c12..d85c85c9 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/workflow_action_item_form_field_conditions/{id}", + "url": "/v1/workflow_action_item_form_field_conditions/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]] + Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse] + ErrorsList | WorkflowActionItemFormFieldConditionResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse]] + Response[ErrorsList | WorkflowActionItemFormFieldConditionResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowActionItemFormFieldConditionResponse] + 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 6fd39430..1060e8f5 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/workflows/{workflow_id}/form_field_conditions", + "url": "/v1/workflows/{workflow_id}/form_field_conditions".format( + workflow_id=quote(str(workflow_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] + Response[ErrorsList | WorkflowFormFieldConditionResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowFormFieldConditionResponse] + ErrorsList | WorkflowFormFieldConditionResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] + Response[ErrorsList | WorkflowFormFieldConditionResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowFormFieldConditionResponse] + 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 d8a84656..c0bdb34a 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/workflow_form_field_conditions/{id}", + "url": "/v1/workflow_form_field_conditions/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] + Response[ErrorsList | WorkflowFormFieldConditionResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowFormFieldConditionResponse] + ErrorsList | WorkflowFormFieldConditionResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] + Response[ErrorsList | WorkflowFormFieldConditionResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowFormFieldConditionResponse] + 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 a5e5f940..9e3dbac4 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/workflow_form_field_conditions/{id}", + "url": "/v1/workflow_form_field_conditions/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] + Response[ErrorsList | WorkflowFormFieldConditionResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowFormFieldConditionResponse] + ErrorsList | WorkflowFormFieldConditionResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] + Response[ErrorsList | WorkflowFormFieldConditionResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowFormFieldConditionResponse] + 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 9b10918e..2bca4f9a 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,10 +13,11 @@ def _get_kwargs( workflow_id: str, *, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -28,7 +30,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/workflows/{workflow_id}/form_field_conditions", + "url": "/v1/workflows/{workflow_id}/form_field_conditions".format( + workflow_id=quote(str(workflow_id), safe=""), + ), "params": params, } @@ -64,9 +68,9 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[WorkflowFormFieldConditionList]: """List workflow form field conditions @@ -74,9 +78,9 @@ def sync_detailed( Args: workflow_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -104,9 +108,9 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> WorkflowFormFieldConditionList | None: """List workflow form field conditions @@ -114,9 +118,9 @@ def sync( Args: workflow_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -139,9 +143,9 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> Response[WorkflowFormFieldConditionList]: """List workflow form field conditions @@ -149,9 +153,9 @@ async def asyncio_detailed( Args: workflow_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -177,9 +181,9 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - include: Unset | str = UNSET, - pagenumber: Unset | int = UNSET, - pagesize: Unset | int = UNSET, + include: str | Unset = UNSET, + pagenumber: int | Unset = UNSET, + pagesize: int | Unset = UNSET, ) -> WorkflowFormFieldConditionList | None: """List workflow form field conditions @@ -187,9 +191,9 @@ async def asyncio( Args: workflow_id (str): - include (Union[Unset, str]): - pagenumber (Union[Unset, int]): - pagesize (Union[Unset, int]): + include (str | Unset): + pagenumber (int | Unset): + pagesize (int | Unset): 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 5c3f0de6..3badeef1 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,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/workflow_form_field_conditions/{id}", + "url": "/v1/workflow_form_field_conditions/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] + Response[ErrorsList | WorkflowFormFieldConditionResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowFormFieldConditionResponse] + ErrorsList | WorkflowFormFieldConditionResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowFormFieldConditionResponse]] + Response[ErrorsList | WorkflowFormFieldConditionResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowFormFieldConditionResponse] + 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 75cea8c3..33784b56 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[Union[ErrorsList, WorkflowGroupResponse]] + Response[ErrorsList | WorkflowGroupResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowGroupResponse] + 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[Union[ErrorsList, WorkflowGroupResponse]] + Response[ErrorsList | WorkflowGroupResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowGroupResponse] + 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 8537c97c..46a16891 100644 --- a/rootly_sdk/api/workflow_groups/delete_workflow_group.py +++ b/rootly_sdk/api/workflow_groups/delete_workflow_group.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/workflow_groups/{id}", + "url": "/v1/workflow_groups/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowGroupResponse]] + Response[ErrorsList | WorkflowGroupResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowGroupResponse] + ErrorsList | WorkflowGroupResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowGroupResponse]] + Response[ErrorsList | WorkflowGroupResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowGroupResponse] + 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 ef87b467..2484f46b 100644 --- a/rootly_sdk/api/workflow_groups/get_workflow_group.py +++ b/rootly_sdk/api/workflow_groups/get_workflow_group.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/workflow_groups/{id}", + "url": "/v1/workflow_groups/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowGroupResponse]] + Response[ErrorsList | WorkflowGroupResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowGroupResponse] + ErrorsList | WorkflowGroupResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowGroupResponse]] + Response[ErrorsList | WorkflowGroupResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowGroupResponse] + 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 26a08737..4a20aac8 100644 --- a/rootly_sdk/api/workflow_groups/list_workflow_groups.py +++ b/rootly_sdk/api/workflow_groups/list_workflow_groups.py @@ -11,16 +11,17 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -76,30 +77,30 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[WorkflowGroupList]: """List workflow groups List workflow groups Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -131,30 +132,30 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> WorkflowGroupList | None: """List workflow groups List workflow groups Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -181,30 +182,30 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[WorkflowGroupList]: """List workflow groups List workflow groups Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -234,30 +235,30 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> WorkflowGroupList | None: """List workflow groups List workflow groups Args: - 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]): + 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): 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 2338e429..f1922d9a 100644 --- a/rootly_sdk/api/workflow_groups/update_workflow_group.py +++ b/rootly_sdk/api/workflow_groups/update_workflow_group.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/workflow_groups/{id}", + "url": "/v1/workflow_groups/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowGroupResponse]] + Response[ErrorsList | WorkflowGroupResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowGroupResponse] + ErrorsList | WorkflowGroupResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowGroupResponse]] + Response[ErrorsList | WorkflowGroupResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowGroupResponse] + 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 8876080e..70d53a0f 100644 --- a/rootly_sdk/api/workflow_runs/create_workflow_run.py +++ b/rootly_sdk/api/workflow_runs/create_workflow_run.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/workflows/{workflow_id}/workflow_runs", + "url": "/v1/workflows/{workflow_id}/workflow_runs".format( + workflow_id=quote(str(workflow_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -85,7 +88,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowRunResponse]] + Response[ErrorsList | WorkflowRunResponse] """ kwargs = _get_kwargs( @@ -119,7 +122,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowRunResponse] + ErrorsList | WorkflowRunResponse """ return sync_detailed( @@ -148,7 +151,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowRunResponse]] + Response[ErrorsList | WorkflowRunResponse] """ kwargs = _get_kwargs( @@ -180,7 +183,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowRunResponse] + 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 4c1bf17f..236adc68 100644 --- a/rootly_sdk/api/workflow_runs/list_workflow_runs.py +++ b/rootly_sdk/api/workflow_runs/list_workflow_runs.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,17 +14,18 @@ def _get_kwargs( workflow_id: str, *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -45,7 +47,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/workflows/{workflow_id}/workflow_runs", + "url": "/v1/workflows/{workflow_id}/workflow_runs".format( + workflow_id=quote(str(workflow_id), safe=""), + ), "params": params, } @@ -77,13 +81,13 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> Response[WorkflowRunsList]: """List workflow runs @@ -91,13 +95,13 @@ def sync_detailed( Args: workflow_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -129,13 +133,13 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> WorkflowRunsList | None: """List workflow runs @@ -143,13 +147,13 @@ def sync( Args: workflow_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -176,13 +180,13 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> Response[WorkflowRunsList]: """List workflow runs @@ -190,13 +194,13 @@ async def asyncio_detailed( Args: workflow_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -226,13 +230,13 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> WorkflowRunsList | None: """List workflow runs @@ -240,13 +244,13 @@ async def asyncio( Args: workflow_id (str): - 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]): + 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): 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 6a5588e5..cc51608f 100644 --- a/rootly_sdk/api/workflow_tasks/create_workflow_task.py +++ b/rootly_sdk/api/workflow_tasks/create_workflow_task.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "post", - "url": f"/v1/workflows/{workflow_id}/workflow_tasks", + "url": "/v1/workflows/{workflow_id}/workflow_tasks".format( + workflow_id=quote(str(workflow_id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowTaskResponse]] + Response[ErrorsList | WorkflowTaskResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowTaskResponse] + ErrorsList | WorkflowTaskResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowTaskResponse]] + Response[ErrorsList | WorkflowTaskResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowTaskResponse] + 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 b5db52c2..5c119fa1 100644 --- a/rootly_sdk/api/workflow_tasks/delete_workflow_task.py +++ b/rootly_sdk/api/workflow_tasks/delete_workflow_task.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/workflow_tasks/{id}", + "url": "/v1/workflow_tasks/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowTaskResponse]] + Response[ErrorsList | WorkflowTaskResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowTaskResponse] + ErrorsList | WorkflowTaskResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowTaskResponse]] + Response[ErrorsList | WorkflowTaskResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowTaskResponse] + 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 1e2d3735..d2ceba25 100644 --- a/rootly_sdk/api/workflow_tasks/get_workflow_task.py +++ b/rootly_sdk/api/workflow_tasks/get_workflow_task.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -13,9 +14,12 @@ def _get_kwargs( id: str, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/workflow_tasks/{id}", + "url": "/v1/workflow_tasks/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -68,7 +72,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowTaskResponse]] + Response[ErrorsList | WorkflowTaskResponse] """ kwargs = _get_kwargs( @@ -99,7 +103,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowTaskResponse] + ErrorsList | WorkflowTaskResponse """ return sync_detailed( @@ -125,7 +129,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowTaskResponse]] + Response[ErrorsList | WorkflowTaskResponse] """ kwargs = _get_kwargs( @@ -154,7 +158,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowTaskResponse] + 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 dedb18a3..cc404c3a 100644 --- a/rootly_sdk/api/workflow_tasks/list_workflow_tasks.py +++ b/rootly_sdk/api/workflow_tasks/list_workflow_tasks.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -12,21 +13,22 @@ def _get_kwargs( workflow_id: str, *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} params["include"] = include @@ -61,7 +63,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/workflows/{workflow_id}/workflow_tasks", + "url": "/v1/workflows/{workflow_id}/workflow_tasks".format( + workflow_id=quote(str(workflow_id), safe=""), + ), "params": params, } @@ -93,20 +97,20 @@ def sync_detailed( workflow_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> Response[WorkflowTaskList]: """List workflow tasks @@ -114,20 +118,20 @@ def sync_detailed( Args: workflow_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -166,20 +170,20 @@ def sync( workflow_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> WorkflowTaskList | None: """List workflow tasks @@ -187,20 +191,20 @@ def sync( Args: workflow_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -234,20 +238,20 @@ async def asyncio_detailed( workflow_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> Response[WorkflowTaskList]: """List workflow tasks @@ -255,20 +259,20 @@ async def asyncio_detailed( Args: workflow_id (str): - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -305,20 +309,20 @@ async def asyncio( workflow_id: str, *, client: AuthenticatedClient, - 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, + 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, ) -> WorkflowTaskList | None: """List workflow tasks @@ -326,20 +330,20 @@ async def asyncio( Args: workflow_id (str): - 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]): + 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): 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 51e59bd2..3b045b86 100644 --- a/rootly_sdk/api/workflow_tasks/update_workflow_task.py +++ b/rootly_sdk/api/workflow_tasks/update_workflow_task.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote import httpx @@ -20,7 +21,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/workflow_tasks/{id}", + "url": "/v1/workflow_tasks/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -80,7 +83,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowTaskResponse]] + Response[ErrorsList | WorkflowTaskResponse] """ kwargs = _get_kwargs( @@ -114,7 +117,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowTaskResponse] + ErrorsList | WorkflowTaskResponse """ return sync_detailed( @@ -143,7 +146,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowTaskResponse]] + Response[ErrorsList | WorkflowTaskResponse] """ kwargs = _get_kwargs( @@ -175,7 +178,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowTaskResponse] + ErrorsList | WorkflowTaskResponse """ return ( diff --git a/rootly_sdk/api/workflows/create_workflow.py b/rootly_sdk/api/workflows/create_workflow.py index df1267c7..2db8a745 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[Union[ErrorsList, WorkflowResponse]] + Response[ErrorsList | WorkflowResponse] """ kwargs = _get_kwargs( @@ -113,7 +113,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowResponse] + 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[Union[ErrorsList, WorkflowResponse]] + Response[ErrorsList | WorkflowResponse] """ kwargs = _get_kwargs( @@ -168,7 +168,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowResponse] + ErrorsList | WorkflowResponse """ return ( diff --git a/rootly_sdk/api/workflows/delete_workflow.py b/rootly_sdk/api/workflows/delete_workflow.py index 88b7e2a2..c407da66 100644 --- a/rootly_sdk/api/workflows/delete_workflow.py +++ b/rootly_sdk/api/workflows/delete_workflow.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -12,11 +13,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, ) -> dict[str, Any]: + _kwargs: dict[str, Any] = { "method": "delete", - "url": f"/v1/workflows/{id}", + "url": "/v1/workflows/{id}".format( + id=quote(str(id), safe=""), + ), } return _kwargs @@ -53,7 +57,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | WorkflowResponse]: @@ -62,14 +66,14 @@ def sync_detailed( Delete a specific workflow by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, WorkflowResponse]] + Response[ErrorsList | WorkflowResponse] """ kwargs = _get_kwargs( @@ -84,7 +88,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | WorkflowResponse | None: @@ -93,14 +97,14 @@ def sync( Delete a specific workflow by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, WorkflowResponse] + ErrorsList | WorkflowResponse """ return sync_detailed( @@ -110,7 +114,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> Response[ErrorsList | WorkflowResponse]: @@ -119,14 +123,14 @@ async def asyncio_detailed( Delete a specific workflow by id Args: - id (Union[UUID, str]): + id (str | 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[Union[ErrorsList, WorkflowResponse]] + Response[ErrorsList | WorkflowResponse] """ kwargs = _get_kwargs( @@ -139,7 +143,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, ) -> ErrorsList | WorkflowResponse | None: @@ -148,14 +152,14 @@ async def asyncio( Delete a specific workflow by id Args: - id (Union[UUID, str]): + id (str | 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: - Union[ErrorsList, WorkflowResponse] + ErrorsList | WorkflowResponse """ return ( diff --git a/rootly_sdk/api/workflows/get_workflow.py b/rootly_sdk/api/workflows/get_workflow.py index 87dfb81a..905edf81 100644 --- a/rootly_sdk/api/workflows/get_workflow.py +++ b/rootly_sdk/api/workflows/get_workflow.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,13 +14,14 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, - include: Unset | GetWorkflowInclude = UNSET, + include: GetWorkflowInclude | Unset = UNSET, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include @@ -29,7 +31,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "get", - "url": f"/v1/workflows/{id}", + "url": "/v1/workflows/{id}".format( + id=quote(str(id), safe=""), + ), "params": params, } @@ -67,25 +71,25 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetWorkflowInclude = UNSET, + include: GetWorkflowInclude | Unset = UNSET, ) -> Response[ErrorsList | WorkflowResponse]: """Retrieves a workflow Retrieves a specific workflow by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetWorkflowInclude]): + id (str | UUID): + include (GetWorkflowInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowResponse]] + Response[ErrorsList | WorkflowResponse] """ kwargs = _get_kwargs( @@ -101,25 +105,25 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetWorkflowInclude = UNSET, + include: GetWorkflowInclude | Unset = UNSET, ) -> ErrorsList | WorkflowResponse | None: """Retrieves a workflow Retrieves a specific workflow by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetWorkflowInclude]): + id (str | UUID): + include (GetWorkflowInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowResponse] + ErrorsList | WorkflowResponse """ return sync_detailed( @@ -130,25 +134,25 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetWorkflowInclude = UNSET, + include: GetWorkflowInclude | Unset = UNSET, ) -> Response[ErrorsList | WorkflowResponse]: """Retrieves a workflow Retrieves a specific workflow by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetWorkflowInclude]): + id (str | UUID): + include (GetWorkflowInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowResponse]] + Response[ErrorsList | WorkflowResponse] """ kwargs = _get_kwargs( @@ -162,25 +166,25 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, - include: Unset | GetWorkflowInclude = UNSET, + include: GetWorkflowInclude | Unset = UNSET, ) -> ErrorsList | WorkflowResponse | None: """Retrieves a workflow Retrieves a specific workflow by id Args: - id (Union[UUID, str]): - include (Union[Unset, GetWorkflowInclude]): + id (str | UUID): + include (GetWorkflowInclude | Unset): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowResponse] + ErrorsList | WorkflowResponse """ return ( diff --git a/rootly_sdk/api/workflows/list_workflows.py b/rootly_sdk/api/workflows/list_workflows.py index 96900f54..8b9f0bb3 100644 --- a/rootly_sdk/api/workflows/list_workflows.py +++ b/rootly_sdk/api/workflows/list_workflows.py @@ -13,35 +13,36 @@ def _get_kwargs( *, - 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, + 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, ) -> dict[str, Any]: + params: dict[str, Any] = {} - json_include: Unset | str = UNSET + json_include: str | Unset = UNSET if not isinstance(include, Unset): json_include = include params["include"] = json_include - json_sort: Unset | str = UNSET + json_sort: str | Unset = UNSET if not isinstance(sort, Unset): json_sort = sort @@ -116,50 +117,50 @@ def _build_response(*, client: AuthenticatedClient | Client, response: httpx.Res def sync_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[WorkflowList]: """List workflows List workflows Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -201,50 +202,50 @@ def sync_detailed( def sync( *, client: AuthenticatedClient, - 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, + 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, ) -> WorkflowList | None: """List workflows List workflows Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -281,50 +282,50 @@ def sync( async def asyncio_detailed( *, client: AuthenticatedClient, - 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, + 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, ) -> Response[WorkflowList]: """List workflows List workflows Args: - 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]): + 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): Raises: errors.UnexpectedStatus: If the server returns an undocumented status code and Client.raise_on_unexpected_status is True. @@ -364,50 +365,50 @@ async def asyncio_detailed( async def asyncio( *, client: AuthenticatedClient, - 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, + 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, ) -> WorkflowList | None: """List workflows List workflows Args: - 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]): + 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): 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 d2ac8854..aa48bba6 100644 --- a/rootly_sdk/api/workflows/update_workflow.py +++ b/rootly_sdk/api/workflows/update_workflow.py @@ -1,5 +1,6 @@ from http import HTTPStatus from typing import Any +from urllib.parse import quote from uuid import UUID import httpx @@ -13,7 +14,7 @@ def _get_kwargs( - id: UUID | str, + id: str | UUID, *, body: UpdateWorkflow, ) -> dict[str, Any]: @@ -21,7 +22,9 @@ def _get_kwargs( _kwargs: dict[str, Any] = { "method": "put", - "url": f"/v1/workflows/{id}", + "url": "/v1/workflows/{id}".format( + id=quote(str(id), safe=""), + ), } _kwargs["json"] = body.to_dict() @@ -68,7 +71,7 @@ def _build_response( def sync_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateWorkflow, @@ -78,7 +81,7 @@ def sync_detailed( Update a specific workflow by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateWorkflow): Raises: @@ -86,7 +89,7 @@ def sync_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowResponse]] + Response[ErrorsList | WorkflowResponse] """ kwargs = _get_kwargs( @@ -102,7 +105,7 @@ def sync_detailed( def sync( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateWorkflow, @@ -112,7 +115,7 @@ def sync( Update a specific workflow by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateWorkflow): Raises: @@ -120,7 +123,7 @@ def sync( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowResponse] + ErrorsList | WorkflowResponse """ return sync_detailed( @@ -131,7 +134,7 @@ def sync( async def asyncio_detailed( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateWorkflow, @@ -141,7 +144,7 @@ async def asyncio_detailed( Update a specific workflow by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateWorkflow): Raises: @@ -149,7 +152,7 @@ async def asyncio_detailed( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Response[Union[ErrorsList, WorkflowResponse]] + Response[ErrorsList | WorkflowResponse] """ kwargs = _get_kwargs( @@ -163,7 +166,7 @@ async def asyncio_detailed( async def asyncio( - id: UUID | str, + id: str | UUID, *, client: AuthenticatedClient, body: UpdateWorkflow, @@ -173,7 +176,7 @@ async def asyncio( Update a specific workflow by id Args: - id (Union[UUID, str]): + id (str | UUID): body (UpdateWorkflow): Raises: @@ -181,7 +184,7 @@ async def asyncio( httpx.TimeoutException: If the request takes longer than Client.timeout. Returns: - Union[ErrorsList, WorkflowResponse] + ErrorsList | WorkflowResponse """ return ( diff --git a/rootly_sdk/client.py b/rootly_sdk/client.py index 3f312fb1..1b7055ab 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 (in seconds)""" + """Get a new client matching this one with a new timeout configuration""" if self._client is not None: self._client.timeout = timeout if self._async_client is not None: @@ -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 the underlying httpx.AsyncClient + """Manually set the underlying httpx.AsyncClient **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. """ @@ -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 (in seconds)""" + """Get a new client matching this one with a new timeout configuration""" if self._client is not None: self._client.timeout = timeout if self._async_client is not None: @@ -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 the underlying httpx.AsyncClient + """Manually set the underlying httpx.AsyncClient **NOTE**: This will override any other settings on the client, including cookies, headers, and timeout. """ diff --git a/rootly_sdk/models/__init__.py b/rootly_sdk/models/__init__.py index 171285a1..d764e579 100644 --- a/rootly_sdk/models/__init__.py +++ b/rootly_sdk/models/__init__.py @@ -1,5 +1,15 @@ """Contains all the data models used in inputs/outputs""" +from .acknowledge_alert import AcknowledgeAlert +from .acknowledge_alert_data import AcknowledgeAlertData +from .acknowledge_alert_data_attributes import AcknowledgeAlertDataAttributes +from .acknowledge_alert_data_attributes_actor_type_0 import AcknowledgeAlertDataAttributesActorType0 +from .acknowledge_alert_data_attributes_actor_type_1 import AcknowledgeAlertDataAttributesActorType1 +from .acknowledge_alert_data_attributes_actor_type_2_type_0 import AcknowledgeAlertDataAttributesActorType2Type0 +from .acknowledge_alert_data_attributes_actor_type_2_type_1 import AcknowledgeAlertDataAttributesActorType2Type1 +from .acknowledge_alert_data_attributes_actor_type_3_type_0 import AcknowledgeAlertDataAttributesActorType3Type0 +from .acknowledge_alert_data_attributes_actor_type_3_type_1 import AcknowledgeAlertDataAttributesActorType3Type1 +from .acknowledge_alert_data_type import AcknowledgeAlertDataType from .action_item_trigger_params import ActionItemTriggerParams from .action_item_trigger_params_incident_action_item_condition import ( ActionItemTriggerParamsIncidentActionItemCondition, @@ -53,6 +63,12 @@ from .action_item_trigger_params_incident_condition_resolved_at import ( ActionItemTriggerParamsIncidentConditionResolvedAt, ) +from .action_item_trigger_params_incident_condition_scheduled_for import ( + ActionItemTriggerParamsIncidentConditionScheduledFor, +) +from .action_item_trigger_params_incident_condition_scheduled_until import ( + ActionItemTriggerParamsIncidentConditionScheduledUntil, +) from .action_item_trigger_params_incident_condition_service import ActionItemTriggerParamsIncidentConditionService from .action_item_trigger_params_incident_condition_severity import ActionItemTriggerParamsIncidentConditionSeverity from .action_item_trigger_params_incident_condition_started_at import ActionItemTriggerParamsIncidentConditionStartedAt @@ -104,6 +120,22 @@ from .alert import Alert from .alert_alert_field_values_type_0_item import AlertAlertFieldValuesType0Item from .alert_alerting_targets_type_0_item import AlertAlertingTargetsType0Item +from .alert_configuration import AlertConfiguration +from .alert_configuration_alert_acknowledgment import AlertConfigurationAlertAcknowledgment +from .alert_configuration_alert_acknowledgment_timeout_minutes import ( + AlertConfigurationAlertAcknowledgmentTimeoutMinutes, +) +from .alert_configuration_default_user_notification_settings import AlertConfigurationDefaultUserNotificationSettings +from .alert_configuration_default_user_notification_settings_audible_contact_types_item import ( + AlertConfigurationDefaultUserNotificationSettingsAudibleContactTypesItem, +) +from .alert_configuration_default_user_notification_settings_quiet_contact_types_item import ( + AlertConfigurationDefaultUserNotificationSettingsQuietContactTypesItem, +) +from .alert_configuration_manual_paging_form_settings_item import AlertConfigurationManualPagingFormSettingsItem +from .alert_configuration_response import AlertConfigurationResponse +from .alert_configuration_response_data import AlertConfigurationResponseData +from .alert_configuration_response_data_type import AlertConfigurationResponseDataType from .alert_data_type_0 import AlertDataType0 from .alert_event import AlertEvent from .alert_event_action import AlertEventAction @@ -119,6 +151,7 @@ from .alert_event_list import AlertEventList from .alert_event_list_data_item import AlertEventListDataItem from .alert_event_list_data_item_type import AlertEventListDataItemType +from .alert_event_page_reason import AlertEventPageReason from .alert_event_response import AlertEventResponse from .alert_event_response_data import AlertEventResponseData from .alert_event_response_data_type import AlertEventResponseDataType @@ -158,17 +191,6 @@ 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 @@ -223,6 +245,7 @@ from .alert_routing_rule_response_data_type import AlertRoutingRuleResponseDataType from .alert_routing_rule_target_type_0 import AlertRoutingRuleTargetType0 from .alert_routing_rule_target_type_0_target_type import AlertRoutingRuleTargetType0TargetType +from .alert_slack_notifications_type_0_item import AlertSlackNotificationsType0Item from .alert_status import AlertStatus from .alert_trigger_params import AlertTriggerParams from .alert_trigger_params_alert_condition import AlertTriggerParamsAlertCondition @@ -302,6 +325,9 @@ from .alerts_source_sourceable_attributes_type_0_field_mappings_attributes_item_field import ( AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField, ) +from .alerts_source_sourceable_attributes_type_0_notification_target_type import ( + AlertsSourceSourceableAttributesType0NotificationTargetType, +) from .alerts_source_status import AlertsSourceStatus from .api_key import ApiKey from .api_key_kind import ApiKeyKind @@ -450,6 +476,7 @@ from .bulk_upsert_teams import BulkUpsertTeams from .bulk_upsert_teams_entities_item import BulkUpsertTeamsEntitiesItem from .bulk_upsert_teams_entities_item_fields_item import BulkUpsertTeamsEntitiesItemFieldsItem +from .bulk_upsert_teams_entities_item_schedule_override_policy import BulkUpsertTeamsEntitiesItemScheduleOverridePolicy from .bulk_upsert_teams_error import BulkUpsertTeamsError from .bulk_upsert_teams_error_errors_item import BulkUpsertTeamsErrorErrorsItem from .bulk_upsert_teams_response import BulkUpsertTeamsResponse @@ -839,6 +866,9 @@ from .create_shortcut_task_task_params import CreateShortcutTaskTaskParams from .create_shortcut_task_task_params_completion import CreateShortcutTaskTaskParamsCompletion from .create_shortcut_task_task_params_task_type import CreateShortcutTaskTaskParamsTaskType +from .create_slack_canvas_task_params import CreateSlackCanvasTaskParams +from .create_slack_canvas_task_params_channel import CreateSlackCanvasTaskParamsChannel +from .create_slack_canvas_task_params_task_type import CreateSlackCanvasTaskParamsTaskType from .create_slack_channel_task_params import CreateSlackChannelTaskParams from .create_slack_channel_task_params_private import CreateSlackChannelTaskParamsPrivate from .create_slack_channel_task_params_task_type import CreateSlackChannelTaskParamsTaskType @@ -986,7 +1016,31 @@ from .escalate_alert import EscalateAlert from .escalate_alert_data import EscalateAlertData from .escalate_alert_data_attributes import EscalateAlertDataAttributes +from .escalate_alert_data_attributes_actor_type_0 import EscalateAlertDataAttributesActorType0 +from .escalate_alert_data_attributes_actor_type_1 import EscalateAlertDataAttributesActorType1 +from .escalate_alert_data_attributes_actor_type_2_type_0 import EscalateAlertDataAttributesActorType2Type0 +from .escalate_alert_data_attributes_actor_type_2_type_1 import EscalateAlertDataAttributesActorType2Type1 +from .escalate_alert_data_attributes_actor_type_3_type_0 import EscalateAlertDataAttributesActorType3Type0 +from .escalate_alert_data_attributes_actor_type_3_type_1 import EscalateAlertDataAttributesActorType3Type1 from .escalate_alert_data_type import EscalateAlertDataType +from .escalation_path_rule_alert_urgency import EscalationPathRuleAlertUrgency +from .escalation_path_rule_alert_urgency_operator import EscalationPathRuleAlertUrgencyOperator +from .escalation_path_rule_alert_urgency_rule_type import EscalationPathRuleAlertUrgencyRuleType +from .escalation_path_rule_deferral_window import EscalationPathRuleDeferralWindow +from .escalation_path_rule_deferral_window_rule_type import EscalationPathRuleDeferralWindowRuleType +from .escalation_path_rule_deferral_window_time_blocks_item import EscalationPathRuleDeferralWindowTimeBlocksItem +from .escalation_path_rule_deferral_window_time_zone import EscalationPathRuleDeferralWindowTimeZone +from .escalation_path_rule_field import EscalationPathRuleField +from .escalation_path_rule_field_operator import EscalationPathRuleFieldOperator +from .escalation_path_rule_field_rule_type import EscalationPathRuleFieldRuleType +from .escalation_path_rule_json_path import EscalationPathRuleJsonPath +from .escalation_path_rule_json_path_operator import EscalationPathRuleJsonPathOperator +from .escalation_path_rule_json_path_rule_type import EscalationPathRuleJsonPathRuleType +from .escalation_path_rule_service import EscalationPathRuleService +from .escalation_path_rule_service_operator import EscalationPathRuleServiceOperator +from .escalation_path_rule_service_rule_type import EscalationPathRuleServiceRuleType +from .escalation_path_rule_working_hour import EscalationPathRuleWorkingHour +from .escalation_path_rule_working_hour_rule_type import EscalationPathRuleWorkingHourRuleType from .escalation_policy import EscalationPolicy from .escalation_policy_business_hours_type_0 import EscalationPolicyBusinessHoursType0 from .escalation_policy_business_hours_type_0_days_type_0_item import EscalationPolicyBusinessHoursType0DaysType0Item @@ -1026,80 +1080,90 @@ from .escalation_policy_path_list import EscalationPolicyPathList from .escalation_policy_path_list_data_item import EscalationPolicyPathListDataItem from .escalation_policy_path_match_mode import EscalationPolicyPathMatchMode +from .escalation_policy_path_notification_type_fallback import EscalationPolicyPathNotificationTypeFallback +from .escalation_policy_path_notification_type_rules_item import EscalationPolicyPathNotificationTypeRulesItem +from .escalation_policy_path_notification_type_rules_item_alert_field import ( + EscalationPolicyPathNotificationTypeRulesItemAlertField, +) +from .escalation_policy_path_notification_type_rules_item_alert_field_operator import ( + EscalationPolicyPathNotificationTypeRulesItemAlertFieldOperator, +) +from .escalation_policy_path_notification_type_rules_item_alert_field_rule_type import ( + EscalationPolicyPathNotificationTypeRulesItemAlertFieldRuleType, +) +from .escalation_policy_path_notification_type_rules_item_alert_source import ( + EscalationPolicyPathNotificationTypeRulesItemAlertSource, +) +from .escalation_policy_path_notification_type_rules_item_alert_source_operator import ( + EscalationPolicyPathNotificationTypeRulesItemAlertSourceOperator, +) +from .escalation_policy_path_notification_type_rules_item_alert_source_rule_type import ( + EscalationPolicyPathNotificationTypeRulesItemAlertSourceRuleType, +) +from .escalation_policy_path_notification_type_rules_item_alert_urgency import ( + EscalationPolicyPathNotificationTypeRulesItemAlertUrgency, +) +from .escalation_policy_path_notification_type_rules_item_alert_urgency_operator import ( + EscalationPolicyPathNotificationTypeRulesItemAlertUrgencyOperator, +) +from .escalation_policy_path_notification_type_rules_item_alert_urgency_rule_type import ( + EscalationPolicyPathNotificationTypeRulesItemAlertUrgencyRuleType, +) +from .escalation_policy_path_notification_type_rules_item_deferral_window import ( + EscalationPolicyPathNotificationTypeRulesItemDeferralWindow, +) +from .escalation_policy_path_notification_type_rules_item_deferral_window_rule_type import ( + EscalationPolicyPathNotificationTypeRulesItemDeferralWindowRuleType, +) +from .escalation_policy_path_notification_type_rules_item_deferral_window_time_blocks_item import ( + EscalationPolicyPathNotificationTypeRulesItemDeferralWindowTimeBlocksItem, +) +from .escalation_policy_path_notification_type_rules_item_deferral_window_time_zone import ( + EscalationPolicyPathNotificationTypeRulesItemDeferralWindowTimeZone, +) +from .escalation_policy_path_notification_type_rules_item_json_path import ( + EscalationPolicyPathNotificationTypeRulesItemJSONPath, +) +from .escalation_policy_path_notification_type_rules_item_json_path_operator import ( + EscalationPolicyPathNotificationTypeRulesItemJSONPathOperator, +) +from .escalation_policy_path_notification_type_rules_item_json_path_rule_type import ( + EscalationPolicyPathNotificationTypeRulesItemJSONPathRuleType, +) +from .escalation_policy_path_notification_type_rules_item_match_mode import ( + EscalationPolicyPathNotificationTypeRulesItemMatchMode, +) +from .escalation_policy_path_notification_type_rules_item_notification_type import ( + EscalationPolicyPathNotificationTypeRulesItemNotificationType, +) +from .escalation_policy_path_notification_type_rules_item_related_incidents import ( + EscalationPolicyPathNotificationTypeRulesItemRelatedIncidents, +) +from .escalation_policy_path_notification_type_rules_item_related_incidents_operator import ( + EscalationPolicyPathNotificationTypeRulesItemRelatedIncidentsOperator, +) +from .escalation_policy_path_notification_type_rules_item_related_incidents_rule_type import ( + EscalationPolicyPathNotificationTypeRulesItemRelatedIncidentsRuleType, +) +from .escalation_policy_path_notification_type_rules_item_service import ( + EscalationPolicyPathNotificationTypeRulesItemService, +) +from .escalation_policy_path_notification_type_rules_item_service_operator import ( + EscalationPolicyPathNotificationTypeRulesItemServiceOperator, +) +from .escalation_policy_path_notification_type_rules_item_service_rule_type import ( + EscalationPolicyPathNotificationTypeRulesItemServiceRuleType, +) +from .escalation_policy_path_notification_type_rules_item_working_hours import ( + EscalationPolicyPathNotificationTypeRulesItemWorkingHours, +) +from .escalation_policy_path_notification_type_rules_item_working_hours_rule_type import ( + EscalationPolicyPathNotificationTypeRulesItemWorkingHoursRuleType, +) from .escalation_policy_path_path_type import EscalationPolicyPathPathType from .escalation_policy_path_response import EscalationPolicyPathResponse from .escalation_policy_path_response_data import EscalationPolicyPathResponseData from .escalation_policy_path_response_data_type import EscalationPolicyPathResponseDataType -from .escalation_policy_path_rules_item_type_0 import EscalationPolicyPathRulesItemType0 -from .escalation_policy_path_rules_item_type_0_rule_type import EscalationPolicyPathRulesItemType0RuleType -from .escalation_policy_path_rules_item_type_1 import EscalationPolicyPathRulesItemType1 -from .escalation_policy_path_rules_item_type_1_rule_type import EscalationPolicyPathRulesItemType1RuleType -from .escalation_policy_path_rules_item_type_2 import EscalationPolicyPathRulesItemType2 -from .escalation_policy_path_rules_item_type_2_operator import EscalationPolicyPathRulesItemType2Operator -from .escalation_policy_path_rules_item_type_2_rule_type import EscalationPolicyPathRulesItemType2RuleType -from .escalation_policy_path_rules_item_type_3 import EscalationPolicyPathRulesItemType3 -from .escalation_policy_path_rules_item_type_3_operator import EscalationPolicyPathRulesItemType3Operator -from .escalation_policy_path_rules_item_type_3_rule_type import EscalationPolicyPathRulesItemType3RuleType -from .escalation_policy_path_rules_item_type_4 import EscalationPolicyPathRulesItemType4 -from .escalation_policy_path_rules_item_type_4_rule_type import EscalationPolicyPathRulesItemType4RuleType -from .escalation_policy_path_rules_item_type_5 import EscalationPolicyPathRulesItemType5 -from .escalation_policy_path_rules_item_type_5_rule_type import EscalationPolicyPathRulesItemType5RuleType -from .escalation_policy_path_rules_item_type_5_time_blocks_item import EscalationPolicyPathRulesItemType5TimeBlocksItem -from .escalation_policy_path_rules_item_type_5_time_zone import EscalationPolicyPathRulesItemType5TimeZone -from .escalation_policy_path_rules_item_type_6 import EscalationPolicyPathRulesItemType6 -from .escalation_policy_path_rules_item_type_6_operator import EscalationPolicyPathRulesItemType6Operator -from .escalation_policy_path_rules_item_type_6_rule_type import EscalationPolicyPathRulesItemType6RuleType -from .escalation_policy_path_rules_item_type_7 import EscalationPolicyPathRulesItemType7 -from .escalation_policy_path_rules_item_type_7_operator import EscalationPolicyPathRulesItemType7Operator -from .escalation_policy_path_rules_item_type_7_rule_type import EscalationPolicyPathRulesItemType7RuleType -from .escalation_policy_path_rules_item_type_8_type_0 import EscalationPolicyPathRulesItemType8Type0 -from .escalation_policy_path_rules_item_type_8_type_0_rule_type import EscalationPolicyPathRulesItemType8Type0RuleType -from .escalation_policy_path_rules_item_type_8_type_1 import EscalationPolicyPathRulesItemType8Type1 -from .escalation_policy_path_rules_item_type_8_type_1_rule_type import EscalationPolicyPathRulesItemType8Type1RuleType -from .escalation_policy_path_rules_item_type_8_type_2 import EscalationPolicyPathRulesItemType8Type2 -from .escalation_policy_path_rules_item_type_8_type_2_operator import EscalationPolicyPathRulesItemType8Type2Operator -from .escalation_policy_path_rules_item_type_8_type_2_rule_type import EscalationPolicyPathRulesItemType8Type2RuleType -from .escalation_policy_path_rules_item_type_8_type_3 import EscalationPolicyPathRulesItemType8Type3 -from .escalation_policy_path_rules_item_type_8_type_3_operator import EscalationPolicyPathRulesItemType8Type3Operator -from .escalation_policy_path_rules_item_type_8_type_3_rule_type import EscalationPolicyPathRulesItemType8Type3RuleType -from .escalation_policy_path_rules_item_type_8_type_4 import EscalationPolicyPathRulesItemType8Type4 -from .escalation_policy_path_rules_item_type_8_type_4_rule_type import EscalationPolicyPathRulesItemType8Type4RuleType -from .escalation_policy_path_rules_item_type_8_type_5 import EscalationPolicyPathRulesItemType8Type5 -from .escalation_policy_path_rules_item_type_8_type_5_rule_type import EscalationPolicyPathRulesItemType8Type5RuleType -from .escalation_policy_path_rules_item_type_8_type_5_time_blocks_item import ( - EscalationPolicyPathRulesItemType8Type5TimeBlocksItem, -) -from .escalation_policy_path_rules_item_type_8_type_5_time_zone import EscalationPolicyPathRulesItemType8Type5TimeZone -from .escalation_policy_path_rules_item_type_8_type_6 import EscalationPolicyPathRulesItemType8Type6 -from .escalation_policy_path_rules_item_type_8_type_6_operator import EscalationPolicyPathRulesItemType8Type6Operator -from .escalation_policy_path_rules_item_type_8_type_6_rule_type import EscalationPolicyPathRulesItemType8Type6RuleType -from .escalation_policy_path_rules_item_type_8_type_7 import EscalationPolicyPathRulesItemType8Type7 -from .escalation_policy_path_rules_item_type_8_type_7_operator import EscalationPolicyPathRulesItemType8Type7Operator -from .escalation_policy_path_rules_item_type_8_type_7_rule_type import EscalationPolicyPathRulesItemType8Type7RuleType -from .escalation_policy_path_rules_item_type_9_type_0 import EscalationPolicyPathRulesItemType9Type0 -from .escalation_policy_path_rules_item_type_9_type_0_rule_type import EscalationPolicyPathRulesItemType9Type0RuleType -from .escalation_policy_path_rules_item_type_9_type_1 import EscalationPolicyPathRulesItemType9Type1 -from .escalation_policy_path_rules_item_type_9_type_1_rule_type import EscalationPolicyPathRulesItemType9Type1RuleType -from .escalation_policy_path_rules_item_type_9_type_2 import EscalationPolicyPathRulesItemType9Type2 -from .escalation_policy_path_rules_item_type_9_type_2_operator import EscalationPolicyPathRulesItemType9Type2Operator -from .escalation_policy_path_rules_item_type_9_type_2_rule_type import EscalationPolicyPathRulesItemType9Type2RuleType -from .escalation_policy_path_rules_item_type_9_type_3 import EscalationPolicyPathRulesItemType9Type3 -from .escalation_policy_path_rules_item_type_9_type_3_operator import EscalationPolicyPathRulesItemType9Type3Operator -from .escalation_policy_path_rules_item_type_9_type_3_rule_type import EscalationPolicyPathRulesItemType9Type3RuleType -from .escalation_policy_path_rules_item_type_9_type_4 import EscalationPolicyPathRulesItemType9Type4 -from .escalation_policy_path_rules_item_type_9_type_4_rule_type import EscalationPolicyPathRulesItemType9Type4RuleType -from .escalation_policy_path_rules_item_type_9_type_5 import EscalationPolicyPathRulesItemType9Type5 -from .escalation_policy_path_rules_item_type_9_type_5_rule_type import EscalationPolicyPathRulesItemType9Type5RuleType -from .escalation_policy_path_rules_item_type_9_type_5_time_blocks_item import ( - EscalationPolicyPathRulesItemType9Type5TimeBlocksItem, -) -from .escalation_policy_path_rules_item_type_9_type_5_time_zone import EscalationPolicyPathRulesItemType9Type5TimeZone -from .escalation_policy_path_rules_item_type_9_type_6 import EscalationPolicyPathRulesItemType9Type6 -from .escalation_policy_path_rules_item_type_9_type_6_operator import EscalationPolicyPathRulesItemType9Type6Operator -from .escalation_policy_path_rules_item_type_9_type_6_rule_type import EscalationPolicyPathRulesItemType9Type6RuleType -from .escalation_policy_path_rules_item_type_9_type_7 import EscalationPolicyPathRulesItemType9Type7 -from .escalation_policy_path_rules_item_type_9_type_7_operator import EscalationPolicyPathRulesItemType9Type7Operator -from .escalation_policy_path_rules_item_type_9_type_7_rule_type import EscalationPolicyPathRulesItemType9Type7RuleType from .escalation_policy_path_time_restriction_time_zone import EscalationPolicyPathTimeRestrictionTimeZone from .escalation_policy_path_time_restrictions_item import EscalationPolicyPathTimeRestrictionsItem from .escalation_policy_path_time_restrictions_item_end_day import EscalationPolicyPathTimeRestrictionsItemEndDay @@ -1220,6 +1284,7 @@ from .heartbeat_response_data_type import HeartbeatResponseDataType from .heartbeat_status import HeartbeatStatus from .http_client_task_params import HttpClientTaskParams +from .http_client_task_params_expected_response_headers import HttpClientTaskParamsExpectedResponseHeaders from .http_client_task_params_method import HttpClientTaskParamsMethod from .http_client_task_params_post_to_slack_channels_item import HttpClientTaskParamsPostToSlackChannelsItem from .http_client_task_params_task_type import HttpClientTaskParamsTaskType @@ -1395,6 +1460,10 @@ from .incident_trigger_params_incident_condition_label import IncidentTriggerParamsIncidentConditionLabel from .incident_trigger_params_incident_condition_mitigated_at import IncidentTriggerParamsIncidentConditionMitigatedAt from .incident_trigger_params_incident_condition_resolved_at import IncidentTriggerParamsIncidentConditionResolvedAt +from .incident_trigger_params_incident_condition_scheduled_for import IncidentTriggerParamsIncidentConditionScheduledFor +from .incident_trigger_params_incident_condition_scheduled_until import ( + IncidentTriggerParamsIncidentConditionScheduledUntil, +) from .incident_trigger_params_incident_condition_service import IncidentTriggerParamsIncidentConditionService from .incident_trigger_params_incident_condition_severity import IncidentTriggerParamsIncidentConditionSeverity from .incident_trigger_params_incident_condition_started_at import IncidentTriggerParamsIncidentConditionStartedAt @@ -1497,6 +1566,10 @@ from .jsonapi_included_resource import JsonapiIncludedResource from .jsonapi_included_resource_attributes import JsonapiIncludedResourceAttributes from .jsonapi_included_resource_relationships import JsonapiIncludedResourceRelationships +from .link_incidents import LinkIncidents +from .link_incidents_data import LinkIncidentsData +from .link_incidents_data_attributes import LinkIncidentsDataAttributes +from .link_incidents_data_type import LinkIncidentsDataType from .links import Links from .list_alert_events_feed_filteraction import ListAlertEventsFeedFilteraction from .list_alert_events_feed_filterkind import ListAlertEventsFeedFilterkind @@ -1586,6 +1659,12 @@ from .new_alert import NewAlert from .new_alert_data import NewAlertData from .new_alert_data_attributes import NewAlertDataAttributes +from .new_alert_data_attributes_actor_type_0 import NewAlertDataAttributesActorType0 +from .new_alert_data_attributes_actor_type_1 import NewAlertDataAttributesActorType1 +from .new_alert_data_attributes_actor_type_2_type_0 import NewAlertDataAttributesActorType2Type0 +from .new_alert_data_attributes_actor_type_2_type_1 import NewAlertDataAttributesActorType2Type1 +from .new_alert_data_attributes_actor_type_3_type_0 import NewAlertDataAttributesActorType3Type0 +from .new_alert_data_attributes_actor_type_3_type_1 import NewAlertDataAttributesActorType3Type1 from .new_alert_data_attributes_alert_field_values_attributes_item_type_0 import ( NewAlertDataAttributesAlertFieldValuesAttributesItemType0, ) @@ -1630,19 +1709,6 @@ 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 @@ -1688,6 +1754,9 @@ from .new_alert_urgency import NewAlertUrgency from .new_alert_urgency_data import NewAlertUrgencyData from .new_alert_urgency_data_attributes import NewAlertUrgencyDataAttributes +from .new_alert_urgency_data_attributes_retrigger_timeout_minutes import ( + NewAlertUrgencyDataAttributesRetriggerTimeoutMinutes, +) from .new_alert_urgency_data_type import NewAlertUrgencyDataType from .new_alerts_source import NewAlertsSource from .new_alerts_source_data import NewAlertsSourceData @@ -1745,6 +1814,9 @@ from .new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item_field import ( NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField, ) +from .new_alerts_source_data_attributes_sourceable_attributes_type_0_notification_target_type import ( + NewAlertsSourceDataAttributesSourceableAttributesType0NotificationTargetType, +) from .new_alerts_source_data_type import NewAlertsSourceDataType from .new_api_key import NewApiKey from .new_api_key_data import NewApiKeyData @@ -1980,72 +2052,93 @@ from .new_escalation_policy_path_data_attributes_notification_type import ( NewEscalationPolicyPathDataAttributesNotificationType, ) -from .new_escalation_policy_path_data_attributes_path_type import NewEscalationPolicyPathDataAttributesPathType -from .new_escalation_policy_path_data_attributes_rules_item_type_0 import ( - NewEscalationPolicyPathDataAttributesRulesItemType0, +from .new_escalation_policy_path_data_attributes_notification_type_fallback import ( + NewEscalationPolicyPathDataAttributesNotificationTypeFallback, +) +from .new_escalation_policy_path_data_attributes_notification_type_rules_item import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItem, +) +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField, +) +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_operator import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldOperator, +) +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_rule_type import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldRuleType, +) +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource, +) +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_operator import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceOperator, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_0_rule_type import ( - NewEscalationPolicyPathDataAttributesRulesItemType0RuleType, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_rule_type import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceRuleType, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_1 import ( - NewEscalationPolicyPathDataAttributesRulesItemType1, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_1_rule_type import ( - NewEscalationPolicyPathDataAttributesRulesItemType1RuleType, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_operator import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyOperator, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_2 import ( - NewEscalationPolicyPathDataAttributesRulesItemType2, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_rule_type import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyRuleType, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_2_operator import ( - NewEscalationPolicyPathDataAttributesRulesItemType2Operator, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_2_rule_type import ( - NewEscalationPolicyPathDataAttributesRulesItemType2RuleType, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_rule_type import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowRuleType, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_3 import ( - NewEscalationPolicyPathDataAttributesRulesItemType3, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_blocks_item import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeBlocksItem, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_3_operator import ( - NewEscalationPolicyPathDataAttributesRulesItemType3Operator, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_zone import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeZone, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_3_rule_type import ( - NewEscalationPolicyPathDataAttributesRulesItemType3RuleType, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_4 import ( - NewEscalationPolicyPathDataAttributesRulesItemType4, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_operator import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathOperator, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_4_rule_type import ( - NewEscalationPolicyPathDataAttributesRulesItemType4RuleType, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_rule_type import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathRuleType, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_5 import ( - NewEscalationPolicyPathDataAttributesRulesItemType5, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_match_mode import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemMatchMode, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_5_rule_type import ( - NewEscalationPolicyPathDataAttributesRulesItemType5RuleType, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_notification_type import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemNotificationType, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item import ( - NewEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_5_time_zone import ( - NewEscalationPolicyPathDataAttributesRulesItemType5TimeZone, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_operator import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsOperator, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_6 import ( - NewEscalationPolicyPathDataAttributesRulesItemType6, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_rule_type import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsRuleType, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_6_operator import ( - NewEscalationPolicyPathDataAttributesRulesItemType6Operator, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_service import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemService, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_6_rule_type import ( - NewEscalationPolicyPathDataAttributesRulesItemType6RuleType, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_service_operator import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceOperator, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_7 import ( - NewEscalationPolicyPathDataAttributesRulesItemType7, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_service_rule_type import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceRuleType, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_7_operator import ( - NewEscalationPolicyPathDataAttributesRulesItemType7Operator, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours, ) -from .new_escalation_policy_path_data_attributes_rules_item_type_7_rule_type import ( - NewEscalationPolicyPathDataAttributesRulesItemType7RuleType, +from .new_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours_rule_type import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHoursRuleType, +) +from .new_escalation_policy_path_data_attributes_path_type import NewEscalationPolicyPathDataAttributesPathType +from .new_escalation_policy_path_data_attributes_retrigger_timeout_minutes import ( + NewEscalationPolicyPathDataAttributesRetriggerTimeoutMinutes, ) from .new_escalation_policy_path_data_attributes_time_restriction_time_zone import ( NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone, @@ -2301,6 +2394,7 @@ from .new_on_call_role_data_attributes_live_call_routing_permissions_item import ( NewOnCallRoleDataAttributesLiveCallRoutingPermissionsItem, ) +from .new_on_call_role_data_attributes_members_permissions_item import NewOnCallRoleDataAttributesMembersPermissionsItem from .new_on_call_role_data_attributes_on_call_readiness_report_permissions_item import ( NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem, ) @@ -2335,6 +2429,7 @@ from .new_playbook import NewPlaybook from .new_playbook_data import NewPlaybookData from .new_playbook_data_attributes import NewPlaybookDataAttributes +from .new_playbook_data_attributes_kind import NewPlaybookDataAttributesKind from .new_playbook_data_type import NewPlaybookDataType from .new_playbook_task import NewPlaybookTask from .new_playbook_task_data import NewPlaybookTaskData @@ -2345,6 +2440,18 @@ from .new_post_mortem_template_data_attributes import NewPostMortemTemplateDataAttributes from .new_post_mortem_template_data_attributes_format import NewPostMortemTemplateDataAttributesFormat from .new_post_mortem_template_data_type import NewPostMortemTemplateDataType +from .new_problem import NewProblem +from .new_problem_action_item import NewProblemActionItem +from .new_problem_action_item_data import NewProblemActionItemData +from .new_problem_action_item_data_attributes import NewProblemActionItemDataAttributes +from .new_problem_action_item_data_attributes_priority import NewProblemActionItemDataAttributesPriority +from .new_problem_action_item_data_attributes_status import NewProblemActionItemDataAttributesStatus +from .new_problem_action_item_data_type import NewProblemActionItemDataType +from .new_problem_data import NewProblemData +from .new_problem_data_attributes import NewProblemDataAttributes +from .new_problem_data_attributes_form_field_selections_item import NewProblemDataAttributesFormFieldSelectionsItem +from .new_problem_data_attributes_priority import NewProblemDataAttributesPriority +from .new_problem_data_type import NewProblemDataType from .new_pulse import NewPulse from .new_pulse_data import NewPulseData from .new_pulse_data_attributes import NewPulseDataAttributes @@ -2409,6 +2516,7 @@ from .new_role_data_attributes_invitations_permissions_item import NewRoleDataAttributesInvitationsPermissionsItem from .new_role_data_attributes_paging_permissions_item import NewRoleDataAttributesPagingPermissionsItem from .new_role_data_attributes_playbooks_permissions_item import NewRoleDataAttributesPlaybooksPermissionsItem +from .new_role_data_attributes_private_agent_permissions_item import NewRoleDataAttributesPrivateAgentPermissionsItem from .new_role_data_attributes_private_incidents_permissions_item import ( NewRoleDataAttributesPrivateIncidentsPermissionsItem, ) @@ -2419,6 +2527,9 @@ from .new_role_data_attributes_services_permissions_item import NewRoleDataAttributesServicesPermissionsItem from .new_role_data_attributes_severities_permissions_item import NewRoleDataAttributesSeveritiesPermissionsItem from .new_role_data_attributes_slas_permissions_item import NewRoleDataAttributesSlasPermissionsItem +from .new_role_data_attributes_status_page_updates_permissions_type_0_item import ( + NewRoleDataAttributesStatusPageUpdatesPermissionsType0Item, +) from .new_role_data_attributes_status_pages_permissions_item import NewRoleDataAttributesStatusPagesPermissionsItem from .new_role_data_attributes_sub_statuses_permissions_item import NewRoleDataAttributesSubStatusesPermissionsItem from .new_role_data_attributes_webhooks_permissions_item import NewRoleDataAttributesWebhooksPermissionsItem @@ -2427,6 +2538,7 @@ from .new_schedule import NewSchedule from .new_schedule_data import NewScheduleData from .new_schedule_data_attributes import NewScheduleDataAttributes +from .new_schedule_data_attributes_business_hours_type_0 import NewScheduleDataAttributesBusinessHoursType0 from .new_schedule_data_attributes_shift_report_day_of_week import NewScheduleDataAttributesShiftReportDayOfWeek from .new_schedule_data_attributes_slack_channel_type_0 import NewScheduleDataAttributesSlackChannelType0 from .new_schedule_data_attributes_slack_user_group import NewScheduleDataAttributesSlackUserGroup @@ -2556,6 +2668,11 @@ from .new_status_page_data_attributes_section_order_type_0_item import NewStatusPageDataAttributesSectionOrderType0Item from .new_status_page_data_attributes_show_uptime_last_days import NewStatusPageDataAttributesShowUptimeLastDays from .new_status_page_data_type import NewStatusPageDataType +from .new_status_page_team import NewStatusPageTeam +from .new_status_page_team_data import NewStatusPageTeamData +from .new_status_page_team_data_attributes import NewStatusPageTeamDataAttributes +from .new_status_page_team_data_attributes_permission_level import NewStatusPageTeamDataAttributesPermissionLevel +from .new_status_page_team_data_type import NewStatusPageTeamDataType from .new_status_page_template import NewStatusPageTemplate from .new_status_page_template_data import NewStatusPageTemplateData from .new_status_page_template_data_attributes import NewStatusPageTemplateDataAttributes @@ -2576,6 +2693,7 @@ NewTeamDataAttributesIncidentBroadcastChannelType0, ) from .new_team_data_attributes_properties_item import NewTeamDataAttributesPropertiesItem +from .new_team_data_attributes_schedule_override_policy import NewTeamDataAttributesScheduleOverridePolicy from .new_team_data_attributes_slack_aliases_type_0_item import NewTeamDataAttributesSlackAliasesType0Item from .new_team_data_attributes_slack_channels_type_0_item import NewTeamDataAttributesSlackChannelsType0Item from .new_team_data_type import NewTeamDataType @@ -2625,6 +2743,10 @@ from .new_workflow_custom_field_selection_data_type import NewWorkflowCustomFieldSelectionDataType from .new_workflow_data import NewWorkflowData from .new_workflow_data_attributes import NewWorkflowDataAttributes +from .new_workflow_data_attributes_failure_notification_channels_item import ( + NewWorkflowDataAttributesFailureNotificationChannelsItem, +) +from .new_workflow_data_attributes_failure_notification_mode import NewWorkflowDataAttributesFailureNotificationMode from .new_workflow_data_attributes_priority import NewWorkflowDataAttributesPriority from .new_workflow_data_attributes_repeat_on_item import NewWorkflowDataAttributesRepeatOnItem from .new_workflow_data_type import NewWorkflowDataType @@ -2659,6 +2781,9 @@ from .new_workflow_task_data import NewWorkflowTaskData from .new_workflow_task_data_attributes import NewWorkflowTaskDataAttributes from .new_workflow_task_data_type import NewWorkflowTaskDataType +from .nullable_severity_response_data import NullableSeverityResponseData +from .nullable_severity_response_data_type import NullableSeverityResponseDataType +from .nullable_severity_response_type_0 import NullableSeverityResponseType0 from .on_call_pay_report import OnCallPayReport from .on_call_pay_report_list import OnCallPayReportList from .on_call_pay_report_list_data_item import OnCallPayReportListDataItem @@ -2689,6 +2814,7 @@ from .on_call_role_list_data_item import OnCallRoleListDataItem from .on_call_role_list_data_item_type import OnCallRoleListDataItemType from .on_call_role_live_call_routing_permissions_item import OnCallRoleLiveCallRoutingPermissionsItem +from .on_call_role_members_permissions_item import OnCallRoleMembersPermissionsItem from .on_call_role_on_call_readiness_report_permissions_item import OnCallRoleOnCallReadinessReportPermissionsItem from .on_call_role_on_call_roles_permissions_item import OnCallRoleOnCallRolesPermissionsItem from .on_call_role_relationship import OnCallRoleRelationship @@ -2725,6 +2851,7 @@ from .oncall_relationships_user import OncallRelationshipsUser from .oncall_relationships_user_data_type_0 import OncallRelationshipsUserDataType0 from .oncall_relationships_user_data_type_0_type import OncallRelationshipsUserDataType0Type +from .overridden_shift import OverriddenShift from .override_shift import OverrideShift from .override_shift_list import OverrideShiftList from .override_shift_list_data_item import OverrideShiftListDataItem @@ -2795,6 +2922,7 @@ from .patch_alert_route_data_type import PatchAlertRouteDataType from .phone_verification_response import PhoneVerificationResponse from .playbook import Playbook +from .playbook_kind import PlaybookKind from .playbook_list import PlaybookList from .playbook_list_data_item import PlaybookListDataItem from .playbook_list_data_item_type import PlaybookListDataItemType @@ -2847,6 +2975,12 @@ from .post_mortem_trigger_params_incident_condition_resolved_at import ( PostMortemTriggerParamsIncidentConditionResolvedAt, ) +from .post_mortem_trigger_params_incident_condition_scheduled_for import ( + PostMortemTriggerParamsIncidentConditionScheduledFor, +) +from .post_mortem_trigger_params_incident_condition_scheduled_until import ( + PostMortemTriggerParamsIncidentConditionScheduledUntil, +) from .post_mortem_trigger_params_incident_condition_service import PostMortemTriggerParamsIncidentConditionService from .post_mortem_trigger_params_incident_condition_severity import PostMortemTriggerParamsIncidentConditionSeverity from .post_mortem_trigger_params_incident_condition_started_at import PostMortemTriggerParamsIncidentConditionStartedAt @@ -2874,10 +3008,60 @@ from .post_mortem_trigger_params_trigger_type import PostMortemTriggerParamsTriggerType from .print_task_params import PrintTaskParams from .print_task_params_task_type import PrintTaskParamsTaskType +from .private_agent import PrivateAgent +from .private_agent_attributes import PrivateAgentAttributes +from .private_agent_attributes_deployment_mode import PrivateAgentAttributesDeploymentMode +from .private_agent_attributes_providers_item import PrivateAgentAttributesProvidersItem +from .private_agent_attributes_providers_item_capabilities_item import ( + PrivateAgentAttributesProvidersItemCapabilitiesItem, +) +from .private_agent_attributes_providers_item_health_type_0 import PrivateAgentAttributesProvidersItemHealthType0 +from .private_agent_attributes_providers_item_policy_type_0 import PrivateAgentAttributesProvidersItemPolicyType0 +from .private_agent_attributes_status import PrivateAgentAttributesStatus +from .private_agent_enrollment_token_response import PrivateAgentEnrollmentTokenResponse +from .private_agent_enrollment_token_response_data import PrivateAgentEnrollmentTokenResponseData +from .private_agent_enrollment_token_response_data_attributes import PrivateAgentEnrollmentTokenResponseDataAttributes +from .private_agent_enrollment_token_response_data_type import PrivateAgentEnrollmentTokenResponseDataType +from .private_agent_list import PrivateAgentList +from .private_agent_list_meta import PrivateAgentListMeta +from .private_agent_response import PrivateAgentResponse +from .private_agent_summary import PrivateAgentSummary +from .private_agent_summary_attributes import PrivateAgentSummaryAttributes +from .private_agent_summary_attributes_deployment_mode import PrivateAgentSummaryAttributesDeploymentMode +from .private_agent_summary_attributes_status import PrivateAgentSummaryAttributesStatus +from .private_agent_summary_type import PrivateAgentSummaryType +from .private_agent_type import PrivateAgentType +from .private_agent_update import PrivateAgentUpdate +from .private_agent_update_data import PrivateAgentUpdateData +from .private_agent_update_data_attributes import PrivateAgentUpdateDataAttributes +from .private_agent_update_data_type import PrivateAgentUpdateDataType +from .problem import Problem +from .problem_action_item import ProblemActionItem +from .problem_action_item_list import ProblemActionItemList +from .problem_action_item_list_data_item import ProblemActionItemListDataItem +from .problem_action_item_list_data_item_type import ProblemActionItemListDataItemType +from .problem_action_item_priority import ProblemActionItemPriority +from .problem_action_item_response import ProblemActionItemResponse +from .problem_action_item_response_data import ProblemActionItemResponseData +from .problem_action_item_response_data_type import ProblemActionItemResponseDataType +from .problem_action_item_status import ProblemActionItemStatus +from .problem_list import ProblemList +from .problem_list_data_item import ProblemListDataItem +from .problem_list_data_item_type import ProblemListDataItemType +from .problem_priority import ProblemPriority +from .problem_response import ProblemResponse +from .problem_response_data import ProblemResponseData +from .problem_response_data_type import ProblemResponseDataType +from .problem_status import ProblemStatus from .publish_incident_task_params import PublishIncidentTaskParams from .publish_incident_task_params_incident import PublishIncidentTaskParamsIncident +from .publish_incident_task_params_selected_component_statuses import PublishIncidentTaskParamsSelectedComponentStatuses +from .publish_incident_task_params_selected_component_statuses_additional_property import ( + PublishIncidentTaskParamsSelectedComponentStatusesAdditionalProperty, +) from .publish_incident_task_params_status import PublishIncidentTaskParamsStatus from .publish_incident_task_params_status_page_template import PublishIncidentTaskParamsStatusPageTemplate +from .publish_incident_task_params_synced_component_status import PublishIncidentTaskParamsSyncedComponentStatus from .publish_incident_task_params_task_type import PublishIncidentTaskParamsTaskType from .pulse import Pulse from .pulse_data_type_0 import PulseDataType0 @@ -2902,6 +3086,9 @@ from .redis_client_task_params import RedisClientTaskParams from .redis_client_task_params_post_to_slack_channels_item import RedisClientTaskParamsPostToSlackChannelsItem from .redis_client_task_params_task_type import RedisClientTaskParamsTaskType +from .remove_from_slack_channel_task_params import RemoveFromSlackChannelTaskParams +from .remove_from_slack_channel_task_params_target_kind import RemoveFromSlackChannelTaskParamsTargetKind +from .remove_from_slack_channel_task_params_task_type import RemoveFromSlackChannelTaskParamsTaskType from .remove_google_docs_permissions_task_params import RemoveGoogleDocsPermissionsTaskParams from .remove_google_docs_permissions_task_params_attribute_to_query_by import ( RemoveGoogleDocsPermissionsTaskParamsAttributeToQueryBy, @@ -2921,9 +3108,17 @@ from .rename_slack_channel_task_params import RenameSlackChannelTaskParams from .rename_slack_channel_task_params_channel import RenameSlackChannelTaskParamsChannel from .rename_slack_channel_task_params_task_type import RenameSlackChannelTaskParamsTaskType +from .resend_verification_user_phone_number_response_200 import ResendVerificationUserPhoneNumberResponse200 +from .resend_verification_user_phone_number_response_429 import ResendVerificationUserPhoneNumberResponse429 from .resolve_alert import ResolveAlert from .resolve_alert_data import ResolveAlertData from .resolve_alert_data_attributes import ResolveAlertDataAttributes +from .resolve_alert_data_attributes_actor_type_0 import ResolveAlertDataAttributesActorType0 +from .resolve_alert_data_attributes_actor_type_1 import ResolveAlertDataAttributesActorType1 +from .resolve_alert_data_attributes_actor_type_2_type_0 import ResolveAlertDataAttributesActorType2Type0 +from .resolve_alert_data_attributes_actor_type_2_type_1 import ResolveAlertDataAttributesActorType2Type1 +from .resolve_alert_data_attributes_actor_type_3_type_0 import ResolveAlertDataAttributesActorType3Type0 +from .resolve_alert_data_attributes_actor_type_3_type_1 import ResolveAlertDataAttributesActorType3Type1 from .resolve_alert_data_type import ResolveAlertDataType from .resolve_incident import ResolveIncident from .resolve_incident_data import ResolveIncidentData @@ -3003,6 +3198,7 @@ from .role_list_data_item_type import RoleListDataItemType from .role_paging_permissions_item import RolePagingPermissionsItem from .role_playbooks_permissions_item import RolePlaybooksPermissionsItem +from .role_private_agent_permissions_item import RolePrivateAgentPermissionsItem from .role_private_incidents_permissions_item import RolePrivateIncidentsPermissionsItem from .role_pulses_permissions_item import RolePulsesPermissionsItem from .role_relationship import RoleRelationship @@ -3017,6 +3213,7 @@ from .role_services_permissions_item import RoleServicesPermissionsItem from .role_severities_permissions_item import RoleSeveritiesPermissionsItem from .role_slas_permissions_item import RoleSlasPermissionsItem +from .role_status_page_updates_permissions_type_0_item import RoleStatusPageUpdatesPermissionsType0Item from .role_status_pages_permissions_item import RoleStatusPagesPermissionsItem from .role_sub_statuses_permissions_item import RoleSubStatusesPermissionsItem from .role_webhooks_permissions_item import RoleWebhooksPermissionsItem @@ -3032,6 +3229,7 @@ from .run_command_heroku_task_params_size import RunCommandHerokuTaskParamsSize from .run_command_heroku_task_params_task_type import RunCommandHerokuTaskParamsTaskType from .schedule import Schedule +from .schedule_business_hours_type_0 import ScheduleBusinessHoursType0 from .schedule_list import ScheduleList from .schedule_list_data_item import ScheduleListDataItem from .schedule_list_data_item_type import ScheduleListDataItemType @@ -3219,6 +3417,12 @@ from .snooze_alert import SnoozeAlert from .snooze_alert_data import SnoozeAlertData from .snooze_alert_data_attributes import SnoozeAlertDataAttributes +from .snooze_alert_data_attributes_actor_type_0 import SnoozeAlertDataAttributesActorType0 +from .snooze_alert_data_attributes_actor_type_1 import SnoozeAlertDataAttributesActorType1 +from .snooze_alert_data_attributes_actor_type_2_type_0 import SnoozeAlertDataAttributesActorType2Type0 +from .snooze_alert_data_attributes_actor_type_2_type_1 import SnoozeAlertDataAttributesActorType2Type1 +from .snooze_alert_data_attributes_actor_type_3_type_0 import SnoozeAlertDataAttributesActorType3Type0 +from .snooze_alert_data_attributes_actor_type_3_type_1 import SnoozeAlertDataAttributesActorType3Type1 from .snooze_alert_data_type import SnoozeAlertDataType from .start_session_request import StartSessionRequest from .start_session_request_platform import StartSessionRequestPlatform @@ -3262,6 +3466,14 @@ from .status_page_saml_name_identifier_format import StatusPageSamlNameIdentifierFormat from .status_page_section_order_type_0_item import StatusPageSectionOrderType0Item from .status_page_show_uptime_last_days import StatusPageShowUptimeLastDays +from .status_page_team import StatusPageTeam +from .status_page_team_list import StatusPageTeamList +from .status_page_team_list_data_item import StatusPageTeamListDataItem +from .status_page_team_list_data_item_type import StatusPageTeamListDataItemType +from .status_page_team_permission_level import StatusPageTeamPermissionLevel +from .status_page_team_response import StatusPageTeamResponse +from .status_page_team_response_data import StatusPageTeamResponseData +from .status_page_team_response_data_type import StatusPageTeamResponseDataType from .status_page_template import StatusPageTemplate from .status_page_template_kind import StatusPageTemplateKind from .status_page_template_list import StatusPageTemplateList @@ -3293,6 +3505,7 @@ from .team_response import TeamResponse from .team_response_data import TeamResponseData from .team_response_data_type import TeamResponseDataType +from .team_schedule_override_policy import TeamScheduleOverridePolicy from .team_slack_aliases_type_0_item import TeamSlackAliasesType0Item from .team_slack_channels_type_0_item import TeamSlackChannelsType0Item from .tiptap_block_schema import TiptapBlockSchema @@ -3320,8 +3533,36 @@ from .update_airtable_table_record_task_params import UpdateAirtableTableRecordTaskParams from .update_airtable_table_record_task_params_task_type import UpdateAirtableTableRecordTaskParamsTaskType from .update_alert import UpdateAlert +from .update_alert_configuration import UpdateAlertConfiguration +from .update_alert_configuration_data import UpdateAlertConfigurationData +from .update_alert_configuration_data_attributes import UpdateAlertConfigurationDataAttributes +from .update_alert_configuration_data_attributes_alert_acknowledgment import ( + UpdateAlertConfigurationDataAttributesAlertAcknowledgment, +) +from .update_alert_configuration_data_attributes_alert_acknowledgment_timeout_minutes import ( + UpdateAlertConfigurationDataAttributesAlertAcknowledgmentTimeoutMinutes, +) +from .update_alert_configuration_data_attributes_default_user_notification_settings import ( + UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettings, +) +from .update_alert_configuration_data_attributes_default_user_notification_settings_audible_contact_types_item import ( + UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettingsAudibleContactTypesItem, +) +from .update_alert_configuration_data_attributes_default_user_notification_settings_quiet_contact_types_item import ( + UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettingsQuietContactTypesItem, +) +from .update_alert_configuration_data_attributes_manual_paging_form_settings_item import ( + UpdateAlertConfigurationDataAttributesManualPagingFormSettingsItem, +) +from .update_alert_configuration_data_type import UpdateAlertConfigurationDataType from .update_alert_data import UpdateAlertData from .update_alert_data_attributes import UpdateAlertDataAttributes +from .update_alert_data_attributes_actor_type_0 import UpdateAlertDataAttributesActorType0 +from .update_alert_data_attributes_actor_type_1 import UpdateAlertDataAttributesActorType1 +from .update_alert_data_attributes_actor_type_2_type_0 import UpdateAlertDataAttributesActorType2Type0 +from .update_alert_data_attributes_actor_type_2_type_1 import UpdateAlertDataAttributesActorType2Type1 +from .update_alert_data_attributes_actor_type_3_type_0 import UpdateAlertDataAttributesActorType3Type0 +from .update_alert_data_attributes_actor_type_3_type_1 import UpdateAlertDataAttributesActorType3Type1 from .update_alert_data_attributes_alert_field_values_attributes_item_type_0 import ( UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0, ) @@ -3359,23 +3600,6 @@ 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 @@ -3423,6 +3647,9 @@ from .update_alert_urgency import UpdateAlertUrgency from .update_alert_urgency_data import UpdateAlertUrgencyData from .update_alert_urgency_data_attributes import UpdateAlertUrgencyDataAttributes +from .update_alert_urgency_data_attributes_retrigger_timeout_minutes import ( + UpdateAlertUrgencyDataAttributesRetriggerTimeoutMinutes, +) from .update_alert_urgency_data_type import UpdateAlertUrgencyDataType from .update_alerts_source import UpdateAlertsSource from .update_alerts_source_data import UpdateAlertsSourceData @@ -3482,6 +3709,9 @@ from .update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item_field import ( UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField, ) +from .update_alerts_source_data_attributes_sourceable_attributes_type_0_notification_target_type import ( + UpdateAlertsSourceDataAttributesSourceableAttributesType0NotificationTargetType, +) from .update_alerts_source_data_type import UpdateAlertsSourceDataType from .update_api_key import UpdateApiKey from .update_api_key_data import UpdateApiKeyData @@ -3742,204 +3972,93 @@ from .update_escalation_policy_path_data_attributes_notification_type import ( UpdateEscalationPolicyPathDataAttributesNotificationType, ) -from .update_escalation_policy_path_data_attributes_path_type import UpdateEscalationPolicyPathDataAttributesPathType -from .update_escalation_policy_path_data_attributes_rules_item_type_0 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType0, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_0_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType0RuleType, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_1 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType1, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_1_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType1RuleType, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_2 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType2, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_2_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType2Operator, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_2_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType2RuleType, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_3 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType3, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_3_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType3Operator, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_3_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType3RuleType, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_4 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType4, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_4_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType4RuleType, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_5 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType5, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_5_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType5RuleType, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_5_time_zone import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeZone, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_6 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType6, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_6_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType6Operator, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_6_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType6RuleType, +from .update_escalation_policy_path_data_attributes_notification_type_fallback import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeFallback, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_7 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType7, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItem, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_7_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType7Operator, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_7_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType7RuleType, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_operator import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldOperator, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_0 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_rule_type import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldRuleType, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_0_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0RuleType, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_1 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_operator import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceOperator, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_1_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1RuleType, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_rule_type import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceRuleType, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_2 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_2_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2Operator, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_operator import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyOperator, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_2_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2RuleType, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_rule_type import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyRuleType, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_3 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_3_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3Operator, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_rule_type import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowRuleType, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_3_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3RuleType, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_blocks_item import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeBlocksItem, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_4 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_zone import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeZone, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_4_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4RuleType, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_5 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_operator import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathOperator, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5RuleType, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_rule_type import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathRuleType, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_item import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_match_mode import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemMatchMode, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_zone import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeZone, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_notification_type import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemNotificationType, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_6 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_6_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6Operator, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_operator import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsOperator, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_6_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6RuleType, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_rule_type import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsRuleType, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_7 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_service import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemService, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_7_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7Operator, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_service_operator import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceOperator, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_8_type_7_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7RuleType, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_service_rule_type import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceRuleType, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_0 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_0_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0RuleType, +from .update_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours_rule_type import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHoursRuleType, ) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_1 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_1_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1RuleType, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_2 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_2_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2Operator, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_2_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2RuleType, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_3 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_3_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3Operator, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_3_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3RuleType, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_4 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_4_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4RuleType, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_5 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5RuleType, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_item import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_zone import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeZone, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_6 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_6_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6Operator, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_6_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6RuleType, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_7 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_7_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7Operator, -) -from .update_escalation_policy_path_data_attributes_rules_item_type_9_type_7_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7RuleType, +from .update_escalation_policy_path_data_attributes_path_type import UpdateEscalationPolicyPathDataAttributesPathType +from .update_escalation_policy_path_data_attributes_retrigger_timeout_minutes import ( + UpdateEscalationPolicyPathDataAttributesRetriggerTimeoutMinutes, ) from .update_escalation_policy_path_data_attributes_time_restriction_time_zone import ( UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone, @@ -4263,6 +4382,9 @@ from .update_on_call_role_data_attributes_live_call_routing_permissions_item import ( UpdateOnCallRoleDataAttributesLiveCallRoutingPermissionsItem, ) +from .update_on_call_role_data_attributes_members_permissions_item import ( + UpdateOnCallRoleDataAttributesMembersPermissionsItem, +) from .update_on_call_role_data_attributes_on_call_readiness_report_permissions_item import ( UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem, ) @@ -4315,6 +4437,7 @@ from .update_playbook import UpdatePlaybook from .update_playbook_data import UpdatePlaybookData from .update_playbook_data_attributes import UpdatePlaybookDataAttributes +from .update_playbook_data_attributes_kind import UpdatePlaybookDataAttributesKind from .update_playbook_data_type import UpdatePlaybookDataType from .update_playbook_task import UpdatePlaybookTask from .update_playbook_task_data import UpdatePlaybookTaskData @@ -4325,6 +4448,22 @@ from .update_post_mortem_template_data_attributes import UpdatePostMortemTemplateDataAttributes from .update_post_mortem_template_data_attributes_format import UpdatePostMortemTemplateDataAttributesFormat from .update_post_mortem_template_data_type import UpdatePostMortemTemplateDataType +from .update_problem import UpdateProblem +from .update_problem_action_item import UpdateProblemActionItem +from .update_problem_action_item_data import UpdateProblemActionItemData +from .update_problem_action_item_data_attributes import UpdateProblemActionItemDataAttributes +from .update_problem_action_item_data_attributes_priority import UpdateProblemActionItemDataAttributesPriority +from .update_problem_action_item_data_attributes_status import UpdateProblemActionItemDataAttributesStatus +from .update_problem_action_item_data_type import UpdateProblemActionItemDataType +from .update_problem_data import UpdateProblemData +from .update_problem_data_attributes import UpdateProblemDataAttributes +from .update_problem_data_attributes_expected_status import UpdateProblemDataAttributesExpectedStatus +from .update_problem_data_attributes_form_field_selections_item import ( + UpdateProblemDataAttributesFormFieldSelectionsItem, +) +from .update_problem_data_attributes_priority import UpdateProblemDataAttributesPriority +from .update_problem_data_attributes_status import UpdateProblemDataAttributesStatus +from .update_problem_data_type import UpdateProblemDataType from .update_pulse import UpdatePulse from .update_pulse_data import UpdatePulseData from .update_pulse_data_attributes import UpdatePulseDataAttributes @@ -4406,6 +4545,9 @@ from .update_role_data_attributes_invitations_permissions_item import UpdateRoleDataAttributesInvitationsPermissionsItem from .update_role_data_attributes_paging_permissions_item import UpdateRoleDataAttributesPagingPermissionsItem from .update_role_data_attributes_playbooks_permissions_item import UpdateRoleDataAttributesPlaybooksPermissionsItem +from .update_role_data_attributes_private_agent_permissions_item import ( + UpdateRoleDataAttributesPrivateAgentPermissionsItem, +) from .update_role_data_attributes_private_incidents_permissions_item import ( UpdateRoleDataAttributesPrivateIncidentsPermissionsItem, ) @@ -4417,6 +4559,9 @@ from .update_role_data_attributes_services_permissions_item import UpdateRoleDataAttributesServicesPermissionsItem from .update_role_data_attributes_severities_permissions_item import UpdateRoleDataAttributesSeveritiesPermissionsItem from .update_role_data_attributes_slas_permissions_item import UpdateRoleDataAttributesSlasPermissionsItem +from .update_role_data_attributes_status_page_updates_permissions_type_0_item import ( + UpdateRoleDataAttributesStatusPageUpdatesPermissionsType0Item, +) from .update_role_data_attributes_status_pages_permissions_item import ( UpdateRoleDataAttributesStatusPagesPermissionsItem, ) @@ -4429,6 +4574,7 @@ from .update_schedule import UpdateSchedule from .update_schedule_data import UpdateScheduleData from .update_schedule_data_attributes import UpdateScheduleDataAttributes +from .update_schedule_data_attributes_business_hours_type_0 import UpdateScheduleDataAttributesBusinessHoursType0 from .update_schedule_data_attributes_shift_report_day_of_week import UpdateScheduleDataAttributesShiftReportDayOfWeek from .update_schedule_data_attributes_slack_channel_type_0 import UpdateScheduleDataAttributesSlackChannelType0 from .update_schedule_data_attributes_slack_user_group import UpdateScheduleDataAttributesSlackUserGroup @@ -4549,6 +4695,10 @@ UpdateSlaDataAttributesNotificationConfigurationsItemOffsetType, ) from .update_sla_data_type import UpdateSlaDataType +from .update_slack_canvas_task_params import UpdateSlackCanvasTaskParams +from .update_slack_canvas_task_params_channel import UpdateSlackCanvasTaskParamsChannel +from .update_slack_canvas_task_params_operation import UpdateSlackCanvasTaskParamsOperation +from .update_slack_canvas_task_params_task_type import UpdateSlackCanvasTaskParamsTaskType from .update_slack_channel_topic_task_params import UpdateSlackChannelTopicTaskParams from .update_slack_channel_topic_task_params_channel import UpdateSlackChannelTopicTaskParamsChannel from .update_slack_channel_topic_task_params_task_type import UpdateSlackChannelTopicTaskParamsTaskType @@ -4576,6 +4726,11 @@ ) from .update_status_page_data_attributes_show_uptime_last_days import UpdateStatusPageDataAttributesShowUptimeLastDays from .update_status_page_data_type import UpdateStatusPageDataType +from .update_status_page_team import UpdateStatusPageTeam +from .update_status_page_team_data import UpdateStatusPageTeamData +from .update_status_page_team_data_attributes import UpdateStatusPageTeamDataAttributes +from .update_status_page_team_data_attributes_permission_level import UpdateStatusPageTeamDataAttributesPermissionLevel +from .update_status_page_team_data_type import UpdateStatusPageTeamDataType from .update_status_page_template import UpdateStatusPageTemplate from .update_status_page_template_data import UpdateStatusPageTemplateData from .update_status_page_template_data_attributes import UpdateStatusPageTemplateDataAttributes @@ -4602,6 +4757,7 @@ UpdateTeamDataAttributesIncidentBroadcastChannelType0, ) from .update_team_data_attributes_properties_item import UpdateTeamDataAttributesPropertiesItem +from .update_team_data_attributes_schedule_override_policy import UpdateTeamDataAttributesScheduleOverridePolicy from .update_team_data_attributes_slack_aliases_type_0_item import UpdateTeamDataAttributesSlackAliasesType0Item from .update_team_data_attributes_slack_channels_type_0_item import UpdateTeamDataAttributesSlackChannelsType0Item from .update_team_data_type import UpdateTeamDataType @@ -4664,6 +4820,12 @@ from .update_workflow_custom_field_selection_data_type import UpdateWorkflowCustomFieldSelectionDataType from .update_workflow_data import UpdateWorkflowData from .update_workflow_data_attributes import UpdateWorkflowDataAttributes +from .update_workflow_data_attributes_failure_notification_channels_item import ( + UpdateWorkflowDataAttributesFailureNotificationChannelsItem, +) +from .update_workflow_data_attributes_failure_notification_mode import ( + UpdateWorkflowDataAttributesFailureNotificationMode, +) from .update_workflow_data_type import UpdateWorkflowDataType from .update_workflow_form_field_condition import UpdateWorkflowFormFieldCondition from .update_workflow_form_field_condition_data import UpdateWorkflowFormFieldConditionData @@ -4729,6 +4891,9 @@ from .verified_domain_source import VerifiedDomainSource from .verified_domain_verification_status import VerifiedDomainVerificationStatus from .verify_phone_number_request import VerifyPhoneNumberRequest +from .verify_user_phone_number_response_200 import VerifyUserPhoneNumberResponse200 +from .verify_user_phone_number_response_429 import VerifyUserPhoneNumberResponse429 +from .verify_user_phone_number_response_503 import VerifyUserPhoneNumberResponse503 from .webhooks_delivery import WebhooksDelivery from .webhooks_delivery_list import WebhooksDeliveryList from .webhooks_delivery_list_data_item import WebhooksDeliveryListDataItem @@ -4769,6 +4934,8 @@ from .workflow_custom_field_selection_response import WorkflowCustomFieldSelectionResponse from .workflow_custom_field_selection_response_data import WorkflowCustomFieldSelectionResponseData from .workflow_custom_field_selection_response_data_type import WorkflowCustomFieldSelectionResponseDataType +from .workflow_failure_notification_channels_item import WorkflowFailureNotificationChannelsItem +from .workflow_failure_notification_mode import WorkflowFailureNotificationMode from .workflow_form_field_condition import WorkflowFormFieldCondition from .workflow_form_field_condition_incident_condition import WorkflowFormFieldConditionIncidentCondition from .workflow_form_field_condition_list import WorkflowFormFieldConditionList @@ -4811,6 +4978,16 @@ from .workflow_task_response_data_type import WorkflowTaskResponseDataType __all__ = ( + "AcknowledgeAlert", + "AcknowledgeAlertData", + "AcknowledgeAlertDataAttributes", + "AcknowledgeAlertDataAttributesActorType0", + "AcknowledgeAlertDataAttributesActorType1", + "AcknowledgeAlertDataAttributesActorType2Type0", + "AcknowledgeAlertDataAttributesActorType2Type1", + "AcknowledgeAlertDataAttributesActorType3Type0", + "AcknowledgeAlertDataAttributesActorType3Type1", + "AcknowledgeAlertDataType", "ActionItemTriggerParams", "ActionItemTriggerParamsIncidentActionItemCondition", "ActionItemTriggerParamsIncidentActionItemConditionGroup", @@ -4833,6 +5010,8 @@ "ActionItemTriggerParamsIncidentConditionLabel", "ActionItemTriggerParamsIncidentConditionMitigatedAt", "ActionItemTriggerParamsIncidentConditionResolvedAt", + "ActionItemTriggerParamsIncidentConditionScheduledFor", + "ActionItemTriggerParamsIncidentConditionScheduledUntil", "ActionItemTriggerParamsIncidentConditionService", "ActionItemTriggerParamsIncidentConditionSeverity", "ActionItemTriggerParamsIncidentConditionStartedAt", @@ -4881,6 +5060,16 @@ "Alert", "AlertAlertFieldValuesType0Item", "AlertAlertingTargetsType0Item", + "AlertConfiguration", + "AlertConfigurationAlertAcknowledgment", + "AlertConfigurationAlertAcknowledgmentTimeoutMinutes", + "AlertConfigurationDefaultUserNotificationSettings", + "AlertConfigurationDefaultUserNotificationSettingsAudibleContactTypesItem", + "AlertConfigurationDefaultUserNotificationSettingsQuietContactTypesItem", + "AlertConfigurationManualPagingFormSettingsItem", + "AlertConfigurationResponse", + "AlertConfigurationResponseData", + "AlertConfigurationResponseDataType", "AlertDataType0", "AlertEvent", "AlertEventAction", @@ -4896,6 +5085,7 @@ "AlertEventList", "AlertEventListDataItem", "AlertEventListDataItemType", + "AlertEventPageReason", "AlertEventResponse", "AlertEventResponseData", "AlertEventResponseDataType", @@ -4933,17 +5123,6 @@ "AlertResponse", "AlertResponseData", "AlertResponseDataType", - "AlertRetriggerRule", - "AlertRetriggerRuleConditionsItem", - "AlertRetriggerRuleConditionsItemKind", - "AlertRetriggerRuleConditionsItemOperator", - "AlertRetriggerRuleList", - "AlertRetriggerRuleListDataItem", - "AlertRetriggerRuleListDataItemType", - "AlertRetriggerRuleMatchMode", - "AlertRetriggerRuleResponse", - "AlertRetriggerRuleResponseData", - "AlertRetriggerRuleResponseDataType", "AlertRoute", "AlertRouteList", "AlertRouteListDataItem", @@ -4982,6 +5161,7 @@ "AlertRoutingRuleResponseDataType", "AlertRoutingRuleTargetType0", "AlertRoutingRuleTargetType0TargetType", + "AlertSlackNotificationsType0Item", "AlertsSource", "AlertsSourceAlertSourceFieldsAttributesItem", "AlertsSourceAlertSourceUrgencyRulesAttributesItem", @@ -5007,6 +5187,7 @@ "AlertsSourceSourceableAttributesType0", "AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem", "AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField", + "AlertsSourceSourceableAttributesType0NotificationTargetType", "AlertsSourceSourceType", "AlertsSourceStatus", "AlertStatus", @@ -5161,6 +5342,7 @@ "BulkUpsertTeams", "BulkUpsertTeamsEntitiesItem", "BulkUpsertTeamsEntitiesItemFieldsItem", + "BulkUpsertTeamsEntitiesItemScheduleOverridePolicy", "BulkUpsertTeamsError", "BulkUpsertTeamsErrorErrorsItem", "BulkUpsertTeamsResponse", @@ -5490,6 +5672,9 @@ "CreateShortcutTaskTaskParams", "CreateShortcutTaskTaskParamsCompletion", "CreateShortcutTaskTaskParamsTaskType", + "CreateSlackCanvasTaskParams", + "CreateSlackCanvasTaskParamsChannel", + "CreateSlackCanvasTaskParamsTaskType", "CreateSlackChannelTaskParams", "CreateSlackChannelTaskParamsPrivate", "CreateSlackChannelTaskParamsTaskType", @@ -5615,7 +5800,31 @@ "EscalateAlert", "EscalateAlertData", "EscalateAlertDataAttributes", + "EscalateAlertDataAttributesActorType0", + "EscalateAlertDataAttributesActorType1", + "EscalateAlertDataAttributesActorType2Type0", + "EscalateAlertDataAttributesActorType2Type1", + "EscalateAlertDataAttributesActorType3Type0", + "EscalateAlertDataAttributesActorType3Type1", "EscalateAlertDataType", + "EscalationPathRuleAlertUrgency", + "EscalationPathRuleAlertUrgencyOperator", + "EscalationPathRuleAlertUrgencyRuleType", + "EscalationPathRuleDeferralWindow", + "EscalationPathRuleDeferralWindowRuleType", + "EscalationPathRuleDeferralWindowTimeBlocksItem", + "EscalationPathRuleDeferralWindowTimeZone", + "EscalationPathRuleField", + "EscalationPathRuleFieldOperator", + "EscalationPathRuleFieldRuleType", + "EscalationPathRuleJsonPath", + "EscalationPathRuleJsonPathOperator", + "EscalationPathRuleJsonPathRuleType", + "EscalationPathRuleService", + "EscalationPathRuleServiceOperator", + "EscalationPathRuleServiceRuleType", + "EscalationPathRuleWorkingHour", + "EscalationPathRuleWorkingHourRuleType", "EscalationPolicy", "EscalationPolicyBusinessHoursType0", "EscalationPolicyBusinessHoursType0DaysType0Item", @@ -5641,76 +5850,38 @@ "EscalationPolicyPathList", "EscalationPolicyPathListDataItem", "EscalationPolicyPathMatchMode", + "EscalationPolicyPathNotificationTypeFallback", + "EscalationPolicyPathNotificationTypeRulesItem", + "EscalationPolicyPathNotificationTypeRulesItemAlertField", + "EscalationPolicyPathNotificationTypeRulesItemAlertFieldOperator", + "EscalationPolicyPathNotificationTypeRulesItemAlertFieldRuleType", + "EscalationPolicyPathNotificationTypeRulesItemAlertSource", + "EscalationPolicyPathNotificationTypeRulesItemAlertSourceOperator", + "EscalationPolicyPathNotificationTypeRulesItemAlertSourceRuleType", + "EscalationPolicyPathNotificationTypeRulesItemAlertUrgency", + "EscalationPolicyPathNotificationTypeRulesItemAlertUrgencyOperator", + "EscalationPolicyPathNotificationTypeRulesItemAlertUrgencyRuleType", + "EscalationPolicyPathNotificationTypeRulesItemDeferralWindow", + "EscalationPolicyPathNotificationTypeRulesItemDeferralWindowRuleType", + "EscalationPolicyPathNotificationTypeRulesItemDeferralWindowTimeBlocksItem", + "EscalationPolicyPathNotificationTypeRulesItemDeferralWindowTimeZone", + "EscalationPolicyPathNotificationTypeRulesItemJSONPath", + "EscalationPolicyPathNotificationTypeRulesItemJSONPathOperator", + "EscalationPolicyPathNotificationTypeRulesItemJSONPathRuleType", + "EscalationPolicyPathNotificationTypeRulesItemMatchMode", + "EscalationPolicyPathNotificationTypeRulesItemNotificationType", + "EscalationPolicyPathNotificationTypeRulesItemRelatedIncidents", + "EscalationPolicyPathNotificationTypeRulesItemRelatedIncidentsOperator", + "EscalationPolicyPathNotificationTypeRulesItemRelatedIncidentsRuleType", + "EscalationPolicyPathNotificationTypeRulesItemService", + "EscalationPolicyPathNotificationTypeRulesItemServiceOperator", + "EscalationPolicyPathNotificationTypeRulesItemServiceRuleType", + "EscalationPolicyPathNotificationTypeRulesItemWorkingHours", + "EscalationPolicyPathNotificationTypeRulesItemWorkingHoursRuleType", "EscalationPolicyPathPathType", "EscalationPolicyPathResponse", "EscalationPolicyPathResponseData", "EscalationPolicyPathResponseDataType", - "EscalationPolicyPathRulesItemType0", - "EscalationPolicyPathRulesItemType0RuleType", - "EscalationPolicyPathRulesItemType1", - "EscalationPolicyPathRulesItemType1RuleType", - "EscalationPolicyPathRulesItemType2", - "EscalationPolicyPathRulesItemType2Operator", - "EscalationPolicyPathRulesItemType2RuleType", - "EscalationPolicyPathRulesItemType3", - "EscalationPolicyPathRulesItemType3Operator", - "EscalationPolicyPathRulesItemType3RuleType", - "EscalationPolicyPathRulesItemType4", - "EscalationPolicyPathRulesItemType4RuleType", - "EscalationPolicyPathRulesItemType5", - "EscalationPolicyPathRulesItemType5RuleType", - "EscalationPolicyPathRulesItemType5TimeBlocksItem", - "EscalationPolicyPathRulesItemType5TimeZone", - "EscalationPolicyPathRulesItemType6", - "EscalationPolicyPathRulesItemType6Operator", - "EscalationPolicyPathRulesItemType6RuleType", - "EscalationPolicyPathRulesItemType7", - "EscalationPolicyPathRulesItemType7Operator", - "EscalationPolicyPathRulesItemType7RuleType", - "EscalationPolicyPathRulesItemType8Type0", - "EscalationPolicyPathRulesItemType8Type0RuleType", - "EscalationPolicyPathRulesItemType8Type1", - "EscalationPolicyPathRulesItemType8Type1RuleType", - "EscalationPolicyPathRulesItemType8Type2", - "EscalationPolicyPathRulesItemType8Type2Operator", - "EscalationPolicyPathRulesItemType8Type2RuleType", - "EscalationPolicyPathRulesItemType8Type3", - "EscalationPolicyPathRulesItemType8Type3Operator", - "EscalationPolicyPathRulesItemType8Type3RuleType", - "EscalationPolicyPathRulesItemType8Type4", - "EscalationPolicyPathRulesItemType8Type4RuleType", - "EscalationPolicyPathRulesItemType8Type5", - "EscalationPolicyPathRulesItemType8Type5RuleType", - "EscalationPolicyPathRulesItemType8Type5TimeBlocksItem", - "EscalationPolicyPathRulesItemType8Type5TimeZone", - "EscalationPolicyPathRulesItemType8Type6", - "EscalationPolicyPathRulesItemType8Type6Operator", - "EscalationPolicyPathRulesItemType8Type6RuleType", - "EscalationPolicyPathRulesItemType8Type7", - "EscalationPolicyPathRulesItemType8Type7Operator", - "EscalationPolicyPathRulesItemType8Type7RuleType", - "EscalationPolicyPathRulesItemType9Type0", - "EscalationPolicyPathRulesItemType9Type0RuleType", - "EscalationPolicyPathRulesItemType9Type1", - "EscalationPolicyPathRulesItemType9Type1RuleType", - "EscalationPolicyPathRulesItemType9Type2", - "EscalationPolicyPathRulesItemType9Type2Operator", - "EscalationPolicyPathRulesItemType9Type2RuleType", - "EscalationPolicyPathRulesItemType9Type3", - "EscalationPolicyPathRulesItemType9Type3Operator", - "EscalationPolicyPathRulesItemType9Type3RuleType", - "EscalationPolicyPathRulesItemType9Type4", - "EscalationPolicyPathRulesItemType9Type4RuleType", - "EscalationPolicyPathRulesItemType9Type5", - "EscalationPolicyPathRulesItemType9Type5RuleType", - "EscalationPolicyPathRulesItemType9Type5TimeBlocksItem", - "EscalationPolicyPathRulesItemType9Type5TimeZone", - "EscalationPolicyPathRulesItemType9Type6", - "EscalationPolicyPathRulesItemType9Type6Operator", - "EscalationPolicyPathRulesItemType9Type6RuleType", - "EscalationPolicyPathRulesItemType9Type7", - "EscalationPolicyPathRulesItemType9Type7Operator", - "EscalationPolicyPathRulesItemType9Type7RuleType", "EscalationPolicyPathTimeRestrictionsItem", "EscalationPolicyPathTimeRestrictionsItemEndDay", "EscalationPolicyPathTimeRestrictionsItemStartDay", @@ -5831,6 +6002,7 @@ "HeartbeatResponseDataType", "HeartbeatStatus", "HttpClientTaskParams", + "HttpClientTaskParamsExpectedResponseHeaders", "HttpClientTaskParamsMethod", "HttpClientTaskParamsPostToSlackChannelsItem", "HttpClientTaskParamsTaskType", @@ -5996,6 +6168,8 @@ "IncidentTriggerParamsIncidentConditionLabel", "IncidentTriggerParamsIncidentConditionMitigatedAt", "IncidentTriggerParamsIncidentConditionResolvedAt", + "IncidentTriggerParamsIncidentConditionScheduledFor", + "IncidentTriggerParamsIncidentConditionScheduledUntil", "IncidentTriggerParamsIncidentConditionService", "IncidentTriggerParamsIncidentConditionSeverity", "IncidentTriggerParamsIncidentConditionStartedAt", @@ -6066,6 +6240,10 @@ "JsonapiIncludedResource", "JsonapiIncludedResourceAttributes", "JsonapiIncludedResourceRelationships", + "LinkIncidents", + "LinkIncidentsData", + "LinkIncidentsDataAttributes", + "LinkIncidentsDataType", "Links", "ListAlertEventsFeedFilteraction", "ListAlertEventsFeedFilterkind", @@ -6155,6 +6333,12 @@ "NewAlert", "NewAlertData", "NewAlertDataAttributes", + "NewAlertDataAttributesActorType0", + "NewAlertDataAttributesActorType1", + "NewAlertDataAttributesActorType2Type0", + "NewAlertDataAttributesActorType2Type1", + "NewAlertDataAttributesActorType3Type0", + "NewAlertDataAttributesActorType3Type1", "NewAlertDataAttributesAlertFieldValuesAttributesItemType0", "NewAlertDataAttributesDataType0", "NewAlertDataAttributesLabelsItemType0", @@ -6187,15 +6371,6 @@ "NewAlertGroupDataAttributesTargetsItem", "NewAlertGroupDataAttributesTargetsItemTargetType", "NewAlertGroupDataType", - "NewAlertRetriggerRule", - "NewAlertRetriggerRuleData", - "NewAlertRetriggerRuleDataAttributes", - "NewAlertRetriggerRuleDataAttributesConditionsItem", - "NewAlertRetriggerRuleDataAttributesConditionsItemKind", - "NewAlertRetriggerRuleDataAttributesConditionsItemOperator", - "NewAlertRetriggerRuleDataAttributesMatchMode", - "NewAlertRetriggerRuleDataAttributesTimeoutMinutes", - "NewAlertRetriggerRuleDataType", "NewAlertRoute", "NewAlertRouteData", "NewAlertRouteDataAttributes", @@ -6239,11 +6414,13 @@ "NewAlertsSourceDataAttributesSourceableAttributesType0", "NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem", "NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField", + "NewAlertsSourceDataAttributesSourceableAttributesType0NotificationTargetType", "NewAlertsSourceDataAttributesSourceType", "NewAlertsSourceDataType", "NewAlertUrgency", "NewAlertUrgencyData", "NewAlertUrgencyDataAttributes", + "NewAlertUrgencyDataAttributesRetriggerTimeoutMinutes", "NewAlertUrgencyDataType", "NewApiKey", "NewApiKeyData", @@ -6405,29 +6582,36 @@ "NewEscalationPolicyPathDataAttributesAfterDeferralBehavior", "NewEscalationPolicyPathDataAttributesMatchMode", "NewEscalationPolicyPathDataAttributesNotificationType", + "NewEscalationPolicyPathDataAttributesNotificationTypeFallback", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItem", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldOperator", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldRuleType", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceOperator", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceRuleType", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyOperator", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyRuleType", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowRuleType", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeBlocksItem", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeZone", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathOperator", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathRuleType", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemMatchMode", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemNotificationType", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsOperator", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsRuleType", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemService", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceOperator", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceRuleType", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours", + "NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHoursRuleType", "NewEscalationPolicyPathDataAttributesPathType", - "NewEscalationPolicyPathDataAttributesRulesItemType0", - "NewEscalationPolicyPathDataAttributesRulesItemType0RuleType", - "NewEscalationPolicyPathDataAttributesRulesItemType1", - "NewEscalationPolicyPathDataAttributesRulesItemType1RuleType", - "NewEscalationPolicyPathDataAttributesRulesItemType2", - "NewEscalationPolicyPathDataAttributesRulesItemType2Operator", - "NewEscalationPolicyPathDataAttributesRulesItemType2RuleType", - "NewEscalationPolicyPathDataAttributesRulesItemType3", - "NewEscalationPolicyPathDataAttributesRulesItemType3Operator", - "NewEscalationPolicyPathDataAttributesRulesItemType3RuleType", - "NewEscalationPolicyPathDataAttributesRulesItemType4", - "NewEscalationPolicyPathDataAttributesRulesItemType4RuleType", - "NewEscalationPolicyPathDataAttributesRulesItemType5", - "NewEscalationPolicyPathDataAttributesRulesItemType5RuleType", - "NewEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem", - "NewEscalationPolicyPathDataAttributesRulesItemType5TimeZone", - "NewEscalationPolicyPathDataAttributesRulesItemType6", - "NewEscalationPolicyPathDataAttributesRulesItemType6Operator", - "NewEscalationPolicyPathDataAttributesRulesItemType6RuleType", - "NewEscalationPolicyPathDataAttributesRulesItemType7", - "NewEscalationPolicyPathDataAttributesRulesItemType7Operator", - "NewEscalationPolicyPathDataAttributesRulesItemType7RuleType", + "NewEscalationPolicyPathDataAttributesRetriggerTimeoutMinutes", "NewEscalationPolicyPathDataAttributesTimeRestrictionsItem", "NewEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay", "NewEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay", @@ -6608,6 +6792,7 @@ "NewOnCallRoleDataAttributesIntegrationsPermissionsItem", "NewOnCallRoleDataAttributesInvitationsPermissionsItem", "NewOnCallRoleDataAttributesLiveCallRoutingPermissionsItem", + "NewOnCallRoleDataAttributesMembersPermissionsItem", "NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem", "NewOnCallRoleDataAttributesOnCallRolesPermissionsItem", "NewOnCallRoleDataAttributesScheduleOverridePermissionsItem", @@ -6628,6 +6813,7 @@ "NewPlaybook", "NewPlaybookData", "NewPlaybookDataAttributes", + "NewPlaybookDataAttributesKind", "NewPlaybookDataType", "NewPlaybookTask", "NewPlaybookTaskData", @@ -6638,6 +6824,18 @@ "NewPostMortemTemplateDataAttributes", "NewPostMortemTemplateDataAttributesFormat", "NewPostMortemTemplateDataType", + "NewProblem", + "NewProblemActionItem", + "NewProblemActionItemData", + "NewProblemActionItemDataAttributes", + "NewProblemActionItemDataAttributesPriority", + "NewProblemActionItemDataAttributesStatus", + "NewProblemActionItemDataType", + "NewProblemData", + "NewProblemDataAttributes", + "NewProblemDataAttributesFormFieldSelectionsItem", + "NewProblemDataAttributesPriority", + "NewProblemDataType", "NewPulse", "NewPulseData", "NewPulseDataAttributes", @@ -6688,6 +6886,7 @@ "NewRoleDataAttributesInvitationsPermissionsItem", "NewRoleDataAttributesPagingPermissionsItem", "NewRoleDataAttributesPlaybooksPermissionsItem", + "NewRoleDataAttributesPrivateAgentPermissionsItem", "NewRoleDataAttributesPrivateIncidentsPermissionsItem", "NewRoleDataAttributesPulsesPermissionsItem", "NewRoleDataAttributesRetrospectivePermissionsItem", @@ -6697,6 +6896,7 @@ "NewRoleDataAttributesSeveritiesPermissionsItem", "NewRoleDataAttributesSlasPermissionsItem", "NewRoleDataAttributesStatusPagesPermissionsItem", + "NewRoleDataAttributesStatusPageUpdatesPermissionsType0Item", "NewRoleDataAttributesSubStatusesPermissionsItem", "NewRoleDataAttributesWebhooksPermissionsItem", "NewRoleDataAttributesWorkflowsPermissionsItem", @@ -6704,6 +6904,7 @@ "NewSchedule", "NewScheduleData", "NewScheduleDataAttributes", + "NewScheduleDataAttributesBusinessHoursType0", "NewScheduleDataAttributesShiftReportDayOfWeek", "NewScheduleDataAttributesSlackChannelType0", "NewScheduleDataAttributesSlackUserGroup", @@ -6795,6 +6996,11 @@ "NewStatusPageDataAttributesSectionOrderType0Item", "NewStatusPageDataAttributesShowUptimeLastDays", "NewStatusPageDataType", + "NewStatusPageTeam", + "NewStatusPageTeamData", + "NewStatusPageTeamDataAttributes", + "NewStatusPageTeamDataAttributesPermissionLevel", + "NewStatusPageTeamDataType", "NewStatusPageTemplate", "NewStatusPageTemplateData", "NewStatusPageTemplateDataAttributes", @@ -6813,6 +7019,7 @@ "NewTeamDataAttributesAutoAddMembersScope", "NewTeamDataAttributesIncidentBroadcastChannelType0", "NewTeamDataAttributesPropertiesItem", + "NewTeamDataAttributesScheduleOverridePolicy", "NewTeamDataAttributesSlackAliasesType0Item", "NewTeamDataAttributesSlackChannelsType0Item", "NewTeamDataType", @@ -6852,6 +7059,8 @@ "NewWorkflowCustomFieldSelectionDataType", "NewWorkflowData", "NewWorkflowDataAttributes", + "NewWorkflowDataAttributesFailureNotificationChannelsItem", + "NewWorkflowDataAttributesFailureNotificationMode", "NewWorkflowDataAttributesPriority", "NewWorkflowDataAttributesRepeatOnItem", "NewWorkflowDataType", @@ -6884,6 +7093,9 @@ "NewWorkflowTaskData", "NewWorkflowTaskDataAttributes", "NewWorkflowTaskDataType", + "NullableSeverityResponseData", + "NullableSeverityResponseDataType", + "NullableSeverityResponseType0", "Oncall", "OncallList", "OncallListDataItem", @@ -6929,6 +7141,7 @@ "OnCallRoleListDataItem", "OnCallRoleListDataItemType", "OnCallRoleLiveCallRoutingPermissionsItem", + "OnCallRoleMembersPermissionsItem", "OnCallRoleOnCallReadinessReportPermissionsItem", "OnCallRoleOnCallRolesPermissionsItem", "OnCallRoleRelationship", @@ -6950,6 +7163,7 @@ "OnCallShadowsList", "OnCallShadowsListDataItem", "OnCallShadowsListDataItemType", + "OverriddenShift", "OverrideShift", "OverrideShiftList", "OverrideShiftListDataItem", @@ -6996,6 +7210,7 @@ "PatchAlertRouteDataType", "PhoneVerificationResponse", "Playbook", + "PlaybookKind", "PlaybookList", "PlaybookListDataItem", "PlaybookListDataItemType", @@ -7033,6 +7248,8 @@ "PostMortemTriggerParamsIncidentConditionLabel", "PostMortemTriggerParamsIncidentConditionMitigatedAt", "PostMortemTriggerParamsIncidentConditionResolvedAt", + "PostMortemTriggerParamsIncidentConditionScheduledFor", + "PostMortemTriggerParamsIncidentConditionScheduledUntil", "PostMortemTriggerParamsIncidentConditionService", "PostMortemTriggerParamsIncidentConditionSeverity", "PostMortemTriggerParamsIncidentConditionStartedAt", @@ -7049,10 +7266,56 @@ "PostMortemTriggerParamsTriggerType", "PrintTaskParams", "PrintTaskParamsTaskType", + "PrivateAgent", + "PrivateAgentAttributes", + "PrivateAgentAttributesDeploymentMode", + "PrivateAgentAttributesProvidersItem", + "PrivateAgentAttributesProvidersItemCapabilitiesItem", + "PrivateAgentAttributesProvidersItemHealthType0", + "PrivateAgentAttributesProvidersItemPolicyType0", + "PrivateAgentAttributesStatus", + "PrivateAgentEnrollmentTokenResponse", + "PrivateAgentEnrollmentTokenResponseData", + "PrivateAgentEnrollmentTokenResponseDataAttributes", + "PrivateAgentEnrollmentTokenResponseDataType", + "PrivateAgentList", + "PrivateAgentListMeta", + "PrivateAgentResponse", + "PrivateAgentSummary", + "PrivateAgentSummaryAttributes", + "PrivateAgentSummaryAttributesDeploymentMode", + "PrivateAgentSummaryAttributesStatus", + "PrivateAgentSummaryType", + "PrivateAgentType", + "PrivateAgentUpdate", + "PrivateAgentUpdateData", + "PrivateAgentUpdateDataAttributes", + "PrivateAgentUpdateDataType", + "Problem", + "ProblemActionItem", + "ProblemActionItemList", + "ProblemActionItemListDataItem", + "ProblemActionItemListDataItemType", + "ProblemActionItemPriority", + "ProblemActionItemResponse", + "ProblemActionItemResponseData", + "ProblemActionItemResponseDataType", + "ProblemActionItemStatus", + "ProblemList", + "ProblemListDataItem", + "ProblemListDataItemType", + "ProblemPriority", + "ProblemResponse", + "ProblemResponseData", + "ProblemResponseDataType", + "ProblemStatus", "PublishIncidentTaskParams", "PublishIncidentTaskParamsIncident", + "PublishIncidentTaskParamsSelectedComponentStatuses", + "PublishIncidentTaskParamsSelectedComponentStatusesAdditionalProperty", "PublishIncidentTaskParamsStatus", "PublishIncidentTaskParamsStatusPageTemplate", + "PublishIncidentTaskParamsSyncedComponentStatus", "PublishIncidentTaskParamsTaskType", "Pulse", "PulseDataType0", @@ -7077,6 +7340,9 @@ "RedisClientTaskParams", "RedisClientTaskParamsPostToSlackChannelsItem", "RedisClientTaskParamsTaskType", + "RemoveFromSlackChannelTaskParams", + "RemoveFromSlackChannelTaskParamsTargetKind", + "RemoveFromSlackChannelTaskParamsTaskType", "RemoveGoogleDocsPermissionsTaskParams", "RemoveGoogleDocsPermissionsTaskParamsAttributeToQueryBy", "RemoveGoogleDocsPermissionsTaskParamsTaskType", @@ -7094,9 +7360,17 @@ "RenameSlackChannelTaskParams", "RenameSlackChannelTaskParamsChannel", "RenameSlackChannelTaskParamsTaskType", + "ResendVerificationUserPhoneNumberResponse200", + "ResendVerificationUserPhoneNumberResponse429", "ResolveAlert", "ResolveAlertData", "ResolveAlertDataAttributes", + "ResolveAlertDataAttributesActorType0", + "ResolveAlertDataAttributesActorType1", + "ResolveAlertDataAttributesActorType2Type0", + "ResolveAlertDataAttributesActorType2Type1", + "ResolveAlertDataAttributesActorType3Type0", + "ResolveAlertDataAttributesActorType3Type1", "ResolveAlertDataType", "ResolveIncident", "ResolveIncidentData", @@ -7170,6 +7444,7 @@ "RoleListDataItemType", "RolePagingPermissionsItem", "RolePlaybooksPermissionsItem", + "RolePrivateAgentPermissionsItem", "RolePrivateIncidentsPermissionsItem", "RolePulsesPermissionsItem", "RoleRelationship", @@ -7185,6 +7460,7 @@ "RoleSeveritiesPermissionsItem", "RoleSlasPermissionsItem", "RoleStatusPagesPermissionsItem", + "RoleStatusPageUpdatesPermissionsType0Item", "RoleSubStatusesPermissionsItem", "RoleWebhooksPermissionsItem", "RoleWorkflowsPermissionsItem", @@ -7197,6 +7473,7 @@ "RunCommandHerokuTaskParamsSize", "RunCommandHerokuTaskParamsTaskType", "Schedule", + "ScheduleBusinessHoursType0", "ScheduleList", "ScheduleListDataItem", "ScheduleListDataItemType", @@ -7354,6 +7631,12 @@ "SnoozeAlert", "SnoozeAlertData", "SnoozeAlertDataAttributes", + "SnoozeAlertDataAttributesActorType0", + "SnoozeAlertDataAttributesActorType1", + "SnoozeAlertDataAttributesActorType2Type0", + "SnoozeAlertDataAttributesActorType2Type1", + "SnoozeAlertDataAttributesActorType3Type0", + "SnoozeAlertDataAttributesActorType3Type1", "SnoozeAlertDataType", "StartSessionRequest", "StartSessionRequestPlatform", @@ -7397,6 +7680,14 @@ "StatusPageSamlNameIdentifierFormat", "StatusPageSectionOrderType0Item", "StatusPageShowUptimeLastDays", + "StatusPageTeam", + "StatusPageTeamList", + "StatusPageTeamListDataItem", + "StatusPageTeamListDataItemType", + "StatusPageTeamPermissionLevel", + "StatusPageTeamResponse", + "StatusPageTeamResponseData", + "StatusPageTeamResponseDataType", "StatusPageTemplate", "StatusPageTemplateKind", "StatusPageTemplateList", @@ -7428,6 +7719,7 @@ "TeamResponse", "TeamResponseData", "TeamResponseDataType", + "TeamScheduleOverridePolicy", "TeamSlackAliasesType0Item", "TeamSlackChannelsType0Item", "TiptapBlockSchema", @@ -7455,8 +7747,24 @@ "UpdateAirtableTableRecordTaskParams", "UpdateAirtableTableRecordTaskParamsTaskType", "UpdateAlert", + "UpdateAlertConfiguration", + "UpdateAlertConfigurationData", + "UpdateAlertConfigurationDataAttributes", + "UpdateAlertConfigurationDataAttributesAlertAcknowledgment", + "UpdateAlertConfigurationDataAttributesAlertAcknowledgmentTimeoutMinutes", + "UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettings", + "UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettingsAudibleContactTypesItem", + "UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettingsQuietContactTypesItem", + "UpdateAlertConfigurationDataAttributesManualPagingFormSettingsItem", + "UpdateAlertConfigurationDataType", "UpdateAlertData", "UpdateAlertDataAttributes", + "UpdateAlertDataAttributesActorType0", + "UpdateAlertDataAttributesActorType1", + "UpdateAlertDataAttributesActorType2Type0", + "UpdateAlertDataAttributesActorType2Type1", + "UpdateAlertDataAttributesActorType3Type0", + "UpdateAlertDataAttributesActorType3Type1", "UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0", "UpdateAlertDataAttributesDataType0", "UpdateAlertDataAttributesLabelsItemType0", @@ -7484,15 +7792,6 @@ "UpdateAlertGroupDataAttributesTargetsItem", "UpdateAlertGroupDataAttributesTargetsItemTargetType", "UpdateAlertGroupDataType", - "UpdateAlertRetriggerRule", - "UpdateAlertRetriggerRuleData", - "UpdateAlertRetriggerRuleDataAttributes", - "UpdateAlertRetriggerRuleDataAttributesConditionsItem", - "UpdateAlertRetriggerRuleDataAttributesConditionsItemKind", - "UpdateAlertRetriggerRuleDataAttributesConditionsItemOperator", - "UpdateAlertRetriggerRuleDataAttributesMatchMode", - "UpdateAlertRetriggerRuleDataAttributesTimeoutMinutes", - "UpdateAlertRetriggerRuleDataType", "UpdateAlertRoute", "UpdateAlertRouteData", "UpdateAlertRouteDataAttributes", @@ -7536,11 +7835,13 @@ "UpdateAlertsSourceDataAttributesSourceableAttributesType0", "UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem", "UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField", + "UpdateAlertsSourceDataAttributesSourceableAttributesType0NotificationTargetType", "UpdateAlertsSourceDataAttributesSourceType", "UpdateAlertsSourceDataType", "UpdateAlertUrgency", "UpdateAlertUrgencyData", "UpdateAlertUrgencyDataAttributes", + "UpdateAlertUrgencyDataAttributesRetriggerTimeoutMinutes", "UpdateAlertUrgencyDataType", "UpdateApiKey", "UpdateApiKeyData", @@ -7727,73 +8028,36 @@ "UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior", "UpdateEscalationPolicyPathDataAttributesMatchMode", "UpdateEscalationPolicyPathDataAttributesNotificationType", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeFallback", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItem", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldOperator", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldRuleType", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceOperator", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceRuleType", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyOperator", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyRuleType", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowRuleType", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeBlocksItem", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeZone", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathOperator", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathRuleType", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemMatchMode", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemNotificationType", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsOperator", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsRuleType", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemService", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceOperator", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceRuleType", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours", + "UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHoursRuleType", "UpdateEscalationPolicyPathDataAttributesPathType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType0", - "UpdateEscalationPolicyPathDataAttributesRulesItemType0RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType1", - "UpdateEscalationPolicyPathDataAttributesRulesItemType1RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType2", - "UpdateEscalationPolicyPathDataAttributesRulesItemType2Operator", - "UpdateEscalationPolicyPathDataAttributesRulesItemType2RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType3", - "UpdateEscalationPolicyPathDataAttributesRulesItemType3Operator", - "UpdateEscalationPolicyPathDataAttributesRulesItemType3RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType4", - "UpdateEscalationPolicyPathDataAttributesRulesItemType4RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType5", - "UpdateEscalationPolicyPathDataAttributesRulesItemType5RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem", - "UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeZone", - "UpdateEscalationPolicyPathDataAttributesRulesItemType6", - "UpdateEscalationPolicyPathDataAttributesRulesItemType6Operator", - "UpdateEscalationPolicyPathDataAttributesRulesItemType6RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType7", - "UpdateEscalationPolicyPathDataAttributesRulesItemType7Operator", - "UpdateEscalationPolicyPathDataAttributesRulesItemType7RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2Operator", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3Operator", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeZone", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6Operator", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7Operator", - "UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2Operator", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3Operator", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeZone", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6Operator", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6RuleType", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7Operator", - "UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7RuleType", + "UpdateEscalationPolicyPathDataAttributesRetriggerTimeoutMinutes", "UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem", "UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay", "UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay", @@ -8024,6 +8288,7 @@ "UpdateOnCallRoleDataAttributesIntegrationsPermissionsItem", "UpdateOnCallRoleDataAttributesInvitationsPermissionsItem", "UpdateOnCallRoleDataAttributesLiveCallRoutingPermissionsItem", + "UpdateOnCallRoleDataAttributesMembersPermissionsItem", "UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem", "UpdateOnCallRoleDataAttributesOnCallRolesPermissionsItem", "UpdateOnCallRoleDataAttributesScheduleOverridePermissionsItem", @@ -8062,6 +8327,7 @@ "UpdatePlaybook", "UpdatePlaybookData", "UpdatePlaybookDataAttributes", + "UpdatePlaybookDataAttributesKind", "UpdatePlaybookDataType", "UpdatePlaybookTask", "UpdatePlaybookTaskData", @@ -8072,6 +8338,20 @@ "UpdatePostMortemTemplateDataAttributes", "UpdatePostMortemTemplateDataAttributesFormat", "UpdatePostMortemTemplateDataType", + "UpdateProblem", + "UpdateProblemActionItem", + "UpdateProblemActionItemData", + "UpdateProblemActionItemDataAttributes", + "UpdateProblemActionItemDataAttributesPriority", + "UpdateProblemActionItemDataAttributesStatus", + "UpdateProblemActionItemDataType", + "UpdateProblemData", + "UpdateProblemDataAttributes", + "UpdateProblemDataAttributesExpectedStatus", + "UpdateProblemDataAttributesFormFieldSelectionsItem", + "UpdateProblemDataAttributesPriority", + "UpdateProblemDataAttributesStatus", + "UpdateProblemDataType", "UpdatePulse", "UpdatePulseData", "UpdatePulseDataAttributes", @@ -8127,6 +8407,7 @@ "UpdateRoleDataAttributesInvitationsPermissionsItem", "UpdateRoleDataAttributesPagingPermissionsItem", "UpdateRoleDataAttributesPlaybooksPermissionsItem", + "UpdateRoleDataAttributesPrivateAgentPermissionsItem", "UpdateRoleDataAttributesPrivateIncidentsPermissionsItem", "UpdateRoleDataAttributesRetrospectivePermissionsItem", "UpdateRoleDataAttributesRolesPermissionsItem", @@ -8135,6 +8416,7 @@ "UpdateRoleDataAttributesSeveritiesPermissionsItem", "UpdateRoleDataAttributesSlasPermissionsItem", "UpdateRoleDataAttributesStatusPagesPermissionsItem", + "UpdateRoleDataAttributesStatusPageUpdatesPermissionsType0Item", "UpdateRoleDataAttributesSubStatusesPermissionsItem", "UpdateRoleDataAttributesWebhooksPermissionsItem", "UpdateRoleDataAttributesWorkflowsPermissionsItem", @@ -8142,6 +8424,7 @@ "UpdateSchedule", "UpdateScheduleData", "UpdateScheduleDataAttributes", + "UpdateScheduleDataAttributesBusinessHoursType0", "UpdateScheduleDataAttributesShiftReportDayOfWeek", "UpdateScheduleDataAttributesSlackChannelType0", "UpdateScheduleDataAttributesSlackUserGroup", @@ -8205,6 +8488,10 @@ "UpdateShortcutTaskTaskParamsCompletion", "UpdateShortcutTaskTaskParamsTaskType", "UpdateSla", + "UpdateSlackCanvasTaskParams", + "UpdateSlackCanvasTaskParamsChannel", + "UpdateSlackCanvasTaskParamsOperation", + "UpdateSlackCanvasTaskParamsTaskType", "UpdateSlackChannelTopicTaskParams", "UpdateSlackChannelTopicTaskParamsChannel", "UpdateSlackChannelTopicTaskParamsTaskType", @@ -8241,6 +8528,11 @@ "UpdateStatusPageDataAttributesSectionOrderType0Item", "UpdateStatusPageDataAttributesShowUptimeLastDays", "UpdateStatusPageDataType", + "UpdateStatusPageTeam", + "UpdateStatusPageTeamData", + "UpdateStatusPageTeamDataAttributes", + "UpdateStatusPageTeamDataAttributesPermissionLevel", + "UpdateStatusPageTeamDataType", "UpdateStatusPageTemplate", "UpdateStatusPageTemplateData", "UpdateStatusPageTemplateDataAttributes", @@ -8261,6 +8553,7 @@ "UpdateTeamDataAttributesAutoAddMembersScope", "UpdateTeamDataAttributesIncidentBroadcastChannelType0", "UpdateTeamDataAttributesPropertiesItem", + "UpdateTeamDataAttributesScheduleOverridePolicy", "UpdateTeamDataAttributesSlackAliasesType0Item", "UpdateTeamDataAttributesSlackChannelsType0Item", "UpdateTeamDataType", @@ -8309,6 +8602,8 @@ "UpdateWorkflowCustomFieldSelectionDataType", "UpdateWorkflowData", "UpdateWorkflowDataAttributes", + "UpdateWorkflowDataAttributesFailureNotificationChannelsItem", + "UpdateWorkflowDataAttributesFailureNotificationMode", "UpdateWorkflowDataType", "UpdateWorkflowFormFieldCondition", "UpdateWorkflowFormFieldConditionData", @@ -8372,6 +8667,9 @@ "VerifiedDomainSource", "VerifiedDomainVerificationStatus", "VerifyPhoneNumberRequest", + "VerifyUserPhoneNumberResponse200", + "VerifyUserPhoneNumberResponse429", + "VerifyUserPhoneNumberResponse503", "WebhooksDelivery", "WebhooksDeliveryList", "WebhooksDeliveryListDataItem", @@ -8406,6 +8704,8 @@ "WorkflowCustomFieldSelectionResponse", "WorkflowCustomFieldSelectionResponseData", "WorkflowCustomFieldSelectionResponseDataType", + "WorkflowFailureNotificationChannelsItem", + "WorkflowFailureNotificationMode", "WorkflowFormFieldCondition", "WorkflowFormFieldConditionIncidentCondition", "WorkflowFormFieldConditionList", diff --git a/rootly_sdk/models/acknowledge_alert.py b/rootly_sdk/models/acknowledge_alert.py new file mode 100644 index 00000000..e4066910 --- /dev/null +++ b/rootly_sdk/models/acknowledge_alert.py @@ -0,0 +1,55 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.acknowledge_alert_data import AcknowledgeAlertData + + +T = TypeVar("T", bound="AcknowledgeAlert") + + +@_attrs_define +class AcknowledgeAlert: + """ + Attributes: + data (AcknowledgeAlertData | Unset): + """ + + data: AcknowledgeAlertData | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + data: dict[str, Any] | Unset = UNSET + if not isinstance(self.data, Unset): + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if data is not UNSET: + field_dict["data"] = data + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.acknowledge_alert_data import AcknowledgeAlertData + + d = dict(src_dict) + _data = d.pop("data", UNSET) + data: AcknowledgeAlertData | Unset + if isinstance(_data, Unset): + data = UNSET + else: + data = AcknowledgeAlertData.from_dict(_data) + + acknowledge_alert = cls( + data=data, + ) + + return acknowledge_alert diff --git a/rootly_sdk/models/acknowledge_alert_data.py b/rootly_sdk/models/acknowledge_alert_data.py new file mode 100644 index 00000000..225aaa14 --- /dev/null +++ b/rootly_sdk/models/acknowledge_alert_data.py @@ -0,0 +1,72 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.acknowledge_alert_data_type import AcknowledgeAlertDataType, check_acknowledge_alert_data_type +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.acknowledge_alert_data_attributes import AcknowledgeAlertDataAttributes + + +T = TypeVar("T", bound="AcknowledgeAlertData") + + +@_attrs_define +class AcknowledgeAlertData: + """ + Attributes: + type_ (AcknowledgeAlertDataType | Unset): + attributes (AcknowledgeAlertDataAttributes | Unset): + """ + + type_: AcknowledgeAlertDataType | Unset = UNSET + attributes: AcknowledgeAlertDataAttributes | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + type_: str | Unset = UNSET + if not isinstance(self.type_, Unset): + type_ = self.type_ + + attributes: dict[str, Any] | Unset = UNSET + if not isinstance(self.attributes, Unset): + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if type_ is not UNSET: + field_dict["type"] = type_ + if attributes is not UNSET: + field_dict["attributes"] = attributes + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.acknowledge_alert_data_attributes import AcknowledgeAlertDataAttributes + + d = dict(src_dict) + _type_ = d.pop("type", UNSET) + type_: AcknowledgeAlertDataType | Unset + if isinstance(_type_, Unset): + type_ = UNSET + else: + type_ = check_acknowledge_alert_data_type(_type_) + + _attributes = d.pop("attributes", UNSET) + attributes: AcknowledgeAlertDataAttributes | Unset + if isinstance(_attributes, Unset): + attributes = UNSET + else: + attributes = AcknowledgeAlertDataAttributes.from_dict(_attributes) + + acknowledge_alert_data = cls( + type_=type_, + attributes=attributes, + ) + + return acknowledge_alert_data diff --git a/rootly_sdk/models/acknowledge_alert_data_attributes.py b/rootly_sdk/models/acknowledge_alert_data_attributes.py new file mode 100644 index 00000000..4883b15a --- /dev/null +++ b/rootly_sdk/models/acknowledge_alert_data_attributes.py @@ -0,0 +1,174 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.acknowledge_alert_data_attributes_actor_type_0 import AcknowledgeAlertDataAttributesActorType0 + from ..models.acknowledge_alert_data_attributes_actor_type_1 import AcknowledgeAlertDataAttributesActorType1 + from ..models.acknowledge_alert_data_attributes_actor_type_2_type_0 import ( + AcknowledgeAlertDataAttributesActorType2Type0, + ) + from ..models.acknowledge_alert_data_attributes_actor_type_2_type_1 import ( + AcknowledgeAlertDataAttributesActorType2Type1, + ) + from ..models.acknowledge_alert_data_attributes_actor_type_3_type_0 import ( + AcknowledgeAlertDataAttributesActorType3Type0, + ) + from ..models.acknowledge_alert_data_attributes_actor_type_3_type_1 import ( + AcknowledgeAlertDataAttributesActorType3Type1, + ) + + +T = TypeVar("T", bound="AcknowledgeAlertDataAttributes") + + +@_attrs_define +class AcknowledgeAlertDataAttributes: + """ + Attributes: + actor (AcknowledgeAlertDataAttributesActorType0 | AcknowledgeAlertDataAttributesActorType1 | + AcknowledgeAlertDataAttributesActorType2Type0 | AcknowledgeAlertDataAttributesActorType2Type1 | + AcknowledgeAlertDataAttributesActorType3Type0 | AcknowledgeAlertDataAttributesActorType3Type1 | Unset): The user + to record as performing this action. Only available when actor attribution is enabled for the organization; + otherwise it is ignored. Only supported with Global and Team API keys; with a Team API key the user must belong + to one of the key's teams. When omitted or null, the action is attributed to the API key. Otherwise provide + either `email` or `user_id`, not both. + """ + + actor: ( + AcknowledgeAlertDataAttributesActorType0 + | AcknowledgeAlertDataAttributesActorType1 + | AcknowledgeAlertDataAttributesActorType2Type0 + | AcknowledgeAlertDataAttributesActorType2Type1 + | AcknowledgeAlertDataAttributesActorType3Type0 + | AcknowledgeAlertDataAttributesActorType3Type1 + | Unset + ) = UNSET + + def to_dict(self) -> dict[str, Any]: + from ..models.acknowledge_alert_data_attributes_actor_type_0 import AcknowledgeAlertDataAttributesActorType0 + from ..models.acknowledge_alert_data_attributes_actor_type_1 import AcknowledgeAlertDataAttributesActorType1 + from ..models.acknowledge_alert_data_attributes_actor_type_2_type_0 import ( + AcknowledgeAlertDataAttributesActorType2Type0, + ) + from ..models.acknowledge_alert_data_attributes_actor_type_2_type_1 import ( + AcknowledgeAlertDataAttributesActorType2Type1, + ) + from ..models.acknowledge_alert_data_attributes_actor_type_3_type_0 import ( + AcknowledgeAlertDataAttributesActorType3Type0, + ) + + actor: dict[str, Any] | Unset + if isinstance(self.actor, Unset): + actor = UNSET + elif isinstance(self.actor, AcknowledgeAlertDataAttributesActorType0): + actor = self.actor.to_dict() + elif isinstance(self.actor, AcknowledgeAlertDataAttributesActorType1): + actor = self.actor.to_dict() + elif isinstance(self.actor, AcknowledgeAlertDataAttributesActorType2Type0): + actor = self.actor.to_dict() + elif isinstance(self.actor, AcknowledgeAlertDataAttributesActorType2Type1): + actor = self.actor.to_dict() + elif isinstance(self.actor, AcknowledgeAlertDataAttributesActorType3Type0): + actor = self.actor.to_dict() + else: + actor = self.actor.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if actor is not UNSET: + field_dict["actor"] = actor + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.acknowledge_alert_data_attributes_actor_type_0 import AcknowledgeAlertDataAttributesActorType0 + from ..models.acknowledge_alert_data_attributes_actor_type_1 import AcknowledgeAlertDataAttributesActorType1 + from ..models.acknowledge_alert_data_attributes_actor_type_2_type_0 import ( + AcknowledgeAlertDataAttributesActorType2Type0, + ) + from ..models.acknowledge_alert_data_attributes_actor_type_2_type_1 import ( + AcknowledgeAlertDataAttributesActorType2Type1, + ) + from ..models.acknowledge_alert_data_attributes_actor_type_3_type_0 import ( + AcknowledgeAlertDataAttributesActorType3Type0, + ) + from ..models.acknowledge_alert_data_attributes_actor_type_3_type_1 import ( + AcknowledgeAlertDataAttributesActorType3Type1, + ) + + d = dict(src_dict) + + def _parse_actor( + data: object, + ) -> ( + AcknowledgeAlertDataAttributesActorType0 + | AcknowledgeAlertDataAttributesActorType1 + | AcknowledgeAlertDataAttributesActorType2Type0 + | AcknowledgeAlertDataAttributesActorType2Type1 + | AcknowledgeAlertDataAttributesActorType3Type0 + | AcknowledgeAlertDataAttributesActorType3Type1 + | Unset + ): + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_0 = AcknowledgeAlertDataAttributesActorType0.from_dict(data) + + return actor_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_1 = AcknowledgeAlertDataAttributesActorType1.from_dict(data) + + return actor_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_2_type_0 = AcknowledgeAlertDataAttributesActorType2Type0.from_dict(data) + + return actor_type_2_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_2_type_1 = AcknowledgeAlertDataAttributesActorType2Type1.from_dict(data) + + return actor_type_2_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_3_type_0 = AcknowledgeAlertDataAttributesActorType3Type0.from_dict(data) + + return actor_type_3_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + actor_type_3_type_1 = AcknowledgeAlertDataAttributesActorType3Type1.from_dict(data) + + return actor_type_3_type_1 + + actor = _parse_actor(d.pop("actor", UNSET)) + + acknowledge_alert_data_attributes = cls( + actor=actor, + ) + + return acknowledge_alert_data_attributes diff --git a/rootly_sdk/models/acknowledge_alert_data_attributes_actor_type_0.py b/rootly_sdk/models/acknowledge_alert_data_attributes_actor_type_0.py new file mode 100644 index 00000000..c73a612a --- /dev/null +++ b/rootly_sdk/models/acknowledge_alert_data_attributes_actor_type_0.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="AcknowledgeAlertDataAttributesActorType0") + + +@_attrs_define +class AcknowledgeAlertDataAttributesActorType0: + """ + Attributes: + email (str): Email of the user, including verified secondary emails. + """ + + email: str + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + acknowledge_alert_data_attributes_actor_type_0 = cls( + email=email, + ) + + return acknowledge_alert_data_attributes_actor_type_0 diff --git a/rootly_sdk/models/acknowledge_alert_data_attributes_actor_type_1.py b/rootly_sdk/models/acknowledge_alert_data_attributes_actor_type_1.py new file mode 100644 index 00000000..62e0e573 --- /dev/null +++ b/rootly_sdk/models/acknowledge_alert_data_attributes_actor_type_1.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="AcknowledgeAlertDataAttributesActorType1") + + +@_attrs_define +class AcknowledgeAlertDataAttributesActorType1: + """ + Attributes: + user_id (str): Rootly ID of the user. + """ + + user_id: str + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user_id": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("user_id") + + acknowledge_alert_data_attributes_actor_type_1 = cls( + user_id=user_id, + ) + + return acknowledge_alert_data_attributes_actor_type_1 diff --git a/rootly_sdk/models/acknowledge_alert_data_attributes_actor_type_2_type_0.py b/rootly_sdk/models/acknowledge_alert_data_attributes_actor_type_2_type_0.py new file mode 100644 index 00000000..f85b9f3f --- /dev/null +++ b/rootly_sdk/models/acknowledge_alert_data_attributes_actor_type_2_type_0.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="AcknowledgeAlertDataAttributesActorType2Type0") + + +@_attrs_define +class AcknowledgeAlertDataAttributesActorType2Type0: + """ + Attributes: + email (str): Email of the user, including verified secondary emails. + """ + + email: str + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + acknowledge_alert_data_attributes_actor_type_2_type_0 = cls( + email=email, + ) + + return acknowledge_alert_data_attributes_actor_type_2_type_0 diff --git a/rootly_sdk/models/acknowledge_alert_data_attributes_actor_type_2_type_1.py b/rootly_sdk/models/acknowledge_alert_data_attributes_actor_type_2_type_1.py new file mode 100644 index 00000000..37811972 --- /dev/null +++ b/rootly_sdk/models/acknowledge_alert_data_attributes_actor_type_2_type_1.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="AcknowledgeAlertDataAttributesActorType2Type1") + + +@_attrs_define +class AcknowledgeAlertDataAttributesActorType2Type1: + """ + Attributes: + user_id (str): Rootly ID of the user. + """ + + user_id: str + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user_id": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("user_id") + + acknowledge_alert_data_attributes_actor_type_2_type_1 = cls( + user_id=user_id, + ) + + return acknowledge_alert_data_attributes_actor_type_2_type_1 diff --git a/rootly_sdk/models/acknowledge_alert_data_attributes_actor_type_3_type_0.py b/rootly_sdk/models/acknowledge_alert_data_attributes_actor_type_3_type_0.py new file mode 100644 index 00000000..3a233c6a --- /dev/null +++ b/rootly_sdk/models/acknowledge_alert_data_attributes_actor_type_3_type_0.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="AcknowledgeAlertDataAttributesActorType3Type0") + + +@_attrs_define +class AcknowledgeAlertDataAttributesActorType3Type0: + """ + Attributes: + email (str): Email of the user, including verified secondary emails. + """ + + email: str + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + acknowledge_alert_data_attributes_actor_type_3_type_0 = cls( + email=email, + ) + + return acknowledge_alert_data_attributes_actor_type_3_type_0 diff --git a/rootly_sdk/models/acknowledge_alert_data_attributes_actor_type_3_type_1.py b/rootly_sdk/models/acknowledge_alert_data_attributes_actor_type_3_type_1.py new file mode 100644 index 00000000..eef34552 --- /dev/null +++ b/rootly_sdk/models/acknowledge_alert_data_attributes_actor_type_3_type_1.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="AcknowledgeAlertDataAttributesActorType3Type1") + + +@_attrs_define +class AcknowledgeAlertDataAttributesActorType3Type1: + """ + Attributes: + user_id (str): Rootly ID of the user. + """ + + user_id: str + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user_id": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("user_id") + + acknowledge_alert_data_attributes_actor_type_3_type_1 = cls( + user_id=user_id, + ) + + return acknowledge_alert_data_attributes_actor_type_3_type_1 diff --git a/rootly_sdk/models/acknowledge_alert_data_type.py b/rootly_sdk/models/acknowledge_alert_data_type.py new file mode 100644 index 00000000..d3085f71 --- /dev/null +++ b/rootly_sdk/models/acknowledge_alert_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +AcknowledgeAlertDataType = Literal["alerts"] + +ACKNOWLEDGE_ALERT_DATA_TYPE_VALUES: set[AcknowledgeAlertDataType] = { + "alerts", +} + + +def check_acknowledge_alert_data_type(value: str | None) -> AcknowledgeAlertDataType | None: + if value is None: + return None + if value in ACKNOWLEDGE_ALERT_DATA_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ACKNOWLEDGE_ALERT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/action_item_trigger_params.py b/rootly_sdk/models/action_item_trigger_params.py index fde80595..15454276 100644 --- a/rootly_sdk/models/action_item_trigger_params.py +++ b/rootly_sdk/models/action_item_trigger_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -84,6 +86,14 @@ ActionItemTriggerParamsIncidentConditionResolvedAt, check_action_item_trigger_params_incident_condition_resolved_at, ) +from ..models.action_item_trigger_params_incident_condition_scheduled_for import ( + ActionItemTriggerParamsIncidentConditionScheduledFor, + check_action_item_trigger_params_incident_condition_scheduled_for, +) +from ..models.action_item_trigger_params_incident_condition_scheduled_until import ( + ActionItemTriggerParamsIncidentConditionScheduledUntil, + check_action_item_trigger_params_incident_condition_scheduled_until, +) from ..models.action_item_trigger_params_incident_condition_service import ( ActionItemTriggerParamsIncidentConditionService, check_action_item_trigger_params_incident_condition_service, @@ -138,252 +148,261 @@ class ActionItemTriggerParams: """ Attributes: trigger_type (ActionItemTriggerParamsTriggerType): - 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: + 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: 'ANY'. - incident_condition_kind (Union[Unset, ActionItemTriggerParamsIncidentConditionKind]): Default: 'IS'. - incident_condition_status (Union[Unset, ActionItemTriggerParamsIncidentConditionStatus]): Default: 'ANY'. - incident_condition_sub_status (Union[Unset, ActionItemTriggerParamsIncidentConditionSubStatus]): Default: + incident_condition_incident_roles (ActionItemTriggerParamsIncidentConditionIncidentRoles | Unset): Default: 'ANY'. - incident_condition_environment (Union[Unset, ActionItemTriggerParamsIncidentConditionEnvironment]): Default: + incident_condition_service (ActionItemTriggerParamsIncidentConditionService | Unset): Default: 'ANY'. + incident_condition_functionality (ActionItemTriggerParamsIncidentConditionFunctionality | Unset): Default: 'ANY'. - incident_condition_severity (Union[Unset, ActionItemTriggerParamsIncidentConditionSeverity]): Default: 'ANY'. - incident_condition_incident_type (Union[Unset, ActionItemTriggerParamsIncidentConditionIncidentType]): Default: + 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_condition_scheduled_for (ActionItemTriggerParamsIncidentConditionScheduledFor | Unset): + incident_condition_scheduled_until (ActionItemTriggerParamsIncidentConditionScheduledUntil | Unset): + incident_conditional_inactivity (ActionItemTriggerParamsIncidentConditionalInactivity | Unset): + incident_action_item_condition (ActionItemTriggerParamsIncidentActionItemCondition | Unset): + incident_action_item_condition_kind (ActionItemTriggerParamsIncidentActionItemConditionKind | Unset): Default: 'ANY'. - incident_condition_incident_roles (Union[Unset, ActionItemTriggerParamsIncidentConditionIncidentRoles]): - Default: 'ANY'. - incident_condition_service (Union[Unset, ActionItemTriggerParamsIncidentConditionService]): Default: 'ANY'. - incident_condition_functionality (Union[Unset, ActionItemTriggerParamsIncidentConditionFunctionality]): + incident_action_item_kinds (list[ActionItemTriggerParamsIncidentActionItemKindsItem] | Unset): + incident_action_item_condition_status (ActionItemTriggerParamsIncidentActionItemConditionStatus | Unset): 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]): + incident_action_item_statuses (list[ActionItemTriggerParamsIncidentActionItemStatusesItem] | Unset): + incident_action_item_condition_priority (ActionItemTriggerParamsIncidentActionItemConditionPriority | Unset): Default: 'ANY'. - incident_action_item_kinds (Union[Unset, list[ActionItemTriggerParamsIncidentActionItemKindsItem]]): - incident_action_item_condition_status (Union[Unset, ActionItemTriggerParamsIncidentActionItemConditionStatus]): + incident_action_item_priorities (list[ActionItemTriggerParamsIncidentActionItemPrioritiesItem] | Unset): + incident_action_item_condition_group (ActionItemTriggerParamsIncidentActionItemConditionGroup | Unset): Default: 'ANY'. - 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 (Union[Unset, list[str]]): + incident_action_item_group_ids (list[str] | Unset): """ trigger_type: ActionItemTriggerParamsTriggerType - 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 + 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_condition_scheduled_for: ActionItemTriggerParamsIncidentConditionScheduledFor | Unset = UNSET + incident_condition_scheduled_until: ActionItemTriggerParamsIncidentConditionScheduledUntil | 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 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: Unset | list[str] = UNSET + triggers: list[str] | Unset = UNSET if not isinstance(self.triggers, Unset): triggers = self.triggers - incident_visibilities: Unset | list[bool] = UNSET + incident_visibilities: list[bool] | Unset = UNSET if not isinstance(self.incident_visibilities, Unset): incident_visibilities = self.incident_visibilities - incident_kinds: Unset | list[str] = UNSET + incident_kinds: list[str] | Unset = 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: Unset | list[str] = UNSET + incident_statuses: list[str] | Unset = 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 | Unset | str + incident_inactivity_duration: None | str | Unset if isinstance(self.incident_inactivity_duration, Unset): incident_inactivity_duration = UNSET else: incident_inactivity_duration = self.incident_inactivity_duration - incident_condition: Unset | str = UNSET + incident_condition: str | Unset = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - incident_condition_visibility: Unset | str = UNSET + incident_condition_visibility: str | Unset = UNSET if not isinstance(self.incident_condition_visibility, Unset): incident_condition_visibility = self.incident_condition_visibility - incident_condition_kind: Unset | str = UNSET + incident_condition_kind: str | Unset = UNSET if not isinstance(self.incident_condition_kind, Unset): incident_condition_kind = self.incident_condition_kind - incident_condition_status: Unset | str = UNSET + incident_condition_status: str | Unset = UNSET if not isinstance(self.incident_condition_status, Unset): incident_condition_status = self.incident_condition_status - incident_condition_sub_status: Unset | str = UNSET + incident_condition_sub_status: str | Unset = UNSET if not isinstance(self.incident_condition_sub_status, Unset): incident_condition_sub_status = self.incident_condition_sub_status - incident_condition_environment: Unset | str = UNSET + incident_condition_environment: str | Unset = UNSET if not isinstance(self.incident_condition_environment, Unset): incident_condition_environment = self.incident_condition_environment - incident_condition_severity: Unset | str = UNSET + incident_condition_severity: str | Unset = UNSET if not isinstance(self.incident_condition_severity, Unset): incident_condition_severity = self.incident_condition_severity - incident_condition_incident_type: Unset | str = UNSET + incident_condition_incident_type: str | Unset = UNSET if not isinstance(self.incident_condition_incident_type, Unset): incident_condition_incident_type = self.incident_condition_incident_type - incident_condition_incident_roles: Unset | str = UNSET + incident_condition_incident_roles: str | Unset = UNSET if not isinstance(self.incident_condition_incident_roles, Unset): incident_condition_incident_roles = self.incident_condition_incident_roles - incident_condition_service: Unset | str = UNSET + incident_condition_service: str | Unset = UNSET if not isinstance(self.incident_condition_service, Unset): incident_condition_service = self.incident_condition_service - incident_condition_functionality: Unset | str = UNSET + incident_condition_functionality: str | Unset = UNSET if not isinstance(self.incident_condition_functionality, Unset): incident_condition_functionality = self.incident_condition_functionality - incident_condition_group: Unset | str = UNSET + incident_condition_group: str | Unset = UNSET if not isinstance(self.incident_condition_group, Unset): incident_condition_group = self.incident_condition_group - incident_condition_label: Unset | str = UNSET + incident_condition_label: str | Unset = 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: Unset | list[str] = UNSET + incident_labels: list[str] | Unset = UNSET if not isinstance(self.incident_labels, Unset): incident_labels = self.incident_labels - incident_condition_summary: Unset | str = UNSET + incident_condition_summary: str | Unset = UNSET if not isinstance(self.incident_condition_summary, Unset): incident_condition_summary = self.incident_condition_summary - incident_condition_started_at: Unset | str = UNSET + incident_condition_started_at: str | Unset = UNSET if not isinstance(self.incident_condition_started_at, Unset): incident_condition_started_at = self.incident_condition_started_at - incident_condition_detected_at: Unset | str = UNSET + incident_condition_detected_at: str | Unset = UNSET if not isinstance(self.incident_condition_detected_at, Unset): incident_condition_detected_at = self.incident_condition_detected_at - incident_condition_acknowledged_at: Unset | str = UNSET + incident_condition_acknowledged_at: str | Unset = UNSET if not isinstance(self.incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = self.incident_condition_acknowledged_at - incident_condition_mitigated_at: Unset | str = UNSET + incident_condition_mitigated_at: str | Unset = UNSET if not isinstance(self.incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = self.incident_condition_mitigated_at - incident_condition_resolved_at: Unset | str = UNSET + incident_condition_resolved_at: str | Unset = UNSET if not isinstance(self.incident_condition_resolved_at, Unset): incident_condition_resolved_at = self.incident_condition_resolved_at - incident_conditional_inactivity: Unset | str = UNSET + incident_condition_scheduled_for: str | Unset = UNSET + if not isinstance(self.incident_condition_scheduled_for, Unset): + incident_condition_scheduled_for = self.incident_condition_scheduled_for + + incident_condition_scheduled_until: str | Unset = UNSET + if not isinstance(self.incident_condition_scheduled_until, Unset): + incident_condition_scheduled_until = self.incident_condition_scheduled_until + + incident_conditional_inactivity: str | Unset = UNSET if not isinstance(self.incident_conditional_inactivity, Unset): incident_conditional_inactivity = self.incident_conditional_inactivity - incident_action_item_condition: Unset | str = UNSET + incident_action_item_condition: str | Unset = UNSET if not isinstance(self.incident_action_item_condition, Unset): incident_action_item_condition = self.incident_action_item_condition - incident_action_item_condition_kind: Unset | str = UNSET + incident_action_item_condition_kind: str | Unset = 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: Unset | list[str] = UNSET + incident_action_item_kinds: list[str] | Unset = 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: Unset | str = UNSET + incident_action_item_condition_status: str | Unset = 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: Unset | list[str] = UNSET + incident_action_item_statuses: list[str] | Unset = 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: Unset | str = UNSET + incident_action_item_condition_priority: str | Unset = 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: Unset | list[str] = UNSET + incident_action_item_priorities: list[str] | Unset = 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: Unset | str = UNSET + incident_action_item_condition_group: str | Unset = 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: Unset | list[str] = UNSET + incident_action_item_group_ids: list[str] | Unset = UNSET if not isinstance(self.incident_action_item_group_ids, Unset): incident_action_item_group_ids = self.incident_action_item_group_ids @@ -446,6 +465,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["incident_condition_mitigated_at"] = incident_condition_mitigated_at if incident_condition_resolved_at is not UNSET: field_dict["incident_condition_resolved_at"] = incident_condition_resolved_at + if incident_condition_scheduled_for is not UNSET: + field_dict["incident_condition_scheduled_for"] = incident_condition_scheduled_for + if incident_condition_scheduled_until is not UNSET: + field_dict["incident_condition_scheduled_until"] = incident_condition_scheduled_until if incident_conditional_inactivity is not UNSET: field_dict["incident_conditional_inactivity"] = incident_conditional_inactivity if incident_action_item_condition is not UNSET: @@ -478,40 +501,44 @@ 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) - 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: 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) - incident_kinds.append(incident_kinds_item) + incident_kinds.append(incident_kinds_item) - incident_statuses = [] _incident_statuses = d.pop("incident_statuses", UNSET) - 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: 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 + ) - incident_statuses.append(incident_statuses_item) + incident_statuses.append(incident_statuses_item) - def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: + def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) incident_inactivity_duration = _parse_incident_inactivity_duration(d.pop("incident_inactivity_duration", UNSET)) _incident_condition = d.pop("incident_condition", UNSET) - incident_condition: Unset | ActionItemTriggerParamsIncidentCondition + incident_condition: ActionItemTriggerParamsIncidentCondition | Unset 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: Unset | ActionItemTriggerParamsIncidentConditionVisibility + incident_condition_visibility: ActionItemTriggerParamsIncidentConditionVisibility | Unset if isinstance(_incident_condition_visibility, Unset): incident_condition_visibility = UNSET else: @@ -520,14 +547,14 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_kind = d.pop("incident_condition_kind", UNSET) - incident_condition_kind: Unset | ActionItemTriggerParamsIncidentConditionKind + incident_condition_kind: ActionItemTriggerParamsIncidentConditionKind | Unset 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: Unset | ActionItemTriggerParamsIncidentConditionStatus + incident_condition_status: ActionItemTriggerParamsIncidentConditionStatus | Unset if isinstance(_incident_condition_status, Unset): incident_condition_status = UNSET else: @@ -536,7 +563,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_sub_status = d.pop("incident_condition_sub_status", UNSET) - incident_condition_sub_status: Unset | ActionItemTriggerParamsIncidentConditionSubStatus + incident_condition_sub_status: ActionItemTriggerParamsIncidentConditionSubStatus | Unset if isinstance(_incident_condition_sub_status, Unset): incident_condition_sub_status = UNSET else: @@ -545,7 +572,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_environment = d.pop("incident_condition_environment", UNSET) - incident_condition_environment: Unset | ActionItemTriggerParamsIncidentConditionEnvironment + incident_condition_environment: ActionItemTriggerParamsIncidentConditionEnvironment | Unset if isinstance(_incident_condition_environment, Unset): incident_condition_environment = UNSET else: @@ -554,7 +581,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_severity = d.pop("incident_condition_severity", UNSET) - incident_condition_severity: Unset | ActionItemTriggerParamsIncidentConditionSeverity + incident_condition_severity: ActionItemTriggerParamsIncidentConditionSeverity | Unset if isinstance(_incident_condition_severity, Unset): incident_condition_severity = UNSET else: @@ -563,7 +590,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_incident_type = d.pop("incident_condition_incident_type", UNSET) - incident_condition_incident_type: Unset | ActionItemTriggerParamsIncidentConditionIncidentType + incident_condition_incident_type: ActionItemTriggerParamsIncidentConditionIncidentType | Unset if isinstance(_incident_condition_incident_type, Unset): incident_condition_incident_type = UNSET else: @@ -572,7 +599,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_incident_roles = d.pop("incident_condition_incident_roles", UNSET) - incident_condition_incident_roles: Unset | ActionItemTriggerParamsIncidentConditionIncidentRoles + incident_condition_incident_roles: ActionItemTriggerParamsIncidentConditionIncidentRoles | Unset if isinstance(_incident_condition_incident_roles, Unset): incident_condition_incident_roles = UNSET else: @@ -581,7 +608,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_service = d.pop("incident_condition_service", UNSET) - incident_condition_service: Unset | ActionItemTriggerParamsIncidentConditionService + incident_condition_service: ActionItemTriggerParamsIncidentConditionService | Unset if isinstance(_incident_condition_service, Unset): incident_condition_service = UNSET else: @@ -590,7 +617,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_functionality = d.pop("incident_condition_functionality", UNSET) - incident_condition_functionality: Unset | ActionItemTriggerParamsIncidentConditionFunctionality + incident_condition_functionality: ActionItemTriggerParamsIncidentConditionFunctionality | Unset if isinstance(_incident_condition_functionality, Unset): incident_condition_functionality = UNSET else: @@ -599,7 +626,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_group = d.pop("incident_condition_group", UNSET) - incident_condition_group: Unset | ActionItemTriggerParamsIncidentConditionGroup + incident_condition_group: ActionItemTriggerParamsIncidentConditionGroup | Unset if isinstance(_incident_condition_group, Unset): incident_condition_group = UNSET else: @@ -608,7 +635,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_label = d.pop("incident_condition_label", UNSET) - incident_condition_label: Unset | ActionItemTriggerParamsIncidentConditionLabel + incident_condition_label: ActionItemTriggerParamsIncidentConditionLabel | Unset if isinstance(_incident_condition_label, Unset): incident_condition_label = UNSET else: @@ -621,7 +648,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: incident_labels = cast(list[str], d.pop("incident_labels", UNSET)) _incident_condition_summary = d.pop("incident_condition_summary", UNSET) - incident_condition_summary: Unset | ActionItemTriggerParamsIncidentConditionSummary + incident_condition_summary: ActionItemTriggerParamsIncidentConditionSummary | Unset if isinstance(_incident_condition_summary, Unset): incident_condition_summary = UNSET else: @@ -630,7 +657,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_started_at = d.pop("incident_condition_started_at", UNSET) - incident_condition_started_at: Unset | ActionItemTriggerParamsIncidentConditionStartedAt + incident_condition_started_at: ActionItemTriggerParamsIncidentConditionStartedAt | Unset if isinstance(_incident_condition_started_at, Unset): incident_condition_started_at = UNSET else: @@ -639,7 +666,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_detected_at = d.pop("incident_condition_detected_at", UNSET) - incident_condition_detected_at: Unset | ActionItemTriggerParamsIncidentConditionDetectedAt + incident_condition_detected_at: ActionItemTriggerParamsIncidentConditionDetectedAt | Unset if isinstance(_incident_condition_detected_at, Unset): incident_condition_detected_at = UNSET else: @@ -648,7 +675,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_acknowledged_at = d.pop("incident_condition_acknowledged_at", UNSET) - incident_condition_acknowledged_at: Unset | ActionItemTriggerParamsIncidentConditionAcknowledgedAt + incident_condition_acknowledged_at: ActionItemTriggerParamsIncidentConditionAcknowledgedAt | Unset if isinstance(_incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = UNSET else: @@ -657,7 +684,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_mitigated_at = d.pop("incident_condition_mitigated_at", UNSET) - incident_condition_mitigated_at: Unset | ActionItemTriggerParamsIncidentConditionMitigatedAt + incident_condition_mitigated_at: ActionItemTriggerParamsIncidentConditionMitigatedAt | Unset if isinstance(_incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = UNSET else: @@ -666,7 +693,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_resolved_at = d.pop("incident_condition_resolved_at", UNSET) - incident_condition_resolved_at: Unset | ActionItemTriggerParamsIncidentConditionResolvedAt + incident_condition_resolved_at: ActionItemTriggerParamsIncidentConditionResolvedAt | Unset if isinstance(_incident_condition_resolved_at, Unset): incident_condition_resolved_at = UNSET else: @@ -674,8 +701,26 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: _incident_condition_resolved_at ) + _incident_condition_scheduled_for = d.pop("incident_condition_scheduled_for", UNSET) + incident_condition_scheduled_for: ActionItemTriggerParamsIncidentConditionScheduledFor | Unset + if isinstance(_incident_condition_scheduled_for, Unset): + incident_condition_scheduled_for = UNSET + else: + incident_condition_scheduled_for = check_action_item_trigger_params_incident_condition_scheduled_for( + _incident_condition_scheduled_for + ) + + _incident_condition_scheduled_until = d.pop("incident_condition_scheduled_until", UNSET) + incident_condition_scheduled_until: ActionItemTriggerParamsIncidentConditionScheduledUntil | Unset + if isinstance(_incident_condition_scheduled_until, Unset): + incident_condition_scheduled_until = UNSET + else: + incident_condition_scheduled_until = check_action_item_trigger_params_incident_condition_scheduled_until( + _incident_condition_scheduled_until + ) + _incident_conditional_inactivity = d.pop("incident_conditional_inactivity", UNSET) - incident_conditional_inactivity: Unset | ActionItemTriggerParamsIncidentConditionalInactivity + incident_conditional_inactivity: ActionItemTriggerParamsIncidentConditionalInactivity | Unset if isinstance(_incident_conditional_inactivity, Unset): incident_conditional_inactivity = UNSET else: @@ -684,7 +729,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_action_item_condition = d.pop("incident_action_item_condition", UNSET) - incident_action_item_condition: Unset | ActionItemTriggerParamsIncidentActionItemCondition + incident_action_item_condition: ActionItemTriggerParamsIncidentActionItemCondition | Unset if isinstance(_incident_action_item_condition, Unset): incident_action_item_condition = UNSET else: @@ -693,7 +738,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_action_item_condition_kind = d.pop("incident_action_item_condition_kind", UNSET) - incident_action_item_condition_kind: Unset | ActionItemTriggerParamsIncidentActionItemConditionKind + incident_action_item_condition_kind: ActionItemTriggerParamsIncidentActionItemConditionKind | Unset if isinstance(_incident_action_item_condition_kind, Unset): incident_action_item_condition_kind = UNSET else: @@ -701,17 +746,19 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: _incident_action_item_condition_kind ) - incident_action_item_kinds = [] _incident_action_item_kinds = d.pop("incident_action_item_kinds", UNSET) - 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: 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 + ) - 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: Unset | ActionItemTriggerParamsIncidentActionItemConditionStatus + incident_action_item_condition_status: ActionItemTriggerParamsIncidentActionItemConditionStatus | Unset if isinstance(_incident_action_item_condition_status, Unset): incident_action_item_condition_status = UNSET else: @@ -721,17 +768,21 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) ) - incident_action_item_statuses = [] _incident_action_item_statuses = d.pop("incident_action_item_statuses", UNSET) - 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: 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 + ) + ) - 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: Unset | ActionItemTriggerParamsIncidentActionItemConditionPriority + incident_action_item_condition_priority: ActionItemTriggerParamsIncidentActionItemConditionPriority | Unset if isinstance(_incident_action_item_condition_priority, Unset): incident_action_item_condition_priority = UNSET else: @@ -741,19 +792,21 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) ) - incident_action_item_priorities = [] _incident_action_item_priorities = d.pop("incident_action_item_priorities", UNSET) - 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: 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 + ) ) - ) - 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: Unset | ActionItemTriggerParamsIncidentActionItemConditionGroup + incident_action_item_condition_group: ActionItemTriggerParamsIncidentActionItemConditionGroup | Unset if isinstance(_incident_action_item_condition_group, Unset): incident_action_item_condition_group = UNSET else: @@ -793,6 +846,8 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: incident_condition_acknowledged_at=incident_condition_acknowledged_at, incident_condition_mitigated_at=incident_condition_mitigated_at, incident_condition_resolved_at=incident_condition_resolved_at, + incident_condition_scheduled_for=incident_condition_scheduled_for, + incident_condition_scheduled_until=incident_condition_scheduled_until, incident_conditional_inactivity=incident_conditional_inactivity, incident_action_item_condition=incident_action_item_condition, incident_action_item_condition_kind=incident_action_item_condition_kind, diff --git a/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition.py b/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition.py index d077911b..a4efd448 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentActionItemCondition = Literal["ALL", "ANY", "NONE"] @@ -17,7 +17,7 @@ def check_action_item_trigger_params_incident_action_item_condition( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_ACTION_ITEM_CONDITION_VALUES: - return cast(ActionItemTriggerParamsIncidentActionItemCondition, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_ACTION_ITEM_CONDITION_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition_group.py b/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition_group.py index f5de7b48..91da2916 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition_group.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition_group.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentActionItemConditionGroup = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_action_item_trigger_params_incident_action_item_condition_group( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_ACTION_ITEM_CONDITION_GROUP_VALUES: - return cast(ActionItemTriggerParamsIncidentActionItemConditionGroup, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_ACTION_ITEM_CONDITION_GROUP_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition_kind.py b/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition_kind.py index 21d29608..e653a2ea 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition_kind.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentActionItemConditionKind = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_action_item_trigger_params_incident_action_item_condition_kind( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_ACTION_ITEM_CONDITION_KIND_VALUES: - return cast(ActionItemTriggerParamsIncidentActionItemConditionKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_ACTION_ITEM_CONDITION_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition_priority.py b/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition_priority.py index 40125f22..3df7e3d4 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition_priority.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition_priority.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentActionItemConditionPriority = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_action_item_trigger_params_incident_action_item_condition_priority( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_ACTION_ITEM_CONDITION_PRIORITY_VALUES: - return cast(ActionItemTriggerParamsIncidentActionItemConditionPriority, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_ACTION_ITEM_CONDITION_PRIORITY_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition_status.py b/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition_status.py index 07139772..a4e1d1f8 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition_status.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_action_item_condition_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentActionItemConditionStatus = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_action_item_trigger_params_incident_action_item_condition_status( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_ACTION_ITEM_CONDITION_STATUS_VALUES: - return cast(ActionItemTriggerParamsIncidentActionItemConditionStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_ACTION_ITEM_CONDITION_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_action_item_kinds_item.py b/rootly_sdk/models/action_item_trigger_params_incident_action_item_kinds_item.py index b7459dd8..6129df54 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_action_item_kinds_item.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_action_item_kinds_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentActionItemKindsItem = Literal["follow_up", "task"] @@ -16,7 +16,7 @@ def check_action_item_trigger_params_incident_action_item_kinds_item( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_ACTION_ITEM_KINDS_ITEM_VALUES: - return cast(ActionItemTriggerParamsIncidentActionItemKindsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_ACTION_ITEM_KINDS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_action_item_priorities_item.py b/rootly_sdk/models/action_item_trigger_params_incident_action_item_priorities_item.py index 29b00b6e..197e5b03 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_action_item_priorities_item.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_action_item_priorities_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentActionItemPrioritiesItem = Literal["high", "low", "medium"] @@ -17,7 +17,7 @@ def check_action_item_trigger_params_incident_action_item_priorities_item( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_ACTION_ITEM_PRIORITIES_ITEM_VALUES: - return cast(ActionItemTriggerParamsIncidentActionItemPrioritiesItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_ACTION_ITEM_PRIORITIES_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_action_item_statuses_item.py b/rootly_sdk/models/action_item_trigger_params_incident_action_item_statuses_item.py index 6fbf2950..f7a879ba 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_action_item_statuses_item.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_action_item_statuses_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentActionItemStatusesItem = Literal["cancelled", "done", "in_progress", "open"] @@ -18,7 +18,7 @@ def check_action_item_trigger_params_incident_action_item_statuses_item( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_ACTION_ITEM_STATUSES_ITEM_VALUES: - return cast(ActionItemTriggerParamsIncidentActionItemStatusesItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_ACTION_ITEM_STATUSES_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition.py b/rootly_sdk/models/action_item_trigger_params_incident_condition.py index c8a26fae..75ae6cbf 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentCondition = Literal["ALL", "ANY", "NONE"] @@ -15,7 +15,7 @@ def check_action_item_trigger_params_incident_condition( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_VALUES: - return cast(ActionItemTriggerParamsIncidentCondition, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_acknowledged_at.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_acknowledged_at.py index 2595f3d8..c59f2b6b 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition_acknowledged_at.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_acknowledged_at.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionAcknowledgedAt = Literal["SET", "UNSET"] @@ -16,7 +16,7 @@ def check_action_item_trigger_params_incident_condition_acknowledged_at( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_ACKNOWLEDGED_AT_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionAcknowledgedAt, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_ACKNOWLEDGED_AT_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_detected_at.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_detected_at.py index 28ddd119..184bb174 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition_detected_at.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_detected_at.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionDetectedAt = Literal["SET", "UNSET"] @@ -16,7 +16,7 @@ def check_action_item_trigger_params_incident_condition_detected_at( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_DETECTED_AT_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionDetectedAt, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_DETECTED_AT_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_environment.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_environment.py index a68b5705..9907865c 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition_environment.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_environment.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionEnvironment = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_action_item_trigger_params_incident_condition_environment( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_ENVIRONMENT_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionEnvironment, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_ENVIRONMENT_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_functionality.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_functionality.py index 63bda233..753ff663 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition_functionality.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_functionality.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionFunctionality = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_action_item_trigger_params_incident_condition_functionality( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_FUNCTIONALITY_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionFunctionality, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_FUNCTIONALITY_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_group.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_group.py index 98822693..149e2af3 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition_group.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_group.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionGroup = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_action_item_trigger_params_incident_condition_group( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_GROUP_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionGroup, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_GROUP_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_incident_roles.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_incident_roles.py index 841e1d9f..1d9e7579 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition_incident_roles.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_incident_roles.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionIncidentRoles = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_action_item_trigger_params_incident_condition_incident_roles( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_INCIDENT_ROLES_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionIncidentRoles, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_INCIDENT_ROLES_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_incident_type.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_incident_type.py index 4716737a..fe68dc33 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition_incident_type.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_incident_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionIncidentType = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_action_item_trigger_params_incident_condition_incident_type( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_INCIDENT_TYPE_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionIncidentType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_INCIDENT_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_kind.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_kind.py index c45ddce4..a334acf2 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition_kind.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionKind = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_action_item_trigger_params_incident_condition_kind( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_KIND_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_label.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_label.py index cfee44ca..dca3bb9d 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition_label.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_label.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionLabel = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_action_item_trigger_params_incident_condition_label( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_LABEL_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionLabel, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_LABEL_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_mitigated_at.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_mitigated_at.py index 2972d7af..803467a5 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition_mitigated_at.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_mitigated_at.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionMitigatedAt = Literal["SET", "UNSET"] @@ -16,7 +16,7 @@ def check_action_item_trigger_params_incident_condition_mitigated_at( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_MITIGATED_AT_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionMitigatedAt, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_MITIGATED_AT_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_resolved_at.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_resolved_at.py index 35990efc..af6362e0 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition_resolved_at.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_resolved_at.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionResolvedAt = Literal["SET", "UNSET"] @@ -16,7 +16,7 @@ def check_action_item_trigger_params_incident_condition_resolved_at( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_RESOLVED_AT_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionResolvedAt, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_RESOLVED_AT_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_scheduled_for.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_scheduled_for.py new file mode 100644 index 00000000..fb8e18c4 --- /dev/null +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_scheduled_for.py @@ -0,0 +1,22 @@ +from typing import Literal + +ActionItemTriggerParamsIncidentConditionScheduledFor = Literal["SET", "UNSET"] + +ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SCHEDULED_FOR_VALUES: set[ + ActionItemTriggerParamsIncidentConditionScheduledFor +] = { + "SET", + "UNSET", +} + + +def check_action_item_trigger_params_incident_condition_scheduled_for( + value: str | None, +) -> ActionItemTriggerParamsIncidentConditionScheduledFor | None: + if value is None: + return None + if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SCHEDULED_FOR_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SCHEDULED_FOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_scheduled_until.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_scheduled_until.py new file mode 100644 index 00000000..cd404a7c --- /dev/null +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_scheduled_until.py @@ -0,0 +1,22 @@ +from typing import Literal + +ActionItemTriggerParamsIncidentConditionScheduledUntil = Literal["SET", "UNSET"] + +ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SCHEDULED_UNTIL_VALUES: set[ + ActionItemTriggerParamsIncidentConditionScheduledUntil +] = { + "SET", + "UNSET", +} + + +def check_action_item_trigger_params_incident_condition_scheduled_until( + value: str | None, +) -> ActionItemTriggerParamsIncidentConditionScheduledUntil | None: + if value is None: + return None + if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SCHEDULED_UNTIL_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SCHEDULED_UNTIL_VALUES!r}" + ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_service.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_service.py index 6a8e6f36..ee224973 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition_service.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_service.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionService = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_action_item_trigger_params_incident_condition_service( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SERVICE_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionService, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SERVICE_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_severity.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_severity.py index 6cc7f448..b90646cd 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition_severity.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_severity.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionSeverity = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_action_item_trigger_params_incident_condition_severity( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SEVERITY_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionSeverity, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SEVERITY_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_started_at.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_started_at.py index 965e16e2..4db0963e 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition_started_at.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_started_at.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionStartedAt = Literal["SET", "UNSET"] @@ -16,7 +16,7 @@ def check_action_item_trigger_params_incident_condition_started_at( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_STARTED_AT_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionStartedAt, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_STARTED_AT_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_status.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_status.py index e683f429..bbb2b77a 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition_status.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionStatus = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_action_item_trigger_params_incident_condition_status( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_STATUS_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_sub_status.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_sub_status.py index 402e31c3..8b36aa15 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition_sub_status.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_sub_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionSubStatus = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_action_item_trigger_params_incident_condition_sub_status( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SUB_STATUS_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionSubStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SUB_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_summary.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_summary.py index fbde515f..930a4eb9 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition_summary.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_summary.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionSummary = Literal["SET", "UNSET"] @@ -14,7 +14,7 @@ def check_action_item_trigger_params_incident_condition_summary( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SUMMARY_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionSummary, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SUMMARY_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_condition_visibility.py b/rootly_sdk/models/action_item_trigger_params_incident_condition_visibility.py index 39be7fa6..bfb24b05 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_condition_visibility.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_condition_visibility.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionVisibility = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_action_item_trigger_params_incident_condition_visibility( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_VISIBILITY_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionVisibility, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITION_VISIBILITY_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_conditional_inactivity.py b/rootly_sdk/models/action_item_trigger_params_incident_conditional_inactivity.py index 82797de0..4fd72fb3 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_conditional_inactivity.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_conditional_inactivity.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentConditionalInactivity = Literal["IS"] @@ -15,7 +15,7 @@ def check_action_item_trigger_params_incident_conditional_inactivity( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITIONAL_INACTIVITY_VALUES: - return cast(ActionItemTriggerParamsIncidentConditionalInactivity, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_CONDITIONAL_INACTIVITY_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_kinds_item.py b/rootly_sdk/models/action_item_trigger_params_incident_kinds_item.py index 017b0575..dd0aecc4 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_kinds_item.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_kinds_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentKindsItem = Literal[ "backfilled", "example", "example_sub", "normal", "normal_sub", "scheduled", "scheduled_sub", "test", "test_sub" @@ -23,7 +23,7 @@ def check_action_item_trigger_params_incident_kinds_item( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_KINDS_ITEM_VALUES: - return cast(ActionItemTriggerParamsIncidentKindsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_KINDS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_incident_statuses_item.py b/rootly_sdk/models/action_item_trigger_params_incident_statuses_item.py index 088ff71d..d32c8a9f 100644 --- a/rootly_sdk/models/action_item_trigger_params_incident_statuses_item.py +++ b/rootly_sdk/models/action_item_trigger_params_incident_statuses_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsIncidentStatusesItem = Literal[ "acknowledged", @@ -35,7 +35,7 @@ def check_action_item_trigger_params_incident_statuses_item( if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_STATUSES_ITEM_VALUES: - return cast(ActionItemTriggerParamsIncidentStatusesItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_INCIDENT_STATUSES_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/action_item_trigger_params_trigger_type.py b/rootly_sdk/models/action_item_trigger_params_trigger_type.py index d7db5adb..a4680ffd 100644 --- a/rootly_sdk/models/action_item_trigger_params_trigger_type.py +++ b/rootly_sdk/models/action_item_trigger_params_trigger_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ActionItemTriggerParamsTriggerType = Literal["action_item"] @@ -11,5 +11,5 @@ def check_action_item_trigger_params_trigger_type(value: str | None) -> ActionIt if value is None: return None if value in ACTION_ITEM_TRIGGER_PARAMS_TRIGGER_TYPE_VALUES: - return cast(ActionItemTriggerParamsTriggerType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ACTION_ITEM_TRIGGER_PARAMS_TRIGGER_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/add_action_item_task_params.py b/rootly_sdk/models/add_action_item_task_params.py index ce3f369c..285b47a0 100644 --- a/rootly_sdk/models/add_action_item_task_params.py +++ b/rootly_sdk/models/add_action_item_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -39,37 +41,36 @@ class AddActionItemTaskParams: priority (AddActionItemTaskParamsPriority): The action item priority summary (str): The action item summary status (AddActionItemTaskParamsStatus): The action item status - 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 + 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 valid JSON - post_to_slack_channels (Union[Unset, list['AddActionItemTaskParamsPostToSlackChannelsItem']]): + post_to_slack_channels (list[AddActionItemTaskParamsPostToSlackChannelsItem] | Unset): """ priority: AddActionItemTaskParamsPriority summary: str status: AddActionItemTaskParamsStatus - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -79,15 +80,15 @@ def to_dict(self) -> dict[str, Any]: status: str = self.status - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - attribute_to_query_by: Unset | str = UNSET + attribute_to_query_by: str | Unset = UNSET if not isinstance(self.attribute_to_query_by, Unset): attribute_to_query_by = self.attribute_to_query_by - query_value: None | Unset | str + query_value: None | str | Unset if isinstance(self.query_value, Unset): query_value = UNSET else: @@ -97,7 +98,7 @@ def to_dict(self) -> dict[str, Any]: assigned_to_user_id = self.assigned_to_user_id - assigned_to_user: Unset | dict[str, Any] = UNSET + assigned_to_user: dict[str, Any] | Unset = UNSET if not isinstance(self.assigned_to_user, Unset): assigned_to_user = self.assigned_to_user.to_dict() @@ -107,13 +108,13 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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: @@ -169,25 +170,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: Unset | AddActionItemTaskParamsTaskType + task_type: AddActionItemTaskParamsTaskType | Unset 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: Unset | AddActionItemTaskParamsAttributeToQueryBy + attribute_to_query_by: AddActionItemTaskParamsAttributeToQueryBy | Unset 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 | Unset | str: + def _parse_query_value(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) query_value = _parse_query_value(d.pop("query_value", UNSET)) @@ -196,7 +197,7 @@ def _parse_query_value(data: object) -> None | Unset | str: assigned_to_user_id = d.pop("assigned_to_user_id", UNSET) _assigned_to_user = d.pop("assigned_to_user", UNSET) - assigned_to_user: Unset | AddActionItemTaskParamsAssignedToUser + assigned_to_user: AddActionItemTaskParamsAssignedToUser | Unset if isinstance(_assigned_to_user, Unset): assigned_to_user = UNSET else: @@ -208,23 +209,25 @@ def _parse_query_value(data: object) -> None | Unset | str: post_to_incident_timeline = d.pop("post_to_incident_timeline", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) - 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: 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 + ) - 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 972a5720..8d65de98 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class AddActionItemTaskParamsAssignedToUser: """The user this action item is assigned to Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_attribute_to_query_by.py b/rootly_sdk/models/add_action_item_task_params_attribute_to_query_by.py index 07884b76..d3689253 100644 --- a/rootly_sdk/models/add_action_item_task_params_attribute_to_query_by.py +++ b/rootly_sdk/models/add_action_item_task_params_attribute_to_query_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AddActionItemTaskParamsAttributeToQueryBy = Literal["jira_issue_id"] @@ -13,7 +13,7 @@ def check_add_action_item_task_params_attribute_to_query_by( if value is None: return None if value in ADD_ACTION_ITEM_TASK_PARAMS_ATTRIBUTE_TO_QUERY_BY_VALUES: - return cast(AddActionItemTaskParamsAttributeToQueryBy, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ADD_ACTION_ITEM_TASK_PARAMS_ATTRIBUTE_TO_QUERY_BY_VALUES!r}" ) 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 0c500319..2f32e287 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class AddActionItemTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_priority.py b/rootly_sdk/models/add_action_item_task_params_priority.py index b992e106..77484905 100644 --- a/rootly_sdk/models/add_action_item_task_params_priority.py +++ b/rootly_sdk/models/add_action_item_task_params_priority.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AddActionItemTaskParamsPriority = Literal["high", "low", "medium"] @@ -13,5 +13,5 @@ def check_add_action_item_task_params_priority(value: str | None) -> AddActionIt if value is None: return None if value in ADD_ACTION_ITEM_TASK_PARAMS_PRIORITY_VALUES: - return cast(AddActionItemTaskParamsPriority, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ADD_ACTION_ITEM_TASK_PARAMS_PRIORITY_VALUES!r}") diff --git a/rootly_sdk/models/add_action_item_task_params_status.py b/rootly_sdk/models/add_action_item_task_params_status.py index 91cb18d6..5bfc7529 100644 --- a/rootly_sdk/models/add_action_item_task_params_status.py +++ b/rootly_sdk/models/add_action_item_task_params_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AddActionItemTaskParamsStatus = Literal["cancelled", "done", "in_progress", "open"] @@ -14,5 +14,5 @@ def check_add_action_item_task_params_status(value: str | None) -> AddActionItem if value is None: return None if value in ADD_ACTION_ITEM_TASK_PARAMS_STATUS_VALUES: - return cast(AddActionItemTaskParamsStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ADD_ACTION_ITEM_TASK_PARAMS_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/add_action_item_task_params_task_type.py b/rootly_sdk/models/add_action_item_task_params_task_type.py index 69a10947..316cfab5 100644 --- a/rootly_sdk/models/add_action_item_task_params_task_type.py +++ b/rootly_sdk/models/add_action_item_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AddActionItemTaskParamsTaskType = Literal["add_action_item"] @@ -11,5 +11,5 @@ def check_add_action_item_task_params_task_type(value: str | None) -> AddActionI if value is None: return None if value in ADD_ACTION_ITEM_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(AddActionItemTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ADD_ACTION_ITEM_TASK_PARAMS_TASK_TYPE_VALUES!r}") 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 ae7c5c7b..393233e1 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,13 +26,13 @@ class AddMicrosoftTeamsChatTabTaskParams: chat (AddMicrosoftTeamsChatTabTaskParamsChat): title (str): The tab title link (str): The tab link - task_type (Union[Unset, AddMicrosoftTeamsChatTabTaskParamsTaskType]): + task_type (AddMicrosoftTeamsChatTabTaskParamsTaskType | Unset): """ - chat: "AddMicrosoftTeamsChatTabTaskParamsChat" + chat: AddMicrosoftTeamsChatTabTaskParamsChat title: str link: str - task_type: Unset | AddMicrosoftTeamsChatTabTaskParamsTaskType = UNSET + task_type: AddMicrosoftTeamsChatTabTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: link = self.link - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,7 +72,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: Unset | AddMicrosoftTeamsChatTabTaskParamsTaskType + task_type: AddMicrosoftTeamsChatTabTaskParamsTaskType | Unset 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 2d33f9ef..8d82e503 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class AddMicrosoftTeamsChatTabTaskParamsChat: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params_task_type.py index 344f4682..b1289e99 100644 --- a/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params_task_type.py +++ b/rootly_sdk/models/add_microsoft_teams_chat_tab_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AddMicrosoftTeamsChatTabTaskParamsTaskType = Literal["add_microsoft_teams_chat_tab"] @@ -13,7 +13,7 @@ def check_add_microsoft_teams_chat_tab_task_params_task_type( if value is None: return None if value in ADD_MICROSOFT_TEAMS_CHAT_TAB_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(AddMicrosoftTeamsChatTabTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ADD_MICROSOFT_TEAMS_CHAT_TAB_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 f7b9192a..b641221f 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,3 +1,5 @@ +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 d8eb83a4..d3997e1b 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,3 +1,5 @@ +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 85e68e5a..886d7027 100644 --- a/rootly_sdk/models/add_role_task_params.py +++ b/rootly_sdk/models/add_role_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,28 +21,28 @@ class AddRoleTaskParams: """ Attributes: incident_role_id (str): The role id to add to the incident - 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 + 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 """ incident_role_id: str - task_type: Unset | AddRoleTaskParamsTaskType = UNSET - assigned_to_user_id: Unset | str = UNSET - assigned_to_user: Union[Unset, "AddRoleTaskParamsAssignedToUser"] = UNSET + task_type: AddRoleTaskParamsTaskType | Unset = UNSET + assigned_to_user_id: str | Unset = UNSET + assigned_to_user: AddRoleTaskParamsAssignedToUser | 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: Unset | str = UNSET + task_type: str | Unset = 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: Unset | dict[str, Any] = UNSET + assigned_to_user: dict[str, Any] | Unset = UNSET if not isinstance(self.assigned_to_user, Unset): assigned_to_user = self.assigned_to_user.to_dict() @@ -68,7 +70,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: Unset | AddRoleTaskParamsTaskType + task_type: AddRoleTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -77,7 +79,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: Unset | AddRoleTaskParamsAssignedToUser + assigned_to_user: AddRoleTaskParamsAssignedToUser | Unset 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 8e99caa9..2c165799 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class AddRoleTaskParamsAssignedToUser: """The user this role is assigned to Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_role_task_params_task_type.py b/rootly_sdk/models/add_role_task_params_task_type.py index 7f129d9a..0f6284e0 100644 --- a/rootly_sdk/models/add_role_task_params_task_type.py +++ b/rootly_sdk/models/add_role_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AddRoleTaskParamsTaskType = Literal["add_role"] @@ -11,5 +11,5 @@ def check_add_role_task_params_task_type(value: str | None) -> AddRoleTaskParams if value is None: return None if value in ADD_ROLE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(AddRoleTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ADD_ROLE_TASK_PARAMS_TASK_TYPE_VALUES!r}") 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 0f43cd35..e256010f 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,3 +1,5 @@ +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 17fb508b..051110dd 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,3 +1,5 @@ +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 8c8f6c2d..ff0c4c11 100644 --- a/rootly_sdk/models/add_subscribers.py +++ b/rootly_sdk/models/add_subscribers.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.add_subscribers_data import AddSubscribersData @@ -18,14 +19,13 @@ class AddSubscribers: data (AddSubscribersData): """ - data: "AddSubscribersData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: AddSubscribersData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - add_subscribers.additional_properties = d return add_subscribers - - @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/add_subscribers_data.py b/rootly_sdk/models/add_subscribers_data.py index e3a5017b..dd9d95d6 100644 --- a/rootly_sdk/models/add_subscribers_data.py +++ b/rootly_sdk/models/add_subscribers_data.py @@ -1,8 +1,9 @@ +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.add_subscribers_data_type import AddSubscribersDataType, check_add_subscribers_data_type @@ -22,8 +23,7 @@ class AddSubscribersData: """ type_: AddSubscribersDataType - attributes: "AddSubscribersDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: AddSubscribersDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - add_subscribers_data.additional_properties = d return add_subscribers_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/add_subscribers_data_attributes.py b/rootly_sdk/models/add_subscribers_data_attributes.py index b3543b07..7f819592 100644 --- a/rootly_sdk/models/add_subscribers_data_attributes.py +++ b/rootly_sdk/models/add_subscribers_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,16 +14,16 @@ class AddSubscribersDataAttributes: """ Attributes: - 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): 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: None | Unset | list[str] = UNSET - remove_users_with_no_private_incident_access: None | Unset | bool = False + user_ids: list[str] | None | Unset = UNSET + remove_users_with_no_private_incident_access: bool | None | Unset = False def to_dict(self) -> dict[str, Any]: - user_ids: None | Unset | list[str] + user_ids: list[str] | None | Unset if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -30,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - remove_users_with_no_private_incident_access: None | Unset | bool + remove_users_with_no_private_incident_access: bool | None | Unset if isinstance(self.remove_users_with_no_private_incident_access, Unset): remove_users_with_no_private_incident_access = UNSET else: @@ -50,7 +52,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) -> None | Unset | list[str]: + def _parse_user_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -61,18 +63,18 @@ def _parse_user_ids(data: object) -> None | Unset | list[str]: user_ids_type_0 = cast(list[str], data) return user_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_remove_users_with_no_private_incident_access(data: object) -> None | Unset | bool: + def _parse_remove_users_with_no_private_incident_access(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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_subscribers_data_type.py b/rootly_sdk/models/add_subscribers_data_type.py index 700ea1cc..d3c844c5 100644 --- a/rootly_sdk/models/add_subscribers_data_type.py +++ b/rootly_sdk/models/add_subscribers_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AddSubscribersDataType = Literal["incidents"] @@ -11,5 +11,5 @@ def check_add_subscribers_data_type(value: str | None) -> AddSubscribersDataType if value is None: return None if value in ADD_SUBSCRIBERS_DATA_TYPE_VALUES: - return cast(AddSubscribersDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ADD_SUBSCRIBERS_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/add_team_task_params.py b/rootly_sdk/models/add_team_task_params.py index f1847b9a..20b40bd2 100644 --- a/rootly_sdk/models/add_team_task_params.py +++ b/rootly_sdk/models/add_team_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -15,17 +17,17 @@ class AddTeamTaskParams: """ Attributes: group_id (str): The team id - task_type (Union[Unset, AddTeamTaskParamsTaskType]): + task_type (AddTeamTaskParamsTaskType | Unset): """ group_id: str - task_type: Unset | AddTeamTaskParamsTaskType = UNSET + task_type: AddTeamTaskParamsTaskType | Unset = 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -47,7 +49,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: Unset | AddTeamTaskParamsTaskType + task_type: AddTeamTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/add_team_task_params_task_type.py b/rootly_sdk/models/add_team_task_params_task_type.py index b9dd478d..d66838bd 100644 --- a/rootly_sdk/models/add_team_task_params_task_type.py +++ b/rootly_sdk/models/add_team_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AddTeamTaskParamsTaskType = Literal["add_team"] @@ -11,5 +11,5 @@ def check_add_team_task_params_task_type(value: str | None) -> AddTeamTaskParams if value is None: return None if value in ADD_TEAM_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(AddTeamTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ADD_TEAM_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/add_to_timeline_task_params.py b/rootly_sdk/models/add_to_timeline_task_params.py index d30f8943..200ae000 100644 --- a/rootly_sdk/models/add_to_timeline_task_params.py +++ b/rootly_sdk/models/add_to_timeline_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,27 +26,27 @@ class AddToTimelineTaskParams: """ Attributes: event (str): The timeline event description - task_type (Union[Unset, AddToTimelineTaskParamsTaskType]): - url (Union[Unset, str]): A URL for the timeline event - post_to_slack_channels (Union[Unset, list['AddToTimelineTaskParamsPostToSlackChannelsItem']]): + task_type (AddToTimelineTaskParamsTaskType | Unset): + url (str | Unset): A URL for the timeline event + post_to_slack_channels (list[AddToTimelineTaskParamsPostToSlackChannelsItem] | Unset): """ event: str - task_type: Unset | AddToTimelineTaskParamsTaskType = UNSET - url: Unset | str = UNSET - post_to_slack_channels: Unset | list["AddToTimelineTaskParamsPostToSlackChannelsItem"] = UNSET + task_type: AddToTimelineTaskParamsTaskType | Unset = UNSET + url: str | Unset = UNSET + post_to_slack_channels: list[AddToTimelineTaskParamsPostToSlackChannelsItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: event = self.event - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type url = self.url - post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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: @@ -77,7 +79,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: Unset | AddToTimelineTaskParamsTaskType + task_type: AddToTimelineTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -85,14 +87,16 @@ 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) - 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: 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 + ) - 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 bd3ec020..a0238cd6 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class AddToTimelineTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_to_timeline_task_params_task_type.py b/rootly_sdk/models/add_to_timeline_task_params_task_type.py index e22394f2..23cdac31 100644 --- a/rootly_sdk/models/add_to_timeline_task_params_task_type.py +++ b/rootly_sdk/models/add_to_timeline_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AddToTimelineTaskParamsTaskType = Literal["add_to_timeline"] @@ -11,5 +11,5 @@ def check_add_to_timeline_task_params_task_type(value: str | None) -> AddToTimel if value is None: return None if value in ADD_TO_TIMELINE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(AddToTimelineTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ADD_TO_TIMELINE_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/ai_chat_response.py b/rootly_sdk/models/ai_chat_response.py index f2b4be4e..b263ac4e 100644 --- a/rootly_sdk/models/ai_chat_response.py +++ b/rootly_sdk/models/ai_chat_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class AiChatResponse: """ Attributes: data (AiChatResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "AiChatResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: AiChatResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 5b4dbe46..c4b27e32 100644 --- a/rootly_sdk/models/ai_chat_response_data.py +++ b/rootly_sdk/models/ai_chat_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -25,7 +27,7 @@ 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]: diff --git a/rootly_sdk/models/ai_chat_response_data_attributes.py b/rootly_sdk/models/ai_chat_response_data_attributes.py index 7c79d03d..67c0577f 100644 --- a/rootly_sdk/models/ai_chat_response_data_attributes.py +++ b/rootly_sdk/models/ai_chat_response_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast from uuid import UUID @@ -19,25 +21,25 @@ class AiChatResponseDataAttributes: """ Attributes: session_id (UUID): AI chat session UUID - reply (Union[None, Unset, str]): Assistant reply text - status (Union[Unset, AiChatResponseDataAttributesStatus]): Response status (present when user input is required) + reply (None | str | Unset): Assistant reply text + status (AiChatResponseDataAttributesStatus | Unset): Response status (present when user input is required) """ session_id: UUID - reply: None | Unset | str = UNSET - status: Unset | AiChatResponseDataAttributesStatus = UNSET + reply: None | str | Unset = UNSET + status: AiChatResponseDataAttributesStatus | Unset = 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 | Unset | str + reply: None | str | Unset if isinstance(self.reply, Unset): reply = UNSET else: reply = self.reply - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status @@ -60,17 +62,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 | Unset | str: + def _parse_reply(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) reply = _parse_reply(d.pop("reply", UNSET)) _status = d.pop("status", UNSET) - status: Unset | AiChatResponseDataAttributesStatus + status: AiChatResponseDataAttributesStatus | Unset if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/ai_chat_response_data_attributes_status.py b/rootly_sdk/models/ai_chat_response_data_attributes_status.py index 5dbfeaac..6f48ec61 100644 --- a/rootly_sdk/models/ai_chat_response_data_attributes_status.py +++ b/rootly_sdk/models/ai_chat_response_data_attributes_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AiChatResponseDataAttributesStatus = Literal["user_input_required"] @@ -11,5 +11,5 @@ def check_ai_chat_response_data_attributes_status(value: str | None) -> AiChatRe if value is None: return None if value in AI_CHAT_RESPONSE_DATA_ATTRIBUTES_STATUS_VALUES: - return cast(AiChatResponseDataAttributesStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {AI_CHAT_RESPONSE_DATA_ATTRIBUTES_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/ai_chat_response_data_type.py b/rootly_sdk/models/ai_chat_response_data_type.py index ac9c7a26..d642eece 100644 --- a/rootly_sdk/models/ai_chat_response_data_type.py +++ b/rootly_sdk/models/ai_chat_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AiChatResponseDataType = Literal["ai_chat_responses"] @@ -11,5 +11,5 @@ def check_ai_chat_response_data_type(value: str | None) -> AiChatResponseDataTyp if value is None: return None if value in AI_CHAT_RESPONSE_DATA_TYPE_VALUES: - return cast(AiChatResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {AI_CHAT_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/ai_chat_session_message.py b/rootly_sdk/models/ai_chat_session_message.py index 710a10ad..d0d97056 100644 --- a/rootly_sdk/models/ai_chat_session_message.py +++ b/rootly_sdk/models/ai_chat_session_message.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar @@ -5,7 +7,6 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from dateutil.parser import isoparse from ..models.ai_chat_session_message_role import AiChatSessionMessageRole, check_ai_chat_session_message_role @@ -59,7 +60,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content") - created_at = isoparse(d.pop("created_at")) + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) ai_chat_session_message = cls( id=id, diff --git a/rootly_sdk/models/ai_chat_session_message_list.py b/rootly_sdk/models/ai_chat_session_message_list.py index 30301e4a..73007389 100644 --- a/rootly_sdk/models/ai_chat_session_message_list.py +++ b/rootly_sdk/models/ai_chat_session_message_list.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,12 +20,12 @@ class AiChatSessionMessageList: """ Attributes: - messages (list['AiChatSessionMessage']): - meta (Union[Unset, AiChatSessionMessageListMeta]): + messages (list[AiChatSessionMessage]): + meta (AiChatSessionMessageListMeta | Unset): """ - messages: list["AiChatSessionMessage"] - meta: Union[Unset, "AiChatSessionMessageListMeta"] = UNSET + messages: list[AiChatSessionMessage] + meta: AiChatSessionMessageListMeta | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: messages_item = messages_item_data.to_dict() messages.append(messages_item) - meta: Unset | dict[str, Any] = UNSET + meta: dict[str, Any] | Unset = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() @@ -62,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: messages.append(messages_item) _meta = d.pop("meta", UNSET) - meta: Unset | AiChatSessionMessageListMeta + meta: AiChatSessionMessageListMeta | Unset 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 c338c5d4..6d3a6dd3 100644 --- a/rootly_sdk/models/ai_chat_session_message_list_meta.py +++ b/rootly_sdk/models/ai_chat_session_message_list_meta.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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/ai_chat_session_message_role.py b/rootly_sdk/models/ai_chat_session_message_role.py index 1010ea80..c767e702 100644 --- a/rootly_sdk/models/ai_chat_session_message_role.py +++ b/rootly_sdk/models/ai_chat_session_message_role.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AiChatSessionMessageRole = Literal["assistant", "user"] @@ -12,5 +12,5 @@ def check_ai_chat_session_message_role(value: str | None) -> AiChatSessionMessag if value is None: return None if value in AI_CHAT_SESSION_MESSAGE_ROLE_VALUES: - return cast(AiChatSessionMessageRole, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {AI_CHAT_SESSION_MESSAGE_ROLE_VALUES!r}") diff --git a/rootly_sdk/models/alert.py b/rootly_sdk/models/alert.py index c4303e8e..d2b5950a 100644 --- a/rootly_sdk/models/alert.py +++ b/rootly_sdk/models/alert.py @@ -1,10 +1,11 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field -from dateutil.parser import isoparse from ..models.alert_noise import AlertNoise, check_alert_noise from ..models.alert_notification_target_type import AlertNotificationTargetType, check_alert_notification_target_type @@ -16,6 +17,7 @@ from ..models.alert_alerting_targets_type_0_item import AlertAlertingTargetsType0Item from ..models.alert_data_type_0 import AlertDataType0 from ..models.alert_labels_item_type_0 import AlertLabelsItemType0 + from ..models.alert_slack_notifications_type_0_item import AlertSlackNotificationsType0Item from ..models.alert_urgency import AlertUrgency from ..models.environment import Environment from ..models.functionality import Functionality @@ -37,46 +39,53 @@ class Alert: summary (str): The summary of the alert created_at (str): Date of creation updated_at (str): Date of last update - 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 + 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 requested. - 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 + alerting_targets (list[AlertAlertingTargetsType0Item] | None | Unset): Alerting targets associated with the + alert. Only present when advanced routing is enabled for the team. + slack_notifications (list[AlertSlackNotificationsType0Item] | None | Unset): Slack channel and root thread ts of + each announcement Rootly posted for the alert. Only present when the alert-slack-message-references feature flag + 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 + acknowledged_at (datetime.datetime | None | Unset): When the alert was first acknowledged. Null if it has never + been acknowledged. An alert that is retriggered and acknowledged again keeps its original acknowledgement + timestamp. + resolved_at (datetime.datetime | None | Unset): When the alert was first resolved. Null if it has never been + resolved. Like `acknowledged_at`, an alert that is retriggered and resolved again keeps its original resolution + timestamp; use `ended_at` for the current resolution state. """ short_id: str @@ -84,35 +93,38 @@ class Alert: summary: str created_at: str updated_at: str - 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 + 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 + slack_notifications: list[AlertSlackNotificationsType0Item] | None | Unset = UNSET + url: str | Unset = UNSET + started_at: datetime.datetime | None | Unset = UNSET + ended_at: datetime.datetime | None | Unset = UNSET + acknowledged_at: datetime.datetime | None | Unset = UNSET + resolved_at: datetime.datetime | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -129,49 +141,49 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - noise: Unset | str = UNSET + noise: str | Unset = UNSET if not isinstance(self.noise, Unset): noise = self.noise - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - services: Unset | list[dict[str, Any]] = UNSET + services: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + groups: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + functionalities: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + environments: list[dict[str, Any]] | Unset = 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: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -180,7 +192,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - group_ids: None | Unset | list[str] + group_ids: list[str] | None | Unset if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -189,7 +201,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - functionality_ids: None | Unset | list[str] + functionality_ids: list[str] | None | Unset if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -198,7 +210,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - environment_ids: None | Unset | list[str] + environment_ids: list[str] | None | Unset if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -207,52 +219,52 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - external_url: None | Unset | str + external_url: None | str | Unset if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - alert_urgency_id: None | Unset | str + alert_urgency_id: None | str | Unset if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - alert_urgency: Unset | dict[str, Any] = UNSET + alert_urgency: dict[str, Any] | Unset = UNSET if not isinstance(self.alert_urgency, Unset): alert_urgency = self.alert_urgency.to_dict() - group_leader_alert_id: None | Unset | str + group_leader_alert_id: None | str | Unset 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: None | Unset | bool + is_group_leader_alert: bool | None | Unset if isinstance(self.is_group_leader_alert, Unset): is_group_leader_alert = UNSET else: is_group_leader_alert = self.is_group_leader_alert - labels: Unset | list[None | dict[str, Any]] = UNSET + labels: list[dict[str, Any] | None] | Unset = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: None | dict[str, Any] + labels_item: dict[str, Any] | None if isinstance(labels_item_data, AlertLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - data: None | Unset | dict[str, Any] + data: dict[str, Any] | None | Unset if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, AlertDataType0): @@ -260,23 +272,23 @@ def to_dict(self) -> dict[str, Any]: else: data = self.data - notification_target_type: Unset | str = UNSET + notification_target_type: str | Unset = UNSET if not isinstance(self.notification_target_type, Unset): notification_target_type = self.notification_target_type - notification_target_id: None | Unset | str + notification_target_id: None | str | Unset if isinstance(self.notification_target_id, Unset): notification_target_id = UNSET else: notification_target_id = self.notification_target_id - deduplication_key: None | Unset | str + deduplication_key: None | str | Unset if isinstance(self.deduplication_key, Unset): deduplication_key = UNSET else: deduplication_key = self.deduplication_key - alert_field_values: None | Unset | list[dict[str, Any]] + alert_field_values: list[dict[str, Any]] | None | Unset if isinstance(self.alert_field_values, Unset): alert_field_values = UNSET elif isinstance(self.alert_field_values, list): @@ -288,7 +300,7 @@ def to_dict(self) -> dict[str, Any]: else: alert_field_values = self.alert_field_values - responders: None | Unset | list[dict[str, Any]] + responders: list[dict[str, Any]] | None | Unset if isinstance(self.responders, Unset): responders = UNSET elif isinstance(self.responders, list): @@ -300,7 +312,7 @@ def to_dict(self) -> dict[str, Any]: else: responders = self.responders - notified_users: None | Unset | list[dict[str, Any]] + notified_users: list[dict[str, Any]] | None | Unset if isinstance(self.notified_users, Unset): notified_users = UNSET elif isinstance(self.notified_users, list): @@ -312,7 +324,7 @@ def to_dict(self) -> dict[str, Any]: else: notified_users = self.notified_users - alerting_targets: None | Unset | list[dict[str, Any]] + alerting_targets: list[dict[str, Any]] | None | Unset if isinstance(self.alerting_targets, Unset): alerting_targets = UNSET elif isinstance(self.alerting_targets, list): @@ -324,9 +336,21 @@ def to_dict(self) -> dict[str, Any]: else: alerting_targets = self.alerting_targets + slack_notifications: list[dict[str, Any]] | None | Unset + if isinstance(self.slack_notifications, Unset): + slack_notifications = UNSET + elif isinstance(self.slack_notifications, list): + slack_notifications = [] + for slack_notifications_type_0_item_data in self.slack_notifications: + slack_notifications_type_0_item = slack_notifications_type_0_item_data.to_dict() + slack_notifications.append(slack_notifications_type_0_item) + + else: + slack_notifications = self.slack_notifications + url = self.url - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -334,7 +358,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | Unset | str + ended_at: None | str | Unset if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -342,6 +366,22 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at + acknowledged_at: None | str | Unset + if isinstance(self.acknowledged_at, Unset): + acknowledged_at = UNSET + elif isinstance(self.acknowledged_at, datetime.datetime): + acknowledged_at = self.acknowledged_at.isoformat() + else: + acknowledged_at = self.acknowledged_at + + resolved_at: None | str | Unset + if isinstance(self.resolved_at, Unset): + resolved_at = UNSET + elif isinstance(self.resolved_at, datetime.datetime): + resolved_at = self.resolved_at.isoformat() + else: + resolved_at = self.resolved_at + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -405,12 +445,18 @@ def to_dict(self) -> dict[str, Any]: field_dict["notified_users"] = notified_users if alerting_targets is not UNSET: field_dict["alerting_targets"] = alerting_targets + if slack_notifications is not UNSET: + field_dict["slack_notifications"] = slack_notifications if url is not UNSET: field_dict["url"] = url if started_at is not UNSET: field_dict["started_at"] = started_at if ended_at is not UNSET: field_dict["ended_at"] = ended_at + if acknowledged_at is not UNSET: + field_dict["acknowledged_at"] = acknowledged_at + if resolved_at is not UNSET: + field_dict["resolved_at"] = resolved_at return field_dict @@ -420,6 +466,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.alert_alerting_targets_type_0_item import AlertAlertingTargetsType0Item from ..models.alert_data_type_0 import AlertDataType0 from ..models.alert_labels_item_type_0 import AlertLabelsItemType0 + from ..models.alert_slack_notifications_type_0_item import AlertSlackNotificationsType0Item from ..models.alert_urgency import AlertUrgency from ..models.environment import Environment from ..models.functionality import Functionality @@ -440,57 +487,65 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") _noise = d.pop("noise", UNSET) - noise: Unset | AlertNoise + noise: AlertNoise | Unset if isinstance(_noise, Unset): noise = UNSET else: noise = check_alert_noise(_noise) _status = d.pop("status", UNSET) - status: Unset | AlertStatus + status: AlertStatus | Unset if isinstance(_status, Unset): status = UNSET else: status = check_alert_status(_status) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - services = [] _services = d.pop("services", UNSET) - for services_item_data in _services or []: - services_item = Service.from_dict(services_item_data) + 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) - services.append(services_item) + services.append(services_item) - groups = [] _groups = d.pop("groups", UNSET) - for groups_item_data in _groups or []: - groups_item = Team.from_dict(groups_item_data) + 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) - groups.append(groups_item) + groups.append(groups_item) - functionalities = [] _functionalities = d.pop("functionalities", UNSET) - for functionalities_item_data in _functionalities or []: - functionalities_item = Functionality.from_dict(functionalities_item_data) + 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) - functionalities.append(functionalities_item) + functionalities.append(functionalities_item) - environments = [] _environments = d.pop("environments", UNSET) - for environments_item_data in _environments or []: - environments_item = Environment.from_dict(environments_item_data) + 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) - environments.append(environments_item) + environments.append(environments_item) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -501,13 +556,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_group_ids(data: object) -> None | Unset | list[str]: + def _parse_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -518,13 +573,13 @@ def _parse_group_ids(data: object) -> None | Unset | list[str]: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_functionality_ids(data: object) -> None | Unset | list[str]: + def _parse_functionality_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -535,13 +590,13 @@ def _parse_functionality_ids(data: object) -> None | Unset | list[str]: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_environment_ids(data: object) -> None | Unset | list[str]: + def _parse_environment_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -552,86 +607,88 @@ def _parse_environment_ids(data: object) -> None | Unset | list[str]: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_external_url(data: object) -> None | Unset | str: + def _parse_external_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | Unset | str: + def _parse_alert_urgency_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) _alert_urgency = d.pop("alert_urgency", UNSET) - alert_urgency: Unset | AlertUrgency + alert_urgency: AlertUrgency | Unset 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 | Unset | str: + def _parse_group_leader_alert_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) -> None | Unset | bool: + def _parse_is_group_leader_alert(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) is_group_leader_alert = _parse_is_group_leader_alert(d.pop("is_group_leader_alert", UNSET)) - labels = [] _labels = d.pop("labels", UNSET) - for labels_item_data in _labels or []: + labels: list[AlertLabelsItemType0 | None] | Unset = UNSET + if _labels is not UNSET: + labels = [] + for labels_item_data in _labels: - 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) + 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) - return labels_item_type_0 - except: # noqa: E722 - pass - return cast(Union["AlertLabelsItemType0", None], data) + return labels_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(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) -> Union["AlertDataType0", None, Unset]: + def _parse_data(data: object) -> AlertDataType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -642,38 +699,38 @@ def _parse_data(data: object) -> Union["AlertDataType0", None, Unset]: data_type_0 = AlertDataType0.from_dict(data) return data_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["AlertDataType0", None, Unset], data) + return cast(AlertDataType0 | None | Unset, data) data = _parse_data(d.pop("data", UNSET)) _notification_target_type = d.pop("notification_target_type", UNSET) - notification_target_type: Unset | AlertNotificationTargetType + notification_target_type: AlertNotificationTargetType | Unset 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 | Unset | str: + def _parse_notification_target_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) notification_target_id = _parse_notification_target_id(d.pop("notification_target_id", UNSET)) - def _parse_deduplication_key(data: object) -> None | Unset | str: + def _parse_deduplication_key(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) deduplication_key = _parse_deduplication_key(d.pop("deduplication_key", UNSET)) - def _parse_alert_field_values(data: object) -> None | Unset | list["AlertAlertFieldValuesType0Item"]: + def _parse_alert_field_values(data: object) -> list[AlertAlertFieldValuesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -691,13 +748,13 @@ def _parse_alert_field_values(data: object) -> None | Unset | list["AlertAlertFi alert_field_values_type_0.append(alert_field_values_type_0_item) return alert_field_values_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["AlertAlertFieldValuesType0Item"], data) + return cast(list[AlertAlertFieldValuesType0Item] | None | Unset, data) alert_field_values = _parse_alert_field_values(d.pop("alert_field_values", UNSET)) - def _parse_responders(data: object) -> None | Unset | list["UserFlatResponse"]: + def _parse_responders(data: object) -> list[UserFlatResponse] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -713,13 +770,13 @@ def _parse_responders(data: object) -> None | Unset | list["UserFlatResponse"]: responders_type_0.append(responders_type_0_item) return responders_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["UserFlatResponse"], data) + return cast(list[UserFlatResponse] | None | Unset, data) responders = _parse_responders(d.pop("responders", UNSET)) - def _parse_notified_users(data: object) -> None | Unset | list["User"]: + def _parse_notified_users(data: object) -> list[User] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -735,13 +792,13 @@ def _parse_notified_users(data: object) -> None | Unset | list["User"]: notified_users_type_0.append(notified_users_type_0_item) return notified_users_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["User"], data) + return cast(list[User] | None | Unset, data) notified_users = _parse_notified_users(d.pop("notified_users", UNSET)) - def _parse_alerting_targets(data: object) -> None | Unset | list["AlertAlertingTargetsType0Item"]: + def _parse_alerting_targets(data: object) -> list[AlertAlertingTargetsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -759,15 +816,39 @@ def _parse_alerting_targets(data: object) -> None | Unset | list["AlertAlertingT alerting_targets_type_0.append(alerting_targets_type_0_item) return alerting_targets_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["AlertAlertingTargetsType0Item"], data) + return cast(list[AlertAlertingTargetsType0Item] | None | Unset, data) alerting_targets = _parse_alerting_targets(d.pop("alerting_targets", UNSET)) + def _parse_slack_notifications(data: object) -> list[AlertSlackNotificationsType0Item] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + slack_notifications_type_0 = [] + _slack_notifications_type_0 = data + for slack_notifications_type_0_item_data in _slack_notifications_type_0: + slack_notifications_type_0_item = AlertSlackNotificationsType0Item.from_dict( + slack_notifications_type_0_item_data + ) + + slack_notifications_type_0.append(slack_notifications_type_0_item) + + return slack_notifications_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[AlertSlackNotificationsType0Item] | None | Unset, data) + + slack_notifications = _parse_slack_notifications(d.pop("slack_notifications", UNSET)) + url = d.pop("url", UNSET) - def _parse_started_at(data: object) -> None | Unset | datetime.datetime: + def _parse_started_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -775,16 +856,16 @@ def _parse_started_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - started_at_type_0 = isoparse(data) + started_at_type_0 = datetime.datetime.fromisoformat(data) return started_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: + def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -792,15 +873,49 @@ def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - ended_at_type_0 = isoparse(data) + ended_at_type_0 = datetime.datetime.fromisoformat(data) return ended_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) + def _parse_acknowledged_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + acknowledged_at_type_0 = datetime.datetime.fromisoformat(data) + + return acknowledged_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + acknowledged_at = _parse_acknowledged_at(d.pop("acknowledged_at", UNSET)) + + def _parse_resolved_at(data: object) -> datetime.datetime | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + resolved_at_type_0 = datetime.datetime.fromisoformat(data) + + return resolved_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None | Unset, data) + + resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) + alert = cls( short_id=short_id, source=source, @@ -833,9 +948,12 @@ def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: responders=responders, notified_users=notified_users, alerting_targets=alerting_targets, + slack_notifications=slack_notifications, url=url, started_at=started_at, ended_at=ended_at, + acknowledged_at=acknowledged_at, + resolved_at=resolved_at, ) alert.additional_properties = d 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 1e14bd36..2be2c603 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,3 +1,5 @@ +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 056c6203..2ed599cc 100644 --- a/rootly_sdk/models/alert_alerting_targets_type_0_item.py +++ b/rootly_sdk/models/alert_alerting_targets_type_0_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/alert_configuration.py b/rootly_sdk/models/alert_configuration.py new file mode 100644 index 00000000..74e782de --- /dev/null +++ b/rootly_sdk/models/alert_configuration.py @@ -0,0 +1,187 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.alert_configuration_manual_paging_form_settings_item import ( + AlertConfigurationManualPagingFormSettingsItem, + check_alert_configuration_manual_paging_form_settings_item, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.alert_configuration_alert_acknowledgment import AlertConfigurationAlertAcknowledgment + from ..models.alert_configuration_default_user_notification_settings import ( + AlertConfigurationDefaultUserNotificationSettings, + ) + + +T = TypeVar("T", bound="AlertConfiguration") + + +@_attrs_define +class AlertConfiguration: + """ + Attributes: + alert_acknowledgment (AlertConfigurationAlertAcknowledgment | Unset): Re-trigger behaviour for acknowledged + alerts. Replaces the stored object as a whole. + manual_paging_form_settings (list[AlertConfigurationManualPagingFormSettingsItem] | Unset): Stored entity types + for the manual paging form, as configured; at least one is required. The form itself may hide a type the team + cannot use yet, such as functionality. + manual_paging_urgency_ids (list[UUID] | Unset): Alert urgency ids allowed when manually paging. Empty means all; + deleted urgencies are left out. Present and accepted only while the manual-page-urgency-allowlist feature is on + for the team. + default_user_notification_settings (AlertConfigurationDefaultUserNotificationSettings | Unset): Channel defaults + for new users, per urgency level. Omitted levels keep the built-in defaults; existing users are never changed. + Present and accepted only while org-default-notification-settings is on for the team. + created_at (datetime.datetime | Unset): + updated_at (datetime.datetime | Unset): + """ + + alert_acknowledgment: AlertConfigurationAlertAcknowledgment | Unset = UNSET + manual_paging_form_settings: list[AlertConfigurationManualPagingFormSettingsItem] | Unset = UNSET + manual_paging_urgency_ids: list[UUID] | Unset = UNSET + default_user_notification_settings: AlertConfigurationDefaultUserNotificationSettings | Unset = UNSET + created_at: datetime.datetime | Unset = UNSET + updated_at: datetime.datetime | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + alert_acknowledgment: dict[str, Any] | Unset = UNSET + if not isinstance(self.alert_acknowledgment, Unset): + alert_acknowledgment = self.alert_acknowledgment.to_dict() + + manual_paging_form_settings: list[str] | Unset = UNSET + if not isinstance(self.manual_paging_form_settings, Unset): + manual_paging_form_settings = [] + for manual_paging_form_settings_item_data in self.manual_paging_form_settings: + manual_paging_form_settings_item: str = manual_paging_form_settings_item_data + manual_paging_form_settings.append(manual_paging_form_settings_item) + + manual_paging_urgency_ids: list[str] | Unset = UNSET + if not isinstance(self.manual_paging_urgency_ids, Unset): + manual_paging_urgency_ids = [] + for manual_paging_urgency_ids_item_data in self.manual_paging_urgency_ids: + manual_paging_urgency_ids_item = str(manual_paging_urgency_ids_item_data) + manual_paging_urgency_ids.append(manual_paging_urgency_ids_item) + + default_user_notification_settings: dict[str, Any] | Unset = UNSET + if not isinstance(self.default_user_notification_settings, Unset): + default_user_notification_settings = self.default_user_notification_settings.to_dict() + + created_at: str | Unset = UNSET + if not isinstance(self.created_at, Unset): + created_at = self.created_at.isoformat() + + updated_at: str | Unset = 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 alert_acknowledgment is not UNSET: + field_dict["alert_acknowledgment"] = alert_acknowledgment + if manual_paging_form_settings is not UNSET: + field_dict["manual_paging_form_settings"] = manual_paging_form_settings + if manual_paging_urgency_ids is not UNSET: + field_dict["manual_paging_urgency_ids"] = manual_paging_urgency_ids + if default_user_notification_settings is not UNSET: + field_dict["default_user_notification_settings"] = default_user_notification_settings + 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_configuration_alert_acknowledgment import AlertConfigurationAlertAcknowledgment + from ..models.alert_configuration_default_user_notification_settings import ( + AlertConfigurationDefaultUserNotificationSettings, + ) + + d = dict(src_dict) + _alert_acknowledgment = d.pop("alert_acknowledgment", UNSET) + alert_acknowledgment: AlertConfigurationAlertAcknowledgment | Unset + if isinstance(_alert_acknowledgment, Unset): + alert_acknowledgment = UNSET + else: + alert_acknowledgment = AlertConfigurationAlertAcknowledgment.from_dict(_alert_acknowledgment) + + _manual_paging_form_settings = d.pop("manual_paging_form_settings", UNSET) + manual_paging_form_settings: list[AlertConfigurationManualPagingFormSettingsItem] | Unset = UNSET + if _manual_paging_form_settings is not UNSET: + manual_paging_form_settings = [] + for manual_paging_form_settings_item_data in _manual_paging_form_settings: + manual_paging_form_settings_item = check_alert_configuration_manual_paging_form_settings_item( + manual_paging_form_settings_item_data + ) + + manual_paging_form_settings.append(manual_paging_form_settings_item) + + _manual_paging_urgency_ids = d.pop("manual_paging_urgency_ids", UNSET) + manual_paging_urgency_ids: list[UUID] | Unset = UNSET + if _manual_paging_urgency_ids is not UNSET: + manual_paging_urgency_ids = [] + for manual_paging_urgency_ids_item_data in _manual_paging_urgency_ids: + manual_paging_urgency_ids_item = UUID(manual_paging_urgency_ids_item_data) + + manual_paging_urgency_ids.append(manual_paging_urgency_ids_item) + + _default_user_notification_settings = d.pop("default_user_notification_settings", UNSET) + default_user_notification_settings: AlertConfigurationDefaultUserNotificationSettings | Unset + if isinstance(_default_user_notification_settings, Unset): + default_user_notification_settings = UNSET + else: + default_user_notification_settings = AlertConfigurationDefaultUserNotificationSettings.from_dict( + _default_user_notification_settings + ) + + _created_at = d.pop("created_at", UNSET) + created_at: datetime.datetime | Unset + if isinstance(_created_at, Unset): + created_at = UNSET + else: + created_at = datetime.datetime.fromisoformat(_created_at) + + _updated_at = d.pop("updated_at", UNSET) + updated_at: datetime.datetime | Unset + if isinstance(_updated_at, Unset): + updated_at = UNSET + else: + updated_at = datetime.datetime.fromisoformat(_updated_at) + + alert_configuration = cls( + alert_acknowledgment=alert_acknowledgment, + manual_paging_form_settings=manual_paging_form_settings, + manual_paging_urgency_ids=manual_paging_urgency_ids, + default_user_notification_settings=default_user_notification_settings, + created_at=created_at, + updated_at=updated_at, + ) + + alert_configuration.additional_properties = d + return alert_configuration + + @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_configuration_alert_acknowledgment.py b/rootly_sdk/models/alert_configuration_alert_acknowledgment.py new file mode 100644 index 00000000..0adb4d23 --- /dev/null +++ b/rootly_sdk/models/alert_configuration_alert_acknowledgment.py @@ -0,0 +1,74 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.alert_configuration_alert_acknowledgment_timeout_minutes import ( + AlertConfigurationAlertAcknowledgmentTimeoutMinutes, + check_alert_configuration_alert_acknowledgment_timeout_minutes, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AlertConfigurationAlertAcknowledgment") + + +@_attrs_define +class AlertConfigurationAlertAcknowledgment: + """Re-trigger behaviour for acknowledged alerts. Replaces the stored object as a whole. + + Attributes: + timeout_enabled (bool | Unset): Re-trigger an acknowledged alert after the timeout. + timeout_minutes (AlertConfigurationAlertAcknowledgmentTimeoutMinutes | Unset): Minutes before an acknowledged + alert re-triggers. + retrigger_manual_alerts (bool | Unset): Whether alerts created from a manual page also re-trigger. Changing it + is rejected with 422 until the manual page re-trigger opt-out is enabled for the team. + """ + + timeout_enabled: bool | Unset = UNSET + timeout_minutes: AlertConfigurationAlertAcknowledgmentTimeoutMinutes | Unset = UNSET + retrigger_manual_alerts: bool | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + timeout_enabled = self.timeout_enabled + + timeout_minutes: int | Unset = UNSET + if not isinstance(self.timeout_minutes, Unset): + timeout_minutes = self.timeout_minutes + + retrigger_manual_alerts = self.retrigger_manual_alerts + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if timeout_enabled is not UNSET: + field_dict["timeout_enabled"] = timeout_enabled + if timeout_minutes is not UNSET: + field_dict["timeout_minutes"] = timeout_minutes + if retrigger_manual_alerts is not UNSET: + field_dict["retrigger_manual_alerts"] = retrigger_manual_alerts + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + timeout_enabled = d.pop("timeout_enabled", UNSET) + + _timeout_minutes = d.pop("timeout_minutes", UNSET) + timeout_minutes: AlertConfigurationAlertAcknowledgmentTimeoutMinutes | Unset + if isinstance(_timeout_minutes, Unset): + timeout_minutes = UNSET + else: + timeout_minutes = check_alert_configuration_alert_acknowledgment_timeout_minutes(_timeout_minutes) + + retrigger_manual_alerts = d.pop("retrigger_manual_alerts", UNSET) + + alert_configuration_alert_acknowledgment = cls( + timeout_enabled=timeout_enabled, + timeout_minutes=timeout_minutes, + retrigger_manual_alerts=retrigger_manual_alerts, + ) + + return alert_configuration_alert_acknowledgment diff --git a/rootly_sdk/models/alert_configuration_alert_acknowledgment_timeout_minutes.py b/rootly_sdk/models/alert_configuration_alert_acknowledgment_timeout_minutes.py new file mode 100644 index 00000000..37a9a4e8 --- /dev/null +++ b/rootly_sdk/models/alert_configuration_alert_acknowledgment_timeout_minutes.py @@ -0,0 +1,34 @@ +from typing import Literal + +AlertConfigurationAlertAcknowledgmentTimeoutMinutes = Literal[ + 10, 20, 30, 40, 50, 60, 90, 120, 180, 240, 300, 360, 720, 1440 +] + +ALERT_CONFIGURATION_ALERT_ACKNOWLEDGMENT_TIMEOUT_MINUTES_VALUES: set[ + AlertConfigurationAlertAcknowledgmentTimeoutMinutes +] = { + 10, + 20, + 30, + 40, + 50, + 60, + 90, + 120, + 180, + 240, + 300, + 360, + 720, + 1440, +} + + +def check_alert_configuration_alert_acknowledgment_timeout_minutes( + value: int, +) -> AlertConfigurationAlertAcknowledgmentTimeoutMinutes: + if value in ALERT_CONFIGURATION_ALERT_ACKNOWLEDGMENT_TIMEOUT_MINUTES_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ALERT_CONFIGURATION_ALERT_ACKNOWLEDGMENT_TIMEOUT_MINUTES_VALUES!r}" + ) diff --git a/rootly_sdk/models/alert_configuration_default_user_notification_settings.py b/rootly_sdk/models/alert_configuration_default_user_notification_settings.py new file mode 100644 index 00000000..e0492b70 --- /dev/null +++ b/rootly_sdk/models/alert_configuration_default_user_notification_settings.py @@ -0,0 +1,101 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.alert_configuration_default_user_notification_settings_audible_contact_types_item import ( + AlertConfigurationDefaultUserNotificationSettingsAudibleContactTypesItem, + check_alert_configuration_default_user_notification_settings_audible_contact_types_item, +) +from ..models.alert_configuration_default_user_notification_settings_quiet_contact_types_item import ( + AlertConfigurationDefaultUserNotificationSettingsQuietContactTypesItem, + check_alert_configuration_default_user_notification_settings_quiet_contact_types_item, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="AlertConfigurationDefaultUserNotificationSettings") + + +@_attrs_define +class AlertConfigurationDefaultUserNotificationSettings: + """Channel defaults for new users, per urgency level. Omitted levels keep the built-in defaults; existing users are + never changed. Present and accepted only while org-default-notification-settings is on for the team. + + Attributes: + audible_contact_types (list[AlertConfigurationDefaultUserNotificationSettingsAudibleContactTypesItem] | Unset): + Channels enabled on a newly created user's audible notification rule. At least one channel is required. + quiet_contact_types (list[AlertConfigurationDefaultUserNotificationSettingsQuietContactTypesItem] | Unset): + Channels enabled on a newly created user's quiet notification rule. At least one channel is required. + """ + + audible_contact_types: list[AlertConfigurationDefaultUserNotificationSettingsAudibleContactTypesItem] | Unset = ( + UNSET + ) + quiet_contact_types: list[AlertConfigurationDefaultUserNotificationSettingsQuietContactTypesItem] | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + audible_contact_types: list[str] | Unset = UNSET + if not isinstance(self.audible_contact_types, Unset): + audible_contact_types = [] + for audible_contact_types_item_data in self.audible_contact_types: + audible_contact_types_item: str = audible_contact_types_item_data + audible_contact_types.append(audible_contact_types_item) + + quiet_contact_types: list[str] | Unset = UNSET + if not isinstance(self.quiet_contact_types, Unset): + quiet_contact_types = [] + for quiet_contact_types_item_data in self.quiet_contact_types: + quiet_contact_types_item: str = quiet_contact_types_item_data + quiet_contact_types.append(quiet_contact_types_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if audible_contact_types is not UNSET: + field_dict["audible_contact_types"] = audible_contact_types + if quiet_contact_types is not UNSET: + field_dict["quiet_contact_types"] = quiet_contact_types + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _audible_contact_types = d.pop("audible_contact_types", UNSET) + audible_contact_types: ( + list[AlertConfigurationDefaultUserNotificationSettingsAudibleContactTypesItem] | Unset + ) = UNSET + if _audible_contact_types is not UNSET: + audible_contact_types = [] + for audible_contact_types_item_data in _audible_contact_types: + audible_contact_types_item = ( + check_alert_configuration_default_user_notification_settings_audible_contact_types_item( + audible_contact_types_item_data + ) + ) + + audible_contact_types.append(audible_contact_types_item) + + _quiet_contact_types = d.pop("quiet_contact_types", UNSET) + quiet_contact_types: list[AlertConfigurationDefaultUserNotificationSettingsQuietContactTypesItem] | Unset = ( + UNSET + ) + if _quiet_contact_types is not UNSET: + quiet_contact_types = [] + for quiet_contact_types_item_data in _quiet_contact_types: + quiet_contact_types_item = ( + check_alert_configuration_default_user_notification_settings_quiet_contact_types_item( + quiet_contact_types_item_data + ) + ) + + quiet_contact_types.append(quiet_contact_types_item) + + alert_configuration_default_user_notification_settings = cls( + audible_contact_types=audible_contact_types, + quiet_contact_types=quiet_contact_types, + ) + + return alert_configuration_default_user_notification_settings diff --git a/rootly_sdk/models/alert_configuration_default_user_notification_settings_audible_contact_types_item.py b/rootly_sdk/models/alert_configuration_default_user_notification_settings_audible_contact_types_item.py new file mode 100644 index 00000000..9eb10f77 --- /dev/null +++ b/rootly_sdk/models/alert_configuration_default_user_notification_settings_audible_contact_types_item.py @@ -0,0 +1,24 @@ +from typing import Literal + +AlertConfigurationDefaultUserNotificationSettingsAudibleContactTypesItem = Literal["call", "device", "email", "sms"] + +ALERT_CONFIGURATION_DEFAULT_USER_NOTIFICATION_SETTINGS_AUDIBLE_CONTACT_TYPES_ITEM_VALUES: set[ + AlertConfigurationDefaultUserNotificationSettingsAudibleContactTypesItem +] = { + "call", + "device", + "email", + "sms", +} + + +def check_alert_configuration_default_user_notification_settings_audible_contact_types_item( + value: str | None, +) -> AlertConfigurationDefaultUserNotificationSettingsAudibleContactTypesItem | None: + if value is None: + return None + if value in ALERT_CONFIGURATION_DEFAULT_USER_NOTIFICATION_SETTINGS_AUDIBLE_CONTACT_TYPES_ITEM_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ALERT_CONFIGURATION_DEFAULT_USER_NOTIFICATION_SETTINGS_AUDIBLE_CONTACT_TYPES_ITEM_VALUES!r}" + ) diff --git a/rootly_sdk/models/alert_configuration_default_user_notification_settings_quiet_contact_types_item.py b/rootly_sdk/models/alert_configuration_default_user_notification_settings_quiet_contact_types_item.py new file mode 100644 index 00000000..7bf93360 --- /dev/null +++ b/rootly_sdk/models/alert_configuration_default_user_notification_settings_quiet_contact_types_item.py @@ -0,0 +1,26 @@ +from typing import Literal + +AlertConfigurationDefaultUserNotificationSettingsQuietContactTypesItem = Literal[ + "call", "email", "non_critical_device", "sms" +] + +ALERT_CONFIGURATION_DEFAULT_USER_NOTIFICATION_SETTINGS_QUIET_CONTACT_TYPES_ITEM_VALUES: set[ + AlertConfigurationDefaultUserNotificationSettingsQuietContactTypesItem +] = { + "call", + "email", + "non_critical_device", + "sms", +} + + +def check_alert_configuration_default_user_notification_settings_quiet_contact_types_item( + value: str | None, +) -> AlertConfigurationDefaultUserNotificationSettingsQuietContactTypesItem | None: + if value is None: + return None + if value in ALERT_CONFIGURATION_DEFAULT_USER_NOTIFICATION_SETTINGS_QUIET_CONTACT_TYPES_ITEM_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ALERT_CONFIGURATION_DEFAULT_USER_NOTIFICATION_SETTINGS_QUIET_CONTACT_TYPES_ITEM_VALUES!r}" + ) diff --git a/rootly_sdk/models/alert_configuration_manual_paging_form_settings_item.py b/rootly_sdk/models/alert_configuration_manual_paging_form_settings_item.py new file mode 100644 index 00000000..6c5730fd --- /dev/null +++ b/rootly_sdk/models/alert_configuration_manual_paging_form_settings_item.py @@ -0,0 +1,25 @@ +from typing import Literal + +AlertConfigurationManualPagingFormSettingsItem = Literal[ + "escalation_policy", "functionality", "service", "team", "user" +] + +ALERT_CONFIGURATION_MANUAL_PAGING_FORM_SETTINGS_ITEM_VALUES: set[AlertConfigurationManualPagingFormSettingsItem] = { + "escalation_policy", + "functionality", + "service", + "team", + "user", +} + + +def check_alert_configuration_manual_paging_form_settings_item( + value: str | None, +) -> AlertConfigurationManualPagingFormSettingsItem | None: + if value is None: + return None + if value in ALERT_CONFIGURATION_MANUAL_PAGING_FORM_SETTINGS_ITEM_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ALERT_CONFIGURATION_MANUAL_PAGING_FORM_SETTINGS_ITEM_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_alert_retrigger_rule.py b/rootly_sdk/models/alert_configuration_response.py similarity index 67% rename from rootly_sdk/models/update_alert_retrigger_rule.py rename to rootly_sdk/models/alert_configuration_response.py index 67a9c719..d503589c 100644 --- a/rootly_sdk/models/update_alert_retrigger_rule.py +++ b/rootly_sdk/models/alert_configuration_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -5,20 +7,20 @@ from attrs import field as _attrs_field if TYPE_CHECKING: - from ..models.update_alert_retrigger_rule_data import UpdateAlertRetriggerRuleData + from ..models.alert_configuration_response_data import AlertConfigurationResponseData -T = TypeVar("T", bound="UpdateAlertRetriggerRule") +T = TypeVar("T", bound="AlertConfigurationResponse") @_attrs_define -class UpdateAlertRetriggerRule: +class AlertConfigurationResponse: """ Attributes: - data (UpdateAlertRetriggerRuleData): + data (AlertConfigurationResponseData): """ - data: "UpdateAlertRetriggerRuleData" + data: AlertConfigurationResponseData additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,17 +38,17 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.update_alert_retrigger_rule_data import UpdateAlertRetriggerRuleData + from ..models.alert_configuration_response_data import AlertConfigurationResponseData d = dict(src_dict) - data = UpdateAlertRetriggerRuleData.from_dict(d.pop("data")) + data = AlertConfigurationResponseData.from_dict(d.pop("data")) - update_alert_retrigger_rule = cls( + alert_configuration_response = cls( data=data, ) - update_alert_retrigger_rule.additional_properties = d - return update_alert_retrigger_rule + alert_configuration_response.additional_properties = d + return alert_configuration_response @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/alert_configuration_response_data.py b/rootly_sdk/models/alert_configuration_response_data.py new file mode 100644 index 00000000..5afac976 --- /dev/null +++ b/rootly_sdk/models/alert_configuration_response_data.py @@ -0,0 +1,88 @@ +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.alert_configuration_response_data_type import ( + AlertConfigurationResponseDataType, + check_alert_configuration_response_data_type, +) + +if TYPE_CHECKING: + from ..models.alert_configuration import AlertConfiguration + + +T = TypeVar("T", bound="AlertConfigurationResponseData") + + +@_attrs_define +class AlertConfigurationResponseData: + """ + Attributes: + id (str): Unique ID of the alert_configuration + type_ (AlertConfigurationResponseDataType): + attributes (AlertConfiguration): + """ + + id: str + type_: AlertConfigurationResponseDataType + attributes: AlertConfiguration + 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_configuration import AlertConfiguration + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_alert_configuration_response_data_type(d.pop("type")) + + attributes = AlertConfiguration.from_dict(d.pop("attributes")) + + alert_configuration_response_data = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + alert_configuration_response_data.additional_properties = d + return alert_configuration_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_configuration_response_data_type.py b/rootly_sdk/models/alert_configuration_response_data_type.py new file mode 100644 index 00000000..f3043676 --- /dev/null +++ b/rootly_sdk/models/alert_configuration_response_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +AlertConfigurationResponseDataType = Literal["alert_configurations"] + +ALERT_CONFIGURATION_RESPONSE_DATA_TYPE_VALUES: set[AlertConfigurationResponseDataType] = { + "alert_configurations", +} + + +def check_alert_configuration_response_data_type(value: str | None) -> AlertConfigurationResponseDataType | None: + if value is None: + return None + if value in ALERT_CONFIGURATION_RESPONSE_DATA_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_CONFIGURATION_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_data_type_0.py b/rootly_sdk/models/alert_data_type_0.py index a1daf88d..ce1e2630 100644 --- a/rootly_sdk/models/alert_data_type_0.py +++ b/rootly_sdk/models/alert_data_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 035387e9..dc717cbe 100644 --- a/rootly_sdk/models/alert_event.py +++ b/rootly_sdk/models/alert_event.py @@ -1,11 +1,14 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field from ..models.alert_event_action import AlertEventAction, check_alert_event_action from ..models.alert_event_kind import AlertEventKind, check_alert_event_kind +from ..models.alert_event_page_reason import AlertEventPageReason, check_alert_event_page_reason from ..types import UNSET, Unset if TYPE_CHECKING: @@ -29,17 +32,23 @@ class AlertEvent: source (str): created_at (str): updated_at (str): - 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]]): + page_reason (AlertEventPageReason | Unset): Present on paged events when a user explicitly reassigns the alert + to another notification target. + slack_message_ts (None | str | Unset): Slack thread ts of the message Rootly posted for this event, when + present. + slack_message_permalink (None | str | Unset): Permalink to the Slack message Rootly posted for this event, when + present. + 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): """ alert_id: str @@ -48,16 +57,19 @@ class AlertEvent: source: str created_at: str updated_at: str - 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 + page_reason: AlertEventPageReason | Unset = UNSET + slack_message_ts: None | str | Unset = UNSET + slack_message_permalink: None | str | Unset = UNSET + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -77,23 +89,39 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - user_id: None | Unset | int + page_reason: str | Unset = UNSET + if not isinstance(self.page_reason, Unset): + page_reason = self.page_reason + + slack_message_ts: None | str | Unset + if isinstance(self.slack_message_ts, Unset): + slack_message_ts = UNSET + else: + slack_message_ts = self.slack_message_ts + + slack_message_permalink: None | str | Unset + if isinstance(self.slack_message_permalink, Unset): + slack_message_permalink = UNSET + else: + slack_message_permalink = self.slack_message_permalink + + user_id: int | None | Unset if isinstance(self.user_id, Unset): user_id = UNSET else: user_id = self.user_id - details: None | Unset | str + details: None | str | Unset if isinstance(self.details, Unset): details = UNSET else: details = self.details - user: Unset | dict[str, Any] = UNSET + user: dict[str, Any] | Unset = UNSET if not isinstance(self.user, Unset): user = self.user.to_dict() - incident: None | Unset | dict[str, Any] + incident: dict[str, Any] | None | Unset if isinstance(self.incident, Unset): incident = UNSET elif isinstance(self.incident, AlertEventIncidentType0): @@ -101,7 +129,7 @@ def to_dict(self) -> dict[str, Any]: else: incident = self.incident - schedule: None | Unset | dict[str, Any] + schedule: dict[str, Any] | None | Unset if isinstance(self.schedule, Unset): schedule = UNSET elif isinstance(self.schedule, AlertEventScheduleType0): @@ -109,19 +137,19 @@ def to_dict(self) -> dict[str, Any]: else: schedule = self.schedule - escalation_level: None | Unset | int + escalation_level: int | None | Unset if isinstance(self.escalation_level, Unset): escalation_level = UNSET else: escalation_level = self.escalation_level - escalation_target_type: None | Unset | str + escalation_target_type: None | str | Unset if isinstance(self.escalation_target_type, Unset): escalation_target_type = UNSET else: escalation_target_type = self.escalation_target_type - escalation_target: None | Unset | dict[str, Any] + escalation_target: dict[str, Any] | None | Unset if isinstance(self.escalation_target, Unset): escalation_target = UNSET elif isinstance(self.escalation_target, AlertEventEscalationTargetType0): @@ -129,11 +157,11 @@ def to_dict(self) -> dict[str, Any]: else: escalation_target = self.escalation_target - slack_channel: Unset | dict[str, Any] = UNSET + slack_channel: dict[str, Any] | Unset = UNSET if not isinstance(self.slack_channel, Unset): slack_channel = self.slack_channel.to_dict() - incident_ids: None | Unset | list[str] + incident_ids: list[str] | None | Unset if isinstance(self.incident_ids, Unset): incident_ids = UNSET elif isinstance(self.incident_ids, list): @@ -154,6 +182,12 @@ def to_dict(self) -> dict[str, Any]: "updated_at": updated_at, } ) + if page_reason is not UNSET: + field_dict["page_reason"] = page_reason + if slack_message_ts is not UNSET: + field_dict["slack_message_ts"] = slack_message_ts + if slack_message_permalink is not UNSET: + field_dict["slack_message_permalink"] = slack_message_permalink if user_id is not UNSET: field_dict["user_id"] = user_id if details is not UNSET: @@ -198,32 +232,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_user_id(data: object) -> None | Unset | int: + _page_reason = d.pop("page_reason", UNSET) + page_reason: AlertEventPageReason | Unset + if isinstance(_page_reason, Unset): + page_reason = UNSET + else: + page_reason = check_alert_event_page_reason(_page_reason) + + def _parse_slack_message_ts(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + slack_message_ts = _parse_slack_message_ts(d.pop("slack_message_ts", UNSET)) + + def _parse_slack_message_permalink(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + slack_message_permalink = _parse_slack_message_permalink(d.pop("slack_message_permalink", UNSET)) + + def _parse_user_id(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) user_id = _parse_user_id(d.pop("user_id", UNSET)) - def _parse_details(data: object) -> None | Unset | str: + def _parse_details(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) details = _parse_details(d.pop("details", UNSET)) _user = d.pop("user", UNSET) - user: Unset | AlertEventUser + user: AlertEventUser | Unset if isinstance(_user, Unset): user = UNSET else: user = AlertEventUser.from_dict(_user) - def _parse_incident(data: object) -> Union["AlertEventIncidentType0", None, Unset]: + def _parse_incident(data: object) -> AlertEventIncidentType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -234,13 +293,13 @@ def _parse_incident(data: object) -> Union["AlertEventIncidentType0", None, Unse incident_type_0 = AlertEventIncidentType0.from_dict(data) return incident_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["AlertEventIncidentType0", None, Unset], data) + return cast(AlertEventIncidentType0 | None | Unset, data) incident = _parse_incident(d.pop("incident", UNSET)) - def _parse_schedule(data: object) -> Union["AlertEventScheduleType0", None, Unset]: + def _parse_schedule(data: object) -> AlertEventScheduleType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -251,31 +310,31 @@ def _parse_schedule(data: object) -> Union["AlertEventScheduleType0", None, Unse schedule_type_0 = AlertEventScheduleType0.from_dict(data) return schedule_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["AlertEventScheduleType0", None, Unset], data) + return cast(AlertEventScheduleType0 | None | Unset, data) schedule = _parse_schedule(d.pop("schedule", UNSET)) - def _parse_escalation_level(data: object) -> None | Unset | int: + def _parse_escalation_level(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) escalation_level = _parse_escalation_level(d.pop("escalation_level", UNSET)) - def _parse_escalation_target_type(data: object) -> None | Unset | str: + def _parse_escalation_target_type(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) escalation_target_type = _parse_escalation_target_type(d.pop("escalation_target_type", UNSET)) - def _parse_escalation_target(data: object) -> Union["AlertEventEscalationTargetType0", None, Unset]: + def _parse_escalation_target(data: object) -> AlertEventEscalationTargetType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -286,20 +345,20 @@ def _parse_escalation_target(data: object) -> Union["AlertEventEscalationTargetT escalation_target_type_0 = AlertEventEscalationTargetType0.from_dict(data) return escalation_target_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["AlertEventEscalationTargetType0", None, Unset], data) + return cast(AlertEventEscalationTargetType0 | None | Unset, data) escalation_target = _parse_escalation_target(d.pop("escalation_target", UNSET)) _slack_channel = d.pop("slack_channel", UNSET) - slack_channel: Unset | SlackChannel + slack_channel: SlackChannel | Unset if isinstance(_slack_channel, Unset): slack_channel = UNSET else: slack_channel = SlackChannel.from_dict(_slack_channel) - def _parse_incident_ids(data: object) -> None | Unset | list[str]: + def _parse_incident_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -310,9 +369,9 @@ def _parse_incident_ids(data: object) -> None | Unset | list[str]: incident_ids_type_0 = cast(list[str], data) return incident_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) incident_ids = _parse_incident_ids(d.pop("incident_ids", UNSET)) @@ -323,6 +382,9 @@ def _parse_incident_ids(data: object) -> None | Unset | list[str]: source=source, created_at=created_at, updated_at=updated_at, + page_reason=page_reason, + slack_message_ts=slack_message_ts, + slack_message_permalink=slack_message_permalink, user_id=user_id, details=details, user=user, diff --git a/rootly_sdk/models/alert_event_action.py b/rootly_sdk/models/alert_event_action.py index 4bd1983e..cfff1aed 100644 --- a/rootly_sdk/models/alert_event_action.py +++ b/rootly_sdk/models/alert_event_action.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertEventAction = Literal[ "ack_timeout_retriggered", @@ -27,14 +27,17 @@ "paged", "removed", "resolved", + "retrigger_cancelled", "retrigger_suppressed", "retriggered", "skipped", "slacked", "snoozed", + "team_attached_from_payload", "texted", "triggered", "updated", + "user_paged", ] ALERT_EVENT_ACTION_VALUES: set[AlertEventAction] = { @@ -64,14 +67,17 @@ "paged", "removed", "resolved", + "retrigger_cancelled", "retrigger_suppressed", "retriggered", "skipped", "slacked", "snoozed", + "team_attached_from_payload", "texted", "triggered", "updated", + "user_paged", } @@ -79,5 +85,5 @@ def check_alert_event_action(value: str | None) -> AlertEventAction | None: if value is None: return None if value in ALERT_EVENT_ACTION_VALUES: - return cast(AlertEventAction, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_EVENT_ACTION_VALUES!r}") 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 d6c59111..afd5e0b1 100644 --- a/rootly_sdk/models/alert_event_escalation_target_type_0.py +++ b/rootly_sdk/models/alert_event_escalation_target_type_0.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,14 +20,14 @@ class AlertEventEscalationTargetType0: """JSON:API-wrapped escalation target (User or EscalationPolicy). Attributes: - data (Union[Unset, AlertEventEscalationTargetType0Data]): + data (AlertEventEscalationTargetType0Data | Unset): """ - data: Union[Unset, "AlertEventEscalationTargetType0Data"] = UNSET + data: AlertEventEscalationTargetType0Data | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Unset | dict[str, Any] = UNSET + data: dict[str, Any] | Unset = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -43,7 +45,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Unset | AlertEventEscalationTargetType0Data + data: AlertEventEscalationTargetType0Data | Unset 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 75d6a66f..d7edee7f 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,14 +21,14 @@ class AlertEventEscalationTargetType0Data: """ Attributes: - id (Union[Unset, str]): - type_ (Union[Unset, str]): e.g. users, escalation_policies. - attributes (Union[Unset, AlertEventEscalationTargetType0DataAttributes]): + id (str | Unset): + type_ (str | Unset): e.g. users, escalation_policies. + attributes (AlertEventEscalationTargetType0DataAttributes | Unset): """ - id: Unset | str = UNSET - type_: Unset | str = UNSET - attributes: Union[Unset, "AlertEventEscalationTargetType0DataAttributes"] = UNSET + id: str | Unset = UNSET + type_: str | Unset = UNSET + attributes: AlertEventEscalationTargetType0DataAttributes | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: type_ = self.type_ - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -62,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_ = d.pop("type", UNSET) _attributes = d.pop("attributes", UNSET) - attributes: Unset | AlertEventEscalationTargetType0DataAttributes + attributes: AlertEventEscalationTargetType0DataAttributes | Unset 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 26c8be3a..dc65c652 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 726b2d24..b9935957 100644 --- a/rootly_sdk/models/alert_event_feed_list.py +++ b/rootly_sdk/models/alert_event_feed_list.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,17 +22,17 @@ 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 (Union[Unset, Links]): - included (Union[Unset, list['JsonapiIncludedResource']]): + links (Links | Unset): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["AlertEventFeedListDataItem"] - meta: "AlertEventFeedMeta" - links: Union[Unset, "Links"] = UNSET - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[AlertEventFeedListDataItem] + meta: AlertEventFeedMeta + links: Links | Unset = UNSET + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,11 +43,11 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - links: Unset | dict[str, Any] = UNSET + links: dict[str, Any] | Unset = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,18 +87,20 @@ 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: Unset | Links + links: Links | Unset if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) - included = [] _included = d.pop("included", UNSET) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 7016830c..d9c6e923 100644 --- a/rootly_sdk/models/alert_event_feed_list_data_item.py +++ b/rootly_sdk/models/alert_event_feed_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/alert_event_feed_list_data_item_type.py b/rootly_sdk/models/alert_event_feed_list_data_item_type.py index 87999c29..01e05a0d 100644 --- a/rootly_sdk/models/alert_event_feed_list_data_item_type.py +++ b/rootly_sdk/models/alert_event_feed_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertEventFeedListDataItemType = Literal["alert_events"] @@ -11,5 +11,5 @@ def check_alert_event_feed_list_data_item_type(value: str | None) -> AlertEventF if value is None: return None if value in ALERT_EVENT_FEED_LIST_DATA_ITEM_TYPE_VALUES: - return cast(AlertEventFeedListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_EVENT_FEED_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_event_feed_meta.py b/rootly_sdk/models/alert_event_feed_meta.py index 9c99a935..cde271b6 100644 --- a/rootly_sdk/models/alert_event_feed_meta.py +++ b/rootly_sdk/models/alert_event_feed_meta.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,51 +16,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 (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): 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: None | str - 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 + 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 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: None | Unset | int + current_page: int | None | Unset if isinstance(self.current_page, Unset): current_page = UNSET else: current_page = self.current_page - next_page: None | Unset | int + next_page: int | None | Unset if isinstance(self.next_page, Unset): next_page = UNSET else: next_page = self.next_page - prev_page: None | Unset | int + prev_page: int | None | Unset if isinstance(self.prev_page, Unset): prev_page = UNSET else: prev_page = self.prev_page - total_count: None | Unset | int + total_count: int | None | Unset if isinstance(self.total_count, Unset): total_count = UNSET else: total_count = self.total_count - total_pages: None | Unset | int + total_pages: int | None | Unset if isinstance(self.total_pages, Unset): total_pages = UNSET else: @@ -95,48 +97,48 @@ def _parse_next_cursor(data: object) -> None | str: next_cursor = _parse_next_cursor(d.pop("next_cursor")) - def _parse_current_page(data: object) -> None | Unset | int: + def _parse_current_page(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) current_page = _parse_current_page(d.pop("current_page", UNSET)) - def _parse_next_page(data: object) -> None | Unset | int: + def _parse_next_page(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) next_page = _parse_next_page(d.pop("next_page", UNSET)) - def _parse_prev_page(data: object) -> None | Unset | int: + def _parse_prev_page(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) prev_page = _parse_prev_page(d.pop("prev_page", UNSET)) - def _parse_total_count(data: object) -> None | Unset | int: + def _parse_total_count(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) total_count = _parse_total_count(d.pop("total_count", UNSET)) - def _parse_total_pages(data: object) -> None | Unset | int: + def _parse_total_pages(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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 13c40982..902f09f6 100644 --- a/rootly_sdk/models/alert_event_incident_type_0.py +++ b/rootly_sdk/models/alert_event_incident_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,40 +15,40 @@ class AlertEventIncidentType0: """ Attributes: - 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): + 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: 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - sequential_id: None | Unset | int + sequential_id: int | None | Unset if isinstance(self.sequential_id, Unset): sequential_id = UNSET else: @@ -62,19 +64,19 @@ def to_dict(self) -> dict[str, Any]: private = self.private - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - duration: None | Unset | int + duration: int | None | Unset if isinstance(self.duration, Unset): duration = UNSET else: @@ -123,12 +125,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) -> None | Unset | int: + def _parse_sequential_id(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) sequential_id = _parse_sequential_id(d.pop("sequential_id", UNSET)) @@ -142,30 +144,30 @@ def _parse_sequential_id(data: object) -> None | Unset | int: private = d.pop("private", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_started_at(data: object) -> None | Unset | str: + def _parse_started_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_duration(data: object) -> None | Unset | int: + def _parse_duration(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) duration = _parse_duration(d.pop("duration", UNSET)) diff --git a/rootly_sdk/models/alert_event_kind.py b/rootly_sdk/models/alert_event_kind.py index e1e62c19..5610427d 100644 --- a/rootly_sdk/models/alert_event_kind.py +++ b/rootly_sdk/models/alert_event_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertEventKind = Literal[ "action", @@ -35,5 +35,5 @@ def check_alert_event_kind(value: str | None) -> AlertEventKind | None: if value is None: return None if value in ALERT_EVENT_KIND_VALUES: - return cast(AlertEventKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_EVENT_KIND_VALUES!r}") diff --git a/rootly_sdk/models/alert_event_list.py b/rootly_sdk/models/alert_event_list.py index db503596..29523621 100644 --- a/rootly_sdk/models/alert_event_list.py +++ b/rootly_sdk/models/alert_event_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class AlertEventList: """ Attributes: - data (list['AlertEventListDataItem']): + data (list[AlertEventListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["AlertEventListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[AlertEventListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 9228289f..16d7f67a 100644 --- a/rootly_sdk/models/alert_event_list_data_item.py +++ b/rootly_sdk/models/alert_event_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/alert_event_list_data_item_type.py b/rootly_sdk/models/alert_event_list_data_item_type.py index ae5f417a..f07b35fc 100644 --- a/rootly_sdk/models/alert_event_list_data_item_type.py +++ b/rootly_sdk/models/alert_event_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertEventListDataItemType = Literal["alert_events"] @@ -11,5 +11,5 @@ def check_alert_event_list_data_item_type(value: str | None) -> AlertEventListDa if value is None: return None if value in ALERT_EVENT_LIST_DATA_ITEM_TYPE_VALUES: - return cast(AlertEventListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_EVENT_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_event_page_reason.py b/rootly_sdk/models/alert_event_page_reason.py new file mode 100644 index 00000000..bfaa8a5a --- /dev/null +++ b/rootly_sdk/models/alert_event_page_reason.py @@ -0,0 +1,15 @@ +from typing import Literal + +AlertEventPageReason = Literal["manual_reassignment"] + +ALERT_EVENT_PAGE_REASON_VALUES: set[AlertEventPageReason] = { + "manual_reassignment", +} + + +def check_alert_event_page_reason(value: str | None) -> AlertEventPageReason | None: + if value is None: + return None + if value in ALERT_EVENT_PAGE_REASON_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_EVENT_PAGE_REASON_VALUES!r}") diff --git a/rootly_sdk/models/alert_event_response.py b/rootly_sdk/models/alert_event_response.py index c929be5d..022df38b 100644 --- a/rootly_sdk/models/alert_event_response.py +++ b/rootly_sdk/models/alert_event_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class AlertEventResponse: """ Attributes: data (AlertEventResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "AlertEventResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: AlertEventResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 7bb109dc..0fe0cf01 100644 --- a/rootly_sdk/models/alert_event_response_data.py +++ b/rootly_sdk/models/alert_event_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/alert_event_response_data_type.py b/rootly_sdk/models/alert_event_response_data_type.py index 4f214079..62b94747 100644 --- a/rootly_sdk/models/alert_event_response_data_type.py +++ b/rootly_sdk/models/alert_event_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertEventResponseDataType = Literal["alert_events"] @@ -11,5 +11,5 @@ def check_alert_event_response_data_type(value: str | None) -> AlertEventRespons if value is None: return None if value in ALERT_EVENT_RESPONSE_DATA_TYPE_VALUES: - return cast(AlertEventResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_EVENT_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_event_schedule_type_0.py b/rootly_sdk/models/alert_event_schedule_type_0.py index d18aab86..4fd6e442 100644 --- a/rootly_sdk/models/alert_event_schedule_type_0.py +++ b/rootly_sdk/models/alert_event_schedule_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -19,20 +21,20 @@ class AlertEventScheduleType0: """ Attributes: - 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): + name (str | Unset): + description (None | str | Unset): + escalation_policies (list[AlertEventScheduleType0EscalationPoliciesItem] | Unset): + created_at (str | Unset): + updated_at (str | 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,13 +42,13 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - escalation_policies: Unset | list[dict[str, Any]] = UNSET + escalation_policies: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.escalation_policies, Unset): escalation_policies = [] for escalation_policies_item_data in self.escalation_policies: @@ -86,23 +88,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - escalation_policies = [] _escalation_policies = d.pop("escalation_policies", UNSET) - for escalation_policies_item_data in _escalation_policies or []: - escalation_policies_item = AlertEventScheduleType0EscalationPoliciesItem.from_dict( - escalation_policies_item_data - ) + 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 + ) - 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 aea276ce..3f33fcf9 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,16 +15,16 @@ class AlertEventScheduleType0EscalationPoliciesItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): - created_at (Union[Unset, str]): - updated_at (Union[Unset, str]): + id (str | Unset): + name (str | Unset): + created_at (str | Unset): + updated_at (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET - created_at: Unset | str = UNSET - updated_at: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET + created_at: str | Unset = UNSET + updated_at: str | Unset = UNSET 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 961ceb22..d299cff7 100644 --- a/rootly_sdk/models/alert_event_user.py +++ b/rootly_sdk/models/alert_event_user.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,11 +20,11 @@ class AlertEventUser: email (str): created_at (str): updated_at (str): - 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]): + 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): """ id: int @@ -30,11 +32,11 @@ class AlertEventUser: email: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,31 +50,31 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - first_name: None | Unset | str + first_name: None | str | Unset if isinstance(self.first_name, Unset): first_name = UNSET else: first_name = self.first_name - last_name: None | Unset | str + last_name: None | str | Unset if isinstance(self.last_name, Unset): last_name = UNSET else: last_name = self.last_name - preferred_name: None | Unset | str + preferred_name: None | str | Unset if isinstance(self.preferred_name, Unset): preferred_name = UNSET else: preferred_name = self.preferred_name - full_name: None | Unset | str + full_name: None | str | Unset if isinstance(self.full_name, Unset): full_name = UNSET else: full_name = self.full_name - time_zone: None | Unset | str + time_zone: None | str | Unset if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -115,48 +117,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 | Unset | str: + def _parse_first_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) first_name = _parse_first_name(d.pop("first_name", UNSET)) - def _parse_last_name(data: object) -> None | Unset | str: + def _parse_last_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) last_name = _parse_last_name(d.pop("last_name", UNSET)) - def _parse_preferred_name(data: object) -> None | Unset | str: + def _parse_preferred_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) preferred_name = _parse_preferred_name(d.pop("preferred_name", UNSET)) - def _parse_full_name(data: object) -> None | Unset | str: + def _parse_full_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) full_name = _parse_full_name(d.pop("full_name", UNSET)) - def _parse_time_zone(data: object) -> None | Unset | str: + def _parse_time_zone(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 1796e3d9..75f15a31 100644 --- a/rootly_sdk/models/alert_field.py +++ b/rootly_sdk/models/alert_field.py @@ -1,5 +1,7 @@ +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 attrs import field as _attrs_field @@ -17,14 +19,16 @@ class AlertField: kind (str): The kind of alert field created_at (str): Date of creation updated_at (str): Date of last update - slug (Union[Unset, str]): The slug of the alert field + slug (str | Unset): The slug of the alert field + owner_group_ids (list[str] | Unset): IDs of the teams that own the alert field. Empty for org-wide fields. """ name: str kind: str created_at: str updated_at: str - slug: Unset | str = UNSET + slug: str | Unset = UNSET + owner_group_ids: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,6 +42,10 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug + owner_group_ids: list[str] | Unset = UNSET + if not isinstance(self.owner_group_ids, Unset): + owner_group_ids = self.owner_group_ids + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -50,6 +58,8 @@ def to_dict(self) -> dict[str, Any]: ) if slug is not UNSET: field_dict["slug"] = slug + if owner_group_ids is not UNSET: + field_dict["owner_group_ids"] = owner_group_ids return field_dict @@ -66,12 +76,15 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) + owner_group_ids = cast(list[str], d.pop("owner_group_ids", UNSET)) + alert_field = cls( name=name, kind=kind, created_at=created_at, updated_at=updated_at, slug=slug, + owner_group_ids=owner_group_ids, ) alert_field.additional_properties = d diff --git a/rootly_sdk/models/alert_field_list.py b/rootly_sdk/models/alert_field_list.py index d0fb658d..fe0de9aa 100644 --- a/rootly_sdk/models/alert_field_list.py +++ b/rootly_sdk/models/alert_field_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class AlertFieldList: """ Attributes: - data (list['AlertFieldListDataItem']): + data (list[AlertFieldListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["AlertFieldListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[AlertFieldListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 f1b8c603..377b7621 100644 --- a/rootly_sdk/models/alert_field_list_data_item.py +++ b/rootly_sdk/models/alert_field_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/alert_field_list_data_item_type.py b/rootly_sdk/models/alert_field_list_data_item_type.py index b6c79e0f..6807ea64 100644 --- a/rootly_sdk/models/alert_field_list_data_item_type.py +++ b/rootly_sdk/models/alert_field_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertFieldListDataItemType = Literal["alert_fields"] @@ -11,5 +11,5 @@ def check_alert_field_list_data_item_type(value: str | None) -> AlertFieldListDa if value is None: return None if value in ALERT_FIELD_LIST_DATA_ITEM_TYPE_VALUES: - return cast(AlertFieldListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_FIELD_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_field_response.py b/rootly_sdk/models/alert_field_response.py index e6197c98..677831dc 100644 --- a/rootly_sdk/models/alert_field_response.py +++ b/rootly_sdk/models/alert_field_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class AlertFieldResponse: """ Attributes: data (AlertFieldResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "AlertFieldResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: AlertFieldResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 45c54724..2b6de736 100644 --- a/rootly_sdk/models/alert_field_response_data.py +++ b/rootly_sdk/models/alert_field_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,12 +22,12 @@ class AlertFieldResponseData: Attributes: type_ (AlertFieldResponseDataType): attributes (AlertField): - id (Union[Unset, str]): The ID of the alert field + id (str | Unset): The ID of the alert field """ type_: AlertFieldResponseDataType - attributes: "AlertField" - id: Unset | str = UNSET + attributes: AlertField + id: str | Unset = UNSET 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_response_data_type.py b/rootly_sdk/models/alert_field_response_data_type.py index 913d3c71..4e1e416e 100644 --- a/rootly_sdk/models/alert_field_response_data_type.py +++ b/rootly_sdk/models/alert_field_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertFieldResponseDataType = Literal["alert_fields"] @@ -11,5 +11,5 @@ def check_alert_field_response_data_type(value: str | None) -> AlertFieldRespons if value is None: return None if value in ALERT_FIELD_RESPONSE_DATA_TYPE_VALUES: - return cast(AlertFieldResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_FIELD_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_group.py b/rootly_sdk/models/alert_group.py index f9913184..fef2d3eb 100644 --- a/rootly_sdk/models/alert_group.py +++ b/rootly_sdk/models/alert_group.py @@ -1,5 +1,8 @@ +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 @@ -20,21 +23,24 @@ class AlertGroup: """ Attributes: name (str): The name of the alert group - description (Union[None, str]): The description of the alert group + description (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 (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 + 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. + owner_group_ids (list[UUID] | Unset): Teams that own this alert group. Admins of an owning team can manage it, + and an owned alert group can only target destinations that belong to its owning teams. Only available when + owning teams for alert groups are enabled for the organization. + 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 """ name: str @@ -44,12 +50,13 @@ class AlertGroup: created_at: str updated_at: str deleted_at: None | str - 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 + slug: str | Unset = UNSET + group_by_alert_title: bool | Unset = UNSET + group_by_alert_urgency: bool | Unset = UNSET + owner_group_ids: list[UUID] | Unset = UNSET + targets: list[AlertGroupTargetsItem] | Unset = UNSET + attributes: list[AlertGroupAttributesItem] | Unset = UNSET + conditions: list[AlertGroupConditionsItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -75,21 +82,28 @@ def to_dict(self) -> dict[str, Any]: group_by_alert_urgency = self.group_by_alert_urgency - targets: Unset | list[dict[str, Any]] = UNSET + owner_group_ids: list[str] | Unset = UNSET + if not isinstance(self.owner_group_ids, Unset): + owner_group_ids = [] + for owner_group_ids_item_data in self.owner_group_ids: + owner_group_ids_item = str(owner_group_ids_item_data) + owner_group_ids.append(owner_group_ids_item) + + targets: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + attributes: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + conditions: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -115,6 +129,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["group_by_alert_title"] = group_by_alert_title if group_by_alert_urgency is not UNSET: field_dict["group_by_alert_urgency"] = group_by_alert_urgency + if owner_group_ids is not UNSET: + field_dict["owner_group_ids"] = owner_group_ids if targets is not UNSET: field_dict["targets"] = targets if attributes is not UNSET: @@ -161,26 +177,41 @@ def _parse_deleted_at(data: object) -> None | str: group_by_alert_urgency = d.pop("group_by_alert_urgency", UNSET) - targets = [] + _owner_group_ids = d.pop("owner_group_ids", UNSET) + owner_group_ids: list[UUID] | Unset = UNSET + if _owner_group_ids is not UNSET: + owner_group_ids = [] + for owner_group_ids_item_data in _owner_group_ids: + owner_group_ids_item = UUID(owner_group_ids_item_data) + + owner_group_ids.append(owner_group_ids_item) + _targets = d.pop("targets", UNSET) - for targets_item_data in _targets or []: - targets_item = AlertGroupTargetsItem.from_dict(targets_item_data) + 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) - targets.append(targets_item) + targets.append(targets_item) - attributes = [] _attributes = d.pop("attributes", UNSET) - for attributes_item_data in _attributes or []: - attributes_item = AlertGroupAttributesItem.from_dict(attributes_item_data) + 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) - attributes.append(attributes_item) + attributes.append(attributes_item) - conditions = [] _conditions = d.pop("conditions", UNSET) - for conditions_item_data in _conditions or []: - conditions_item = AlertGroupConditionsItem.from_dict(conditions_item_data) + 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) - conditions.append(conditions_item) + conditions.append(conditions_item) alert_group = cls( name=name, @@ -193,6 +224,7 @@ def _parse_deleted_at(data: object) -> None | str: slug=slug, group_by_alert_title=group_by_alert_title, group_by_alert_urgency=group_by_alert_urgency, + owner_group_ids=owner_group_ids, targets=targets, attributes=attributes, conditions=conditions, diff --git a/rootly_sdk/models/alert_group_attributes_item.py b/rootly_sdk/models/alert_group_attributes_item.py index 120ba12a..574f2129 100644 --- a/rootly_sdk/models/alert_group_attributes_item.py +++ b/rootly_sdk/models/alert_group_attributes_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,10 +15,10 @@ class AlertGroupAttributesItem: """ Attributes: - json_path (Union[Unset, str]): The JSON path to the value to group by. + json_path (str | Unset): The JSON path to the value to group by. """ - json_path: Unset | str = UNSET + json_path: str | Unset = UNSET 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 c521f354..7a2c80f7 100644 --- a/rootly_sdk/models/alert_group_conditions_item.py +++ b/rootly_sdk/models/alert_group_conditions_item.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -32,32 +34,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 (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 + 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 condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is 'alert_urgency' - 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 + 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 field condition type is 'is_one_of' or 'is_not_one_of' - 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. + 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. """ property_field_type: AlertGroupConditionsItemPropertyFieldType property_field_condition_type: AlertGroupConditionsItemPropertyFieldConditionType - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -67,34 +69,34 @@ def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type - property_field_name: None | Unset | str + property_field_name: None | str | Unset if isinstance(self.property_field_name, Unset): property_field_name = UNSET else: property_field_name = self.property_field_name - property_field_value: None | Unset | str + property_field_value: None | str | Unset if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: Unset | list[str] = UNSET + property_field_values: list[str] | Unset = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values - values: Unset | list[None | dict[str, Any]] = UNSET + values: list[dict[str, Any] | None] | Unset = UNSET if not isinstance(self.values, Unset): values = [] for values_item_data in self.values: - values_item: None | dict[str, Any] + values_item: dict[str, Any] | None 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: None | Unset | list[str] + alert_urgency_ids: list[str] | None | Unset if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -103,11 +105,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: Unset | str = UNSET + conditionable_type: str | Unset = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | Unset | str + conditionable_id: None | str | Unset if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: @@ -149,48 +151,50 @@ 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 | Unset | str: + def _parse_property_field_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) property_field_name = _parse_property_field_name(d.pop("property_field_name", UNSET)) - def _parse_property_field_value(data: object) -> None | Unset | str: + def _parse_property_field_value(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) - for values_item_data in _values or []: + values: list[AlertGroupConditionsItemValuesItemType0 | None] | Unset = UNSET + if _values is not UNSET: + values = [] + for values_item_data in _values: - 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) + 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) - return values_item_type_0 - except: # noqa: E722 - pass - return cast(Union["AlertGroupConditionsItemValuesItemType0", None], data) + return values_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(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) -> None | Unset | list[str]: + def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -201,25 +205,25 @@ def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Unset | AlertGroupConditionsItemConditionableType + conditionable_type: AlertGroupConditionsItemConditionableType | Unset 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 | Unset | str: + def _parse_conditionable_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) diff --git a/rootly_sdk/models/alert_group_conditions_item_conditionable_type.py b/rootly_sdk/models/alert_group_conditions_item_conditionable_type.py index f2d593fc..e7832d73 100644 --- a/rootly_sdk/models/alert_group_conditions_item_conditionable_type.py +++ b/rootly_sdk/models/alert_group_conditions_item_conditionable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertGroupConditionsItemConditionableType = Literal["AlertField"] @@ -13,7 +13,7 @@ def check_alert_group_conditions_item_conditionable_type( if value is None: return None if value in ALERT_GROUP_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES: - return cast(AlertGroupConditionsItemConditionableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_GROUP_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/alert_group_conditions_item_property_field_condition_type.py b/rootly_sdk/models/alert_group_conditions_item_property_field_condition_type.py index dfdf07d1..3e7fde60 100644 --- a/rootly_sdk/models/alert_group_conditions_item_property_field_condition_type.py +++ b/rootly_sdk/models/alert_group_conditions_item_property_field_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertGroupConditionsItemPropertyFieldConditionType = Literal[ "contains", @@ -33,7 +33,7 @@ def check_alert_group_conditions_item_property_field_condition_type( if value is None: return None if value in ALERT_GROUP_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES: - return cast(AlertGroupConditionsItemPropertyFieldConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_GROUP_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/alert_group_conditions_item_property_field_type.py b/rootly_sdk/models/alert_group_conditions_item_property_field_type.py index 260501d7..4cb05181 100644 --- a/rootly_sdk/models/alert_group_conditions_item_property_field_type.py +++ b/rootly_sdk/models/alert_group_conditions_item_property_field_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertGroupConditionsItemPropertyFieldType = Literal["alert_field", "attribute", "payload"] @@ -15,7 +15,7 @@ def check_alert_group_conditions_item_property_field_type( if value is None: return None if value in ALERT_GROUP_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES: - return cast(AlertGroupConditionsItemPropertyFieldType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_GROUP_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES!r}" ) 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 23ed1e3a..a2bb4948 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,3 +1,5 @@ +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 311a2215..39a89183 100644 --- a/rootly_sdk/models/alert_group_list.py +++ b/rootly_sdk/models/alert_group_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,12 +20,12 @@ class AlertGroupList: """ Attributes: - data (list['AlertGroupListDataItem']): - included (Union[Unset, list['JsonapiIncludedResource']]): + data (list[AlertGroupListDataItem]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["AlertGroupListDataItem"] - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[AlertGroupListDataItem] + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -64,12 +66,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) - included = [] _included = d.pop("included", UNSET) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 f526ed60..3a40c496 100644 --- a/rootly_sdk/models/alert_group_list_data_item.py +++ b/rootly_sdk/models/alert_group_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/alert_group_list_data_item_type.py b/rootly_sdk/models/alert_group_list_data_item_type.py index 2d5568ee..c0df92aa 100644 --- a/rootly_sdk/models/alert_group_list_data_item_type.py +++ b/rootly_sdk/models/alert_group_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertGroupListDataItemType = Literal["alert_groups"] @@ -11,5 +11,5 @@ def check_alert_group_list_data_item_type(value: str | None) -> AlertGroupListDa if value is None: return None if value in ALERT_GROUP_LIST_DATA_ITEM_TYPE_VALUES: - return cast(AlertGroupListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_GROUP_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_group_response.py b/rootly_sdk/models/alert_group_response.py index 5977b2ad..913795e7 100644 --- a/rootly_sdk/models/alert_group_response.py +++ b/rootly_sdk/models/alert_group_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class AlertGroupResponse: """ Attributes: data (AlertGroupResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "AlertGroupResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: AlertGroupResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 96a04949..d2171843 100644 --- a/rootly_sdk/models/alert_group_response_data.py +++ b/rootly_sdk/models/alert_group_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/alert_group_response_data_type.py b/rootly_sdk/models/alert_group_response_data_type.py index 5aefee88..12b0c979 100644 --- a/rootly_sdk/models/alert_group_response_data_type.py +++ b/rootly_sdk/models/alert_group_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertGroupResponseDataType = Literal["alert_groups"] @@ -11,5 +11,5 @@ def check_alert_group_response_data_type(value: str | None) -> AlertGroupRespons if value is None: return None if value in ALERT_GROUP_RESPONSE_DATA_TYPE_VALUES: - return cast(AlertGroupResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_GROUP_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_group_targets_item.py b/rootly_sdk/models/alert_group_targets_item.py index 8083603f..1d7557d3 100644 --- a/rootly_sdk/models/alert_group_targets_item.py +++ b/rootly_sdk/models/alert_group_targets_item.py @@ -1,3 +1,5 @@ +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_group_targets_item_target_type.py b/rootly_sdk/models/alert_group_targets_item_target_type.py index 277ea3d4..cbb4bb35 100644 --- a/rootly_sdk/models/alert_group_targets_item_target_type.py +++ b/rootly_sdk/models/alert_group_targets_item_target_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertGroupTargetsItemTargetType = Literal["EscalationPolicy", "Functionality", "Group", "Service"] @@ -14,5 +14,5 @@ def check_alert_group_targets_item_target_type(value: str | None) -> AlertGroupT if value is None: return None if value in ALERT_GROUP_TARGETS_ITEM_TARGET_TYPE_VALUES: - return cast(AlertGroupTargetsItemTargetType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_GROUP_TARGETS_ITEM_TARGET_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_labels_item_type_0.py b/rootly_sdk/models/alert_labels_item_type_0.py index cf7bf716..432ad1f0 100644 --- a/rootly_sdk/models/alert_labels_item_type_0.py +++ b/rootly_sdk/models/alert_labels_item_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,7 +14,7 @@ class AlertLabelsItemType0: """ Attributes: key (str): Key of the tag - value (Union[bool, float, str]): Value of the tag + value (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 504318ac..1b309061 100644 --- a/rootly_sdk/models/alert_list.py +++ b/rootly_sdk/models/alert_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class AlertList: """ Attributes: - data (list['AlertListDataItem']): + data (list[AlertListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["AlertListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[AlertListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 9cdca68b..f1c5704c 100644 --- a/rootly_sdk/models/alert_list_data_item.py +++ b/rootly_sdk/models/alert_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,13 +23,13 @@ class AlertListDataItem: id (str): Unique ID of the alert type_ (AlertListDataItemType): attributes (Alert): - source (Union[Unset, str]): The source of the alert + source (str | Unset): The source of the alert """ id: str type_: AlertListDataItemType - attributes: "Alert" - source: Unset | str = UNSET + attributes: Alert + source: str | Unset = UNSET 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_list_data_item_type.py b/rootly_sdk/models/alert_list_data_item_type.py index 7c7b66e7..2a338d1a 100644 --- a/rootly_sdk/models/alert_list_data_item_type.py +++ b/rootly_sdk/models/alert_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertListDataItemType = Literal["alerts"] @@ -11,5 +11,5 @@ def check_alert_list_data_item_type(value: str | None) -> AlertListDataItemType if value is None: return None if value in ALERT_LIST_DATA_ITEM_TYPE_VALUES: - return cast(AlertListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_noise.py b/rootly_sdk/models/alert_noise.py index 3942fef4..6c5a96e6 100644 --- a/rootly_sdk/models/alert_noise.py +++ b/rootly_sdk/models/alert_noise.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertNoise = Literal["noise", "not_noise"] @@ -12,5 +12,5 @@ def check_alert_noise(value: str | None) -> AlertNoise | None: if value is None: return None if value in ALERT_NOISE_VALUES: - return cast(AlertNoise, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_NOISE_VALUES!r}") diff --git a/rootly_sdk/models/alert_notification_target_type.py b/rootly_sdk/models/alert_notification_target_type.py index af9bc852..990cb425 100644 --- a/rootly_sdk/models/alert_notification_target_type.py +++ b/rootly_sdk/models/alert_notification_target_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertNotificationTargetType = Literal["EscalationPolicy", "Functionality", "Group", "Service", "User"] @@ -15,5 +15,5 @@ def check_alert_notification_target_type(value: str | None) -> AlertNotification if value is None: return None if value in ALERT_NOTIFICATION_TARGET_TYPE_VALUES: - return cast(AlertNotificationTargetType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_NOTIFICATION_TARGET_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_response.py b/rootly_sdk/models/alert_response.py index 3dec4951..c51549c5 100644 --- a/rootly_sdk/models/alert_response.py +++ b/rootly_sdk/models/alert_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class AlertResponse: """ Attributes: data (AlertResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "AlertResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: AlertResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 c0eb05a2..90cf885f 100644 --- a/rootly_sdk/models/alert_response_data.py +++ b/rootly_sdk/models/alert_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,13 +23,13 @@ class AlertResponseData: id (str): Unique ID of the alert type_ (AlertResponseDataType): attributes (Alert): - source (Union[Unset, str]): The source of the alert + source (str | Unset): The source of the alert """ id: str type_: AlertResponseDataType - attributes: "Alert" - source: Unset | str = UNSET + attributes: Alert + source: str | Unset = UNSET 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_response_data_type.py b/rootly_sdk/models/alert_response_data_type.py index 6ec86a2d..69f505c2 100644 --- a/rootly_sdk/models/alert_response_data_type.py +++ b/rootly_sdk/models/alert_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertResponseDataType = Literal["alerts"] @@ -11,5 +11,5 @@ def check_alert_response_data_type(value: str | None) -> AlertResponseDataType | if value is None: return None if value in ALERT_RESPONSE_DATA_TYPE_VALUES: - return cast(AlertResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_retrigger_rule.py b/rootly_sdk/models/alert_retrigger_rule.py deleted file mode 100644 index eea8cf77..00000000 --- a/rootly_sdk/models/alert_retrigger_rule.py +++ /dev/null @@ -1,165 +0,0 @@ -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 deleted file mode 100644 index 9a0ba8cf..00000000 --- a/rootly_sdk/models/alert_retrigger_rule_conditions_item.py +++ /dev/null @@ -1,130 +0,0 @@ -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 deleted file mode 100644 index 825d2d16..00000000 --- a/rootly_sdk/models/alert_retrigger_rule_conditions_item_kind.py +++ /dev/null @@ -1,20 +0,0 @@ -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 deleted file mode 100644 index a51de929..00000000 --- a/rootly_sdk/models/alert_retrigger_rule_conditions_item_operator.py +++ /dev/null @@ -1,37 +0,0 @@ -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_data_item_type.py b/rootly_sdk/models/alert_retrigger_rule_list_data_item_type.py deleted file mode 100644 index 805d51ee..00000000 --- a/rootly_sdk/models/alert_retrigger_rule_list_data_item_type.py +++ /dev/null @@ -1,15 +0,0 @@ -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 deleted file mode 100644 index 8ffc5c25..00000000 --- a/rootly_sdk/models/alert_retrigger_rule_match_mode.py +++ /dev/null @@ -1,16 +0,0 @@ -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_data_type.py b/rootly_sdk/models/alert_retrigger_rule_response_data_type.py deleted file mode 100644 index 83e34750..00000000 --- a/rootly_sdk/models/alert_retrigger_rule_response_data_type.py +++ /dev/null @@ -1,15 +0,0 @@ -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 d8f701e4..d0895905 100644 --- a/rootly_sdk/models/alert_route.py +++ b/rootly_sdk/models/alert_route.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -20,16 +22,16 @@ class AlertRoute: Attributes: name (str): The name of the alert route alerts_source_ids (list[UUID]): - enabled (Union[Unset, bool]): Whether the alert route is enabled - owning_team_ids (Union[Unset, list[UUID]]): - rules (Union[Unset, list['AlertRouteRulesItem']]): + enabled (bool | Unset): Whether the alert route is enabled + owning_team_ids (list[UUID] | Unset): + rules (list[AlertRouteRulesItem] | Unset): """ name: str alerts_source_ids: list[UUID] - enabled: Unset | bool = UNSET - owning_team_ids: Unset | list[UUID] = UNSET - rules: Unset | list["AlertRouteRulesItem"] = UNSET + enabled: bool | Unset = UNSET + owning_team_ids: list[UUID] | Unset = UNSET + rules: list[AlertRouteRulesItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,14 +44,14 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - owning_team_ids: Unset | list[str] = UNSET + owning_team_ids: list[str] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + rules: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -89,19 +91,23 @@ 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) - for owning_team_ids_item_data in _owning_team_ids or []: - owning_team_ids_item = UUID(owning_team_ids_item_data) + 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) - owning_team_ids.append(owning_team_ids_item) + owning_team_ids.append(owning_team_ids_item) - rules = [] _rules = d.pop("rules", UNSET) - for rules_item_data in _rules or []: - rules_item = AlertRouteRulesItem.from_dict(rules_item_data) + 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) - 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 ccae9fd3..788a6a65 100644 --- a/rootly_sdk/models/alert_route_list.py +++ b/rootly_sdk/models/alert_route_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,14 +19,14 @@ 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]: diff --git a/rootly_sdk/models/alert_route_list_data_item.py b/rootly_sdk/models/alert_route_list_data_item.py index ba77f29a..3aee86f3 100644 --- a/rootly_sdk/models/alert_route_list_data_item.py +++ b/rootly_sdk/models/alert_route_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/alert_route_list_data_item_type.py b/rootly_sdk/models/alert_route_list_data_item_type.py index f669847e..c41ccdbc 100644 --- a/rootly_sdk/models/alert_route_list_data_item_type.py +++ b/rootly_sdk/models/alert_route_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertRouteListDataItemType = Literal["alert_routes"] @@ -11,5 +11,5 @@ def check_alert_route_list_data_item_type(value: str | None) -> AlertRouteListDa if value is None: return None if value in ALERT_ROUTE_LIST_DATA_ITEM_TYPE_VALUES: - return cast(AlertRouteListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_ROUTE_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_route_response.py b/rootly_sdk/models/alert_route_response.py index 21c9cd2d..0fb84000 100644 --- a/rootly_sdk/models/alert_route_response.py +++ b/rootly_sdk/models/alert_route_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,7 +20,7 @@ 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]: diff --git a/rootly_sdk/models/alert_route_response_data.py b/rootly_sdk/models/alert_route_response_data.py index b94232f9..f52eb429 100644 --- a/rootly_sdk/models/alert_route_response_data.py +++ b/rootly_sdk/models/alert_route_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/alert_route_response_data_type.py b/rootly_sdk/models/alert_route_response_data_type.py index 043194f7..3809fb8c 100644 --- a/rootly_sdk/models/alert_route_response_data_type.py +++ b/rootly_sdk/models/alert_route_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertRouteResponseDataType = Literal["alert_routes"] @@ -11,5 +11,5 @@ def check_alert_route_response_data_type(value: str | None) -> AlertRouteRespons if value is None: return None if value in ALERT_ROUTE_RESPONSE_DATA_TYPE_VALUES: - return cast(AlertRouteResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_ROUTE_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_route_rules_item.py b/rootly_sdk/models/alert_route_rules_item.py index 697ee425..6377e212 100644 --- a/rootly_sdk/models/alert_route_rules_item.py +++ b/rootly_sdk/models/alert_route_rules_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class AlertRouteRulesItem: """ Attributes: name (str): The name of the alert routing rule - 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. + 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. """ name: str - destinations: list["AlertRouteRulesItemDestinationsItem"] - condition_groups: list["AlertRouteRulesItemConditionGroupsItem"] - position: Unset | int = UNSET - fallback_rule: Unset | bool = False + destinations: list[AlertRouteRulesItemDestinationsItem] + condition_groups: list[AlertRouteRulesItemConditionGroupsItem] + position: int | Unset = UNSET + fallback_rule: bool | Unset = False 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_route_rules_item_condition_groups_item.py b/rootly_sdk/models/alert_route_rules_item_condition_groups_item.py index 94f139fc..80a9e188 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,12 +21,12 @@ class AlertRouteRulesItemConditionGroupsItem: """ Attributes: - conditions (list['AlertRouteRulesItemConditionGroupsItemConditionsItem']): - position (Union[Unset, int]): The position of the condition group + conditions (list[AlertRouteRulesItemConditionGroupsItemConditionsItem]): + position (int | Unset): The position of the condition group """ - conditions: list["AlertRouteRulesItemConditionGroupsItemConditionsItem"] - position: Unset | int = UNSET + conditions: list[AlertRouteRulesItemConditionGroupsItemConditionsItem] + position: int | Unset = UNSET 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_route_rules_item_condition_groups_item_conditions_item.py b/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item.py index 91f1fba8..a60adc2b 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast from uuid import UUID @@ -17,7 +19,6 @@ AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldType, check_alert_route_rules_item_condition_groups_item_conditions_item_property_field_type, ) -from ..types import UNSET, Unset T = TypeVar("T", bound="AlertRouteRulesItemConditionGroupsItemConditionsItem") @@ -27,65 +28,54 @@ class AlertRouteRulesItemConditionGroupsItemConditionsItem: """ Attributes: property_field_condition_type (AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType): + property_field_name (str): The name of the property field property_field_type (AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldType): - 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_value (None | str): The value of the property field + property_field_values (list[str] | None): + alert_urgency_ids (list[str] | None): The Alert Urgency IDs to check in the condition + conditionable_type (AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType): The type of the + conditionable + conditionable_id (None | UUID): The ID of the conditionable """ property_field_condition_type: AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType + property_field_name: str property_field_type: AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldType - 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 + property_field_value: None | str + property_field_values: list[str] | None + alert_urgency_ids: list[str] | None + conditionable_type: AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType + conditionable_id: None | UUID additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type - property_field_type: str = self.property_field_type - property_field_name = self.property_field_name - 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_type: str = self.property_field_type - 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): + property_field_value: None | str + property_field_value = self.property_field_value + + property_field_values: list[str] | None + if isinstance(self.property_field_values, list): property_field_values = self.property_field_values else: property_field_values = self.property_field_values - 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): + alert_urgency_ids: list[str] | None + if isinstance(self.alert_urgency_ids, list): alert_urgency_ids = self.alert_urgency_ids else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: Unset | str = UNSET - if not isinstance(self.conditionable_type, Unset): - conditionable_type = self.conditionable_type + conditionable_type: str = self.conditionable_type - conditionable_id: None | Unset | str - if isinstance(self.conditionable_id, Unset): - conditionable_id = UNSET - elif isinstance(self.conditionable_id, UUID): + conditionable_id: None | str + if isinstance(self.conditionable_id, UUID): conditionable_id = str(self.conditionable_id) else: conditionable_id = self.conditionable_id @@ -95,21 +85,15 @@ def to_dict(self) -> dict[str, Any]: field_dict.update( { "property_field_condition_type": property_field_condition_type, + "property_field_name": property_field_name, "property_field_type": property_field_type, + "property_field_value": property_field_value, + "property_field_values": property_field_values, + "alert_urgency_ids": alert_urgency_ids, + "conditionable_type": conditionable_type, + "conditionable_id": conditionable_id, } ) - if property_field_name is not UNSET: - field_dict["property_field_name"] = property_field_name - if property_field_value is not UNSET: - field_dict["property_field_value"] = property_field_value - if property_field_values is not UNSET: - field_dict["property_field_values"] = property_field_values - if alert_urgency_ids is not UNSET: - field_dict["alert_urgency_ids"] = alert_urgency_ids - if conditionable_type is not UNSET: - field_dict["conditionable_type"] = conditionable_type - if conditionable_id is not UNSET: - field_dict["conditionable_id"] = conditionable_id return field_dict @@ -122,85 +106,72 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) ) + property_field_name = d.pop("property_field_name") + property_field_type = check_alert_route_rules_item_condition_groups_item_conditions_item_property_field_type( d.pop("property_field_type") ) - property_field_name = d.pop("property_field_name", UNSET) - - def _parse_property_field_value(data: object) -> None | Unset | str: + def _parse_property_field_value(data: object) -> None | str: if data is None: return data - if isinstance(data, Unset): - return data - return cast(None | Unset | str, data) + return cast(None | str, data) - property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) + property_field_value = _parse_property_field_value(d.pop("property_field_value")) - def _parse_property_field_values(data: object) -> None | Unset | list[str]: + def _parse_property_field_values(data: object) -> list[str] | None: if data is None: return data - if isinstance(data, Unset): - return data try: if not isinstance(data, list): raise TypeError() property_field_values_type_0 = cast(list[str], data) return property_field_values_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None, data) - property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) + property_field_values = _parse_property_field_values(d.pop("property_field_values")) - def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: + def _parse_alert_urgency_ids(data: object) -> list[str] | None: if data is None: return data - if isinstance(data, Unset): - return data try: if not isinstance(data, list): raise TypeError() alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None, data) - alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) + alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids")) - _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Unset | AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType - if isinstance(_conditionable_type, Unset): - conditionable_type = UNSET - else: - conditionable_type = check_alert_route_rules_item_condition_groups_item_conditions_item_conditionable_type( - _conditionable_type - ) + conditionable_type = check_alert_route_rules_item_condition_groups_item_conditions_item_conditionable_type( + d.pop("conditionable_type") + ) - def _parse_conditionable_id(data: object) -> None | UUID | Unset: + def _parse_conditionable_id(data: object) -> None | UUID: if data is None: return data - if isinstance(data, Unset): - return data try: if not isinstance(data, str): raise TypeError() conditionable_id_type_0 = UUID(data) return conditionable_id_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | UUID | Unset, data) + return cast(None | UUID, data) - conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) + conditionable_id = _parse_conditionable_id(d.pop("conditionable_id")) alert_route_rules_item_condition_groups_item_conditions_item = cls( property_field_condition_type=property_field_condition_type, - property_field_type=property_field_type, property_field_name=property_field_name, + property_field_type=property_field_type, property_field_value=property_field_value, property_field_values=property_field_values, alert_urgency_ids=alert_urgency_ids, diff --git a/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item_conditionable_type.py b/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item_conditionable_type.py index 5ca9a402..6d9c8c89 100644 --- a/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item_conditionable_type.py +++ b/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item_conditionable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType = Literal["AlertField"] @@ -15,7 +15,7 @@ def check_alert_route_rules_item_condition_groups_item_conditions_item_condition if value is None: return None if value in ALERT_ROUTE_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES: - return cast(AlertRouteRulesItemConditionGroupsItemConditionsItemConditionableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_ROUTE_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item_property_field_condition_type.py b/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item_property_field_condition_type.py index 04815a77..7add1d83 100644 --- a/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item_property_field_condition_type.py +++ b/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item_property_field_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType = Literal[ "contains", @@ -31,7 +31,7 @@ def check_alert_route_rules_item_condition_groups_item_conditions_item_property_ if value is None: return None if value in ALERT_ROUTE_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES: - return cast(AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_ROUTE_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item_property_field_type.py b/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item_property_field_type.py index a6f2e339..d05848f2 100644 --- a/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item_property_field_type.py +++ b/rootly_sdk/models/alert_route_rules_item_condition_groups_item_conditions_item_property_field_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldType = Literal["alert_field", "attribute", "payload"] @@ -17,7 +17,7 @@ def check_alert_route_rules_item_condition_groups_item_conditions_item_property_ if value is None: return None if value in ALERT_ROUTE_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES: - return cast(AlertRouteRulesItemConditionGroupsItemConditionsItemPropertyFieldType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_ROUTE_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES!r}" ) 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 58e62a68..303e9070 100644 --- a/rootly_sdk/models/alert_route_rules_item_destinations_item.py +++ b/rootly_sdk/models/alert_route_rules_item_destinations_item.py @@ -1,3 +1,5 @@ +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_route_rules_item_destinations_item_target_type.py b/rootly_sdk/models/alert_route_rules_item_destinations_item_target_type.py index 03f3bfde..007e3551 100644 --- a/rootly_sdk/models/alert_route_rules_item_destinations_item_target_type.py +++ b/rootly_sdk/models/alert_route_rules_item_destinations_item_target_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertRouteRulesItemDestinationsItemTargetType = Literal["EscalationPolicy", "Functionality", "Group", "Service"] @@ -16,7 +16,7 @@ def check_alert_route_rules_item_destinations_item_target_type( if value is None: return None if value in ALERT_ROUTE_RULES_ITEM_DESTINATIONS_ITEM_TARGET_TYPE_VALUES: - return cast(AlertRouteRulesItemDestinationsItemTargetType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_ROUTE_RULES_ITEM_DESTINATIONS_ITEM_TARGET_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/alert_routing_rule.py b/rootly_sdk/models/alert_routing_rule.py index d6c36741..1ca607b9 100644 --- a/rootly_sdk/models/alert_routing_rule.py +++ b/rootly_sdk/models/alert_routing_rule.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -31,11 +33,10 @@ 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 (Union[Unset, list['AlertRoutingRuleConditionsItem']]): The conditions for the alert routing rule - destination (Union['AlertRoutingRuleDestinationType0', None, Unset]): The destinations for the alert routing + 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 rule - condition_groups (Union[Unset, list['AlertRoutingRuleConditionGroupsItem']]): The condition groups for the alert - routing rule """ name: str @@ -45,9 +46,9 @@ class AlertRoutingRule: condition_type: AlertRoutingRuleConditionType created_at: str updated_at: str - conditions: Unset | list["AlertRoutingRuleConditionsItem"] = UNSET - destination: Union["AlertRoutingRuleDestinationType0", None, Unset] = UNSET - condition_groups: Unset | list["AlertRoutingRuleConditionGroupsItem"] = UNSET + conditions: list[AlertRoutingRuleConditionsItem] | Unset = UNSET + destination: AlertRoutingRuleDestinationType0 | None | Unset = UNSET + condition_groups: list[AlertRoutingRuleConditionGroupsItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -67,14 +68,14 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - conditions: Unset | list[dict[str, Any]] = UNSET + conditions: list[dict[str, Any]] | Unset = 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: None | Unset | dict[str, Any] + destination: dict[str, Any] | None | Unset if isinstance(self.destination, Unset): destination = UNSET elif isinstance(self.destination, AlertRoutingRuleDestinationType0): @@ -82,7 +83,7 @@ def to_dict(self) -> dict[str, Any]: else: destination = self.destination - condition_groups: Unset | list[dict[str, Any]] = UNSET + condition_groups: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.condition_groups, Unset): condition_groups = [] for condition_groups_item_data in self.condition_groups: @@ -132,14 +133,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - conditions = [] _conditions = d.pop("conditions", UNSET) - for conditions_item_data in _conditions or []: - conditions_item = AlertRoutingRuleConditionsItem.from_dict(conditions_item_data) + 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) - conditions.append(conditions_item) + conditions.append(conditions_item) - def _parse_destination(data: object) -> Union["AlertRoutingRuleDestinationType0", None, Unset]: + def _parse_destination(data: object) -> AlertRoutingRuleDestinationType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -150,18 +153,20 @@ def _parse_destination(data: object) -> Union["AlertRoutingRuleDestinationType0" destination_type_0 = AlertRoutingRuleDestinationType0.from_dict(data) return destination_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["AlertRoutingRuleDestinationType0", None, Unset], data) + return cast(AlertRoutingRuleDestinationType0 | None | Unset, data) destination = _parse_destination(d.pop("destination", UNSET)) - condition_groups = [] _condition_groups = d.pop("condition_groups", UNSET) - for condition_groups_item_data in _condition_groups or []: - condition_groups_item = AlertRoutingRuleConditionGroupsItem.from_dict(condition_groups_item_data) + 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) - 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 90aa12ea..0ab961a3 100644 --- a/rootly_sdk/models/alert_routing_rule_condition.py +++ b/rootly_sdk/models/alert_routing_rule_condition.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast from uuid import UUID @@ -27,25 +29,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 (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 + 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 """ property_field_type: AlertRoutingRuleConditionPropertyFieldType property_field_name: str property_field_condition_type: AlertRoutingRuleConditionPropertyFieldConditionType - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -55,17 +57,17 @@ def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type - id: Unset | str = UNSET + id: str | Unset = UNSET if not isinstance(self.id, Unset): id = str(self.id) - property_field_value: None | Unset | str + property_field_value: None | str | Unset if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: None | Unset | list[str] + property_field_values: list[str] | None | Unset if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -74,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - conditionable_id: None | Unset | str + conditionable_id: None | str | Unset if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -82,7 +84,7 @@ def to_dict(self) -> dict[str, Any]: else: conditionable_id = self.conditionable_id - conditionable_type: None | Unset | str + conditionable_type: None | str | Unset if isinstance(self.conditionable_type, Unset): conditionable_type = UNSET else: @@ -130,22 +132,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _id = d.pop("id", UNSET) - id: Unset | UUID + id: UUID | Unset if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) - def _parse_property_field_value(data: object) -> None | Unset | str: + def _parse_property_field_value(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> None | Unset | list[str]: + def _parse_property_field_values(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -156,13 +158,13 @@ def _parse_property_field_values(data: object) -> None | Unset | list[str]: property_field_values_type_0 = cast(list[str], data) return property_field_values_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_conditionable_id(data: object) -> None | UUID | Unset: + def _parse_conditionable_id(data: object) -> None | Unset | UUID: if data is None: return data if isinstance(data, Unset): @@ -173,18 +175,18 @@ def _parse_conditionable_id(data: object) -> None | UUID | Unset: conditionable_id_type_0 = UUID(data) return conditionable_id_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | UUID | Unset, data) + return cast(None | Unset | UUID, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) - def _parse_conditionable_type(data: object) -> None | Unset | str: + def _parse_conditionable_type(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 bc3441dc..056ffefd 100644 --- a/rootly_sdk/models/alert_routing_rule_condition_group.py +++ b/rootly_sdk/models/alert_routing_rule_condition_group.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -20,27 +22,27 @@ class AlertRoutingRuleConditionGroup: Attributes: position (int): The position of the condition group for ordering - 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 + 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 """ position: int - id: Unset | UUID = UNSET - conditions: Unset | list["AlertRoutingRuleCondition"] = UNSET - created_at: Unset | str = UNSET - updated_at: Unset | str = UNSET + id: UUID | Unset = UNSET + conditions: list[AlertRoutingRuleCondition] | Unset = UNSET + created_at: str | Unset = UNSET + updated_at: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: position = self.position - id: Unset | str = UNSET + id: str | Unset = UNSET if not isinstance(self.id, Unset): id = str(self.id) - conditions: Unset | list[dict[str, Any]] = UNSET + conditions: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -77,18 +79,20 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position") _id = d.pop("id", UNSET) - id: Unset | UUID + id: UUID | Unset if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) - conditions = [] _conditions = d.pop("conditions", UNSET) - for conditions_item_data in _conditions or []: - conditions_item = AlertRoutingRuleCondition.from_dict(conditions_item_data) + 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) - 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 e16fffa5..c537c24e 100644 --- a/rootly_sdk/models/alert_routing_rule_condition_groups_item.py +++ b/rootly_sdk/models/alert_routing_rule_condition_groups_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -21,28 +23,27 @@ class AlertRoutingRuleConditionGroupsItem: """ Attributes: position (int): The position of the condition group for ordering - 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 + 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 """ position: int - id: Unset | UUID = UNSET - conditions: Unset | list["AlertRoutingRuleConditionGroupsItemConditionsItem"] = UNSET - created_at: Unset | str = UNSET - updated_at: Unset | str = UNSET + id: UUID | Unset = UNSET + conditions: list[AlertRoutingRuleConditionGroupsItemConditionsItem] | Unset = UNSET + created_at: str | Unset = UNSET + updated_at: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: position = self.position - id: Unset | str = UNSET + id: str | Unset = UNSET if not isinstance(self.id, Unset): id = str(self.id) - conditions: Unset | list[dict[str, Any]] = UNSET + conditions: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -81,18 +82,20 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position") _id = d.pop("id", UNSET) - id: Unset | UUID + id: UUID | Unset if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) - conditions = [] _conditions = d.pop("conditions", UNSET) - for conditions_item_data in _conditions or []: - conditions_item = AlertRoutingRuleConditionGroupsItemConditionsItem.from_dict(conditions_item_data) + 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) - 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 8958ac1b..93399246 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast from uuid import UUID @@ -27,25 +29,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 (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 + 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 """ property_field_type: AlertRoutingRuleConditionGroupsItemConditionsItemPropertyFieldType property_field_name: str property_field_condition_type: AlertRoutingRuleConditionGroupsItemConditionsItemPropertyFieldConditionType - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -55,17 +57,17 @@ def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type - id: Unset | str = UNSET + id: str | Unset = UNSET if not isinstance(self.id, Unset): id = str(self.id) - property_field_value: None | Unset | str + property_field_value: None | str | Unset if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: None | Unset | list[str] + property_field_values: list[str] | None | Unset if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -74,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - conditionable_id: None | Unset | str + conditionable_id: None | str | Unset if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -82,7 +84,7 @@ def to_dict(self) -> dict[str, Any]: else: conditionable_id = self.conditionable_id - conditionable_type: None | Unset | str + conditionable_type: None | str | Unset if isinstance(self.conditionable_type, Unset): conditionable_type = UNSET else: @@ -134,22 +136,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _id = d.pop("id", UNSET) - id: Unset | UUID + id: UUID | Unset if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) - def _parse_property_field_value(data: object) -> None | Unset | str: + def _parse_property_field_value(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> None | Unset | list[str]: + def _parse_property_field_values(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -160,13 +162,13 @@ def _parse_property_field_values(data: object) -> None | Unset | list[str]: property_field_values_type_0 = cast(list[str], data) return property_field_values_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_conditionable_id(data: object) -> None | UUID | Unset: + def _parse_conditionable_id(data: object) -> None | Unset | UUID: if data is None: return data if isinstance(data, Unset): @@ -177,18 +179,18 @@ def _parse_conditionable_id(data: object) -> None | UUID | Unset: conditionable_id_type_0 = UUID(data) return conditionable_id_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | UUID | Unset, data) + return cast(None | Unset | UUID, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) - def _parse_conditionable_type(data: object) -> None | Unset | str: + def _parse_conditionable_type(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) conditionable_type = _parse_conditionable_type(d.pop("conditionable_type", UNSET)) diff --git a/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item_property_field_condition_type.py b/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item_property_field_condition_type.py index 18538f31..005a8a11 100644 --- a/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item_property_field_condition_type.py +++ b/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item_property_field_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertRoutingRuleConditionGroupsItemConditionsItemPropertyFieldConditionType = Literal[ "contains", @@ -31,7 +31,7 @@ def check_alert_routing_rule_condition_groups_item_conditions_item_property_fiel if value is None: return None if value in ALERT_ROUTING_RULE_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES: - return cast(AlertRoutingRuleConditionGroupsItemConditionsItemPropertyFieldConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_ROUTING_RULE_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item_property_field_type.py b/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item_property_field_type.py index 126114d5..5cc129f8 100644 --- a/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item_property_field_type.py +++ b/rootly_sdk/models/alert_routing_rule_condition_groups_item_conditions_item_property_field_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertRoutingRuleConditionGroupsItemConditionsItemPropertyFieldType = Literal["attribute", "payload"] @@ -16,7 +16,7 @@ def check_alert_routing_rule_condition_groups_item_conditions_item_property_fiel if value is None: return None if value in ALERT_ROUTING_RULE_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES: - return cast(AlertRoutingRuleConditionGroupsItemConditionsItemPropertyFieldType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_ROUTING_RULE_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/alert_routing_rule_condition_property_field_condition_type.py b/rootly_sdk/models/alert_routing_rule_condition_property_field_condition_type.py index 61fc4ca1..2ea4c8ab 100644 --- a/rootly_sdk/models/alert_routing_rule_condition_property_field_condition_type.py +++ b/rootly_sdk/models/alert_routing_rule_condition_property_field_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertRoutingRuleConditionPropertyFieldConditionType = Literal[ "contains", @@ -31,7 +31,7 @@ def check_alert_routing_rule_condition_property_field_condition_type( if value is None: return None if value in ALERT_ROUTING_RULE_CONDITION_PROPERTY_FIELD_CONDITION_TYPE_VALUES: - return cast(AlertRoutingRuleConditionPropertyFieldConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_ROUTING_RULE_CONDITION_PROPERTY_FIELD_CONDITION_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/alert_routing_rule_condition_property_field_type.py b/rootly_sdk/models/alert_routing_rule_condition_property_field_type.py index 14899da5..e8101c58 100644 --- a/rootly_sdk/models/alert_routing_rule_condition_property_field_type.py +++ b/rootly_sdk/models/alert_routing_rule_condition_property_field_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertRoutingRuleConditionPropertyFieldType = Literal["attribute", "payload"] @@ -14,7 +14,7 @@ def check_alert_routing_rule_condition_property_field_type( if value is None: return None if value in ALERT_ROUTING_RULE_CONDITION_PROPERTY_FIELD_TYPE_VALUES: - return cast(AlertRoutingRuleConditionPropertyFieldType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_ROUTING_RULE_CONDITION_PROPERTY_FIELD_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/alert_routing_rule_condition_type.py b/rootly_sdk/models/alert_routing_rule_condition_type.py index 8312f6f9..04766864 100644 --- a/rootly_sdk/models/alert_routing_rule_condition_type.py +++ b/rootly_sdk/models/alert_routing_rule_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertRoutingRuleConditionType = Literal["all", "any"] @@ -12,5 +12,5 @@ def check_alert_routing_rule_condition_type(value: str | None) -> AlertRoutingRu if value is None: return None if value in ALERT_ROUTING_RULE_CONDITION_TYPE_VALUES: - return cast(AlertRoutingRuleConditionType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_ROUTING_RULE_CONDITION_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_routing_rule_conditions_item.py b/rootly_sdk/models/alert_routing_rule_conditions_item.py index 88f1a77f..7d65f2f1 100644 --- a/rootly_sdk/models/alert_routing_rule_conditions_item.py +++ b/rootly_sdk/models/alert_routing_rule_conditions_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -28,17 +30,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 (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 + 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 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 | Unset | str = UNSET - property_field_values: Unset | list[str] = UNSET + property_field_value: None | str | Unset = UNSET + property_field_values: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,13 +50,13 @@ def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type - property_field_value: None | Unset | str + property_field_value: None | str | Unset if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: Unset | list[str] = UNSET + property_field_values: list[str] | Unset = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values @@ -85,12 +87,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 | Unset | str: + def _parse_property_field_value(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) diff --git a/rootly_sdk/models/alert_routing_rule_conditions_item_property_field_condition_type.py b/rootly_sdk/models/alert_routing_rule_conditions_item_property_field_condition_type.py index 71e44192..40ad1276 100644 --- a/rootly_sdk/models/alert_routing_rule_conditions_item_property_field_condition_type.py +++ b/rootly_sdk/models/alert_routing_rule_conditions_item_property_field_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertRoutingRuleConditionsItemPropertyFieldConditionType = Literal[ "contains", @@ -31,7 +31,7 @@ def check_alert_routing_rule_conditions_item_property_field_condition_type( if value is None: return None if value in ALERT_ROUTING_RULE_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES: - return cast(AlertRoutingRuleConditionsItemPropertyFieldConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_ROUTING_RULE_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/alert_routing_rule_conditions_item_property_field_type.py b/rootly_sdk/models/alert_routing_rule_conditions_item_property_field_type.py index f214bfeb..a9f27fee 100644 --- a/rootly_sdk/models/alert_routing_rule_conditions_item_property_field_type.py +++ b/rootly_sdk/models/alert_routing_rule_conditions_item_property_field_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertRoutingRuleConditionsItemPropertyFieldType = Literal["attribute", "payload"] @@ -14,7 +14,7 @@ def check_alert_routing_rule_conditions_item_property_field_type( if value is None: return None if value in ALERT_ROUTING_RULE_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES: - return cast(AlertRoutingRuleConditionsItemPropertyFieldType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_ROUTING_RULE_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES!r}" ) 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 80f5de82..e628187c 100644 --- a/rootly_sdk/models/alert_routing_rule_destination_type_0.py +++ b/rootly_sdk/models/alert_routing_rule_destination_type_0.py @@ -1,3 +1,5 @@ +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_destination_type_0_target_type.py b/rootly_sdk/models/alert_routing_rule_destination_type_0_target_type.py index 5a99d87c..b389ab2b 100644 --- a/rootly_sdk/models/alert_routing_rule_destination_type_0_target_type.py +++ b/rootly_sdk/models/alert_routing_rule_destination_type_0_target_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertRoutingRuleDestinationType0TargetType = Literal["EscalationPolicy", "Functionality", "Group", "Service"] @@ -16,7 +16,7 @@ def check_alert_routing_rule_destination_type_0_target_type( if value is None: return None if value in ALERT_ROUTING_RULE_DESTINATION_TYPE_0_TARGET_TYPE_VALUES: - return cast(AlertRoutingRuleDestinationType0TargetType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_ROUTING_RULE_DESTINATION_TYPE_0_TARGET_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/alert_routing_rule_list.py b/rootly_sdk/models/alert_routing_rule_list.py index ffd3bf29..984ae883 100644 --- a/rootly_sdk/models/alert_routing_rule_list.py +++ b/rootly_sdk/models/alert_routing_rule_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class AlertRoutingRuleList: """ Attributes: - data (list['AlertRoutingRuleListDataItem']): + data (list[AlertRoutingRuleListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["AlertRoutingRuleListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[AlertRoutingRuleListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 343f7c40..7f60918e 100644 --- a/rootly_sdk/models/alert_routing_rule_list_data_item.py +++ b/rootly_sdk/models/alert_routing_rule_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/alert_routing_rule_list_data_item_type.py b/rootly_sdk/models/alert_routing_rule_list_data_item_type.py index ba1f4aed..cba76a05 100644 --- a/rootly_sdk/models/alert_routing_rule_list_data_item_type.py +++ b/rootly_sdk/models/alert_routing_rule_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertRoutingRuleListDataItemType = Literal["alert_routing_rules"] @@ -11,5 +11,5 @@ def check_alert_routing_rule_list_data_item_type(value: str | None) -> AlertRout if value is None: return None if value in ALERT_ROUTING_RULE_LIST_DATA_ITEM_TYPE_VALUES: - return cast(AlertRoutingRuleListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_ROUTING_RULE_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_routing_rule_response.py b/rootly_sdk/models/alert_routing_rule_response.py index ac519419..1db47b9d 100644 --- a/rootly_sdk/models/alert_routing_rule_response.py +++ b/rootly_sdk/models/alert_routing_rule_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class AlertRoutingRuleResponse: """ Attributes: data (AlertRoutingRuleResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "AlertRoutingRuleResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: AlertRoutingRuleResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 87bc9619..a03b56b9 100644 --- a/rootly_sdk/models/alert_routing_rule_response_data.py +++ b/rootly_sdk/models/alert_routing_rule_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/alert_routing_rule_response_data_type.py b/rootly_sdk/models/alert_routing_rule_response_data_type.py index 889a2909..a0103c71 100644 --- a/rootly_sdk/models/alert_routing_rule_response_data_type.py +++ b/rootly_sdk/models/alert_routing_rule_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertRoutingRuleResponseDataType = Literal["alert_routing_rules"] @@ -11,5 +11,5 @@ def check_alert_routing_rule_response_data_type(value: str | None) -> AlertRouti if value is None: return None if value in ALERT_ROUTING_RULE_RESPONSE_DATA_TYPE_VALUES: - return cast(AlertRoutingRuleResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_ROUTING_RULE_RESPONSE_DATA_TYPE_VALUES!r}") 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 62218fda..2c3c2e4a 100644 --- a/rootly_sdk/models/alert_routing_rule_target_type_0.py +++ b/rootly_sdk/models/alert_routing_rule_target_type_0.py @@ -1,3 +1,5 @@ +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_target_type_0_target_type.py b/rootly_sdk/models/alert_routing_rule_target_type_0_target_type.py index 4059aae7..fc0f0d90 100644 --- a/rootly_sdk/models/alert_routing_rule_target_type_0_target_type.py +++ b/rootly_sdk/models/alert_routing_rule_target_type_0_target_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertRoutingRuleTargetType0TargetType = Literal["EscalationPolicy", "Functionality", "Group", "Service"] @@ -16,7 +16,7 @@ def check_alert_routing_rule_target_type_0_target_type( if value is None: return None if value in ALERT_ROUTING_RULE_TARGET_TYPE_0_TARGET_TYPE_VALUES: - return cast(AlertRoutingRuleTargetType0TargetType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_ROUTING_RULE_TARGET_TYPE_0_TARGET_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/alert_slack_notifications_type_0_item.py b/rootly_sdk/models/alert_slack_notifications_type_0_item.py new file mode 100644 index 00000000..38fbec09 --- /dev/null +++ b/rootly_sdk/models/alert_slack_notifications_type_0_item.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="AlertSlackNotificationsType0Item") + + +@_attrs_define +class AlertSlackNotificationsType0Item: + """ + Attributes: + channel_id (str): Slack channel ID + thread_ts (str): Slack ts of the root announcement message + """ + + channel_id: str + thread_ts: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + channel_id = self.channel_id + + thread_ts = self.thread_ts + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "channel_id": channel_id, + "thread_ts": thread_ts, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + channel_id = d.pop("channel_id") + + thread_ts = d.pop("thread_ts") + + alert_slack_notifications_type_0_item = cls( + channel_id=channel_id, + thread_ts=thread_ts, + ) + + alert_slack_notifications_type_0_item.additional_properties = d + return alert_slack_notifications_type_0_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_status.py b/rootly_sdk/models/alert_status.py index db925d36..e02d78a6 100644 --- a/rootly_sdk/models/alert_status.py +++ b/rootly_sdk/models/alert_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertStatus = Literal["acknowledged", "deferred", "open", "resolved", "triggered"] @@ -15,5 +15,5 @@ def check_alert_status(value: str | None) -> AlertStatus | None: if value is None: return None if value in ALERT_STATUS_VALUES: - return cast(AlertStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/alert_trigger_params.py b/rootly_sdk/models/alert_trigger_params.py index 0a7cb339..a7761fcf 100644 --- a/rootly_sdk/models/alert_trigger_params.py +++ b/rootly_sdk/models/alert_trigger_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from uuid import UUID from attrs import define as _attrs_define @@ -52,128 +54,128 @@ class AlertTriggerParams: """ Attributes: trigger_type (AlertTriggerParamsTriggerType): - 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]): + 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): """ trigger_type: AlertTriggerParamsTriggerType - 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 + 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 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: Unset | list[str] = UNSET + triggers: list[str] | Unset = 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: Unset | str = UNSET + alert_condition: str | Unset = UNSET if not isinstance(self.alert_condition, Unset): alert_condition = self.alert_condition - alert_condition_source: Unset | str = UNSET + alert_condition_source: str | Unset = 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: Unset | list[str] = UNSET + alert_sources: list[str] | Unset = UNSET if not isinstance(self.alert_sources, Unset): alert_sources = self.alert_sources - alert_condition_label: Unset | str = UNSET + alert_condition_label: str | Unset = 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: Unset | str = UNSET + alert_condition_status: str | Unset = 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: Unset | list[str] = UNSET + alert_statuses: list[str] | Unset = UNSET if not isinstance(self.alert_statuses, Unset): alert_statuses = self.alert_statuses - alert_labels: Unset | list[str] = UNSET + alert_labels: list[str] | Unset = UNSET if not isinstance(self.alert_labels, Unset): alert_labels = self.alert_labels - alert_condition_urgency: Unset | str = UNSET + alert_condition_urgency: str | Unset = UNSET if not isinstance(self.alert_condition_urgency, Unset): alert_condition_urgency = self.alert_condition_urgency - alert_urgency_ids: Unset | list[str] = UNSET + alert_urgency_ids: list[str] | Unset = 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: Unset | str = UNSET + alert_condition_payload: str | Unset = 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: Unset | list[str] = UNSET + alert_payload: list[str] | Unset = UNSET if not isinstance(self.alert_payload, Unset): alert_payload = self.alert_payload - alert_query_payload: None | Unset | str + alert_query_payload: None | str | Unset if isinstance(self.alert_query_payload, Unset): alert_query_payload = UNSET else: alert_query_payload = self.alert_query_payload - alert_field_conditions: Unset | list[dict[str, Any]] = UNSET + alert_field_conditions: list[dict[str, Any]] | Unset = 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: Unset | dict[str, Any] = UNSET + alert_payload_conditions: dict[str, Any] | Unset = UNSET if not isinstance(self.alert_payload_conditions, Unset): alert_payload_conditions = self.alert_payload_conditions.to_dict() @@ -233,22 +235,24 @@ 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) - for triggers_item_data in _triggers or []: - triggers_item = check_alert_trigger_params_triggers_item(triggers_item_data) + 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) - triggers.append(triggers_item) + triggers.append(triggers_item) _alert_condition = d.pop("alert_condition", UNSET) - alert_condition: Unset | AlertTriggerParamsAlertCondition + alert_condition: AlertTriggerParamsAlertCondition | Unset 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: Unset | AlertTriggerParamsAlertConditionSource + alert_condition_source: AlertTriggerParamsAlertConditionSource | Unset if isinstance(_alert_condition_source, Unset): alert_condition_source = UNSET else: @@ -259,7 +263,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: Unset | AlertTriggerParamsAlertConditionLabel + alert_condition_label: AlertTriggerParamsAlertConditionLabel | Unset if isinstance(_alert_condition_label, Unset): alert_condition_label = UNSET else: @@ -268,7 +272,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: Unset | AlertTriggerParamsAlertConditionStatus + alert_condition_status: AlertTriggerParamsAlertConditionStatus | Unset if isinstance(_alert_condition_status, Unset): alert_condition_status = UNSET else: @@ -281,21 +285,23 @@ 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: Unset | AlertTriggerParamsAlertConditionUrgency + alert_condition_urgency: AlertTriggerParamsAlertConditionUrgency | Unset 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) - for alert_urgency_ids_item_data in _alert_urgency_ids or []: - alert_urgency_ids_item = UUID(alert_urgency_ids_item_data) + 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) - 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: Unset | AlertTriggerParamsAlertConditionPayload + alert_condition_payload: AlertTriggerParamsAlertConditionPayload | Unset if isinstance(_alert_condition_payload, Unset): alert_condition_payload = UNSET else: @@ -305,26 +311,28 @@ 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 | Unset | str: + def _parse_alert_query_payload(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) - 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: 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 + ) - 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: Unset | AlertTriggerParamsAlertPayloadConditions + alert_payload_conditions: AlertTriggerParamsAlertPayloadConditions | Unset if isinstance(_alert_payload_conditions, Unset): alert_payload_conditions = UNSET else: diff --git a/rootly_sdk/models/alert_trigger_params_alert_condition.py b/rootly_sdk/models/alert_trigger_params_alert_condition.py index 67392a55..a0987293 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_condition.py +++ b/rootly_sdk/models/alert_trigger_params_alert_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertTriggerParamsAlertCondition = Literal["ALL", "ANY", "NONE"] @@ -13,5 +13,5 @@ def check_alert_trigger_params_alert_condition(value: str | None) -> AlertTrigge if value is None: return None if value in ALERT_TRIGGER_PARAMS_ALERT_CONDITION_VALUES: - return cast(AlertTriggerParamsAlertCondition, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_TRIGGER_PARAMS_ALERT_CONDITION_VALUES!r}") diff --git a/rootly_sdk/models/alert_trigger_params_alert_condition_label.py b/rootly_sdk/models/alert_trigger_params_alert_condition_label.py index 9f623749..4e568ee5 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_condition_label.py +++ b/rootly_sdk/models/alert_trigger_params_alert_condition_label.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertTriggerParamsAlertConditionLabel = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -21,7 +21,7 @@ def check_alert_trigger_params_alert_condition_label(value: str | None) -> Alert if value is None: return None if value in ALERT_TRIGGER_PARAMS_ALERT_CONDITION_LABEL_VALUES: - return cast(AlertTriggerParamsAlertConditionLabel, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_TRIGGER_PARAMS_ALERT_CONDITION_LABEL_VALUES!r}" ) diff --git a/rootly_sdk/models/alert_trigger_params_alert_condition_payload.py b/rootly_sdk/models/alert_trigger_params_alert_condition_payload.py index 3bd1cd38..b0de4b98 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_condition_payload.py +++ b/rootly_sdk/models/alert_trigger_params_alert_condition_payload.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertTriggerParamsAlertConditionPayload = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_alert_trigger_params_alert_condition_payload( if value is None: return None if value in ALERT_TRIGGER_PARAMS_ALERT_CONDITION_PAYLOAD_VALUES: - return cast(AlertTriggerParamsAlertConditionPayload, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_TRIGGER_PARAMS_ALERT_CONDITION_PAYLOAD_VALUES!r}" ) diff --git a/rootly_sdk/models/alert_trigger_params_alert_condition_source.py b/rootly_sdk/models/alert_trigger_params_alert_condition_source.py index 29118194..09f0ca22 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_condition_source.py +++ b/rootly_sdk/models/alert_trigger_params_alert_condition_source.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertTriggerParamsAlertConditionSource = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_alert_trigger_params_alert_condition_source( if value is None: return None if value in ALERT_TRIGGER_PARAMS_ALERT_CONDITION_SOURCE_VALUES: - return cast(AlertTriggerParamsAlertConditionSource, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_TRIGGER_PARAMS_ALERT_CONDITION_SOURCE_VALUES!r}" ) diff --git a/rootly_sdk/models/alert_trigger_params_alert_condition_status.py b/rootly_sdk/models/alert_trigger_params_alert_condition_status.py index d8298538..a0990959 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_condition_status.py +++ b/rootly_sdk/models/alert_trigger_params_alert_condition_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertTriggerParamsAlertConditionStatus = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_alert_trigger_params_alert_condition_status( if value is None: return None if value in ALERT_TRIGGER_PARAMS_ALERT_CONDITION_STATUS_VALUES: - return cast(AlertTriggerParamsAlertConditionStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_TRIGGER_PARAMS_ALERT_CONDITION_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/alert_trigger_params_alert_condition_urgency.py b/rootly_sdk/models/alert_trigger_params_alert_condition_urgency.py index 84bba6a7..4bb0c0a6 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_condition_urgency.py +++ b/rootly_sdk/models/alert_trigger_params_alert_condition_urgency.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertTriggerParamsAlertConditionUrgency = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_alert_trigger_params_alert_condition_urgency( if value is None: return None if value in ALERT_TRIGGER_PARAMS_ALERT_CONDITION_URGENCY_VALUES: - return cast(AlertTriggerParamsAlertConditionUrgency, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_TRIGGER_PARAMS_ALERT_CONDITION_URGENCY_VALUES!r}" ) 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 d4463fd9..56455b09 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,12 +21,12 @@ class AlertTriggerParamsAlertFieldConditionsItem: Attributes: alert_field_id (str): condition_type (AlertTriggerParamsAlertFieldConditionsItemConditionType): - values (Union[Unset, list[str]]): + values (list[str] | Unset): """ alert_field_id: str condition_type: AlertTriggerParamsAlertFieldConditionsItemConditionType - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: condition_type: str = self.condition_type - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/alert_trigger_params_alert_field_conditions_item_condition_type.py b/rootly_sdk/models/alert_trigger_params_alert_field_conditions_item_condition_type.py index 588f9529..fcdd0d07 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_field_conditions_item_condition_type.py +++ b/rootly_sdk/models/alert_trigger_params_alert_field_conditions_item_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertTriggerParamsAlertFieldConditionsItemConditionType = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_alert_trigger_params_alert_field_conditions_item_condition_type( if value is None: return None if value in ALERT_TRIGGER_PARAMS_ALERT_FIELD_CONDITIONS_ITEM_CONDITION_TYPE_VALUES: - return cast(AlertTriggerParamsAlertFieldConditionsItemConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_TRIGGER_PARAMS_ALERT_FIELD_CONDITIONS_ITEM_CONDITION_TYPE_VALUES!r}" ) 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 c037c6b6..dea2beff 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_payload_conditions.py +++ b/rootly_sdk/models/alert_trigger_params_alert_payload_conditions.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,20 +25,20 @@ class AlertTriggerParamsAlertPayloadConditions: """ Attributes: - logic (Union[Unset, AlertTriggerParamsAlertPayloadConditionsLogic]): - conditions (Union[Unset, list['AlertTriggerParamsAlertPayloadConditionsConditionsItem']]): + logic (AlertTriggerParamsAlertPayloadConditionsLogic | Unset): + conditions (list[AlertTriggerParamsAlertPayloadConditionsConditionsItem] | Unset): """ - logic: Unset | AlertTriggerParamsAlertPayloadConditionsLogic = UNSET - conditions: Unset | list["AlertTriggerParamsAlertPayloadConditionsConditionsItem"] = UNSET + logic: AlertTriggerParamsAlertPayloadConditionsLogic | Unset = UNSET + conditions: list[AlertTriggerParamsAlertPayloadConditionsConditionsItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - logic: Unset | str = UNSET + logic: str | Unset = UNSET if not isinstance(self.logic, Unset): logic = self.logic - conditions: Unset | list[dict[str, Any]] = UNSET + conditions: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -61,18 +63,20 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _logic = d.pop("logic", UNSET) - logic: Unset | AlertTriggerParamsAlertPayloadConditionsLogic + logic: AlertTriggerParamsAlertPayloadConditionsLogic | Unset if isinstance(_logic, Unset): logic = UNSET else: logic = check_alert_trigger_params_alert_payload_conditions_logic(_logic) - conditions = [] _conditions = d.pop("conditions", UNSET) - for conditions_item_data in _conditions or []: - conditions_item = AlertTriggerParamsAlertPayloadConditionsConditionsItem.from_dict(conditions_item_data) + 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) - 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 d00a6cc6..6a9ea7fd 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,14 +21,14 @@ class AlertTriggerParamsAlertPayloadConditionsConditionsItem: Attributes: query (str): operator (AlertTriggerParamsAlertPayloadConditionsConditionsItemOperator): - values (Union[Unset, list[str]]): - use_regexp (Union[Unset, bool]): + values (list[str] | Unset): + use_regexp (bool | Unset): """ query: str operator: AlertTriggerParamsAlertPayloadConditionsConditionsItemOperator - values: Unset | list[str] = UNSET - use_regexp: Unset | bool = UNSET + values: list[str] | Unset = UNSET + use_regexp: bool | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_conditions_item_operator.py b/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_conditions_item_operator.py index 906bbeb2..405cfc64 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_conditions_item_operator.py +++ b/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_conditions_item_operator.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertTriggerParamsAlertPayloadConditionsConditionsItemOperator = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_alert_trigger_params_alert_payload_conditions_conditions_item_operator if value is None: return None if value in ALERT_TRIGGER_PARAMS_ALERT_PAYLOAD_CONDITIONS_CONDITIONS_ITEM_OPERATOR_VALUES: - return cast(AlertTriggerParamsAlertPayloadConditionsConditionsItemOperator, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_TRIGGER_PARAMS_ALERT_PAYLOAD_CONDITIONS_CONDITIONS_ITEM_OPERATOR_VALUES!r}" ) diff --git a/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_logic.py b/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_logic.py index b78c4bfb..eb111cfe 100644 --- a/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_logic.py +++ b/rootly_sdk/models/alert_trigger_params_alert_payload_conditions_logic.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertTriggerParamsAlertPayloadConditionsLogic = Literal["ALL", "ANY", "NONE"] @@ -15,7 +15,7 @@ def check_alert_trigger_params_alert_payload_conditions_logic( if value is None: return None if value in ALERT_TRIGGER_PARAMS_ALERT_PAYLOAD_CONDITIONS_LOGIC_VALUES: - return cast(AlertTriggerParamsAlertPayloadConditionsLogic, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERT_TRIGGER_PARAMS_ALERT_PAYLOAD_CONDITIONS_LOGIC_VALUES!r}" ) diff --git a/rootly_sdk/models/alert_trigger_params_trigger_type.py b/rootly_sdk/models/alert_trigger_params_trigger_type.py index 08dd56da..849a8430 100644 --- a/rootly_sdk/models/alert_trigger_params_trigger_type.py +++ b/rootly_sdk/models/alert_trigger_params_trigger_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertTriggerParamsTriggerType = Literal["alert"] @@ -11,5 +11,5 @@ def check_alert_trigger_params_trigger_type(value: str | None) -> AlertTriggerPa if value is None: return None if value in ALERT_TRIGGER_PARAMS_TRIGGER_TYPE_VALUES: - return cast(AlertTriggerParamsTriggerType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_TRIGGER_PARAMS_TRIGGER_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_trigger_params_triggers_item.py b/rootly_sdk/models/alert_trigger_params_triggers_item.py index 646e1ca9..f8abff5c 100644 --- a/rootly_sdk/models/alert_trigger_params_triggers_item.py +++ b/rootly_sdk/models/alert_trigger_params_triggers_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertTriggerParamsTriggersItem = Literal["alert_created", "alert_status_updated"] @@ -12,5 +12,5 @@ def check_alert_trigger_params_triggers_item(value: str | None) -> AlertTriggerP if value is None: return None if value in ALERT_TRIGGER_PARAMS_TRIGGERS_ITEM_VALUES: - return cast(AlertTriggerParamsTriggersItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_TRIGGER_PARAMS_TRIGGERS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/alert_urgency.py b/rootly_sdk/models/alert_urgency.py index d9ae5f2d..6b4b482a 100644 --- a/rootly_sdk/models/alert_urgency.py +++ b/rootly_sdk/models/alert_urgency.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,13 +20,13 @@ class AlertUrgency: position (int): Position of the alert urgency created_at (str): Date of creation updated_at (str): Date of last update - 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 + id (str | Unset): Unique ID of the alert urgency + retrigger_timeout_minutes (int | None | Unset): Re-trigger acknowledged alerts of this urgency after N minutes; + null inherits the workspace default, -1 = never. + 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 """ name: str @@ -32,12 +34,12 @@ class AlertUrgency: position: int created_at: str updated_at: str - 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 + id: str | Unset = UNSET + retrigger_timeout_minutes: int | None | Unset = UNSET + urgency: None | str | Unset = UNSET + color: None | str | Unset = UNSET + team_id: int | Unset = UNSET + deleted_at: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -53,19 +55,19 @@ def to_dict(self) -> dict[str, Any]: id = self.id - retrigger_timeout_minutes: None | Unset | int + retrigger_timeout_minutes: int | None | Unset if isinstance(self.retrigger_timeout_minutes, Unset): retrigger_timeout_minutes = UNSET else: retrigger_timeout_minutes = self.retrigger_timeout_minutes - urgency: None | Unset | str + urgency: None | str | Unset if isinstance(self.urgency, Unset): urgency = UNSET else: urgency = self.urgency - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: @@ -73,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: team_id = self.team_id - deleted_at: None | Unset | str + deleted_at: None | str | Unset if isinstance(self.deleted_at, Unset): deleted_at = UNSET else: @@ -120,41 +122,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) - def _parse_retrigger_timeout_minutes(data: object) -> None | Unset | int: + def _parse_retrigger_timeout_minutes(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) - def _parse_urgency(data: object) -> None | Unset | str: + def _parse_urgency(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) urgency = _parse_urgency(d.pop("urgency", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) team_id = d.pop("team_id", UNSET) - def _parse_deleted_at(data: object) -> None | Unset | str: + def _parse_deleted_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) deleted_at = _parse_deleted_at(d.pop("deleted_at", UNSET)) diff --git a/rootly_sdk/models/alert_urgency_list.py b/rootly_sdk/models/alert_urgency_list.py index ba752c31..30aa1f17 100644 --- a/rootly_sdk/models/alert_urgency_list.py +++ b/rootly_sdk/models/alert_urgency_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class AlertUrgencyList: """ Attributes: - data (list['AlertUrgencyListDataItem']): + data (list[AlertUrgencyListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["AlertUrgencyListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[AlertUrgencyListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 aa0ff94f..634dc584 100644 --- a/rootly_sdk/models/alert_urgency_list_data_item.py +++ b/rootly_sdk/models/alert_urgency_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/alert_urgency_list_data_item_type.py b/rootly_sdk/models/alert_urgency_list_data_item_type.py index 579b2131..a292fc63 100644 --- a/rootly_sdk/models/alert_urgency_list_data_item_type.py +++ b/rootly_sdk/models/alert_urgency_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertUrgencyListDataItemType = Literal["alert_urgencies"] @@ -11,5 +11,5 @@ def check_alert_urgency_list_data_item_type(value: str | None) -> AlertUrgencyLi if value is None: return None if value in ALERT_URGENCY_LIST_DATA_ITEM_TYPE_VALUES: - return cast(AlertUrgencyListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_URGENCY_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_urgency_response.py b/rootly_sdk/models/alert_urgency_response.py index c3fafb51..fcded868 100644 --- a/rootly_sdk/models/alert_urgency_response.py +++ b/rootly_sdk/models/alert_urgency_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class AlertUrgencyResponse: """ Attributes: data (AlertUrgencyResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "AlertUrgencyResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: AlertUrgencyResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 c013d891..9f88c165 100644 --- a/rootly_sdk/models/alert_urgency_response_data.py +++ b/rootly_sdk/models/alert_urgency_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/alert_urgency_response_data_type.py b/rootly_sdk/models/alert_urgency_response_data_type.py index ed1d9f16..70b30ed9 100644 --- a/rootly_sdk/models/alert_urgency_response_data_type.py +++ b/rootly_sdk/models/alert_urgency_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertUrgencyResponseDataType = Literal["alert_urgencies"] @@ -11,5 +11,5 @@ def check_alert_urgency_response_data_type(value: str | None) -> AlertUrgencyRes if value is None: return None if value in ALERT_URGENCY_RESPONSE_DATA_TYPE_VALUES: - return cast(AlertUrgencyResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERT_URGENCY_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alerts_source.py b/rootly_sdk/models/alerts_source.py index 3cc27deb..f8d01023 100644 --- a/rootly_sdk/models/alerts_source.py +++ b/rootly_sdk/models/alerts_source.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -34,32 +36,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 (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, + 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, deduplication_key_kind and deduplication_key_path are required. - 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_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 from the request body. - 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 + 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 + the underlying source. `auto_resolve`, `resolve_state` and `field_mappings_attributes` apply to generic_webhook + sources; `accept_threaded_emails`, `notification_target_type` and `notification_target_id` apply to email + sources. + resolution_rule_attributes (AlertsSourceResolutionRuleAttributesType0 | None | Unset): Provide additional attributes for email alerts source - 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 + 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 """ name: str @@ -67,21 +69,21 @@ class AlertsSource: secret: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -101,7 +103,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - source_type: Unset | str = UNSET + source_type: str | Unset = UNSET if not isinstance(self.source_type, Unset): source_type = self.source_type @@ -109,27 +111,27 @@ def to_dict(self) -> dict[str, Any]: deduplicate_alerts_by_key = self.deduplicate_alerts_by_key - deduplication_key_kind: Unset | str = UNSET + deduplication_key_kind: str | Unset = UNSET if not isinstance(self.deduplication_key_kind, Unset): deduplication_key_kind = self.deduplication_key_kind - deduplication_key_path: None | Unset | str + deduplication_key_path: None | str | Unset if isinstance(self.deduplication_key_path, Unset): deduplication_key_path = UNSET else: deduplication_key_path = self.deduplication_key_path - deduplication_key_regexp: None | Unset | str + deduplication_key_regexp: None | str | Unset if isinstance(self.deduplication_key_regexp, Unset): deduplication_key_regexp = UNSET else: deduplication_key_regexp = self.deduplication_key_regexp - owner_group_ids: Unset | list[str] = UNSET + owner_group_ids: list[str] | Unset = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - alert_template_attributes: None | Unset | dict[str, Any] + alert_template_attributes: dict[str, Any] | None | Unset if isinstance(self.alert_template_attributes, Unset): alert_template_attributes = UNSET elif isinstance(self.alert_template_attributes, AlertsSourceAlertTemplateAttributesType0): @@ -137,14 +139,14 @@ def to_dict(self) -> dict[str, Any]: else: alert_template_attributes = self.alert_template_attributes - alert_source_urgency_rules_attributes: Unset | list[dict[str, Any]] = UNSET + alert_source_urgency_rules_attributes: list[dict[str, Any]] | Unset = 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: None | Unset | dict[str, Any] + sourceable_attributes: dict[str, Any] | None | Unset if isinstance(self.sourceable_attributes, Unset): sourceable_attributes = UNSET elif isinstance(self.sourceable_attributes, AlertsSourceSourceableAttributesType0): @@ -152,7 +154,7 @@ def to_dict(self) -> dict[str, Any]: else: sourceable_attributes = self.sourceable_attributes - resolution_rule_attributes: None | Unset | dict[str, Any] + resolution_rule_attributes: dict[str, Any] | None | Unset if isinstance(self.resolution_rule_attributes, Unset): resolution_rule_attributes = UNSET elif isinstance(self.resolution_rule_attributes, AlertsSourceResolutionRuleAttributesType0): @@ -160,20 +162,20 @@ def to_dict(self) -> dict[str, Any]: else: resolution_rule_attributes = self.resolution_rule_attributes - alert_source_fields_attributes: Unset | list[dict[str, Any]] = UNSET + alert_source_fields_attributes: list[dict[str, Any]] | Unset = 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 | Unset | str + email: None | str | Unset if isinstance(self.email, Unset): email = UNSET else: email = self.email - webhook_endpoint: None | Unset | str + webhook_endpoint: None | str | Unset if isinstance(self.webhook_endpoint, Unset): webhook_endpoint = UNSET else: @@ -249,7 +251,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: Unset | AlertsSourceSourceType + source_type: AlertsSourceSourceType | Unset if isinstance(_source_type, Unset): source_type = UNSET else: @@ -260,35 +262,33 @@ 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: Unset | AlertsSourceDeduplicationKeyKind + deduplication_key_kind: AlertsSourceDeduplicationKeyKind | Unset 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 | Unset | str: + def _parse_deduplication_key_path(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) deduplication_key_path = _parse_deduplication_key_path(d.pop("deduplication_key_path", UNSET)) - def _parse_deduplication_key_regexp(data: object) -> None | Unset | str: + def _parse_deduplication_key_regexp(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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, - ) -> Union["AlertsSourceAlertTemplateAttributesType0", None, Unset]: + def _parse_alert_template_attributes(data: object) -> AlertsSourceAlertTemplateAttributesType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -299,22 +299,26 @@ def _parse_alert_template_attributes( alert_template_attributes_type_0 = AlertsSourceAlertTemplateAttributesType0.from_dict(data) return alert_template_attributes_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["AlertsSourceAlertTemplateAttributesType0", None, Unset], data) + return cast(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) - 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: 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 + ) + ) - 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) -> Union["AlertsSourceSourceableAttributesType0", None, Unset]: + def _parse_sourceable_attributes(data: object) -> AlertsSourceSourceableAttributesType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -325,15 +329,13 @@ def _parse_sourceable_attributes(data: object) -> Union["AlertsSourceSourceableA sourceable_attributes_type_0 = AlertsSourceSourceableAttributesType0.from_dict(data) return sourceable_attributes_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["AlertsSourceSourceableAttributesType0", None, Unset], data) + return cast(AlertsSourceSourceableAttributesType0 | None | Unset, data) sourceable_attributes = _parse_sourceable_attributes(d.pop("sourceable_attributes", UNSET)) - def _parse_resolution_rule_attributes( - data: object, - ) -> Union["AlertsSourceResolutionRuleAttributesType0", None, Unset]: + def _parse_resolution_rule_attributes(data: object) -> AlertsSourceResolutionRuleAttributesType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -344,36 +346,38 @@ def _parse_resolution_rule_attributes( resolution_rule_attributes_type_0 = AlertsSourceResolutionRuleAttributesType0.from_dict(data) return resolution_rule_attributes_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["AlertsSourceResolutionRuleAttributesType0", None, Unset], data) + return cast(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) - 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: 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 + ) - 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 | Unset | str: + def _parse_email(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) email = _parse_email(d.pop("email", UNSET)) - def _parse_webhook_endpoint(data: object) -> None | Unset | str: + def _parse_webhook_endpoint(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 4c60c844..a9f3276f 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,19 +15,19 @@ class AlertsSourceAlertSourceFieldsAttributesItem: """ Attributes: - 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): 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: Unset | str = UNSET - template_body: None | Unset | str = UNSET + alert_field_id: str | Unset = UNSET + template_body: None | str | Unset = 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 | Unset | str + template_body: None | str | Unset if isinstance(self.template_body, Unset): template_body = UNSET else: @@ -46,12 +48,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 | Unset | str: + def _parse_template_body(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 a462d04a..f3cb5e0c 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -25,53 +27,53 @@ class AlertsSourceAlertSourceUrgencyRulesAttributesItem: """ Attributes: - 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 + 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 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 + value (str | Unset): Value that the extracted payload data is compared to using the specified operator to determine a match - 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 + 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 """ - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - json_path: None | Unset | str + json_path: None | str | Unset if isinstance(self.json_path, Unset): json_path = UNSET else: json_path = self.json_path - operator: Unset | str = UNSET + operator: str | Unset = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: Unset | str = UNSET + conditionable_type: str | Unset = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | Unset | str + conditionable_id: None | str | Unset if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -101,17 +103,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 | Unset | str: + def _parse_json_path(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) json_path = _parse_json_path(d.pop("json_path", UNSET)) _operator = d.pop("operator", UNSET) - operator: Unset | AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator + operator: AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator | Unset if isinstance(_operator, Unset): operator = UNSET else: @@ -120,7 +122,7 @@ def _parse_json_path(data: object) -> None | Unset | str: value = d.pop("value", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Unset | AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType + conditionable_type: AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType | Unset if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -128,17 +130,17 @@ def _parse_json_path(data: object) -> None | Unset | str: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | Unset | str: + def _parse_conditionable_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: Unset | AlertsSourceAlertSourceUrgencyRulesAttributesItemKind + kind: AlertsSourceAlertSourceUrgencyRulesAttributesItemKind | Unset if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item_conditionable_type.py b/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item_conditionable_type.py index 1c5805af..d32be709 100644 --- a/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item_conditionable_type.py +++ b/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item_conditionable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType = Literal["AlertField"] @@ -15,7 +15,7 @@ def check_alerts_source_alert_source_urgency_rules_attributes_item_conditionable if value is None: return None if value in ALERTS_SOURCE_ALERT_SOURCE_URGENCY_RULES_ATTRIBUTES_ITEM_CONDITIONABLE_TYPE_VALUES: - return cast(AlertsSourceAlertSourceUrgencyRulesAttributesItemConditionableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERTS_SOURCE_ALERT_SOURCE_URGENCY_RULES_ATTRIBUTES_ITEM_CONDITIONABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item_kind.py b/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item_kind.py index 9997c71b..d3a808e0 100644 --- a/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item_kind.py +++ b/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertsSourceAlertSourceUrgencyRulesAttributesItemKind = Literal["alert_field", "payload"] @@ -16,7 +16,7 @@ def check_alerts_source_alert_source_urgency_rules_attributes_item_kind( if value is None: return None if value in ALERTS_SOURCE_ALERT_SOURCE_URGENCY_RULES_ATTRIBUTES_ITEM_KIND_VALUES: - return cast(AlertsSourceAlertSourceUrgencyRulesAttributesItemKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERTS_SOURCE_ALERT_SOURCE_URGENCY_RULES_ATTRIBUTES_ITEM_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item_operator.py b/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item_operator.py index fc78fcc5..f838e560 100644 --- a/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item_operator.py +++ b/rootly_sdk/models/alerts_source_alert_source_urgency_rules_attributes_item_operator.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator = Literal["contains", "does_not_contain", "is", "is_not"] @@ -18,7 +18,7 @@ def check_alerts_source_alert_source_urgency_rules_attributes_item_operator( if value is None: return None if value in ALERTS_SOURCE_ALERT_SOURCE_URGENCY_RULES_ATTRIBUTES_ITEM_OPERATOR_VALUES: - return cast(AlertsSourceAlertSourceUrgencyRulesAttributesItemOperator, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERTS_SOURCE_ALERT_SOURCE_URGENCY_RULES_ATTRIBUTES_ITEM_OPERATOR_VALUES!r}" ) 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 5cd8aa2f..139bdfa8 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,30 +15,30 @@ class AlertsSourceAlertTemplateAttributesType0: """ Attributes: - 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): The alert title. + description (None | str | Unset): The alert description. + external_url (None | str | Unset): The alert URL. """ - title: None | Unset | str = UNSET - description: None | Unset | str = UNSET - external_url: None | Unset | str = UNSET + title: None | str | Unset = UNSET + description: None | str | Unset = UNSET + external_url: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - title: None | Unset | str + title: None | str | Unset if isinstance(self.title, Unset): title = UNSET else: title = self.title - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - external_url: None | Unset | str + external_url: None | str | Unset if isinstance(self.external_url, Unset): external_url = UNSET else: @@ -58,30 +60,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 | Unset | str: + def _parse_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_external_url(data: object) -> None | Unset | str: + def _parse_external_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) diff --git a/rootly_sdk/models/alerts_source_deduplication_key_kind.py b/rootly_sdk/models/alerts_source_deduplication_key_kind.py index bf066d91..a68aae30 100644 --- a/rootly_sdk/models/alerts_source_deduplication_key_kind.py +++ b/rootly_sdk/models/alerts_source_deduplication_key_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertsSourceDeduplicationKeyKind = Literal["payload"] @@ -11,5 +11,5 @@ def check_alerts_source_deduplication_key_kind(value: str | None) -> AlertsSourc if value is None: return None if value in ALERTS_SOURCE_DEDUPLICATION_KEY_KIND_VALUES: - return cast(AlertsSourceDeduplicationKeyKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERTS_SOURCE_DEDUPLICATION_KEY_KIND_VALUES!r}") diff --git a/rootly_sdk/models/alerts_source_list.py b/rootly_sdk/models/alerts_source_list.py index 8335e9c5..78cc6909 100644 --- a/rootly_sdk/models/alerts_source_list.py +++ b/rootly_sdk/models/alerts_source_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class AlertsSourceList: """ Attributes: - data (list['AlertsSourceListDataItem']): + data (list[AlertsSourceListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["AlertsSourceListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[AlertsSourceListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 5650b90d..26b483bb 100644 --- a/rootly_sdk/models/alerts_source_list_data_item.py +++ b/rootly_sdk/models/alerts_source_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/alerts_source_list_data_item_type.py b/rootly_sdk/models/alerts_source_list_data_item_type.py index e37f5c64..94338d6a 100644 --- a/rootly_sdk/models/alerts_source_list_data_item_type.py +++ b/rootly_sdk/models/alerts_source_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertsSourceListDataItemType = Literal["alert_sources"] @@ -11,5 +11,5 @@ def check_alerts_source_list_data_item_type(value: str | None) -> AlertsSourceLi if value is None: return None if value in ALERTS_SOURCE_LIST_DATA_ITEM_TYPE_VALUES: - return cast(AlertsSourceListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERTS_SOURCE_LIST_DATA_ITEM_TYPE_VALUES!r}") 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 5364cf61..4bfaa3c1 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -32,67 +34,67 @@ class AlertsSourceResolutionRuleAttributesType0: """Provide additional attributes for email alerts source Attributes: - enabled (Union[Unset, bool]): Set this to true to enable the auto resolution rule - condition_type (Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionType]): The type of condition to + enabled (bool | Unset): Set this to true to enable the auto resolution rule + condition_type (AlertsSourceResolutionRuleAttributesType0ConditionType | Unset): The type of condition to evaluate to apply auto resolution rule - 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 + 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 """ - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: enabled = self.enabled - condition_type: Unset | str = UNSET + condition_type: str | Unset = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - identifier_matchable_type: Unset | str = UNSET + identifier_matchable_type: str | Unset = UNSET if not isinstance(self.identifier_matchable_type, Unset): identifier_matchable_type = self.identifier_matchable_type - identifier_matchable_id: None | Unset | str + identifier_matchable_id: None | str | Unset if isinstance(self.identifier_matchable_id, Unset): identifier_matchable_id = UNSET else: identifier_matchable_id = self.identifier_matchable_id - identifier_reference_kind: Unset | str = UNSET + identifier_reference_kind: str | Unset = UNSET if not isinstance(self.identifier_reference_kind, Unset): identifier_reference_kind = self.identifier_reference_kind - identifier_json_path: None | Unset | str + identifier_json_path: None | str | Unset if isinstance(self.identifier_json_path, Unset): identifier_json_path = UNSET else: identifier_json_path = self.identifier_json_path - identifier_value_regex: None | Unset | str + identifier_value_regex: None | str | Unset if isinstance(self.identifier_value_regex, Unset): identifier_value_regex = UNSET else: identifier_value_regex = self.identifier_value_regex - conditions_attributes: Unset | list[dict[str, Any]] = UNSET + conditions_attributes: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.conditions_attributes, Unset): conditions_attributes = [] for conditions_attributes_item_data in self.conditions_attributes: @@ -131,14 +133,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: Unset | AlertsSourceResolutionRuleAttributesType0ConditionType + condition_type: AlertsSourceResolutionRuleAttributesType0ConditionType | Unset 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: Unset | AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType + identifier_matchable_type: AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType | Unset if isinstance(_identifier_matchable_type, Unset): identifier_matchable_type = UNSET else: @@ -146,17 +148,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _identifier_matchable_type ) - def _parse_identifier_matchable_id(data: object) -> None | Unset | str: + def _parse_identifier_matchable_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: Unset | AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind + identifier_reference_kind: AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind | Unset if isinstance(_identifier_reference_kind, Unset): identifier_reference_kind = UNSET else: @@ -164,32 +166,36 @@ def _parse_identifier_matchable_id(data: object) -> None | Unset | str: _identifier_reference_kind ) - def _parse_identifier_json_path(data: object) -> None | Unset | str: + def _parse_identifier_json_path(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) identifier_json_path = _parse_identifier_json_path(d.pop("identifier_json_path", UNSET)) - def _parse_identifier_value_regex(data: object) -> None | Unset | str: + def _parse_identifier_value_regex(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) identifier_value_regex = _parse_identifier_value_regex(d.pop("identifier_value_regex", UNSET)) - conditions_attributes = [] _conditions_attributes = d.pop("conditions_attributes", UNSET) - for conditions_attributes_item_data in _conditions_attributes or []: - conditions_attributes_item = AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem.from_dict( - conditions_attributes_item_data - ) + 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 + ) + ) - 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_condition_type.py b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_condition_type.py index 9847d507..b3f4129e 100644 --- a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_condition_type.py +++ b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertsSourceResolutionRuleAttributesType0ConditionType = Literal["all", "any"] @@ -16,7 +16,7 @@ def check_alerts_source_resolution_rule_attributes_type_0_condition_type( if value is None: return None if value in ALERTS_SOURCE_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITION_TYPE_VALUES: - return cast(AlertsSourceResolutionRuleAttributesType0ConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERTS_SOURCE_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITION_TYPE_VALUES!r}" ) 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 37aa59ad..ccc2ade1 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -25,55 +27,54 @@ class AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItem: """ Attributes: - field (Union[None, Unset, str]): JSON path expression to extract a specific value from the alert's payload for + field (None | str | Unset): JSON path expression to extract a specific value from the alert's payload for evaluation - operator (Union[Unset, AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator]): Comparison + operator (AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset): 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 + value (str | Unset): Value that the extracted payload data is compared to using the specified operator to determine a match - 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_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 """ - field: None | Unset | str = UNSET - operator: Unset | AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator = UNSET - value: Unset | str = UNSET - conditionable_type: Unset | AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType = ( + field: None | str | Unset = UNSET + operator: AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset = UNSET + value: str | Unset = UNSET + conditionable_type: AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset = ( UNSET ) - conditionable_id: None | Unset | str = UNSET - kind: Unset | AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind = UNSET + conditionable_id: None | str | Unset = UNSET + kind: AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: None | Unset | str + field: None | str | Unset if isinstance(self.field, Unset): field = UNSET else: field = self.field - operator: Unset | str = UNSET + operator: str | Unset = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: Unset | str = UNSET + conditionable_type: str | Unset = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | Unset | str + conditionable_id: None | str | Unset if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -99,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 | Unset | str: + def _parse_field(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) field = _parse_field(d.pop("field", UNSET)) _operator = d.pop("operator", UNSET) - operator: Unset | AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator + operator: AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset if isinstance(_operator, Unset): operator = UNSET else: @@ -120,7 +121,7 @@ def _parse_field(data: object) -> None | Unset | str: value = d.pop("value", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Unset | AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType + conditionable_type: AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -130,17 +131,17 @@ def _parse_field(data: object) -> None | Unset | str: ) ) - def _parse_conditionable_id(data: object) -> None | Unset | str: + def _parse_conditionable_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: Unset | AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind + kind: AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset if isinstance(_kind, Unset): kind = UNSET else: diff --git a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item_conditionable_type.py b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item_conditionable_type.py index 5c9b835c..2249e26d 100644 --- a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item_conditionable_type.py +++ b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item_conditionable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType = Literal["AlertField"] @@ -15,7 +15,7 @@ def check_alerts_source_resolution_rule_attributes_type_0_conditions_attributes_ if value is None: return None if value in ALERTS_SOURCE_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITIONS_ATTRIBUTES_ITEM_CONDITIONABLE_TYPE_VALUES: - return cast(AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemConditionableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERTS_SOURCE_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITIONS_ATTRIBUTES_ITEM_CONDITIONABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item_kind.py b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item_kind.py index eff7d1eb..3444b9c8 100644 --- a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item_kind.py +++ b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind = Literal["alert_field", "payload"] @@ -16,7 +16,7 @@ def check_alerts_source_resolution_rule_attributes_type_0_conditions_attributes_ if value is None: return None if value in ALERTS_SOURCE_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITIONS_ATTRIBUTES_ITEM_KIND_VALUES: - return cast(AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERTS_SOURCE_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITIONS_ATTRIBUTES_ITEM_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item_operator.py b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item_operator.py index 506c12ee..f40705c9 100644 --- a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item_operator.py +++ b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_conditions_attributes_item_operator.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator = Literal[ "contains", "does_not_contain", "ends_with", "is", "is_not", "starts_with" @@ -22,7 +22,7 @@ def check_alerts_source_resolution_rule_attributes_type_0_conditions_attributes_ if value is None: return None if value in ALERTS_SOURCE_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITIONS_ATTRIBUTES_ITEM_OPERATOR_VALUES: - return cast(AlertsSourceResolutionRuleAttributesType0ConditionsAttributesItemOperator, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERTS_SOURCE_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITIONS_ATTRIBUTES_ITEM_OPERATOR_VALUES!r}" ) diff --git a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_identifier_matchable_type.py b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_identifier_matchable_type.py index 8fc10e10..d79dd0b0 100644 --- a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_identifier_matchable_type.py +++ b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_identifier_matchable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType = Literal["AlertField"] @@ -15,7 +15,7 @@ def check_alerts_source_resolution_rule_attributes_type_0_identifier_matchable_t if value is None: return None if value in ALERTS_SOURCE_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_IDENTIFIER_MATCHABLE_TYPE_VALUES: - return cast(AlertsSourceResolutionRuleAttributesType0IdentifierMatchableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERTS_SOURCE_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_IDENTIFIER_MATCHABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_identifier_reference_kind.py b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_identifier_reference_kind.py index bdcbb178..8acee44d 100644 --- a/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_identifier_reference_kind.py +++ b/rootly_sdk/models/alerts_source_resolution_rule_attributes_type_0_identifier_reference_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind = Literal["alert_field", "payload"] @@ -16,7 +16,7 @@ def check_alerts_source_resolution_rule_attributes_type_0_identifier_reference_k if value is None: return None if value in ALERTS_SOURCE_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_IDENTIFIER_REFERENCE_KIND_VALUES: - return cast(AlertsSourceResolutionRuleAttributesType0IdentifierReferenceKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERTS_SOURCE_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_IDENTIFIER_REFERENCE_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/alerts_source_response.py b/rootly_sdk/models/alerts_source_response.py index f7e132aa..2def5f16 100644 --- a/rootly_sdk/models/alerts_source_response.py +++ b/rootly_sdk/models/alerts_source_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class AlertsSourceResponse: """ Attributes: data (AlertsSourceResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "AlertsSourceResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: AlertsSourceResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 1c8f6d20..5413efa8 100644 --- a/rootly_sdk/models/alerts_source_response_data.py +++ b/rootly_sdk/models/alerts_source_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/alerts_source_response_data_type.py b/rootly_sdk/models/alerts_source_response_data_type.py index e2bdbeb4..8d928572 100644 --- a/rootly_sdk/models/alerts_source_response_data_type.py +++ b/rootly_sdk/models/alerts_source_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertsSourceResponseDataType = Literal["alert_sources"] @@ -11,5 +11,5 @@ def check_alerts_source_response_data_type(value: str | None) -> AlertsSourceRes if value is None: return None if value in ALERTS_SOURCE_RESPONSE_DATA_TYPE_VALUES: - return cast(AlertsSourceResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERTS_SOURCE_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alerts_source_source_type.py b/rootly_sdk/models/alerts_source_source_type.py index 7762d668..f39e15a3 100644 --- a/rootly_sdk/models/alerts_source_source_type.py +++ b/rootly_sdk/models/alerts_source_source_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertsSourceSourceType = Literal[ "alertmanager", @@ -59,5 +59,5 @@ def check_alerts_source_source_type(value: str | None) -> AlertsSourceSourceType if value is None: return None if value in ALERTS_SOURCE_SOURCE_TYPE_VALUES: - return cast(AlertsSourceSourceType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERTS_SOURCE_SOURCE_TYPE_VALUES!r}") 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 1c5966d0..41c6f29b 100644 --- a/rootly_sdk/models/alerts_source_sourceable_attributes_type_0.py +++ b/rootly_sdk/models/alerts_source_sourceable_attributes_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast from uuid import UUID @@ -5,6 +7,10 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..models.alerts_source_sourceable_attributes_type_0_notification_target_type import ( + AlertsSourceSourceableAttributesType0NotificationTargetType, + check_alerts_source_sourceable_attributes_type_0_notification_target_type, +) from ..types import UNSET, Unset if TYPE_CHECKING: @@ -19,35 +25,45 @@ @_attrs_define class AlertsSourceSourceableAttributesType0: """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. + `field_mappings_attributes` apply to generic_webhook sources; `accept_threaded_emails`, `notification_target_type` + and `notification_target_id` apply 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 + id (UUID | Unset): Unique ID of the underlying source. Read-only; it is resolved from the alert source itself on + update. + auto_resolve (bool | Unset): 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 + 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 + notification_target_type (AlertsSourceSourceableAttributesType0NotificationTargetType | Unset): Email sources + only. The type of the notification target every alert from this source pages directly; While it points to an + active, pageable target, Alert Routes are not evaluated. Only used when the `email-alert-source-notification- + target` feature flag is on for the team. + notification_target_id (None | str | Unset): Email sources only. The ID of the notification target. Set to null + to clear it; this also clears `notification_target_type`. Only used when the `email-alert-source-notification- + target` feature flag is on for the team. + field_mappings_attributes (list[AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem] | Unset): + Specify rules to auto resolve alerts """ - 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 + id: UUID | Unset = UNSET + auto_resolve: bool | Unset = UNSET + resolve_state: None | str | Unset = UNSET + accept_threaded_emails: bool | Unset = UNSET + notification_target_type: AlertsSourceSourceableAttributesType0NotificationTargetType | Unset = UNSET + notification_target_id: None | str | Unset = UNSET + field_mappings_attributes: list[AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: Unset | str = UNSET + id: str | Unset = UNSET if not isinstance(self.id, Unset): id = str(self.id) auto_resolve = self.auto_resolve - resolve_state: None | Unset | str + resolve_state: None | str | Unset if isinstance(self.resolve_state, Unset): resolve_state = UNSET else: @@ -55,7 +71,17 @@ def to_dict(self) -> dict[str, Any]: accept_threaded_emails = self.accept_threaded_emails - field_mappings_attributes: Unset | list[dict[str, Any]] = UNSET + notification_target_type: str | Unset = UNSET + if not isinstance(self.notification_target_type, Unset): + notification_target_type = self.notification_target_type + + notification_target_id: None | str | Unset + if isinstance(self.notification_target_id, Unset): + notification_target_id = UNSET + else: + notification_target_id = self.notification_target_id + + field_mappings_attributes: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.field_mappings_attributes, Unset): field_mappings_attributes = [] for field_mappings_attributes_item_data in self.field_mappings_attributes: @@ -73,6 +99,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["resolve_state"] = resolve_state if accept_threaded_emails is not UNSET: field_dict["accept_threaded_emails"] = accept_threaded_emails + if notification_target_type is not UNSET: + field_dict["notification_target_type"] = notification_target_type + if notification_target_id is not UNSET: + field_dict["notification_target_id"] = notification_target_id if field_mappings_attributes is not UNSET: field_dict["field_mappings_attributes"] = field_mappings_attributes @@ -86,7 +116,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: Unset | UUID + id: UUID | Unset if isinstance(_id, Unset): id = UNSET else: @@ -94,31 +124,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: auto_resolve = d.pop("auto_resolve", UNSET) - def _parse_resolve_state(data: object) -> None | Unset | str: + def _parse_resolve_state(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) - for field_mappings_attributes_item_data in _field_mappings_attributes or []: - field_mappings_attributes_item = AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem.from_dict( - field_mappings_attributes_item_data + _notification_target_type = d.pop("notification_target_type", UNSET) + notification_target_type: AlertsSourceSourceableAttributesType0NotificationTargetType | Unset + if isinstance(_notification_target_type, Unset): + notification_target_type = UNSET + else: + notification_target_type = check_alerts_source_sourceable_attributes_type_0_notification_target_type( + _notification_target_type ) - field_mappings_attributes.append(field_mappings_attributes_item) + def _parse_notification_target_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + notification_target_id = _parse_notification_target_id(d.pop("notification_target_id", UNSET)) + + _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 + ) + ) + + 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, + notification_target_type=notification_target_type, + notification_target_id=notification_target_id, field_mappings_attributes=field_mappings_attributes, ) 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 5c28c098..af6141fc 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -17,19 +19,19 @@ class AlertsSourceSourceableAttributesType0FieldMappingsAttributesItem: """ Attributes: - 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 + 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 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: Unset | AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField = UNSET - json_path: Unset | str = UNSET + field: AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField | Unset = UNSET + json_path: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field: Unset | str = UNSET + field: str | Unset = UNSET if not isinstance(self.field, Unset): field = self.field @@ -49,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) _field = d.pop("field", UNSET) - field: Unset | AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField + field: AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField | Unset if isinstance(_field, Unset): field = UNSET else: diff --git a/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_field_mappings_attributes_item_field.py b/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_field_mappings_attributes_item_field.py index fef68eab..29d94cb8 100644 --- a/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_field_mappings_attributes_item_field.py +++ b/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_field_mappings_attributes_item_field.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField = Literal[ "alert_description", @@ -29,7 +29,7 @@ def check_alerts_source_sourceable_attributes_type_0_field_mappings_attributes_i if value is None: return None if value in ALERTS_SOURCE_SOURCEABLE_ATTRIBUTES_TYPE_0_FIELD_MAPPINGS_ATTRIBUTES_ITEM_FIELD_VALUES: - return cast(AlertsSourceSourceableAttributesType0FieldMappingsAttributesItemField, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ALERTS_SOURCE_SOURCEABLE_ATTRIBUTES_TYPE_0_FIELD_MAPPINGS_ATTRIBUTES_ITEM_FIELD_VALUES!r}" ) diff --git a/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_notification_target_type.py b/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_notification_target_type.py new file mode 100644 index 00000000..e77a2dfa --- /dev/null +++ b/rootly_sdk/models/alerts_source_sourceable_attributes_type_0_notification_target_type.py @@ -0,0 +1,27 @@ +from typing import Literal + +AlertsSourceSourceableAttributesType0NotificationTargetType = Literal[ + "EscalationPolicy", "Functionality", "Group", "Service", "User" +] + +ALERTS_SOURCE_SOURCEABLE_ATTRIBUTES_TYPE_0_NOTIFICATION_TARGET_TYPE_VALUES: set[ + AlertsSourceSourceableAttributesType0NotificationTargetType +] = { + "EscalationPolicy", + "Functionality", + "Group", + "Service", + "User", +} + + +def check_alerts_source_sourceable_attributes_type_0_notification_target_type( + value: str | None, +) -> AlertsSourceSourceableAttributesType0NotificationTargetType | None: + if value is None: + return None + if value in ALERTS_SOURCE_SOURCEABLE_ATTRIBUTES_TYPE_0_NOTIFICATION_TARGET_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ALERTS_SOURCE_SOURCEABLE_ATTRIBUTES_TYPE_0_NOTIFICATION_TARGET_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/alerts_source_status.py b/rootly_sdk/models/alerts_source_status.py index 9c2a0255..e62c39a2 100644 --- a/rootly_sdk/models/alerts_source_status.py +++ b/rootly_sdk/models/alerts_source_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AlertsSourceStatus = Literal["connected", "setup_complete", "setup_incomplete"] @@ -13,5 +13,5 @@ def check_alerts_source_status(value: str | None) -> AlertsSourceStatus | None: if value is None: return None if value in ALERTS_SOURCE_STATUS_VALUES: - return cast(AlertsSourceStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ALERTS_SOURCE_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/api_key.py b/rootly_sdk/models/api_key.py index 8cbe7a1b..6868034f 100644 --- a/rootly_sdk/models/api_key.py +++ b/rootly_sdk/models/api_key.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,24 +20,27 @@ class ApiKey: kind (ApiKeyKind): The kind of the API key created_at (str): Date of creation updated_at (str): Date of last update - 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 + description (None | str | Unset): A description of the API key + group_id (None | str | Unset): The group (team) ID for team API keys. Keys created via the API have exactly one + group; for keys with multiple groups this is the first group. + 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 """ name: str kind: ApiKeyKind created_at: str updated_at: str - 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 + 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 + expires_at: None | str | Unset = UNSET + last_used_at: None | str | Unset = UNSET + grace_period_ends_at: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -47,37 +52,43 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - role_id: None | Unset | str + group_id: None | str | Unset + if isinstance(self.group_id, Unset): + group_id = UNSET + else: + group_id = self.group_id + + role_id: None | str | Unset if isinstance(self.role_id, Unset): role_id = UNSET else: role_id = self.role_id - on_call_role_id: None | Unset | str + on_call_role_id: None | str | Unset 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 | Unset | str + expires_at: None | str | Unset if isinstance(self.expires_at, Unset): expires_at = UNSET else: expires_at = self.expires_at - last_used_at: None | Unset | str + last_used_at: None | str | Unset if isinstance(self.last_used_at, Unset): last_used_at = UNSET else: last_used_at = self.last_used_at - grace_period_ends_at: None | Unset | str + grace_period_ends_at: None | str | Unset if isinstance(self.grace_period_ends_at, Unset): grace_period_ends_at = UNSET else: @@ -95,6 +106,8 @@ def to_dict(self) -> dict[str, Any]: ) if description is not UNSET: field_dict["description"] = description + if group_id is not UNSET: + field_dict["group_id"] = group_id if role_id is not UNSET: field_dict["role_id"] = role_id if on_call_role_id is not UNSET: @@ -119,57 +132,66 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_role_id(data: object) -> None | Unset | str: + def _parse_group_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + group_id = _parse_group_id(d.pop("group_id", UNSET)) + + def _parse_role_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) role_id = _parse_role_id(d.pop("role_id", UNSET)) - def _parse_on_call_role_id(data: object) -> None | Unset | str: + def _parse_on_call_role_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) on_call_role_id = _parse_on_call_role_id(d.pop("on_call_role_id", UNSET)) - def _parse_expires_at(data: object) -> None | Unset | str: + def _parse_expires_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) - def _parse_last_used_at(data: object) -> None | Unset | str: + def _parse_last_used_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) last_used_at = _parse_last_used_at(d.pop("last_used_at", UNSET)) - def _parse_grace_period_ends_at(data: object) -> None | Unset | str: + def _parse_grace_period_ends_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) grace_period_ends_at = _parse_grace_period_ends_at(d.pop("grace_period_ends_at", UNSET)) @@ -179,6 +201,7 @@ def _parse_grace_period_ends_at(data: object) -> None | Unset | str: created_at=created_at, updated_at=updated_at, description=description, + group_id=group_id, role_id=role_id, on_call_role_id=on_call_role_id, expires_at=expires_at, diff --git a/rootly_sdk/models/api_key_kind.py b/rootly_sdk/models/api_key_kind.py index 1d9a84c0..30fec45d 100644 --- a/rootly_sdk/models/api_key_kind.py +++ b/rootly_sdk/models/api_key_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ApiKeyKind = Literal["organization", "personal", "team"] @@ -13,5 +13,5 @@ def check_api_key_kind(value: str | None) -> ApiKeyKind | None: if value is None: return None if value in API_KEY_KIND_VALUES: - return cast(ApiKeyKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {API_KEY_KIND_VALUES!r}") diff --git a/rootly_sdk/models/api_key_list.py b/rootly_sdk/models/api_key_list.py index a2dab4b9..8eb4a375 100644 --- a/rootly_sdk/models/api_key_list.py +++ b/rootly_sdk/models/api_key_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class ApiKeyList: """ Attributes: - data (list['ApiKeyListDataItem']): + data (list[ApiKeyListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["ApiKeyListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[ApiKeyListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 e34eec4d..45c001d8 100644 --- a/rootly_sdk/models/api_key_list_data_item.py +++ b/rootly_sdk/models/api_key_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/api_key_list_data_item_type.py b/rootly_sdk/models/api_key_list_data_item_type.py index 09768eb6..d355cb41 100644 --- a/rootly_sdk/models/api_key_list_data_item_type.py +++ b/rootly_sdk/models/api_key_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ApiKeyListDataItemType = Literal["api_keys"] @@ -11,5 +11,5 @@ def check_api_key_list_data_item_type(value: str | None) -> ApiKeyListDataItemTy if value is None: return None if value in API_KEY_LIST_DATA_ITEM_TYPE_VALUES: - return cast(ApiKeyListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {API_KEY_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/api_key_response.py b/rootly_sdk/models/api_key_response.py index b9623902..0d5e4e70 100644 --- a/rootly_sdk/models/api_key_response.py +++ b/rootly_sdk/models/api_key_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class ApiKeyResponse: """ Attributes: data (ApiKeyResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "ApiKeyResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: ApiKeyResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 651f44fd..a0b026d9 100644 --- a/rootly_sdk/models/api_key_response_data.py +++ b/rootly_sdk/models/api_key_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/api_key_response_data_type.py b/rootly_sdk/models/api_key_response_data_type.py index 6aeeacdd..2d31809d 100644 --- a/rootly_sdk/models/api_key_response_data_type.py +++ b/rootly_sdk/models/api_key_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ApiKeyResponseDataType = Literal["api_keys"] @@ -11,5 +11,5 @@ def check_api_key_response_data_type(value: str | None) -> ApiKeyResponseDataTyp if value is None: return None if value in API_KEY_RESPONSE_DATA_TYPE_VALUES: - return cast(ApiKeyResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {API_KEY_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/api_key_with_token_response.py b/rootly_sdk/models/api_key_with_token_response.py index 6621fe08..94a206e9 100644 --- a/rootly_sdk/models/api_key_with_token_response.py +++ b/rootly_sdk/models/api_key_with_token_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class ApiKeyWithTokenResponse: """ Attributes: data (ApiKeyWithTokenResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "ApiKeyWithTokenResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: ApiKeyWithTokenResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 1b87d1ac..92e10765 100644 --- a/rootly_sdk/models/api_key_with_token_response_data.py +++ b/rootly_sdk/models/api_key_with_token_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: 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 daa23b56..a9de05c5 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,12 +21,14 @@ 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 (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 + description (None | str | Unset): A description of the API key + group_id (None | str | Unset): The group (team) ID for team API keys. Keys created via the API have exactly one + group; for keys with multiple groups this is the first group. + 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 """ name: str @@ -32,12 +36,13 @@ class ApiKeyWithTokenResponseDataAttributes: created_at: str updated_at: str token: str - 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 + 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 + expires_at: None | str | Unset = UNSET + last_used_at: None | str | Unset = UNSET + grace_period_ends_at: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,37 +56,43 @@ def to_dict(self) -> dict[str, Any]: token = self.token - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - role_id: None | Unset | str + group_id: None | str | Unset + if isinstance(self.group_id, Unset): + group_id = UNSET + else: + group_id = self.group_id + + role_id: None | str | Unset if isinstance(self.role_id, Unset): role_id = UNSET else: role_id = self.role_id - on_call_role_id: None | Unset | str + on_call_role_id: None | str | Unset 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 | Unset | str + expires_at: None | str | Unset if isinstance(self.expires_at, Unset): expires_at = UNSET else: expires_at = self.expires_at - last_used_at: None | Unset | str + last_used_at: None | str | Unset if isinstance(self.last_used_at, Unset): last_used_at = UNSET else: last_used_at = self.last_used_at - grace_period_ends_at: None | Unset | str + grace_period_ends_at: None | str | Unset if isinstance(self.grace_period_ends_at, Unset): grace_period_ends_at = UNSET else: @@ -100,6 +111,8 @@ def to_dict(self) -> dict[str, Any]: ) if description is not UNSET: field_dict["description"] = description + if group_id is not UNSET: + field_dict["group_id"] = group_id if role_id is not UNSET: field_dict["role_id"] = role_id if on_call_role_id is not UNSET: @@ -126,57 +139,66 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: token = d.pop("token") - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_role_id(data: object) -> None | Unset | str: + def _parse_group_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + group_id = _parse_group_id(d.pop("group_id", UNSET)) + + def _parse_role_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) role_id = _parse_role_id(d.pop("role_id", UNSET)) - def _parse_on_call_role_id(data: object) -> None | Unset | str: + def _parse_on_call_role_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) on_call_role_id = _parse_on_call_role_id(d.pop("on_call_role_id", UNSET)) - def _parse_expires_at(data: object) -> None | Unset | str: + def _parse_expires_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) - def _parse_last_used_at(data: object) -> None | Unset | str: + def _parse_last_used_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) last_used_at = _parse_last_used_at(d.pop("last_used_at", UNSET)) - def _parse_grace_period_ends_at(data: object) -> None | Unset | str: + def _parse_grace_period_ends_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) grace_period_ends_at = _parse_grace_period_ends_at(d.pop("grace_period_ends_at", UNSET)) @@ -187,6 +209,7 @@ def _parse_grace_period_ends_at(data: object) -> None | Unset | str: updated_at=updated_at, token=token, description=description, + group_id=group_id, role_id=role_id, on_call_role_id=on_call_role_id, expires_at=expires_at, diff --git a/rootly_sdk/models/api_key_with_token_response_data_type.py b/rootly_sdk/models/api_key_with_token_response_data_type.py index ad7bcdc4..da74ec2e 100644 --- a/rootly_sdk/models/api_key_with_token_response_data_type.py +++ b/rootly_sdk/models/api_key_with_token_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ApiKeyWithTokenResponseDataType = Literal["api_keys"] @@ -11,5 +11,5 @@ def check_api_key_with_token_response_data_type(value: str | None) -> ApiKeyWith if value is None: return None if value in API_KEY_WITH_TOKEN_RESPONSE_DATA_TYPE_VALUES: - return cast(ApiKeyWithTokenResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {API_KEY_WITH_TOKEN_RESPONSE_DATA_TYPE_VALUES!r}") 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 fb8c332c..15fe6ffc 100644 --- a/rootly_sdk/models/archive_google_chat_spaces_task_params.py +++ b/rootly_sdk/models/archive_google_chat_spaces_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,12 +23,12 @@ class ArchiveGoogleChatSpacesTaskParams: """ Attributes: - spaces (list['ArchiveGoogleChatSpacesTaskParamsSpacesItem']): - task_type (Union[Unset, ArchiveGoogleChatSpacesTaskParamsTaskType]): + spaces (list[ArchiveGoogleChatSpacesTaskParamsSpacesItem]): + task_type (ArchiveGoogleChatSpacesTaskParamsTaskType | Unset): """ - spaces: list["ArchiveGoogleChatSpacesTaskParamsSpacesItem"] - task_type: Unset | ArchiveGoogleChatSpacesTaskParamsTaskType = UNSET + spaces: list[ArchiveGoogleChatSpacesTaskParamsSpacesItem] + task_type: ArchiveGoogleChatSpacesTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -35,7 +37,7 @@ def to_dict(self) -> dict[str, Any]: spaces_item = spaces_item_data.to_dict() spaces.append(spaces_item) - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -66,7 +68,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: Unset | ArchiveGoogleChatSpacesTaskParamsTaskType + task_type: ArchiveGoogleChatSpacesTaskParamsTaskType | Unset 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 47588364..ae50ba42 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class ArchiveGoogleChatSpacesTaskParamsSpacesItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_google_chat_spaces_task_params_task_type.py b/rootly_sdk/models/archive_google_chat_spaces_task_params_task_type.py index 9443a09a..0fc62a90 100644 --- a/rootly_sdk/models/archive_google_chat_spaces_task_params_task_type.py +++ b/rootly_sdk/models/archive_google_chat_spaces_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ArchiveGoogleChatSpacesTaskParamsTaskType = Literal["archive_google_chat_spaces"] @@ -13,7 +13,7 @@ def check_archive_google_chat_spaces_task_params_task_type( if value is None: return None if value in ARCHIVE_GOOGLE_CHAT_SPACES_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(ArchiveGoogleChatSpacesTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ARCHIVE_GOOGLE_CHAT_SPACES_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 16877c4e..3dfbb94b 100644 --- a/rootly_sdk/models/archive_microsoft_teams_channels_task_params.py +++ b/rootly_sdk/models/archive_microsoft_teams_channels_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,13 +27,13 @@ class ArchiveMicrosoftTeamsChannelsTaskParams: """ Attributes: team (ArchiveMicrosoftTeamsChannelsTaskParamsTeam): - channels (list['ArchiveMicrosoftTeamsChannelsTaskParamsChannelsItem']): - task_type (Union[Unset, ArchiveMicrosoftTeamsChannelsTaskParamsTaskType]): + channels (list[ArchiveMicrosoftTeamsChannelsTaskParamsChannelsItem]): + task_type (ArchiveMicrosoftTeamsChannelsTaskParamsTaskType | Unset): """ - team: "ArchiveMicrosoftTeamsChannelsTaskParamsTeam" - channels: list["ArchiveMicrosoftTeamsChannelsTaskParamsChannelsItem"] - task_type: Unset | ArchiveMicrosoftTeamsChannelsTaskParamsTaskType = UNSET + team: ArchiveMicrosoftTeamsChannelsTaskParamsTeam + channels: list[ArchiveMicrosoftTeamsChannelsTaskParamsChannelsItem] + task_type: ArchiveMicrosoftTeamsChannelsTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: channels_item = channels_item_data.to_dict() channels.append(channels_item) - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -79,7 +81,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: Unset | ArchiveMicrosoftTeamsChannelsTaskParamsTaskType + task_type: ArchiveMicrosoftTeamsChannelsTaskParamsTaskType | Unset 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 d22bf87d..bf1a0ca0 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class ArchiveMicrosoftTeamsChannelsTaskParamsChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/archive_microsoft_teams_channels_task_params_task_type.py index 7e3fd2b3..ef6f7c5b 100644 --- a/rootly_sdk/models/archive_microsoft_teams_channels_task_params_task_type.py +++ b/rootly_sdk/models/archive_microsoft_teams_channels_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ArchiveMicrosoftTeamsChannelsTaskParamsTaskType = Literal["archive_microsoft_teams_channels"] @@ -13,7 +13,7 @@ def check_archive_microsoft_teams_channels_task_params_task_type( if value is None: return None if value in ARCHIVE_MICROSOFT_TEAMS_CHANNELS_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(ArchiveMicrosoftTeamsChannelsTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ARCHIVE_MICROSOFT_TEAMS_CHANNELS_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 d254639c..2bc1aa10 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class ArchiveMicrosoftTeamsChannelsTaskParamsTeam: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 567f8aad..bcc2882d 100644 --- a/rootly_sdk/models/archive_slack_channels_task_params.py +++ b/rootly_sdk/models/archive_slack_channels_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,12 +23,18 @@ class ArchiveSlackChannelsTaskParams: """ Attributes: - channels (list['ArchiveSlackChannelsTaskParamsChannelsItem']): - task_type (Union[Unset, ArchiveSlackChannelsTaskParamsTaskType]): + channels (list[ArchiveSlackChannelsTaskParamsChannelsItem]): + task_type (ArchiveSlackChannelsTaskParamsTaskType | Unset): + retry_count (int | Unset): Number of times to retry on rate-limit (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. """ - channels: list["ArchiveSlackChannelsTaskParamsChannelsItem"] - task_type: Unset | ArchiveSlackChannelsTaskParamsTaskType = UNSET + channels: list[ArchiveSlackChannelsTaskParamsChannelsItem] + task_type: ArchiveSlackChannelsTaskParamsTaskType | Unset = UNSET + retry_count: int | Unset = 0 + retry_wait_time: int | Unset = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -35,10 +43,14 @@ def to_dict(self) -> dict[str, Any]: channels_item = channels_item_data.to_dict() channels.append(channels_item) - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type + 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( @@ -48,6 +60,10 @@ def to_dict(self) -> dict[str, Any]: ) if task_type is not UNSET: field_dict["task_type"] = task_type + 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 @@ -64,15 +80,21 @@ 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: Unset | ArchiveSlackChannelsTaskParamsTaskType + task_type: ArchiveSlackChannelsTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_archive_slack_channels_task_params_task_type(_task_type) + retry_count = d.pop("retry_count", UNSET) + + retry_wait_time = d.pop("retry_wait_time", UNSET) + archive_slack_channels_task_params = cls( channels=channels, task_type=task_type, + retry_count=retry_count, + retry_wait_time=retry_wait_time, ) archive_slack_channels_task_params.additional_properties = d 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 61adea9f..dc246e77 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class ArchiveSlackChannelsTaskParamsChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/archive_slack_channels_task_params_task_type.py index 0e2de158..e22e3f50 100644 --- a/rootly_sdk/models/archive_slack_channels_task_params_task_type.py +++ b/rootly_sdk/models/archive_slack_channels_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ArchiveSlackChannelsTaskParamsTaskType = Literal["archive_slack_channels"] @@ -13,7 +13,7 @@ def check_archive_slack_channels_task_params_task_type( if value is None: return None if value in ARCHIVE_SLACK_CHANNELS_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(ArchiveSlackChannelsTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ARCHIVE_SLACK_CHANNELS_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/assign_role_to_user.py b/rootly_sdk/models/assign_role_to_user.py index e28725e6..11ac367c 100644 --- a/rootly_sdk/models/assign_role_to_user.py +++ b/rootly_sdk/models/assign_role_to_user.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.assign_role_to_user_data import AssignRoleToUserData @@ -18,14 +19,13 @@ class AssignRoleToUser: data (AssignRoleToUserData): """ - data: "AssignRoleToUserData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: AssignRoleToUserData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - assign_role_to_user.additional_properties = d return assign_role_to_user - - @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/assign_role_to_user_data.py b/rootly_sdk/models/assign_role_to_user_data.py index 7586cd3f..1dd40bcb 100644 --- a/rootly_sdk/models/assign_role_to_user_data.py +++ b/rootly_sdk/models/assign_role_to_user_data.py @@ -1,8 +1,9 @@ +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.assign_role_to_user_data_type import AssignRoleToUserDataType, check_assign_role_to_user_data_type @@ -22,8 +23,7 @@ class AssignRoleToUserData: """ type_: AssignRoleToUserDataType - attributes: "AssignRoleToUserDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: AssignRoleToUserDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - assign_role_to_user_data.additional_properties = d return assign_role_to_user_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/assign_role_to_user_data_attributes.py b/rootly_sdk/models/assign_role_to_user_data_attributes.py index 11b176f1..466f8a92 100644 --- a/rootly_sdk/models/assign_role_to_user_data_attributes.py +++ b/rootly_sdk/models/assign_role_to_user_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -12,12 +14,12 @@ class AssignRoleToUserDataAttributes: """ Attributes: - 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): ID of user you wish to assign this incident + incident_role_id (str | Unset): ID of the incident role """ - user_id: Unset | str = UNSET - incident_role_id: Unset | str = UNSET + user_id: str | Unset = UNSET + incident_role_id: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: user_id = self.user_id diff --git a/rootly_sdk/models/assign_role_to_user_data_type.py b/rootly_sdk/models/assign_role_to_user_data_type.py index 224c496e..b7c5fb1e 100644 --- a/rootly_sdk/models/assign_role_to_user_data_type.py +++ b/rootly_sdk/models/assign_role_to_user_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AssignRoleToUserDataType = Literal["incidents"] @@ -11,5 +11,5 @@ def check_assign_role_to_user_data_type(value: str | None) -> AssignRoleToUserDa if value is None: return None if value in ASSIGN_ROLE_TO_USER_DATA_TYPE_VALUES: - return cast(AssignRoleToUserDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ASSIGN_ROLE_TO_USER_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/attach_alert.py b/rootly_sdk/models/attach_alert.py index 556ace8e..ede9073e 100644 --- a/rootly_sdk/models/attach_alert.py +++ b/rootly_sdk/models/attach_alert.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.attach_alert_data import AttachAlertData @@ -18,14 +19,13 @@ class AttachAlert: data (AttachAlertData): """ - data: "AttachAlertData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: AttachAlertData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - attach_alert.additional_properties = d return attach_alert - - @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_alert_data.py b/rootly_sdk/models/attach_alert_data.py index 2fc46472..91382aff 100644 --- a/rootly_sdk/models/attach_alert_data.py +++ b/rootly_sdk/models/attach_alert_data.py @@ -1,8 +1,9 @@ +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.attach_alert_data_type import AttachAlertDataType, check_attach_alert_data_type @@ -22,8 +23,7 @@ class AttachAlertData: """ type_: AttachAlertDataType - attributes: "AttachAlertDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: AttachAlertDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - attach_alert_data.additional_properties = d return attach_alert_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/attach_alert_data_attributes.py b/rootly_sdk/models/attach_alert_data_attributes.py index 597f3be9..6e524c81 100644 --- a/rootly_sdk/models/attach_alert_data_attributes.py +++ b/rootly_sdk/models/attach_alert_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -10,13 +12,13 @@ class AttachAlertDataAttributes: """ Attributes: - alert_ids (Union[None, list[str]]): Alert Id to attach to the incident + alert_ids (list[str] | None): Alert Id to attach to the incident """ - alert_ids: None | list[str] + alert_ids: list[str] | None def to_dict(self) -> dict[str, Any]: - alert_ids: None | list[str] + alert_ids: list[str] | None if isinstance(self.alert_ids, list): alert_ids = self.alert_ids @@ -37,7 +39,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) -> None | list[str]: + def _parse_alert_ids(data: object) -> list[str] | None: if data is None: return data try: @@ -46,9 +48,9 @@ def _parse_alert_ids(data: object) -> None | list[str]: alert_ids_type_0 = cast(list[str], data) return alert_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | list[str], data) + return cast(list[str] | None, data) alert_ids = _parse_alert_ids(d.pop("alert_ids")) diff --git a/rootly_sdk/models/attach_alert_data_type.py b/rootly_sdk/models/attach_alert_data_type.py index feb8206d..5dbb31cb 100644 --- a/rootly_sdk/models/attach_alert_data_type.py +++ b/rootly_sdk/models/attach_alert_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AttachAlertDataType = Literal["alerts"] @@ -11,5 +11,5 @@ def check_attach_alert_data_type(value: str | None) -> AttachAlertDataType | Non if value is None: return None if value in ATTACH_ALERT_DATA_TYPE_VALUES: - return cast(AttachAlertDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ATTACH_ALERT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/attach_datadog_dashboards_task_params.py b/rootly_sdk/models/attach_datadog_dashboards_task_params.py index 36c3444b..c9a50936 100644 --- a/rootly_sdk/models/attach_datadog_dashboards_task_params.py +++ b/rootly_sdk/models/attach_datadog_dashboards_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,16 +28,16 @@ class AttachDatadogDashboardsTaskParams: """ Attributes: - 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): + post_to_incident_timeline (bool | Unset): + post_to_slack_channels (list[AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem] | Unset): """ - dashboards: list["AttachDatadogDashboardsTaskParamsDashboardsItem"] - task_type: Unset | AttachDatadogDashboardsTaskParamsTaskType = UNSET - post_to_incident_timeline: Unset | bool = UNSET - post_to_slack_channels: Unset | list["AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem"] = UNSET + dashboards: list[AttachDatadogDashboardsTaskParamsDashboardsItem] + task_type: AttachDatadogDashboardsTaskParamsTaskType | Unset = UNSET + post_to_incident_timeline: bool | Unset = UNSET + post_to_slack_channels: list[AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +46,13 @@ def to_dict(self) -> dict[str, Any]: dashboards_item = dashboards_item_data.to_dict() dashboards.append(dashboards_item) - task_type: Unset | str = UNSET + task_type: str | Unset = 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: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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 +93,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: Unset | AttachDatadogDashboardsTaskParamsTaskType + task_type: AttachDatadogDashboardsTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -99,14 +101,16 @@ 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) - 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: 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 + ) - 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 7921c70f..5930e6f9 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class AttachDatadogDashboardsTaskParamsDashboardsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 cb588b97..8436f266 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class AttachDatadogDashboardsTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/attach_datadog_dashboards_task_params_task_type.py index c2440f2e..ee87be9f 100644 --- a/rootly_sdk/models/attach_datadog_dashboards_task_params_task_type.py +++ b/rootly_sdk/models/attach_datadog_dashboards_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AttachDatadogDashboardsTaskParamsTaskType = Literal["attach_datadog_dashboards"] @@ -13,7 +13,7 @@ def check_attach_datadog_dashboards_task_params_task_type( if value is None: return None if value in ATTACH_DATADOG_DASHBOARDS_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(AttachDatadogDashboardsTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ATTACH_DATADOG_DASHBOARDS_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 index f9fd95ed..76e3b9da 100644 --- 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 @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -18,19 +20,19 @@ class AttachRetrospectivePdfToFreshserviceTicketTaskParams: """ Attributes: ticket_id (str): The Freshservice ticket id - task_type (Union[Unset, AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType]): - filename (Union[Unset, str]): The attachment filename + task_type (AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType | Unset): + filename (str | Unset): The attachment filename """ ticket_id: str - task_type: Unset | AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType = UNSET - filename: Unset | str = UNSET + task_type: AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType | Unset = UNSET + filename: str | Unset = 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 + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -56,7 +58,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: Unset | AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType + task_type: AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: 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 index dda7dcb5..fb76a0d5 100644 --- 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 @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType = Literal[ "attach_retrospective_pdf_to_freshservice_ticket" @@ -17,7 +17,7 @@ def check_attach_retrospective_pdf_to_freshservice_ticket_task_params_task_type( if value is None: return None if value in ATTACH_RETROSPECTIVE_PDF_TO_FRESHSERVICE_TICKET_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(AttachRetrospectivePdfToFreshserviceTicketTaskParamsTaskType, value) + return 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 5f0d7787..89965b06 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,26 +26,26 @@ class AttachRetrospectivePdfToJiraIssueTaskParams: """ Attributes: issue_id (str): The issue id - 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 + task_type (AttachRetrospectivePdfToJiraIssueTaskParamsTaskType | Unset): + integration (AttachRetrospectivePdfToJiraIssueTaskParamsIntegration | Unset): Specify integration id if you have + more than one Jira instance + filename (str | Unset): The attachment filename """ issue_id: str - task_type: Unset | AttachRetrospectivePdfToJiraIssueTaskParamsTaskType = UNSET - integration: Union[Unset, "AttachRetrospectivePdfToJiraIssueTaskParamsIntegration"] = UNSET - filename: Unset | str = UNSET + task_type: AttachRetrospectivePdfToJiraIssueTaskParamsTaskType | Unset = UNSET + integration: AttachRetrospectivePdfToJiraIssueTaskParamsIntegration | Unset = UNSET + filename: str | Unset = 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: Unset | dict[str, Any] = UNSET + integration: dict[str, Any] | Unset = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -75,14 +77,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: Unset | AttachRetrospectivePdfToJiraIssueTaskParamsTaskType + task_type: AttachRetrospectivePdfToJiraIssueTaskParamsTaskType | Unset 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: Unset | AttachRetrospectivePdfToJiraIssueTaskParamsIntegration + integration: AttachRetrospectivePdfToJiraIssueTaskParamsIntegration | Unset 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 e4aec1c4..8041a47a 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class AttachRetrospectivePdfToJiraIssueTaskParamsIntegration: """Specify integration id if you have more than one Jira instance Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_jira_issue_task_params_task_type.py b/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params_task_type.py index 1e1bdbb8..b646af11 100644 --- a/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params_task_type.py +++ b/rootly_sdk/models/attach_retrospective_pdf_to_jira_issue_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AttachRetrospectivePdfToJiraIssueTaskParamsTaskType = Literal["attach_retrospective_pdf_to_jira_issue"] @@ -15,7 +15,7 @@ def check_attach_retrospective_pdf_to_jira_issue_task_params_task_type( if value is None: return None if value in ATTACH_RETROSPECTIVE_PDF_TO_JIRA_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(AttachRetrospectivePdfToJiraIssueTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ATTACH_RETROSPECTIVE_PDF_TO_JIRA_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/audit.py b/rootly_sdk/models/audit.py index ec4864a5..0f926f92 100644 --- a/rootly_sdk/models/audit.py +++ b/rootly_sdk/models/audit.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,40 +21,44 @@ class Audit: """ Attributes: - event (str): Describes the action that was taken. + event (str): The raw stored action that was taken. Rows written before IR-6875 may carry a trailing `!` for + status transitions (e.g. `mark_as_resolved!`); prefer `event_display` for presentation. created_at (str): Date of creation - 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_display (str | Unset): Human-friendly display name for the action, normalized so a status change reads the + same regardless of the surface it came from + 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 """ event: str created_at: str - 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 + event_display: str | Unset = UNSET + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -63,17 +69,19 @@ def to_dict(self) -> dict[str, Any]: created_at = self.created_at - item_type: Unset | str = UNSET + event_display = self.event_display + + item_type: str | Unset = UNSET if not isinstance(self.item_type, Unset): item_type = self.item_type - item_type_display: None | Unset | str + item_type_display: None | str | Unset if isinstance(self.item_type_display, Unset): item_type_display = UNSET else: item_type_display = self.item_type_display - object_: None | Unset | dict[str, Any] + object_: dict[str, Any] | None | Unset if isinstance(self.object_, Unset): object_ = UNSET elif isinstance(self.object_, AuditObjectType0): @@ -81,7 +89,7 @@ def to_dict(self) -> dict[str, Any]: else: object_ = self.object_ - object_changes: None | Unset | dict[str, Any] + object_changes: dict[str, Any] | None | Unset if isinstance(self.object_changes, Unset): object_changes = UNSET elif isinstance(self.object_changes, AuditObjectChangesType0): @@ -89,55 +97,55 @@ def to_dict(self) -> dict[str, Any]: else: object_changes = self.object_changes - user_id: None | Unset | int + user_id: int | None | Unset if isinstance(self.user_id, Unset): user_id = UNSET else: user_id = self.user_id - user_name: None | Unset | str + user_name: None | str | Unset if isinstance(self.user_name, Unset): user_name = UNSET else: user_name = self.user_name - user_email: None | Unset | str + user_email: None | str | Unset if isinstance(self.user_email, Unset): user_email = UNSET else: user_email = self.user_email - ip_address: None | Unset | str + ip_address: None | str | Unset if isinstance(self.ip_address, Unset): ip_address = UNSET else: ip_address = self.ip_address - user_agent: None | Unset | str + user_agent: None | str | Unset if isinstance(self.user_agent, Unset): user_agent = UNSET else: user_agent = self.user_agent - request_id: None | Unset | str + request_id: None | str | Unset if isinstance(self.request_id, Unset): request_id = UNSET else: request_id = self.request_id - session_id: None | Unset | str + session_id: None | str | Unset if isinstance(self.session_id, Unset): session_id = UNSET else: session_id = self.session_id - item_id: None | Unset | str + item_id: None | str | Unset if isinstance(self.item_id, Unset): item_id = UNSET else: item_id = self.item_id - id: None | Unset | int + id: int | None | Unset if isinstance(self.id, Unset): id = UNSET else: @@ -151,6 +159,8 @@ def to_dict(self) -> dict[str, Any]: "created_at": created_at, } ) + if event_display is not UNSET: + field_dict["event_display"] = event_display if item_type is not UNSET: field_dict["item_type"] = item_type if item_type_display is not UNSET: @@ -190,23 +200,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: created_at = d.pop("created_at") + event_display = d.pop("event_display", UNSET) + _item_type = d.pop("item_type", UNSET) - item_type: Unset | AuditItemType + item_type: AuditItemType | Unset 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 | Unset | str: + def _parse_item_type_display(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) item_type_display = _parse_item_type_display(d.pop("item_type_display", UNSET)) - def _parse_object_(data: object) -> Union["AuditObjectType0", None, Unset]: + def _parse_object_(data: object) -> AuditObjectType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -217,13 +229,13 @@ def _parse_object_(data: object) -> Union["AuditObjectType0", None, Unset]: object_type_0 = AuditObjectType0.from_dict(data) return object_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["AuditObjectType0", None, Unset], data) + return cast(AuditObjectType0 | None | Unset, data) object_ = _parse_object_(d.pop("object", UNSET)) - def _parse_object_changes(data: object) -> Union["AuditObjectChangesType0", None, Unset]: + def _parse_object_changes(data: object) -> AuditObjectChangesType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -234,96 +246,97 @@ def _parse_object_changes(data: object) -> Union["AuditObjectChangesType0", None object_changes_type_0 = AuditObjectChangesType0.from_dict(data) return object_changes_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["AuditObjectChangesType0", None, Unset], data) + return cast(AuditObjectChangesType0 | None | Unset, data) object_changes = _parse_object_changes(d.pop("object_changes", UNSET)) - def _parse_user_id(data: object) -> None | Unset | int: + def _parse_user_id(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) user_id = _parse_user_id(d.pop("user_id", UNSET)) - def _parse_user_name(data: object) -> None | Unset | str: + def _parse_user_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) user_name = _parse_user_name(d.pop("user_name", UNSET)) - def _parse_user_email(data: object) -> None | Unset | str: + def _parse_user_email(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) user_email = _parse_user_email(d.pop("user_email", UNSET)) - def _parse_ip_address(data: object) -> None | Unset | str: + def _parse_ip_address(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) ip_address = _parse_ip_address(d.pop("ip_address", UNSET)) - def _parse_user_agent(data: object) -> None | Unset | str: + def _parse_user_agent(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) user_agent = _parse_user_agent(d.pop("user_agent", UNSET)) - def _parse_request_id(data: object) -> None | Unset | str: + def _parse_request_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) request_id = _parse_request_id(d.pop("request_id", UNSET)) - def _parse_session_id(data: object) -> None | Unset | str: + def _parse_session_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) session_id = _parse_session_id(d.pop("session_id", UNSET)) - def _parse_item_id(data: object) -> None | Unset | str: + def _parse_item_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) item_id = _parse_item_id(d.pop("item_id", UNSET)) - def _parse_id(data: object) -> None | Unset | int: + def _parse_id(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) id = _parse_id(d.pop("id", UNSET)) audit = cls( event=event, created_at=created_at, + event_display=event_display, item_type=item_type, item_type_display=item_type_display, object_=object_, diff --git a/rootly_sdk/models/audit_item_type.py b/rootly_sdk/models/audit_item_type.py index a3f36ce7..6f134540 100644 --- a/rootly_sdk/models/audit_item_type.py +++ b/rootly_sdk/models/audit_item_type.py @@ -1,10 +1,11 @@ -from typing import Literal, cast +from typing import Literal AuditItemType = Literal[ "AlertRoute", "AlertRoutingRule", "Alerts::Source", "ApiKey", + "BrowserIpPolicy", "Catalog", "CatalogEntity", "CatalogEntityProperty", @@ -56,6 +57,7 @@ "LiveCallRouter", "LoginActivity", "Membership", + "OauthApplication", "OnCallRole", "Playbook", "PlaybookTask", @@ -72,6 +74,7 @@ "AlertRoutingRule", "Alerts::Source", "ApiKey", + "BrowserIpPolicy", "Catalog", "CatalogEntity", "CatalogEntityProperty", @@ -123,6 +126,7 @@ "LiveCallRouter", "LoginActivity", "Membership", + "OauthApplication", "OnCallRole", "Playbook", "PlaybookTask", @@ -139,5 +143,5 @@ def check_audit_item_type(value: str | None) -> AuditItemType | None: if value is None: return None if value in AUDIT_ITEM_TYPE_VALUES: - return cast(AuditItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {AUDIT_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/audit_object_changes_type_0.py b/rootly_sdk/models/audit_object_changes_type_0.py index c26c297b..adacb420 100644 --- a/rootly_sdk/models/audit_object_changes_type_0.py +++ b/rootly_sdk/models/audit_object_changes_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 66c54325..2a1a35a1 100644 --- a/rootly_sdk/models/audit_object_type_0.py +++ b/rootly_sdk/models/audit_object_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 bd5ffb11..afb69cbb 100644 --- a/rootly_sdk/models/audits_list.py +++ b/rootly_sdk/models/audits_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class AuditsList: """ Attributes: - data (list['AuditsListDataItem']): + data (list[AuditsListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["AuditsListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[AuditsListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 94b30791..f10c5aff 100644 --- a/rootly_sdk/models/audits_list_data_item.py +++ b/rootly_sdk/models/audits_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/audits_list_data_item_type.py b/rootly_sdk/models/audits_list_data_item_type.py index 4ccd9efc..2693027b 100644 --- a/rootly_sdk/models/audits_list_data_item_type.py +++ b/rootly_sdk/models/audits_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AuditsListDataItemType = Literal["audits"] @@ -11,5 +11,5 @@ def check_audits_list_data_item_type(value: str | None) -> AuditsListDataItemTyp if value is None: return None if value in AUDITS_LIST_DATA_ITEM_TYPE_VALUES: - return cast(AuditsListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {AUDITS_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/authorization.py b/rootly_sdk/models/authorization.py index 8e600ea8..62b21259 100644 --- a/rootly_sdk/models/authorization.py +++ b/rootly_sdk/models/authorization.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/authorization_authorizable_type.py b/rootly_sdk/models/authorization_authorizable_type.py index 1b61fbb4..57c8ae9a 100644 --- a/rootly_sdk/models/authorization_authorizable_type.py +++ b/rootly_sdk/models/authorization_authorizable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AuthorizationAuthorizableType = Literal["Dashboard"] @@ -11,5 +11,5 @@ def check_authorization_authorizable_type(value: str | None) -> AuthorizationAut if value is None: return None if value in AUTHORIZATION_AUTHORIZABLE_TYPE_VALUES: - return cast(AuthorizationAuthorizableType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTHORIZATION_AUTHORIZABLE_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/authorization_grantee_type.py b/rootly_sdk/models/authorization_grantee_type.py index 93aa080e..e261039c 100644 --- a/rootly_sdk/models/authorization_grantee_type.py +++ b/rootly_sdk/models/authorization_grantee_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AuthorizationGranteeType = Literal["Team", "User"] @@ -12,5 +12,5 @@ def check_authorization_grantee_type(value: str | None) -> AuthorizationGranteeT if value is None: return None if value in AUTHORIZATION_GRANTEE_TYPE_VALUES: - return cast(AuthorizationGranteeType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTHORIZATION_GRANTEE_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/authorization_list.py b/rootly_sdk/models/authorization_list.py index fa0df65d..91095777 100644 --- a/rootly_sdk/models/authorization_list.py +++ b/rootly_sdk/models/authorization_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class AuthorizationList: """ Attributes: - data (list['AuthorizationListDataItem']): + data (list[AuthorizationListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["AuthorizationListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[AuthorizationListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 254bb294..32272298 100644 --- a/rootly_sdk/models/authorization_list_data_item.py +++ b/rootly_sdk/models/authorization_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/authorization_list_data_item_type.py b/rootly_sdk/models/authorization_list_data_item_type.py index 1af1f120..4a083ec6 100644 --- a/rootly_sdk/models/authorization_list_data_item_type.py +++ b/rootly_sdk/models/authorization_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AuthorizationListDataItemType = Literal["authorizations"] @@ -11,5 +11,5 @@ def check_authorization_list_data_item_type(value: str | None) -> AuthorizationL if value is None: return None if value in AUTHORIZATION_LIST_DATA_ITEM_TYPE_VALUES: - return cast(AuthorizationListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTHORIZATION_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/authorization_permissions_item.py b/rootly_sdk/models/authorization_permissions_item.py index de7238fc..7aa6cd14 100644 --- a/rootly_sdk/models/authorization_permissions_item.py +++ b/rootly_sdk/models/authorization_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AuthorizationPermissionsItem = Literal["authorize", "destroy", "read", "update"] @@ -14,5 +14,5 @@ def check_authorization_permissions_item(value: str | None) -> AuthorizationPerm if value is None: return None if value in AUTHORIZATION_PERMISSIONS_ITEM_VALUES: - return cast(AuthorizationPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTHORIZATION_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/authorization_response.py b/rootly_sdk/models/authorization_response.py index 0141ff5a..2141ec67 100644 --- a/rootly_sdk/models/authorization_response.py +++ b/rootly_sdk/models/authorization_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class AuthorizationResponse: """ Attributes: data (AuthorizationResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "AuthorizationResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: AuthorizationResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 0b141026..fc5371a6 100644 --- a/rootly_sdk/models/authorization_response_data.py +++ b/rootly_sdk/models/authorization_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/authorization_response_data_type.py b/rootly_sdk/models/authorization_response_data_type.py index a08cafa6..917c614e 100644 --- a/rootly_sdk/models/authorization_response_data_type.py +++ b/rootly_sdk/models/authorization_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AuthorizationResponseDataType = Literal["authorizations"] @@ -11,5 +11,5 @@ def check_authorization_response_data_type(value: str | None) -> AuthorizationRe if value is None: return None if value in AUTHORIZATION_RESPONSE_DATA_TYPE_VALUES: - return cast(AuthorizationResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {AUTHORIZATION_RESPONSE_DATA_TYPE_VALUES!r}") 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 7180c666..e3ef0e7c 100644 --- a/rootly_sdk/models/auto_assign_role_opsgenie_task_params.py +++ b/rootly_sdk/models/auto_assign_role_opsgenie_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,12 +25,12 @@ class AutoAssignRoleOpsgenieTaskParams: Attributes: incident_role_id (str): The role id schedule (AutoAssignRoleOpsgenieTaskParamsSchedule): - task_type (Union[Unset, AutoAssignRoleOpsgenieTaskParamsTaskType]): + task_type (AutoAssignRoleOpsgenieTaskParamsTaskType | Unset): """ incident_role_id: str - schedule: "AutoAssignRoleOpsgenieTaskParamsSchedule" - task_type: Unset | AutoAssignRoleOpsgenieTaskParamsTaskType = UNSET + schedule: AutoAssignRoleOpsgenieTaskParamsSchedule + task_type: AutoAssignRoleOpsgenieTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +38,7 @@ def to_dict(self) -> dict[str, Any]: schedule = self.schedule.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,7 +65,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: Unset | AutoAssignRoleOpsgenieTaskParamsTaskType + task_type: AutoAssignRoleOpsgenieTaskParamsTaskType | Unset 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 f56df6a9..d9929206 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class AutoAssignRoleOpsgenieTaskParamsSchedule: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_opsgenie_task_params_task_type.py b/rootly_sdk/models/auto_assign_role_opsgenie_task_params_task_type.py index 9947cafa..c845e1b7 100644 --- a/rootly_sdk/models/auto_assign_role_opsgenie_task_params_task_type.py +++ b/rootly_sdk/models/auto_assign_role_opsgenie_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AutoAssignRoleOpsgenieTaskParamsTaskType = Literal["auto_assign_role_opsgenie"] @@ -13,7 +13,7 @@ def check_auto_assign_role_opsgenie_task_params_task_type( if value is None: return None if value in AUTO_ASSIGN_ROLE_OPSGENIE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(AutoAssignRoleOpsgenieTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {AUTO_ASSIGN_ROLE_OPSGENIE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 4b18a5dd..cd35eaf2 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class AutoAssignRolePagerdutyTaskParamsType0Schedule: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 31768832..3ef911c2 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class AutoAssignRolePagerdutyTaskParamsType1EscalationPolicy: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_type_0_escalation_policy_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_0_escalation_policy_target.py index 04e6e1a3..9702b84a 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_type_0_escalation_policy_target.py +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_0_escalation_policy_target.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class AutoAssignRoleRootlyTaskParamsType0EscalationPolicyTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_type_1_service_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_1_service_target.py index 04743c81..9f4a89ed 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_type_1_service_target.py +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_1_service_target.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class AutoAssignRoleRootlyTaskParamsType1ServiceTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_type_2_user_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_2_user_target.py index 66331d25..5cb818cd 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_type_2_user_target.py +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_2_user_target.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class AutoAssignRoleRootlyTaskParamsType2UserTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_type_3_group_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_3_group_target.py index 9e506c67..a56fc89e 100644 --- a/rootly_sdk/models/auto_assign_role_rootly_task_params_type_3_group_target.py +++ b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_3_group_target.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class AutoAssignRoleRootlyTaskParamsType3GroupTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_type_4_schedule_target.py b/rootly_sdk/models/auto_assign_role_rootly_task_params_type_4_schedule_target.py index 8d1f180b..c0026b3b 100644 --- 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 @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class AutoAssignRoleRootlyTaskParamsType4ScheduleTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_victor_ops_task_params.py b/rootly_sdk/models/auto_assign_role_victor_ops_task_params.py index 6071ebbb..af0e0efb 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,12 +25,12 @@ class AutoAssignRoleVictorOpsTaskParams: Attributes: incident_role_id (str): The role id team (AutoAssignRoleVictorOpsTaskParamsTeam): - task_type (Union[Unset, AutoAssignRoleVictorOpsTaskParamsTaskType]): + task_type (AutoAssignRoleVictorOpsTaskParamsTaskType | Unset): """ incident_role_id: str - team: "AutoAssignRoleVictorOpsTaskParamsTeam" - task_type: Unset | AutoAssignRoleVictorOpsTaskParamsTaskType = UNSET + team: AutoAssignRoleVictorOpsTaskParamsTeam + task_type: AutoAssignRoleVictorOpsTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +38,7 @@ def to_dict(self) -> dict[str, Any]: team = self.team.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,7 +65,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: Unset | AutoAssignRoleVictorOpsTaskParamsTaskType + task_type: AutoAssignRoleVictorOpsTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/auto_assign_role_victor_ops_task_params_task_type.py b/rootly_sdk/models/auto_assign_role_victor_ops_task_params_task_type.py index b6a97690..dec4b654 100644 --- a/rootly_sdk/models/auto_assign_role_victor_ops_task_params_task_type.py +++ b/rootly_sdk/models/auto_assign_role_victor_ops_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal AutoAssignRoleVictorOpsTaskParamsTaskType = Literal["auto_assign_role_victor_ops"] @@ -13,7 +13,7 @@ def check_auto_assign_role_victor_ops_task_params_task_type( if value is None: return None if value in AUTO_ASSIGN_ROLE_VICTOR_OPS_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(AutoAssignRoleVictorOpsTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {AUTO_ASSIGN_ROLE_VICTOR_OPS_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 c4a051fe..aca48451 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class AutoAssignRoleVictorOpsTaskParamsTeam: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 f2809ade..e20f35d8 100644 --- a/rootly_sdk/models/bulk_destroy_catalog_entities_response.py +++ b/rootly_sdk/models/bulk_destroy_catalog_entities_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,14 +19,14 @@ class BulkDestroyCatalogEntitiesResponse: """ Attributes: - data (Union[Unset, BulkDestroyCatalogEntitiesResponseData]): + data (BulkDestroyCatalogEntitiesResponseData | Unset): """ - data: Union[Unset, "BulkDestroyCatalogEntitiesResponseData"] = UNSET + data: BulkDestroyCatalogEntitiesResponseData | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Unset | dict[str, Any] = UNSET + data: dict[str, Any] | Unset = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +44,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Unset | BulkDestroyCatalogEntitiesResponseData + data: BulkDestroyCatalogEntitiesResponseData | Unset 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 485f2e1c..100418a0 100644 --- a/rootly_sdk/models/bulk_destroy_catalog_entities_response_data.py +++ b/rootly_sdk/models/bulk_destroy_catalog_entities_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,28 +15,28 @@ class BulkDestroyCatalogEntitiesResponseData: """ Attributes: - 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): 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: Unset | list[str] = UNSET - failed_external_ids: Unset | list[str] = UNSET - not_found_external_ids: Unset | list[str] = UNSET + deleted_external_ids: list[str] | Unset = UNSET + failed_external_ids: list[str] | Unset = UNSET + not_found_external_ids: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: Unset | list[str] = UNSET + deleted_external_ids: list[str] | Unset = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: Unset | list[str] = UNSET + failed_external_ids: list[str] | Unset = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: Unset | list[str] = UNSET + not_found_external_ids: list[str] | Unset = 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 c480370e..aa0318b3 100644 --- a/rootly_sdk/models/bulk_destroy_catalog_entities_type_0.py +++ b/rootly_sdk/models/bulk_destroy_catalog_entities_type_0.py @@ -1,3 +1,5 @@ +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 2c7aee2f..82423407 100644 --- a/rootly_sdk/models/bulk_destroy_catalog_entities_type_1.py +++ b/rootly_sdk/models/bulk_destroy_catalog_entities_type_1.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,16 +20,16 @@ class BulkDestroyCatalogEntitiesType1: Attributes: managed_by (BulkDestroyCatalogEntitiesType1ManagedBy): Delete all entities with this managed_by value (web/admin_web not allowed). - keep_external_ids (Union[Unset, list[str]]): Entities with these external_ids are preserved. + keep_external_ids (list[str] | Unset): Entities with these external_ids are preserved. """ managed_by: BulkDestroyCatalogEntitiesType1ManagedBy - keep_external_ids: Unset | list[str] = UNSET + keep_external_ids: list[str] | Unset = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: Unset | list[str] = UNSET + keep_external_ids: list[str] | Unset = UNSET if not isinstance(self.keep_external_ids, Unset): keep_external_ids = self.keep_external_ids diff --git a/rootly_sdk/models/bulk_destroy_catalog_entities_type_1_managed_by.py b/rootly_sdk/models/bulk_destroy_catalog_entities_type_1_managed_by.py index 225693d2..2972ff18 100644 --- a/rootly_sdk/models/bulk_destroy_catalog_entities_type_1_managed_by.py +++ b/rootly_sdk/models/bulk_destroy_catalog_entities_type_1_managed_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal BulkDestroyCatalogEntitiesType1ManagedBy = Literal["api", "backstage", "catalog_sync", "pulumi", "terraform"] @@ -17,7 +17,7 @@ def check_bulk_destroy_catalog_entities_type_1_managed_by( if value is None: return None if value in BULK_DESTROY_CATALOG_ENTITIES_TYPE_1_MANAGED_BY_VALUES: - return cast(BulkDestroyCatalogEntitiesType1ManagedBy, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {BULK_DESTROY_CATALOG_ENTITIES_TYPE_1_MANAGED_BY_VALUES!r}" ) diff --git a/rootly_sdk/models/bulk_destroy_environments_response.py b/rootly_sdk/models/bulk_destroy_environments_response.py index 44391875..f165422c 100644 --- a/rootly_sdk/models/bulk_destroy_environments_response.py +++ b/rootly_sdk/models/bulk_destroy_environments_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,14 +19,14 @@ class BulkDestroyEnvironmentsResponse: """ Attributes: - data (Union[Unset, BulkDestroyEnvironmentsResponseData]): + data (BulkDestroyEnvironmentsResponseData | Unset): """ - data: Union[Unset, "BulkDestroyEnvironmentsResponseData"] = UNSET + data: BulkDestroyEnvironmentsResponseData | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Unset | dict[str, Any] = UNSET + data: dict[str, Any] | Unset = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +44,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Unset | BulkDestroyEnvironmentsResponseData + data: BulkDestroyEnvironmentsResponseData | Unset 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 35713f90..64ba34fd 100644 --- a/rootly_sdk/models/bulk_destroy_environments_response_data.py +++ b/rootly_sdk/models/bulk_destroy_environments_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,28 +15,28 @@ class BulkDestroyEnvironmentsResponseData: """ Attributes: - 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): 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: Unset | list[str] = UNSET - failed_external_ids: Unset | list[str] = UNSET - not_found_external_ids: Unset | list[str] = UNSET + deleted_external_ids: list[str] | Unset = UNSET + failed_external_ids: list[str] | Unset = UNSET + not_found_external_ids: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: Unset | list[str] = UNSET + deleted_external_ids: list[str] | Unset = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: Unset | list[str] = UNSET + failed_external_ids: list[str] | Unset = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: Unset | list[str] = UNSET + not_found_external_ids: list[str] | Unset = 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 a7abe6a2..f214081d 100644 --- a/rootly_sdk/models/bulk_destroy_environments_type_0.py +++ b/rootly_sdk/models/bulk_destroy_environments_type_0.py @@ -1,3 +1,5 @@ +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 20b4d2bc..ce96f4b6 100644 --- a/rootly_sdk/models/bulk_destroy_environments_type_1.py +++ b/rootly_sdk/models/bulk_destroy_environments_type_1.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,16 +20,16 @@ class BulkDestroyEnvironmentsType1: Attributes: managed_by (BulkDestroyEnvironmentsType1ManagedBy): Delete all records with this managed_by value (web/admin_web not allowed). - keep_external_ids (Union[Unset, list[str]]): Records with these external_ids are preserved. + keep_external_ids (list[str] | Unset): Records with these external_ids are preserved. """ managed_by: BulkDestroyEnvironmentsType1ManagedBy - keep_external_ids: Unset | list[str] = UNSET + keep_external_ids: list[str] | Unset = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: Unset | list[str] = UNSET + keep_external_ids: list[str] | Unset = 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_type_1_managed_by.py b/rootly_sdk/models/bulk_destroy_environments_type_1_managed_by.py index cf58aaeb..da11b841 100644 --- a/rootly_sdk/models/bulk_destroy_environments_type_1_managed_by.py +++ b/rootly_sdk/models/bulk_destroy_environments_type_1_managed_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal BulkDestroyEnvironmentsType1ManagedBy = Literal["api", "backstage", "catalog_sync", "pulumi", "terraform"] @@ -17,7 +17,7 @@ def check_bulk_destroy_environments_type_1_managed_by( if value is None: return None if value in BULK_DESTROY_ENVIRONMENTS_TYPE_1_MANAGED_BY_VALUES: - return cast(BulkDestroyEnvironmentsType1ManagedBy, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {BULK_DESTROY_ENVIRONMENTS_TYPE_1_MANAGED_BY_VALUES!r}" ) diff --git a/rootly_sdk/models/bulk_destroy_functionalities_response.py b/rootly_sdk/models/bulk_destroy_functionalities_response.py index 305b6c0c..958efa4b 100644 --- a/rootly_sdk/models/bulk_destroy_functionalities_response.py +++ b/rootly_sdk/models/bulk_destroy_functionalities_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,14 +19,14 @@ class BulkDestroyFunctionalitiesResponse: """ Attributes: - data (Union[Unset, BulkDestroyFunctionalitiesResponseData]): + data (BulkDestroyFunctionalitiesResponseData | Unset): """ - data: Union[Unset, "BulkDestroyFunctionalitiesResponseData"] = UNSET + data: BulkDestroyFunctionalitiesResponseData | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Unset | dict[str, Any] = UNSET + data: dict[str, Any] | Unset = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +44,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Unset | BulkDestroyFunctionalitiesResponseData + data: BulkDestroyFunctionalitiesResponseData | Unset 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 983b7e64..09696126 100644 --- a/rootly_sdk/models/bulk_destroy_functionalities_response_data.py +++ b/rootly_sdk/models/bulk_destroy_functionalities_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,28 +15,28 @@ class BulkDestroyFunctionalitiesResponseData: """ Attributes: - 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): 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: Unset | list[str] = UNSET - failed_external_ids: Unset | list[str] = UNSET - not_found_external_ids: Unset | list[str] = UNSET + deleted_external_ids: list[str] | Unset = UNSET + failed_external_ids: list[str] | Unset = UNSET + not_found_external_ids: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: Unset | list[str] = UNSET + deleted_external_ids: list[str] | Unset = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: Unset | list[str] = UNSET + failed_external_ids: list[str] | Unset = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: Unset | list[str] = UNSET + not_found_external_ids: list[str] | Unset = 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 c7275e20..3d848f82 100644 --- a/rootly_sdk/models/bulk_destroy_functionalities_type_0.py +++ b/rootly_sdk/models/bulk_destroy_functionalities_type_0.py @@ -1,3 +1,5 @@ +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 e68f7239..f26f768a 100644 --- a/rootly_sdk/models/bulk_destroy_functionalities_type_1.py +++ b/rootly_sdk/models/bulk_destroy_functionalities_type_1.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,16 +20,16 @@ class BulkDestroyFunctionalitiesType1: Attributes: managed_by (BulkDestroyFunctionalitiesType1ManagedBy): Delete all records with this managed_by value (web/admin_web not allowed). - keep_external_ids (Union[Unset, list[str]]): Records with these external_ids are preserved. + keep_external_ids (list[str] | Unset): Records with these external_ids are preserved. """ managed_by: BulkDestroyFunctionalitiesType1ManagedBy - keep_external_ids: Unset | list[str] = UNSET + keep_external_ids: list[str] | Unset = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: Unset | list[str] = UNSET + keep_external_ids: list[str] | Unset = 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_type_1_managed_by.py b/rootly_sdk/models/bulk_destroy_functionalities_type_1_managed_by.py index b0afb919..288927d6 100644 --- a/rootly_sdk/models/bulk_destroy_functionalities_type_1_managed_by.py +++ b/rootly_sdk/models/bulk_destroy_functionalities_type_1_managed_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal BulkDestroyFunctionalitiesType1ManagedBy = Literal["api", "backstage", "catalog_sync", "pulumi", "terraform"] @@ -17,7 +17,7 @@ def check_bulk_destroy_functionalities_type_1_managed_by( if value is None: return None if value in BULK_DESTROY_FUNCTIONALITIES_TYPE_1_MANAGED_BY_VALUES: - return cast(BulkDestroyFunctionalitiesType1ManagedBy, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {BULK_DESTROY_FUNCTIONALITIES_TYPE_1_MANAGED_BY_VALUES!r}" ) diff --git a/rootly_sdk/models/bulk_destroy_services_response.py b/rootly_sdk/models/bulk_destroy_services_response.py index af591752..19fc21d5 100644 --- a/rootly_sdk/models/bulk_destroy_services_response.py +++ b/rootly_sdk/models/bulk_destroy_services_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,14 +19,14 @@ class BulkDestroyServicesResponse: """ Attributes: - data (Union[Unset, BulkDestroyServicesResponseData]): + data (BulkDestroyServicesResponseData | Unset): """ - data: Union[Unset, "BulkDestroyServicesResponseData"] = UNSET + data: BulkDestroyServicesResponseData | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Unset | dict[str, Any] = UNSET + data: dict[str, Any] | Unset = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +44,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Unset | BulkDestroyServicesResponseData + data: BulkDestroyServicesResponseData | Unset 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 d5cf813f..f1a02711 100644 --- a/rootly_sdk/models/bulk_destroy_services_response_data.py +++ b/rootly_sdk/models/bulk_destroy_services_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,28 +15,28 @@ class BulkDestroyServicesResponseData: """ Attributes: - 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): 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: Unset | list[str] = UNSET - failed_external_ids: Unset | list[str] = UNSET - not_found_external_ids: Unset | list[str] = UNSET + deleted_external_ids: list[str] | Unset = UNSET + failed_external_ids: list[str] | Unset = UNSET + not_found_external_ids: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: Unset | list[str] = UNSET + deleted_external_ids: list[str] | Unset = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: Unset | list[str] = UNSET + failed_external_ids: list[str] | Unset = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: Unset | list[str] = UNSET + not_found_external_ids: list[str] | Unset = 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 ab09b1c8..1c0b2be3 100644 --- a/rootly_sdk/models/bulk_destroy_services_type_0.py +++ b/rootly_sdk/models/bulk_destroy_services_type_0.py @@ -1,3 +1,5 @@ +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 7a8c0fc9..30af9e88 100644 --- a/rootly_sdk/models/bulk_destroy_services_type_1.py +++ b/rootly_sdk/models/bulk_destroy_services_type_1.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,16 +20,16 @@ class BulkDestroyServicesType1: Attributes: managed_by (BulkDestroyServicesType1ManagedBy): Delete all records with this managed_by value (web/admin_web not allowed). - keep_external_ids (Union[Unset, list[str]]): Records with these external_ids are preserved. + keep_external_ids (list[str] | Unset): Records with these external_ids are preserved. """ managed_by: BulkDestroyServicesType1ManagedBy - keep_external_ids: Unset | list[str] = UNSET + keep_external_ids: list[str] | Unset = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: Unset | list[str] = UNSET + keep_external_ids: list[str] | Unset = 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_type_1_managed_by.py b/rootly_sdk/models/bulk_destroy_services_type_1_managed_by.py index a95baa65..d0802142 100644 --- a/rootly_sdk/models/bulk_destroy_services_type_1_managed_by.py +++ b/rootly_sdk/models/bulk_destroy_services_type_1_managed_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal BulkDestroyServicesType1ManagedBy = Literal["api", "backstage", "catalog_sync", "pulumi", "terraform"] @@ -15,5 +15,5 @@ def check_bulk_destroy_services_type_1_managed_by(value: str | None) -> BulkDest if value is None: return None if value in BULK_DESTROY_SERVICES_TYPE_1_MANAGED_BY_VALUES: - return cast(BulkDestroyServicesType1ManagedBy, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {BULK_DESTROY_SERVICES_TYPE_1_MANAGED_BY_VALUES!r}") diff --git a/rootly_sdk/models/bulk_destroy_teams_response.py b/rootly_sdk/models/bulk_destroy_teams_response.py index 70a1bda4..bdbdd09b 100644 --- a/rootly_sdk/models/bulk_destroy_teams_response.py +++ b/rootly_sdk/models/bulk_destroy_teams_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,14 +19,14 @@ class BulkDestroyTeamsResponse: """ Attributes: - data (Union[Unset, BulkDestroyTeamsResponseData]): + data (BulkDestroyTeamsResponseData | Unset): """ - data: Union[Unset, "BulkDestroyTeamsResponseData"] = UNSET + data: BulkDestroyTeamsResponseData | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Unset | dict[str, Any] = UNSET + data: dict[str, Any] | Unset = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +44,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Unset | BulkDestroyTeamsResponseData + data: BulkDestroyTeamsResponseData | Unset 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 619fd269..c4e2e3fc 100644 --- a/rootly_sdk/models/bulk_destroy_teams_response_data.py +++ b/rootly_sdk/models/bulk_destroy_teams_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,28 +15,28 @@ class BulkDestroyTeamsResponseData: """ Attributes: - 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): 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: Unset | list[str] = UNSET - failed_external_ids: Unset | list[str] = UNSET - not_found_external_ids: Unset | list[str] = UNSET + deleted_external_ids: list[str] | Unset = UNSET + failed_external_ids: list[str] | Unset = UNSET + not_found_external_ids: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - deleted_external_ids: Unset | list[str] = UNSET + deleted_external_ids: list[str] | Unset = UNSET if not isinstance(self.deleted_external_ids, Unset): deleted_external_ids = self.deleted_external_ids - failed_external_ids: Unset | list[str] = UNSET + failed_external_ids: list[str] | Unset = UNSET if not isinstance(self.failed_external_ids, Unset): failed_external_ids = self.failed_external_ids - not_found_external_ids: Unset | list[str] = UNSET + not_found_external_ids: list[str] | Unset = 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 f88ab8c8..3e2eb0d5 100644 --- a/rootly_sdk/models/bulk_destroy_teams_type_0.py +++ b/rootly_sdk/models/bulk_destroy_teams_type_0.py @@ -1,3 +1,5 @@ +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 4063f4b2..881d654b 100644 --- a/rootly_sdk/models/bulk_destroy_teams_type_1.py +++ b/rootly_sdk/models/bulk_destroy_teams_type_1.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,16 +20,16 @@ class BulkDestroyTeamsType1: Attributes: managed_by (BulkDestroyTeamsType1ManagedBy): Delete all records with this managed_by value (web/admin_web not allowed). - keep_external_ids (Union[Unset, list[str]]): Records with these external_ids are preserved. + keep_external_ids (list[str] | Unset): Records with these external_ids are preserved. """ managed_by: BulkDestroyTeamsType1ManagedBy - keep_external_ids: Unset | list[str] = UNSET + keep_external_ids: list[str] | Unset = UNSET def to_dict(self) -> dict[str, Any]: managed_by: str = self.managed_by - keep_external_ids: Unset | list[str] = UNSET + keep_external_ids: list[str] | Unset = 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_type_1_managed_by.py b/rootly_sdk/models/bulk_destroy_teams_type_1_managed_by.py index 8eaf2132..4fba2822 100644 --- a/rootly_sdk/models/bulk_destroy_teams_type_1_managed_by.py +++ b/rootly_sdk/models/bulk_destroy_teams_type_1_managed_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal BulkDestroyTeamsType1ManagedBy = Literal["api", "backstage", "catalog_sync", "pulumi", "terraform"] @@ -15,5 +15,5 @@ def check_bulk_destroy_teams_type_1_managed_by(value: str | None) -> BulkDestroy if value is None: return None if value in BULK_DESTROY_TEAMS_TYPE_1_MANAGED_BY_VALUES: - return cast(BulkDestroyTeamsType1ManagedBy, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {BULK_DESTROY_TEAMS_TYPE_1_MANAGED_BY_VALUES!r}") diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities.py b/rootly_sdk/models/bulk_upsert_catalog_entities.py index 316e8eda..0fcc7813 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -15,11 +17,11 @@ 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]: 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 4e8ecc10..c10ab1a1 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_entities_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -20,21 +22,21 @@ class BulkUpsertCatalogEntitiesEntitiesItem: """ Attributes: external_id (str): External identifier used as the upsert key. Must be unique within the catalog. - 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. + name (str | Unset): Required for new entities. Optional for updates (managed-fields: omitted attributes are + preserved). + description (None | str | Unset): + public_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. """ external_id: str - 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 + name: str | Unset = UNSET + description: None | str | Unset = UNSET + public_description: None | str | Unset = UNSET + backstage_id: None | str | Unset = UNSET + fields: list[BulkUpsertCatalogEntitiesEntitiesItemFieldsItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,25 +44,25 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - backstage_id: None | Unset | str + backstage_id: None | str | Unset if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - fields: Unset | list[dict[str, Any]] = UNSET + fields: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -98,39 +100,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_backstage_id(data: object) -> None | Unset | str: + def _parse_backstage_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - fields = [] _fields = d.pop("fields", UNSET) - for fields_item_data in _fields or []: - fields_item = BulkUpsertCatalogEntitiesEntitiesItemFieldsItem.from_dict(fields_item_data) + 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) - fields.append(fields_item) + fields.append(fields_item) bulk_upsert_catalog_entities_entities_item = cls( external_id=external_id, 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 98503dc3..4ee249c4 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -15,14 +17,14 @@ class BulkUpsertCatalogEntitiesEntitiesItemFieldsItem: Attributes: value (str): The value for this field - 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) + 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) """ value: str - catalog_field_id: Unset | str = UNSET - catalog_property_id: Unset | str = UNSET + catalog_field_id: str | Unset = UNSET + catalog_property_id: str | Unset = UNSET 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 e7351d05..035dd671 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_error.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_error.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -15,10 +17,10 @@ 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]: 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 4b7c5c28..996410a2 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,3 +1,5 @@ +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 3d5f864c..5036da60 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_response.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,14 +19,14 @@ class BulkUpsertCatalogEntitiesResponse: """ Attributes: - data (Union[Unset, list['BulkUpsertCatalogEntitiesResponseDataItem']]): + data (list[BulkUpsertCatalogEntitiesResponseDataItem] | Unset): """ - data: Unset | list["BulkUpsertCatalogEntitiesResponseDataItem"] = UNSET + data: list[BulkUpsertCatalogEntitiesResponseDataItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Unset | list[dict[str, Any]] = UNSET + data: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -44,12 +46,14 @@ 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) - for data_item_data in _data or []: - data_item = BulkUpsertCatalogEntitiesResponseDataItem.from_dict(data_item_data) + 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) - 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 92739697..b259e727 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,24 +23,24 @@ class BulkUpsertCatalogEntitiesResponseDataItem: """ Attributes: - id (Union[Unset, str]): - type_ (Union[Unset, BulkUpsertCatalogEntitiesResponseDataItemType]): - attributes (Union[Unset, CatalogEntity]): + id (str | Unset): + type_ (BulkUpsertCatalogEntitiesResponseDataItemType | Unset): + attributes (CatalogEntity | Unset): """ - id: Unset | str = UNSET - type_: Unset | BulkUpsertCatalogEntitiesResponseDataItemType = UNSET - attributes: Union[Unset, "CatalogEntity"] = UNSET + id: str | Unset = UNSET + type_: BulkUpsertCatalogEntitiesResponseDataItemType | Unset = UNSET + attributes: CatalogEntity | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -62,14 +64,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | BulkUpsertCatalogEntitiesResponseDataItemType + type_: BulkUpsertCatalogEntitiesResponseDataItemType | Unset if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_catalog_entities_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Unset | CatalogEntity + attributes: CatalogEntity | Unset if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/bulk_upsert_catalog_entities_response_data_item_type.py b/rootly_sdk/models/bulk_upsert_catalog_entities_response_data_item_type.py index fbfd77d2..c7bf4441 100644 --- a/rootly_sdk/models/bulk_upsert_catalog_entities_response_data_item_type.py +++ b/rootly_sdk/models/bulk_upsert_catalog_entities_response_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal BulkUpsertCatalogEntitiesResponseDataItemType = Literal["catalog_entities"] @@ -13,7 +13,7 @@ def check_bulk_upsert_catalog_entities_response_data_item_type( if value is None: return None if value in BULK_UPSERT_CATALOG_ENTITIES_RESPONSE_DATA_ITEM_TYPE_VALUES: - return cast(BulkUpsertCatalogEntitiesResponseDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {BULK_UPSERT_CATALOG_ENTITIES_RESPONSE_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/bulk_upsert_environments.py b/rootly_sdk/models/bulk_upsert_environments.py index 92088a23..c2dcac01 100644 --- a/rootly_sdk/models/bulk_upsert_environments.py +++ b/rootly_sdk/models/bulk_upsert_environments.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -15,11 +17,11 @@ 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]: diff --git a/rootly_sdk/models/bulk_upsert_environments_entities_item.py b/rootly_sdk/models/bulk_upsert_environments_entities_item.py index 255726bb..cd6ccc04 100644 --- a/rootly_sdk/models/bulk_upsert_environments_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_environments_entities_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -18,24 +20,24 @@ class BulkUpsertEnvironmentsEntitiesItem: """ Attributes: external_id (str): External identifier used as the upsert key. Unique per team. - 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). + 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): + notify_emails (list[str] | None | Unset): + fields (list[BulkUpsertEnvironmentsEntitiesItemFieldsItem] | Unset): Catalog property values (merge semantics: + only mentioned fields written). """ external_id: str - 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 + 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 + notify_emails: list[str] | None | Unset = UNSET + fields: list[BulkUpsertEnvironmentsEntitiesItemFieldsItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -43,31 +45,31 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -76,7 +78,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - fields: Unset | list[dict[str, Any]] = UNSET + fields: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -118,43 +120,43 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -165,18 +167,20 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - fields = [] _fields = d.pop("fields", UNSET) - for fields_item_data in _fields or []: - fields_item = BulkUpsertEnvironmentsEntitiesItemFieldsItem.from_dict(fields_item_data) + 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) - fields.append(fields_item) + fields.append(fields_item) bulk_upsert_environments_entities_item = cls( external_id=external_id, 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 78b617b9..a2fb5f0b 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -15,14 +17,14 @@ class BulkUpsertEnvironmentsEntitiesItemFieldsItem: Attributes: value (str): The value for this field - 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) + 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) """ value: str - catalog_field_id: Unset | str = UNSET - catalog_property_id: Unset | str = UNSET + catalog_field_id: str | Unset = UNSET + catalog_property_id: str | Unset = UNSET 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 638ed9a8..c13a97a7 100644 --- a/rootly_sdk/models/bulk_upsert_environments_error.py +++ b/rootly_sdk/models/bulk_upsert_environments_error.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -15,10 +17,10 @@ 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]: 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 073c968e..39c9c7b2 100644 --- a/rootly_sdk/models/bulk_upsert_environments_error_errors_item.py +++ b/rootly_sdk/models/bulk_upsert_environments_error_errors_item.py @@ -1,3 +1,5 @@ +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 72890e00..a678ed5c 100644 --- a/rootly_sdk/models/bulk_upsert_environments_response.py +++ b/rootly_sdk/models/bulk_upsert_environments_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,14 +19,14 @@ class BulkUpsertEnvironmentsResponse: """ Attributes: - data (Union[Unset, list['BulkUpsertEnvironmentsResponseDataItem']]): + data (list[BulkUpsertEnvironmentsResponseDataItem] | Unset): """ - data: Unset | list["BulkUpsertEnvironmentsResponseDataItem"] = UNSET + data: list[BulkUpsertEnvironmentsResponseDataItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Unset | list[dict[str, Any]] = UNSET + data: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -44,12 +46,14 @@ 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) - for data_item_data in _data or []: - data_item = BulkUpsertEnvironmentsResponseDataItem.from_dict(data_item_data) + 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) - 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 fd861d60..682da7c6 100644 --- a/rootly_sdk/models/bulk_upsert_environments_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_environments_response_data_item.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,24 +23,24 @@ class BulkUpsertEnvironmentsResponseDataItem: """ Attributes: - id (Union[Unset, str]): - type_ (Union[Unset, BulkUpsertEnvironmentsResponseDataItemType]): - attributes (Union[Unset, Environment]): + id (str | Unset): + type_ (BulkUpsertEnvironmentsResponseDataItemType | Unset): + attributes (Environment | Unset): """ - id: Unset | str = UNSET - type_: Unset | BulkUpsertEnvironmentsResponseDataItemType = UNSET - attributes: Union[Unset, "Environment"] = UNSET + id: str | Unset = UNSET + type_: BulkUpsertEnvironmentsResponseDataItemType | Unset = UNSET + attributes: Environment | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -62,14 +64,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | BulkUpsertEnvironmentsResponseDataItemType + type_: BulkUpsertEnvironmentsResponseDataItemType | Unset if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_environments_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Unset | Environment + attributes: Environment | Unset if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/bulk_upsert_environments_response_data_item_type.py b/rootly_sdk/models/bulk_upsert_environments_response_data_item_type.py index dde45699..fd7fa421 100644 --- a/rootly_sdk/models/bulk_upsert_environments_response_data_item_type.py +++ b/rootly_sdk/models/bulk_upsert_environments_response_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal BulkUpsertEnvironmentsResponseDataItemType = Literal["environments"] @@ -13,7 +13,7 @@ def check_bulk_upsert_environments_response_data_item_type( if value is None: return None if value in BULK_UPSERT_ENVIRONMENTS_RESPONSE_DATA_ITEM_TYPE_VALUES: - return cast(BulkUpsertEnvironmentsResponseDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {BULK_UPSERT_ENVIRONMENTS_RESPONSE_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/bulk_upsert_functionalities.py b/rootly_sdk/models/bulk_upsert_functionalities.py index 256663a4..d4b054c4 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities.py +++ b/rootly_sdk/models/bulk_upsert_functionalities.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -15,12 +17,12 @@ 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]: diff --git a/rootly_sdk/models/bulk_upsert_functionalities_entities_item.py b/rootly_sdk/models/bulk_upsert_functionalities_entities_item.py index b5c14786..b4e0cc1a 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_entities_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -20,42 +22,42 @@ class BulkUpsertFunctionalitiesEntitiesItem: """ Attributes: external_id (str): External identifier used as the upsert key. Unique per team. - 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 + 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 semantics: only mentioned fields written). """ external_id: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -63,43 +65,43 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - show_uptime: None | Unset | bool + show_uptime: bool | None | Unset if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: None | Unset | int + show_uptime_last_days: int | None | Unset 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: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -108,49 +110,49 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - pagerduty_id: None | Unset | str + pagerduty_id: None | str | Unset if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | Unset | str + opsgenie_id: None | str | Unset if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | Unset | str + opsgenie_team_id: None | str | Unset if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - backstage_id: None | Unset | str + backstage_id: None | str | Unset if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - cortex_id: None | Unset | str + cortex_id: None | str | Unset if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - opslevel_id: None | Unset | str + opslevel_id: None | str | Unset if isinstance(self.opslevel_id, Unset): opslevel_id = UNSET else: opslevel_id = self.opslevel_id - service_now_ci_sys_id: None | Unset | str + service_now_ci_sys_id: None | str | Unset 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: Unset | list[dict[str, Any]] = UNSET + fields: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -210,61 +212,61 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_show_uptime(data: object) -> None | Unset | bool: + def _parse_show_uptime(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) - def _parse_show_uptime_last_days(data: object) -> None | Unset | int: + def _parse_show_uptime_last_days(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) show_uptime_last_days = _parse_show_uptime_last_days(d.pop("show_uptime_last_days", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -275,81 +277,83 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_pagerduty_id(data: object) -> None | Unset | str: + def _parse_pagerduty_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | Unset | str: + def _parse_opsgenie_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | Unset | str: + def _parse_opsgenie_team_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_backstage_id(data: object) -> None | Unset | str: + def _parse_backstage_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_cortex_id(data: object) -> None | Unset | str: + def _parse_cortex_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_opslevel_id(data: object) -> None | Unset | str: + def _parse_opslevel_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opslevel_id = _parse_opslevel_id(d.pop("opslevel_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: + def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) - for fields_item_data in _fields or []: - fields_item = BulkUpsertFunctionalitiesEntitiesItemFieldsItem.from_dict(fields_item_data) + 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) - 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 a55c96c3..f56126ce 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -15,14 +17,14 @@ class BulkUpsertFunctionalitiesEntitiesItemFieldsItem: Attributes: value (str): The value for this field - 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) + 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) """ value: str - catalog_field_id: Unset | str = UNSET - catalog_property_id: Unset | str = UNSET + catalog_field_id: str | Unset = UNSET + catalog_property_id: str | Unset = UNSET 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 ae9f29c3..9b027375 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_error.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_error.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -15,10 +17,10 @@ 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]: 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 10981217..8ae7ae2e 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_error_errors_item.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_error_errors_item.py @@ -1,3 +1,5 @@ +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 e042eeba..60ca694b 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_response.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,14 +19,14 @@ class BulkUpsertFunctionalitiesResponse: """ Attributes: - data (Union[Unset, list['BulkUpsertFunctionalitiesResponseDataItem']]): + data (list[BulkUpsertFunctionalitiesResponseDataItem] | Unset): """ - data: Unset | list["BulkUpsertFunctionalitiesResponseDataItem"] = UNSET + data: list[BulkUpsertFunctionalitiesResponseDataItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Unset | list[dict[str, Any]] = UNSET + data: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -44,12 +46,14 @@ 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) - for data_item_data in _data or []: - data_item = BulkUpsertFunctionalitiesResponseDataItem.from_dict(data_item_data) + 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) - 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 d12b3435..b95d2f63 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_response_data_item.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,24 +23,24 @@ class BulkUpsertFunctionalitiesResponseDataItem: """ Attributes: - id (Union[Unset, str]): - type_ (Union[Unset, BulkUpsertFunctionalitiesResponseDataItemType]): - attributes (Union[Unset, Functionality]): + id (str | Unset): + type_ (BulkUpsertFunctionalitiesResponseDataItemType | Unset): + attributes (Functionality | Unset): """ - id: Unset | str = UNSET - type_: Unset | BulkUpsertFunctionalitiesResponseDataItemType = UNSET - attributes: Union[Unset, "Functionality"] = UNSET + id: str | Unset = UNSET + type_: BulkUpsertFunctionalitiesResponseDataItemType | Unset = UNSET + attributes: Functionality | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -62,14 +64,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | BulkUpsertFunctionalitiesResponseDataItemType + type_: BulkUpsertFunctionalitiesResponseDataItemType | Unset if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_functionalities_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Unset | Functionality + attributes: Functionality | Unset if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/bulk_upsert_functionalities_response_data_item_type.py b/rootly_sdk/models/bulk_upsert_functionalities_response_data_item_type.py index b1cdac0f..dbd8881c 100644 --- a/rootly_sdk/models/bulk_upsert_functionalities_response_data_item_type.py +++ b/rootly_sdk/models/bulk_upsert_functionalities_response_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal BulkUpsertFunctionalitiesResponseDataItemType = Literal["functionalities"] @@ -13,7 +13,7 @@ def check_bulk_upsert_functionalities_response_data_item_type( if value is None: return None if value in BULK_UPSERT_FUNCTIONALITIES_RESPONSE_DATA_ITEM_TYPE_VALUES: - return cast(BulkUpsertFunctionalitiesResponseDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {BULK_UPSERT_FUNCTIONALITIES_RESPONSE_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/bulk_upsert_services.py b/rootly_sdk/models/bulk_upsert_services.py index 7efff1ad..a90dac3a 100644 --- a/rootly_sdk/models/bulk_upsert_services.py +++ b/rootly_sdk/models/bulk_upsert_services.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -15,11 +17,11 @@ 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]: diff --git a/rootly_sdk/models/bulk_upsert_services_entities_item.py b/rootly_sdk/models/bulk_upsert_services_entities_item.py index c04617a9..5449faa7 100644 --- a/rootly_sdk/models/bulk_upsert_services_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_services_entities_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -18,54 +20,54 @@ class BulkUpsertServicesEntitiesItem: """ Attributes: external_id (str): External identifier used as the upsert key. Unique per team. - 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). + 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). """ external_id: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -73,115 +75,115 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - show_uptime: None | Unset | bool + show_uptime: bool | None | Unset if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: None | Unset | int + show_uptime_last_days: int | None | Unset 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 | Unset | str + github_repository_name: None | str | Unset if isinstance(self.github_repository_name, Unset): github_repository_name = UNSET else: github_repository_name = self.github_repository_name - github_repository_branch: None | Unset | str + github_repository_branch: None | str | Unset if isinstance(self.github_repository_branch, Unset): github_repository_branch = UNSET else: github_repository_branch = self.github_repository_branch - gitlab_repository_name: None | Unset | str + gitlab_repository_name: None | str | Unset if isinstance(self.gitlab_repository_name, Unset): gitlab_repository_name = UNSET else: gitlab_repository_name = self.gitlab_repository_name - gitlab_repository_branch: None | Unset | str + gitlab_repository_branch: None | str | Unset if isinstance(self.gitlab_repository_branch, Unset): gitlab_repository_branch = UNSET else: gitlab_repository_branch = self.gitlab_repository_branch - kubernetes_deployment_name: None | Unset | str + kubernetes_deployment_name: None | str | Unset if isinstance(self.kubernetes_deployment_name, Unset): kubernetes_deployment_name = UNSET else: kubernetes_deployment_name = self.kubernetes_deployment_name - pagerduty_id: None | Unset | str + pagerduty_id: None | str | Unset if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | Unset | str + opsgenie_id: None | str | Unset if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | Unset | str + opsgenie_team_id: None | str | Unset if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: None | Unset | str + cortex_id: None | str | Unset if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - opslevel_id: None | Unset | str + opslevel_id: None | str | Unset if isinstance(self.opslevel_id, Unset): opslevel_id = UNSET else: opslevel_id = self.opslevel_id - backstage_id: None | Unset | str + backstage_id: None | str | Unset if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - service_now_ci_sys_id: None | Unset | str + service_now_ci_sys_id: None | str | Unset 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: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -190,13 +192,13 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - alerts_email_enabled: None | Unset | bool + alerts_email_enabled: bool | None | Unset if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - fields: Unset | list[dict[str, Any]] = UNSET + fields: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -266,169 +268,169 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_show_uptime(data: object) -> None | Unset | bool: + def _parse_show_uptime(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) show_uptime = _parse_show_uptime(d.pop("show_uptime", UNSET)) - def _parse_show_uptime_last_days(data: object) -> None | Unset | int: + def _parse_show_uptime_last_days(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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 | Unset | str: + def _parse_github_repository_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) github_repository_name = _parse_github_repository_name(d.pop("github_repository_name", UNSET)) - def _parse_github_repository_branch(data: object) -> None | Unset | str: + def _parse_github_repository_branch(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) github_repository_branch = _parse_github_repository_branch(d.pop("github_repository_branch", UNSET)) - def _parse_gitlab_repository_name(data: object) -> None | Unset | str: + def _parse_gitlab_repository_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) gitlab_repository_name = _parse_gitlab_repository_name(d.pop("gitlab_repository_name", UNSET)) - def _parse_gitlab_repository_branch(data: object) -> None | Unset | str: + def _parse_gitlab_repository_branch(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) gitlab_repository_branch = _parse_gitlab_repository_branch(d.pop("gitlab_repository_branch", UNSET)) - def _parse_kubernetes_deployment_name(data: object) -> None | Unset | str: + def _parse_kubernetes_deployment_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) kubernetes_deployment_name = _parse_kubernetes_deployment_name(d.pop("kubernetes_deployment_name", UNSET)) - def _parse_pagerduty_id(data: object) -> None | Unset | str: + def _parse_pagerduty_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | Unset | str: + def _parse_opsgenie_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | Unset | str: + def _parse_opsgenie_team_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> None | Unset | str: + def _parse_cortex_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_opslevel_id(data: object) -> None | Unset | str: + def _parse_opslevel_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opslevel_id = _parse_opslevel_id(d.pop("opslevel_id", UNSET)) - def _parse_backstage_id(data: object) -> None | Unset | str: + def _parse_backstage_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: + def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -439,27 +441,29 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: + def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - fields = [] _fields = d.pop("fields", UNSET) - for fields_item_data in _fields or []: - fields_item = BulkUpsertServicesEntitiesItemFieldsItem.from_dict(fields_item_data) + 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) - 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 4b873417..1c8f31dc 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -15,14 +17,14 @@ class BulkUpsertServicesEntitiesItemFieldsItem: Attributes: value (str): The value for this field - 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) + 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) """ value: str - catalog_field_id: Unset | str = UNSET - catalog_property_id: Unset | str = UNSET + catalog_field_id: str | Unset = UNSET + catalog_property_id: str | Unset = UNSET 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 36ae7c13..47c49dd6 100644 --- a/rootly_sdk/models/bulk_upsert_services_error.py +++ b/rootly_sdk/models/bulk_upsert_services_error.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -15,10 +17,10 @@ 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]: 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 51a76f78..8fb6bac4 100644 --- a/rootly_sdk/models/bulk_upsert_services_error_errors_item.py +++ b/rootly_sdk/models/bulk_upsert_services_error_errors_item.py @@ -1,3 +1,5 @@ +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 1fee4353..0a01a09f 100644 --- a/rootly_sdk/models/bulk_upsert_services_response.py +++ b/rootly_sdk/models/bulk_upsert_services_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,14 +19,14 @@ class BulkUpsertServicesResponse: """ Attributes: - data (Union[Unset, list['BulkUpsertServicesResponseDataItem']]): + data (list[BulkUpsertServicesResponseDataItem] | Unset): """ - data: Unset | list["BulkUpsertServicesResponseDataItem"] = UNSET + data: list[BulkUpsertServicesResponseDataItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Unset | list[dict[str, Any]] = UNSET + data: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -44,12 +46,14 @@ 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) - for data_item_data in _data or []: - data_item = BulkUpsertServicesResponseDataItem.from_dict(data_item_data) + 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) - 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 622e2f0f..f5a047fa 100644 --- a/rootly_sdk/models/bulk_upsert_services_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_services_response_data_item.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,24 +23,24 @@ class BulkUpsertServicesResponseDataItem: """ Attributes: - id (Union[Unset, str]): - type_ (Union[Unset, BulkUpsertServicesResponseDataItemType]): - attributes (Union[Unset, Service]): + id (str | Unset): + type_ (BulkUpsertServicesResponseDataItemType | Unset): + attributes (Service | Unset): """ - id: Unset | str = UNSET - type_: Unset | BulkUpsertServicesResponseDataItemType = UNSET - attributes: Union[Unset, "Service"] = UNSET + id: str | Unset = UNSET + type_: BulkUpsertServicesResponseDataItemType | Unset = UNSET + attributes: Service | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -62,14 +64,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | BulkUpsertServicesResponseDataItemType + type_: BulkUpsertServicesResponseDataItemType | Unset if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_services_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Unset | Service + attributes: Service | Unset if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/bulk_upsert_services_response_data_item_type.py b/rootly_sdk/models/bulk_upsert_services_response_data_item_type.py index 92736645..578060bd 100644 --- a/rootly_sdk/models/bulk_upsert_services_response_data_item_type.py +++ b/rootly_sdk/models/bulk_upsert_services_response_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal BulkUpsertServicesResponseDataItemType = Literal["services"] @@ -13,7 +13,7 @@ def check_bulk_upsert_services_response_data_item_type( if value is None: return None if value in BULK_UPSERT_SERVICES_RESPONSE_DATA_ITEM_TYPE_VALUES: - return cast(BulkUpsertServicesResponseDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {BULK_UPSERT_SERVICES_RESPONSE_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/bulk_upsert_teams.py b/rootly_sdk/models/bulk_upsert_teams.py index ba93015c..813de0aa 100644 --- a/rootly_sdk/models/bulk_upsert_teams.py +++ b/rootly_sdk/models/bulk_upsert_teams.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -15,11 +17,11 @@ 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]: diff --git a/rootly_sdk/models/bulk_upsert_teams_entities_item.py b/rootly_sdk/models/bulk_upsert_teams_entities_item.py index 33868db8..dd92499e 100644 --- a/rootly_sdk/models/bulk_upsert_teams_entities_item.py +++ b/rootly_sdk/models/bulk_upsert_teams_entities_item.py @@ -1,9 +1,15 @@ +from __future__ import annotations + 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 ..models.bulk_upsert_teams_entities_item_schedule_override_policy import ( + BulkUpsertTeamsEntitiesItemScheduleOverridePolicy, + check_bulk_upsert_teams_entities_item_schedule_override_policy, +) from ..types import UNSET, Unset if TYPE_CHECKING: @@ -18,44 +24,50 @@ class BulkUpsertTeamsEntitiesItem: """ Attributes: external_id (str): External identifier used as the upsert key. Unique per team. - 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). + name (str | Unset): Required for new records. Optional for updates. + description (None | str | Unset): + public_description (None | str | Unset): + schedule_override_policy (BulkUpsertTeamsEntitiesItemScheduleOverridePolicy | Unset): Who can create and update + overrides for schedules owned by this team: `everyone` in the organization, only team `members`, or only team + `admins`. Users still need override permission from their on-call role. Only available when the team-level + schedule override policy feature is enabled for the organization. Requests that set it while that feature is + disabled are rejected. + 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). """ external_id: str - 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 + name: str | Unset = UNSET + description: None | str | Unset = UNSET + public_description: None | str | Unset = UNSET + schedule_override_policy: BulkUpsertTeamsEntitiesItemScheduleOverridePolicy | 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -63,31 +75,35 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: None | Unset | str + schedule_override_policy: str | Unset = UNSET + if not isinstance(self.schedule_override_policy, Unset): + schedule_override_policy = self.schedule_override_policy + + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -96,67 +112,67 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - pagerduty_id: None | Unset | str + pagerduty_id: None | str | Unset if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - pagerduty_service_id: None | Unset | str + pagerduty_service_id: None | str | Unset if isinstance(self.pagerduty_service_id, Unset): pagerduty_service_id = UNSET else: pagerduty_service_id = self.pagerduty_service_id - opsgenie_id: None | Unset | str + opsgenie_id: None | str | Unset if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - victor_ops_id: None | Unset | str + victor_ops_id: None | str | Unset if isinstance(self.victor_ops_id, Unset): victor_ops_id = UNSET else: victor_ops_id = self.victor_ops_id - pagertree_id: None | Unset | str + pagertree_id: None | str | Unset if isinstance(self.pagertree_id, Unset): pagertree_id = UNSET else: pagertree_id = self.pagertree_id - backstage_id: None | Unset | str + backstage_id: None | str | Unset if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - cortex_id: None | Unset | str + cortex_id: None | str | Unset if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - opslevel_id: None | Unset | str + opslevel_id: None | str | Unset if isinstance(self.opslevel_id, Unset): opslevel_id = UNSET else: opslevel_id = self.opslevel_id - service_now_ci_sys_id: None | Unset | str + service_now_ci_sys_id: None | str | Unset 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: None | Unset | bool + alerts_email_enabled: bool | None | Unset if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - fields: Unset | list[dict[str, Any]] = UNSET + fields: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.fields, Unset): fields = [] for fields_item_data in self.fields: @@ -176,6 +192,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if public_description is not UNSET: field_dict["public_description"] = public_description + if schedule_override_policy is not UNSET: + field_dict["schedule_override_policy"] = schedule_override_policy if color is not UNSET: field_dict["color"] = color if position is not UNSET: @@ -216,43 +234,52 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + _schedule_override_policy = d.pop("schedule_override_policy", UNSET) + schedule_override_policy: BulkUpsertTeamsEntitiesItemScheduleOverridePolicy | Unset + if isinstance(_schedule_override_policy, Unset): + schedule_override_policy = UNSET + else: + schedule_override_policy = check_bulk_upsert_teams_entities_item_schedule_override_policy( + _schedule_override_policy + ) + + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -263,114 +290,117 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_pagerduty_id(data: object) -> None | Unset | str: + def _parse_pagerduty_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_pagerduty_service_id(data: object) -> None | Unset | str: + def _parse_pagerduty_service_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_service_id = _parse_pagerduty_service_id(d.pop("pagerduty_service_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | Unset | str: + def _parse_opsgenie_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_victor_ops_id(data: object) -> None | Unset | str: + def _parse_victor_ops_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) victor_ops_id = _parse_victor_ops_id(d.pop("victor_ops_id", UNSET)) - def _parse_pagertree_id(data: object) -> None | Unset | str: + def _parse_pagertree_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagertree_id = _parse_pagertree_id(d.pop("pagertree_id", UNSET)) - def _parse_backstage_id(data: object) -> None | Unset | str: + def _parse_backstage_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_cortex_id(data: object) -> None | Unset | str: + def _parse_cortex_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_opslevel_id(data: object) -> None | Unset | str: + def _parse_opslevel_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opslevel_id = _parse_opslevel_id(d.pop("opslevel_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: + def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) -> None | Unset | bool: + def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - fields = [] _fields = d.pop("fields", UNSET) - for fields_item_data in _fields or []: - fields_item = BulkUpsertTeamsEntitiesItemFieldsItem.from_dict(fields_item_data) + 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) - 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, + schedule_override_policy=schedule_override_policy, 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 8d2ce3d1..72057a8f 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -15,14 +17,14 @@ class BulkUpsertTeamsEntitiesItemFieldsItem: Attributes: value (str): The value for this field - 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) + 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) """ value: str - catalog_field_id: Unset | str = UNSET - catalog_property_id: Unset | str = UNSET + catalog_field_id: str | Unset = UNSET + catalog_property_id: str | Unset = UNSET 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_entities_item_schedule_override_policy.py b/rootly_sdk/models/bulk_upsert_teams_entities_item_schedule_override_policy.py new file mode 100644 index 00000000..058b97dc --- /dev/null +++ b/rootly_sdk/models/bulk_upsert_teams_entities_item_schedule_override_policy.py @@ -0,0 +1,23 @@ +from typing import Literal + +BulkUpsertTeamsEntitiesItemScheduleOverridePolicy = Literal["admins", "everyone", "members"] + +BULK_UPSERT_TEAMS_ENTITIES_ITEM_SCHEDULE_OVERRIDE_POLICY_VALUES: set[ + BulkUpsertTeamsEntitiesItemScheduleOverridePolicy +] = { + "admins", + "everyone", + "members", +} + + +def check_bulk_upsert_teams_entities_item_schedule_override_policy( + value: str | None, +) -> BulkUpsertTeamsEntitiesItemScheduleOverridePolicy | None: + if value is None: + return None + if value in BULK_UPSERT_TEAMS_ENTITIES_ITEM_SCHEDULE_OVERRIDE_POLICY_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {BULK_UPSERT_TEAMS_ENTITIES_ITEM_SCHEDULE_OVERRIDE_POLICY_VALUES!r}" + ) diff --git a/rootly_sdk/models/bulk_upsert_teams_error.py b/rootly_sdk/models/bulk_upsert_teams_error.py index 220ce856..612b9b26 100644 --- a/rootly_sdk/models/bulk_upsert_teams_error.py +++ b/rootly_sdk/models/bulk_upsert_teams_error.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -15,10 +17,10 @@ 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]: 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 76cc68ba..bb7cffdc 100644 --- a/rootly_sdk/models/bulk_upsert_teams_error_errors_item.py +++ b/rootly_sdk/models/bulk_upsert_teams_error_errors_item.py @@ -1,3 +1,5 @@ +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 c4644149..fd58eca4 100644 --- a/rootly_sdk/models/bulk_upsert_teams_response.py +++ b/rootly_sdk/models/bulk_upsert_teams_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,14 +19,14 @@ class BulkUpsertTeamsResponse: """ Attributes: - data (Union[Unset, list['BulkUpsertTeamsResponseDataItem']]): + data (list[BulkUpsertTeamsResponseDataItem] | Unset): """ - data: Unset | list["BulkUpsertTeamsResponseDataItem"] = UNSET + data: list[BulkUpsertTeamsResponseDataItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Unset | list[dict[str, Any]] = UNSET + data: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -44,12 +46,14 @@ 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) - for data_item_data in _data or []: - data_item = BulkUpsertTeamsResponseDataItem.from_dict(data_item_data) + 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) - 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 9bdacaaf..5c33c66e 100644 --- a/rootly_sdk/models/bulk_upsert_teams_response_data_item.py +++ b/rootly_sdk/models/bulk_upsert_teams_response_data_item.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,24 +23,24 @@ class BulkUpsertTeamsResponseDataItem: """ Attributes: - id (Union[Unset, str]): - type_ (Union[Unset, BulkUpsertTeamsResponseDataItemType]): - attributes (Union[Unset, Team]): + id (str | Unset): + type_ (BulkUpsertTeamsResponseDataItemType | Unset): + attributes (Team | Unset): """ - id: Unset | str = UNSET - type_: Unset | BulkUpsertTeamsResponseDataItemType = UNSET - attributes: Union[Unset, "Team"] = UNSET + id: str | Unset = UNSET + type_: BulkUpsertTeamsResponseDataItemType | Unset = UNSET + attributes: Team | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -62,14 +64,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | BulkUpsertTeamsResponseDataItemType + type_: BulkUpsertTeamsResponseDataItemType | Unset if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_bulk_upsert_teams_response_data_item_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Unset | Team + attributes: Team | Unset if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/bulk_upsert_teams_response_data_item_type.py b/rootly_sdk/models/bulk_upsert_teams_response_data_item_type.py index 623914c5..94879e78 100644 --- a/rootly_sdk/models/bulk_upsert_teams_response_data_item_type.py +++ b/rootly_sdk/models/bulk_upsert_teams_response_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal BulkUpsertTeamsResponseDataItemType = Literal["groups"] @@ -11,5 +11,5 @@ def check_bulk_upsert_teams_response_data_item_type(value: str | None) -> BulkUp if value is None: return None if value in BULK_UPSERT_TEAMS_RESPONSE_DATA_ITEM_TYPE_VALUES: - return cast(BulkUpsertTeamsResponseDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {BULK_UPSERT_TEAMS_RESPONSE_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/call_people_task_params.py b/rootly_sdk/models/call_people_task_params.py index 796d763c..c5cebec4 100644 --- a/rootly_sdk/models/call_people_task_params.py +++ b/rootly_sdk/models/call_people_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,13 +22,13 @@ class CallPeopleTaskParams: phone_numbers (list[str]): name (str): The name content (str): The message to be read by text-to-voice - task_type (Union[Unset, CallPeopleTaskParamsTaskType]): + task_type (CallPeopleTaskParamsTaskType | Unset): """ phone_numbers: list[str] name: str content: str - task_type: Unset | CallPeopleTaskParamsTaskType = UNSET + task_type: CallPeopleTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +38,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -64,7 +66,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: Unset | CallPeopleTaskParamsTaskType + task_type: CallPeopleTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/call_people_task_params_task_type.py b/rootly_sdk/models/call_people_task_params_task_type.py index 6e244a0d..26cab497 100644 --- a/rootly_sdk/models/call_people_task_params_task_type.py +++ b/rootly_sdk/models/call_people_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CallPeopleTaskParamsTaskType = Literal["call_people"] @@ -11,5 +11,5 @@ def check_call_people_task_params_task_type(value: str | None) -> CallPeopleTask if value is None: return None if value in CALL_PEOPLE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CallPeopleTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CALL_PEOPLE_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/cancel_incident.py b/rootly_sdk/models/cancel_incident.py index 452891a0..fb5f13d1 100644 --- a/rootly_sdk/models/cancel_incident.py +++ b/rootly_sdk/models/cancel_incident.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.cancel_incident_data import CancelIncidentData @@ -18,14 +19,13 @@ class CancelIncident: data (CancelIncidentData): """ - data: "CancelIncidentData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: CancelIncidentData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - cancel_incident.additional_properties = d return cancel_incident - - @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/cancel_incident_data.py b/rootly_sdk/models/cancel_incident_data.py index f93f0b30..283a87cf 100644 --- a/rootly_sdk/models/cancel_incident_data.py +++ b/rootly_sdk/models/cancel_incident_data.py @@ -1,10 +1,12 @@ +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.cancel_incident_data_type import CancelIncidentDataType, check_cancel_incident_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.cancel_incident_data_attributes import CancelIncidentDataAttributes @@ -19,25 +21,31 @@ class CancelIncidentData: Attributes: type_ (CancelIncidentDataType): attributes (CancelIncidentDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: CancelIncidentDataType - attributes: "CancelIncidentDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: CancelIncidentDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = CancelIncidentDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + cancel_incident_data = cls( type_=type_, attributes=attributes, + id=id, ) - cancel_incident_data.additional_properties = d return cancel_incident_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/cancel_incident_data_attributes.py b/rootly_sdk/models/cancel_incident_data_attributes.py index 6586a808..c3362192 100644 --- a/rootly_sdk/models/cancel_incident_data_attributes.py +++ b/rootly_sdk/models/cancel_incident_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,13 +14,13 @@ class CancelIncidentDataAttributes: """ Attributes: - cancellation_message (Union[None, Unset, str]): Why was the incident cancelled? + cancellation_message (None | str | Unset): Why was the incident cancelled? """ - cancellation_message: None | Unset | str = UNSET + cancellation_message: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: - cancellation_message: None | Unset | str + cancellation_message: None | str | Unset if isinstance(self.cancellation_message, Unset): cancellation_message = UNSET else: @@ -36,12 +38,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 | Unset | str: + def _parse_cancellation_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) cancellation_message = _parse_cancellation_message(d.pop("cancellation_message", UNSET)) diff --git a/rootly_sdk/models/cancel_incident_data_type.py b/rootly_sdk/models/cancel_incident_data_type.py index 5d0ce0d7..f19f0e4e 100644 --- a/rootly_sdk/models/cancel_incident_data_type.py +++ b/rootly_sdk/models/cancel_incident_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CancelIncidentDataType = Literal["incidents"] @@ -11,5 +11,5 @@ def check_cancel_incident_data_type(value: str | None) -> CancelIncidentDataType if value is None: return None if value in CANCEL_INCIDENT_DATA_TYPE_VALUES: - return cast(CancelIncidentDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CANCEL_INCIDENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/catalog.py b/rootly_sdk/models/catalog.py index 45896f39..a6658d10 100644 --- a/rootly_sdk/models/catalog.py +++ b/rootly_sdk/models/catalog.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,24 +19,24 @@ class Catalog: Attributes: name (str): icon (CatalogIcon): - position (Union[None, int]): Default position of the catalog when displayed in a list. + position (int | None): Default position of the catalog when displayed in a list. created_at (str): updated_at (str): - 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). + slug (str | Unset): The slug of the catalog. Derived from `name`. + 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). """ name: str icon: CatalogIcon - position: None | int + position: int | None created_at: str updated_at: str - slug: Unset | str = UNSET - description: None | Unset | str = UNSET - external_id: None | Unset | str = UNSET - managed_by: Unset | CatalogManagedBy = UNSET + slug: str | Unset = UNSET + description: None | str | Unset = UNSET + external_id: None | str | Unset = UNSET + managed_by: CatalogManagedBy | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: icon: str = self.icon - position: None | int + position: int | None position = self.position created_at = self.created_at @@ -51,19 +53,19 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - managed_by: Unset | str = UNSET + managed_by: str | Unset = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by @@ -96,10 +98,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) -> None | int: + def _parse_position(data: object) -> int | None: if data is None: return data - return cast(None | int, data) + return cast(int | None, data) position = _parse_position(d.pop("position")) @@ -109,26 +111,26 @@ def _parse_position(data: object) -> None | int: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) _managed_by = d.pop("managed_by", UNSET) - managed_by: Unset | CatalogManagedBy + managed_by: CatalogManagedBy | Unset if isinstance(_managed_by, Unset): managed_by = UNSET else: diff --git a/rootly_sdk/models/catalog_checklist_template.py b/rootly_sdk/models/catalog_checklist_template.py index a9ae621d..db087dd2 100644 --- a/rootly_sdk/models/catalog_checklist_template.py +++ b/rootly_sdk/models/catalog_checklist_template.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -32,10 +34,10 @@ class CatalogChecklistTemplate: scope_id (str): The scope ID created_at (str): Date of creation updated_at (str): Date of last update - 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 + 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 """ name: str @@ -44,10 +46,10 @@ class CatalogChecklistTemplate: scope_id: str created_at: str updated_at: str - slug: Unset | str = UNSET - description: None | Unset | str = UNSET - fields: None | Unset | list["CatalogChecklistTemplateFieldsType0Item"] = UNSET - owners: None | Unset | list["CatalogChecklistTemplateOwnersType0Item"] = UNSET + slug: str | Unset = UNSET + description: None | str | Unset = UNSET + fields: list[CatalogChecklistTemplateFieldsType0Item] | None | Unset = UNSET + owners: list[CatalogChecklistTemplateOwnersType0Item] | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -65,13 +67,13 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - fields: None | Unset | list[dict[str, Any]] + fields: list[dict[str, Any]] | None | Unset if isinstance(self.fields, Unset): fields = UNSET elif isinstance(self.fields, list): @@ -83,7 +85,7 @@ def to_dict(self) -> dict[str, Any]: else: fields = self.fields - owners: None | Unset | list[dict[str, Any]] + owners: list[dict[str, Any]] | None | Unset if isinstance(self.owners, Unset): owners = UNSET elif isinstance(self.owners, list): @@ -138,16 +140,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_fields(data: object) -> None | Unset | list["CatalogChecklistTemplateFieldsType0Item"]: + def _parse_fields(data: object) -> list[CatalogChecklistTemplateFieldsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -163,13 +165,13 @@ def _parse_fields(data: object) -> None | Unset | list["CatalogChecklistTemplate fields_type_0.append(fields_type_0_item) return fields_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["CatalogChecklistTemplateFieldsType0Item"], data) + return cast(list[CatalogChecklistTemplateFieldsType0Item] | None | Unset, data) fields = _parse_fields(d.pop("fields", UNSET)) - def _parse_owners(data: object) -> None | Unset | list["CatalogChecklistTemplateOwnersType0Item"]: + def _parse_owners(data: object) -> list[CatalogChecklistTemplateOwnersType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -185,9 +187,9 @@ def _parse_owners(data: object) -> None | Unset | list["CatalogChecklistTemplate owners_type_0.append(owners_type_0_item) return owners_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["CatalogChecklistTemplateOwnersType0Item"], data) + return cast(list[CatalogChecklistTemplateOwnersType0Item] | None | Unset, data) owners = _parse_owners(d.pop("owners", UNSET)) diff --git a/rootly_sdk/models/catalog_checklist_template_catalog_type.py b/rootly_sdk/models/catalog_checklist_template_catalog_type.py index d84f5ad6..d529aa8f 100644 --- a/rootly_sdk/models/catalog_checklist_template_catalog_type.py +++ b/rootly_sdk/models/catalog_checklist_template_catalog_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogChecklistTemplateCatalogType = Literal[ "Catalog", "Cause", "Environment", "Functionality", "Group", "IncidentType", "Service" @@ -19,5 +19,5 @@ def check_catalog_checklist_template_catalog_type(value: str | None) -> CatalogC if value is None: return None if value in CATALOG_CHECKLIST_TEMPLATE_CATALOG_TYPE_VALUES: - return cast(CatalogChecklistTemplateCatalogType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_CHECKLIST_TEMPLATE_CATALOG_TYPE_VALUES!r}") 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 81804df4..c2eaf173 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,24 +19,24 @@ class CatalogChecklistTemplateFieldsType0Item: """ Attributes: - 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): 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: Unset | CatalogChecklistTemplateFieldsType0ItemFieldSource = UNSET - field_key: Unset | str = UNSET - catalog_property_id: None | Unset | str = UNSET + field_source: CatalogChecklistTemplateFieldsType0ItemFieldSource | Unset = UNSET + field_key: str | Unset = UNSET + catalog_property_id: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - field_source: Unset | str = UNSET + field_source: str | Unset = UNSET if not isinstance(self.field_source, Unset): field_source = self.field_source field_key = self.field_key - catalog_property_id: None | Unset | str + catalog_property_id: None | str | Unset if isinstance(self.catalog_property_id, Unset): catalog_property_id = UNSET else: @@ -56,7 +58,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: Unset | CatalogChecklistTemplateFieldsType0ItemFieldSource + field_source: CatalogChecklistTemplateFieldsType0ItemFieldSource | Unset if isinstance(_field_source, Unset): field_source = UNSET else: @@ -64,12 +66,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 | Unset | str: + def _parse_catalog_property_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) catalog_property_id = _parse_catalog_property_id(d.pop("catalog_property_id", UNSET)) diff --git a/rootly_sdk/models/catalog_checklist_template_fields_type_0_item_field_source.py b/rootly_sdk/models/catalog_checklist_template_fields_type_0_item_field_source.py index 8dde8781..bbed967e 100644 --- a/rootly_sdk/models/catalog_checklist_template_fields_type_0_item_field_source.py +++ b/rootly_sdk/models/catalog_checklist_template_fields_type_0_item_field_source.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogChecklistTemplateFieldsType0ItemFieldSource = Literal["builtin", "custom"] @@ -16,7 +16,7 @@ def check_catalog_checklist_template_fields_type_0_item_field_source( if value is None: return None if value in CATALOG_CHECKLIST_TEMPLATE_FIELDS_TYPE_0_ITEM_FIELD_SOURCE_VALUES: - return cast(CatalogChecklistTemplateFieldsType0ItemFieldSource, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CATALOG_CHECKLIST_TEMPLATE_FIELDS_TYPE_0_ITEM_FIELD_SOURCE_VALUES!r}" ) diff --git a/rootly_sdk/models/catalog_checklist_template_list.py b/rootly_sdk/models/catalog_checklist_template_list.py index c4ef5839..0c0d687b 100644 --- a/rootly_sdk/models/catalog_checklist_template_list.py +++ b/rootly_sdk/models/catalog_checklist_template_list.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,16 +22,16 @@ class CatalogChecklistTemplateList: """ Attributes: - data (list['CatalogChecklistTemplateListDataItem']): - links (Union[Unset, Links]): - meta (Union[Unset, Meta]): - included (Union[Unset, list['JsonapiIncludedResource']]): + data (list[CatalogChecklistTemplateListDataItem]): + links (Links | Unset): + meta (Meta | Unset): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["CatalogChecklistTemplateListDataItem"] - links: Union[Unset, "Links"] = UNSET - meta: Union[Unset, "Meta"] = UNSET - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[CatalogChecklistTemplateListDataItem] + links: Links | Unset = UNSET + meta: Meta | Unset = UNSET + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,15 +40,15 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Unset | dict[str, Any] = UNSET + links: dict[str, Any] | Unset = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Unset | dict[str, Any] = UNSET + meta: dict[str, Any] | Unset = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,25 +87,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Unset | Links + links: Links | Unset if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Unset | Meta + meta: Meta | Unset if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) - included = [] _included = d.pop("included", UNSET) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 d69abd27..005c894f 100644 --- a/rootly_sdk/models/catalog_checklist_template_list_data_item.py +++ b/rootly_sdk/models/catalog_checklist_template_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/catalog_checklist_template_list_data_item_type.py b/rootly_sdk/models/catalog_checklist_template_list_data_item_type.py index d227dd9d..d356a010 100644 --- a/rootly_sdk/models/catalog_checklist_template_list_data_item_type.py +++ b/rootly_sdk/models/catalog_checklist_template_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogChecklistTemplateListDataItemType = Literal["catalog_checklist_templates"] @@ -13,7 +13,7 @@ def check_catalog_checklist_template_list_data_item_type( if value is None: return None if value in CATALOG_CHECKLIST_TEMPLATE_LIST_DATA_ITEM_TYPE_VALUES: - return cast(CatalogChecklistTemplateListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CATALOG_CHECKLIST_TEMPLATE_LIST_DATA_ITEM_TYPE_VALUES!r}" ) 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 5e05961b..23e30f42 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -17,18 +19,18 @@ class CatalogChecklistTemplateOwnersType0Item: """ Attributes: - 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): User ID for user owners, or field key for field owners + type_ (CatalogChecklistTemplateOwnersType0ItemType | Unset): Type of owner """ - id: Unset | str = UNSET - type_: Unset | CatalogChecklistTemplateOwnersType0ItemType = UNSET + id: str | Unset = UNSET + type_: CatalogChecklistTemplateOwnersType0ItemType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -48,7 +50,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | CatalogChecklistTemplateOwnersType0ItemType + type_: CatalogChecklistTemplateOwnersType0ItemType | Unset if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/catalog_checklist_template_owners_type_0_item_type.py b/rootly_sdk/models/catalog_checklist_template_owners_type_0_item_type.py index 27450bd7..f0d8f201 100644 --- a/rootly_sdk/models/catalog_checklist_template_owners_type_0_item_type.py +++ b/rootly_sdk/models/catalog_checklist_template_owners_type_0_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogChecklistTemplateOwnersType0ItemType = Literal["field", "user"] @@ -14,7 +14,7 @@ def check_catalog_checklist_template_owners_type_0_item_type( if value is None: return None if value in CATALOG_CHECKLIST_TEMPLATE_OWNERS_TYPE_0_ITEM_TYPE_VALUES: - return cast(CatalogChecklistTemplateOwnersType0ItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CATALOG_CHECKLIST_TEMPLATE_OWNERS_TYPE_0_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/catalog_checklist_template_response.py b/rootly_sdk/models/catalog_checklist_template_response.py index 1f517df8..c21d9ba4 100644 --- a/rootly_sdk/models/catalog_checklist_template_response.py +++ b/rootly_sdk/models/catalog_checklist_template_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class CatalogChecklistTemplateResponse: """ Attributes: data (CatalogChecklistTemplateResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "CatalogChecklistTemplateResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: CatalogChecklistTemplateResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 8227aea1..d58e7592 100644 --- a/rootly_sdk/models/catalog_checklist_template_response_data.py +++ b/rootly_sdk/models/catalog_checklist_template_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/catalog_checklist_template_response_data_type.py b/rootly_sdk/models/catalog_checklist_template_response_data_type.py index cb700bb8..89dc82c8 100644 --- a/rootly_sdk/models/catalog_checklist_template_response_data_type.py +++ b/rootly_sdk/models/catalog_checklist_template_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogChecklistTemplateResponseDataType = Literal["catalog_checklist_templates"] @@ -13,7 +13,7 @@ def check_catalog_checklist_template_response_data_type( if value is None: return None if value in CATALOG_CHECKLIST_TEMPLATE_RESPONSE_DATA_TYPE_VALUES: - return cast(CatalogChecklistTemplateResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CATALOG_CHECKLIST_TEMPLATE_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/catalog_checklist_template_scope_type.py b/rootly_sdk/models/catalog_checklist_template_scope_type.py index d3bb40b1..49758abd 100644 --- a/rootly_sdk/models/catalog_checklist_template_scope_type.py +++ b/rootly_sdk/models/catalog_checklist_template_scope_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogChecklistTemplateScopeType = Literal["Catalog", "Team"] @@ -12,5 +12,5 @@ def check_catalog_checklist_template_scope_type(value: str | None) -> CatalogChe if value is None: return None if value in CATALOG_CHECKLIST_TEMPLATE_SCOPE_TYPE_VALUES: - return cast(CatalogChecklistTemplateScopeType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_CHECKLIST_TEMPLATE_SCOPE_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/catalog_entity.py b/rootly_sdk/models/catalog_entity.py index 8affd2bd..a51ae87f 100644 --- a/rootly_sdk/models/catalog_entity.py +++ b/rootly_sdk/models/catalog_entity.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -19,36 +21,36 @@ class CatalogEntity: """ Attributes: name (str): - position (Union[None, int]): Default position of the item when displayed in a list. + position (int | None): Default position of the item when displayed in a list. created_at (str): updated_at (str): - 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 + slug (str | Unset): The slug of the catalog entity. Derived from `name`. + description (None | str | Unset): + public_description (None | str | Unset): The status page description of the catalog entity + 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 catalog. - 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 + managed_by (CatalogEntityManagedBy | Unset): Which source manages this resource (read-only). + properties (list[CatalogEntityPropertiesItem] | Unset): Array of property values for this catalog entity """ name: str - position: None | int + position: int | None created_at: str updated_at: str - 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 + slug: str | Unset = UNSET + description: None | str | Unset = UNSET + public_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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - position: None | int + position: int | None position = self.position created_at = self.created_at @@ -57,35 +59,35 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - backstage_id: None | Unset | str + backstage_id: None | str | Unset if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - managed_by: Unset | str = UNSET + managed_by: str | Unset = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - properties: Unset | list[dict[str, Any]] = UNSET + properties: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -126,10 +128,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) -> None | int: + def _parse_position(data: object) -> int | None: if data is None: return data - return cast(None | int, data) + return cast(int | None, data) position = _parse_position(d.pop("position")) @@ -139,55 +141,57 @@ def _parse_position(data: object) -> None | int: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_backstage_id(data: object) -> None | Unset | str: + def _parse_backstage_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) _managed_by = d.pop("managed_by", UNSET) - managed_by: Unset | CatalogEntityManagedBy + managed_by: CatalogEntityManagedBy | Unset if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_catalog_entity_managed_by(_managed_by) - properties = [] _properties = d.pop("properties", UNSET) - for properties_item_data in _properties or []: - properties_item = CatalogEntityPropertiesItem.from_dict(properties_item_data) + 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) - properties.append(properties_item) + properties.append(properties_item) catalog_entity = cls( name=name, diff --git a/rootly_sdk/models/catalog_entity_checklist.py b/rootly_sdk/models/catalog_entity_checklist.py index e13a70db..e8d7db76 100644 --- a/rootly_sdk/models/catalog_entity_checklist.py +++ b/rootly_sdk/models/catalog_entity_checklist.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -33,11 +35,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 (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 + 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 """ catalog_checklist_template_id: str @@ -46,11 +48,11 @@ class CatalogEntityChecklist: status: CatalogEntityChecklistStatus created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -66,25 +68,25 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - completed_at: None | Unset | str + completed_at: None | str | Unset if isinstance(self.completed_at, Unset): completed_at = UNSET else: completed_at = self.completed_at - completed_by_user_id: None | Unset | str + completed_by_user_id: None | str | Unset 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: None | Unset | list[dict[str, Any]] + checklist_fields: list[dict[str, Any]] | None | Unset if isinstance(self.checklist_fields, Unset): checklist_fields = UNSET elif isinstance(self.checklist_fields, list): @@ -96,7 +98,7 @@ def to_dict(self) -> dict[str, Any]: else: checklist_fields = self.checklist_fields - checklist_owners: None | Unset | list[dict[str, Any]] + checklist_owners: list[dict[str, Any]] | None | Unset if isinstance(self.checklist_owners, Unset): checklist_owners = UNSET elif isinstance(self.checklist_owners, list): @@ -155,36 +157,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 | Unset | str: + def _parse_started_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_completed_at(data: object) -> None | Unset | str: + def _parse_completed_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) - def _parse_completed_by_user_id(data: object) -> None | Unset | str: + def _parse_completed_by_user_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) completed_by_user_id = _parse_completed_by_user_id(d.pop("completed_by_user_id", UNSET)) def _parse_checklist_fields( data: object, - ) -> None | Unset | list["CatalogEntityChecklistChecklistFieldsType0Item"]: + ) -> list[CatalogEntityChecklistChecklistFieldsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -202,15 +204,15 @@ def _parse_checklist_fields( checklist_fields_type_0.append(checklist_fields_type_0_item) return checklist_fields_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["CatalogEntityChecklistChecklistFieldsType0Item"], data) + return cast(list[CatalogEntityChecklistChecklistFieldsType0Item] | None | Unset, data) checklist_fields = _parse_checklist_fields(d.pop("checklist_fields", UNSET)) def _parse_checklist_owners( data: object, - ) -> None | Unset | list["CatalogEntityChecklistChecklistOwnersType0Item"]: + ) -> list[CatalogEntityChecklistChecklistOwnersType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -228,9 +230,9 @@ def _parse_checklist_owners( checklist_owners_type_0.append(checklist_owners_type_0_item) return checklist_owners_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["CatalogEntityChecklistChecklistOwnersType0Item"], data) + return cast(list[CatalogEntityChecklistChecklistOwnersType0Item] | None | Unset, data) checklist_owners = _parse_checklist_owners(d.pop("checklist_owners", UNSET)) diff --git a/rootly_sdk/models/catalog_entity_checklist_auditable_type.py b/rootly_sdk/models/catalog_entity_checklist_auditable_type.py index a717f634..d973f872 100644 --- a/rootly_sdk/models/catalog_entity_checklist_auditable_type.py +++ b/rootly_sdk/models/catalog_entity_checklist_auditable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogEntityChecklistAuditableType = Literal[ "CatalogEntity", "Cause", "Environment", "Functionality", "Group", "IncidentType", "Service" @@ -19,5 +19,5 @@ def check_catalog_entity_checklist_auditable_type(value: str | None) -> CatalogE if value is None: return None if value in CATALOG_ENTITY_CHECKLIST_AUDITABLE_TYPE_VALUES: - return cast(CatalogEntityChecklistAuditableType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_ENTITY_CHECKLIST_AUDITABLE_TYPE_VALUES!r}") 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 bcb3ab76..760de6b0 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,14 +21,14 @@ class CatalogEntityChecklistChecklistFieldsType0Item: """ Attributes: - data (Union[Unset, CatalogEntityChecklistChecklistFieldsType0ItemData]): + data (CatalogEntityChecklistChecklistFieldsType0ItemData | Unset): """ - data: Union[Unset, "CatalogEntityChecklistChecklistFieldsType0ItemData"] = UNSET + data: CatalogEntityChecklistChecklistFieldsType0ItemData | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Unset | dict[str, Any] = UNSET + data: dict[str, Any] | Unset = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -46,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Unset | CatalogEntityChecklistChecklistFieldsType0ItemData + data: CatalogEntityChecklistChecklistFieldsType0ItemData | Unset 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 ec8b5928..99be75a9 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,24 +25,24 @@ class CatalogEntityChecklistChecklistFieldsType0ItemData: """ Attributes: - id (Union[Unset, str]): ID of the checklist field - type_ (Union[Unset, CatalogEntityChecklistChecklistFieldsType0ItemDataType]): - attributes (Union[Unset, CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes]): + id (str | Unset): ID of the checklist field + type_ (CatalogEntityChecklistChecklistFieldsType0ItemDataType | Unset): + attributes (CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes | Unset): """ - id: Unset | str = UNSET - type_: Unset | CatalogEntityChecklistChecklistFieldsType0ItemDataType = UNSET - attributes: Union[Unset, "CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes"] = UNSET + id: str | Unset = UNSET + type_: CatalogEntityChecklistChecklistFieldsType0ItemDataType | Unset = UNSET + attributes: CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -66,14 +68,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | CatalogEntityChecklistChecklistFieldsType0ItemDataType + type_: CatalogEntityChecklistChecklistFieldsType0ItemDataType | Unset 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: Unset | CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes + attributes: CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes | Unset 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 9a4d70b7..21f60c2e 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,29 +21,29 @@ class CatalogEntityChecklistChecklistFieldsType0ItemDataAttributes: """ Attributes: - 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): 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: 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,7 +53,7 @@ def to_dict(self) -> dict[str, Any]: catalog_entity_checklist_id = self.catalog_entity_checklist_id - catalog_checklist_template_field_id: None | Unset | str + catalog_checklist_template_field_id: None | str | Unset if isinstance(self.catalog_checklist_template_field_id, Unset): catalog_checklist_template_field_id = UNSET else: @@ -61,7 +63,7 @@ def to_dict(self) -> dict[str, Any]: checked = self.checked - value_snapshot: None | Unset | dict[str, Any] + value_snapshot: dict[str, Any] | None | Unset if isinstance(self.value_snapshot, Unset): value_snapshot = UNSET elif isinstance( @@ -71,13 +73,13 @@ def to_dict(self) -> dict[str, Any]: else: value_snapshot = self.value_snapshot - completed_by_user_id: None | Unset | str + completed_by_user_id: None | str | Unset 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 | Unset | str + completed_at: None | str | Unset if isinstance(self.completed_at, Unset): completed_at = UNSET else: @@ -120,12 +122,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 | Unset | str: + def _parse_catalog_checklist_template_field_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) catalog_checklist_template_field_id = _parse_catalog_checklist_template_field_id( d.pop("catalog_checklist_template_field_id", UNSET) @@ -137,7 +139,7 @@ def _parse_catalog_checklist_template_field_id(data: object) -> None | Unset | s def _parse_value_snapshot( data: object, - ) -> Union["CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0", None, Unset]: + ) -> CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -150,30 +152,29 @@ def _parse_value_snapshot( ) return value_snapshot_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass return cast( - Union["CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0", None, Unset], - data, + CatalogEntityChecklistChecklistFieldsType0ItemDataAttributesValueSnapshotType0 | None | Unset, data ) value_snapshot = _parse_value_snapshot(d.pop("value_snapshot", UNSET)) - def _parse_completed_by_user_id(data: object) -> None | Unset | str: + def _parse_completed_by_user_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) completed_by_user_id = _parse_completed_by_user_id(d.pop("completed_by_user_id", UNSET)) - def _parse_completed_at(data: object) -> None | Unset | str: + def _parse_completed_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 b853f651..c0b25867 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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_fields_type_0_item_data_type.py b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_type.py index 94ec6171..5f70b586 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_type.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_fields_type_0_item_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogEntityChecklistChecklistFieldsType0ItemDataType = Literal["catalog_entity_checklist_fields"] @@ -15,7 +15,7 @@ def check_catalog_entity_checklist_checklist_fields_type_0_item_data_type( if value is None: return None if value in CATALOG_ENTITY_CHECKLIST_CHECKLIST_FIELDS_TYPE_0_ITEM_DATA_TYPE_VALUES: - return cast(CatalogEntityChecklistChecklistFieldsType0ItemDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CATALOG_ENTITY_CHECKLIST_CHECKLIST_FIELDS_TYPE_0_ITEM_DATA_TYPE_VALUES!r}" ) 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 b5f47041..cfcef9a1 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,14 +21,14 @@ class CatalogEntityChecklistChecklistOwnersType0Item: """ Attributes: - data (Union[Unset, CatalogEntityChecklistChecklistOwnersType0ItemData]): + data (CatalogEntityChecklistChecklistOwnersType0ItemData | Unset): """ - data: Union[Unset, "CatalogEntityChecklistChecklistOwnersType0ItemData"] = UNSET + data: CatalogEntityChecklistChecklistOwnersType0ItemData | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Unset | dict[str, Any] = UNSET + data: dict[str, Any] | Unset = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -46,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Unset | CatalogEntityChecklistChecklistOwnersType0ItemData + data: CatalogEntityChecklistChecklistOwnersType0ItemData | Unset 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 04fc37d8..e873ed7a 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,24 +25,24 @@ class CatalogEntityChecklistChecklistOwnersType0ItemData: """ Attributes: - id (Union[Unset, str]): ID of the checklist owner - type_ (Union[Unset, CatalogEntityChecklistChecklistOwnersType0ItemDataType]): - attributes (Union[Unset, CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes]): + id (str | Unset): ID of the checklist owner + type_ (CatalogEntityChecklistChecklistOwnersType0ItemDataType | Unset): + attributes (CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes | Unset): """ - id: Unset | str = UNSET - type_: Unset | CatalogEntityChecklistChecklistOwnersType0ItemDataType = UNSET - attributes: Union[Unset, "CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes"] = UNSET + id: str | Unset = UNSET + type_: CatalogEntityChecklistChecklistOwnersType0ItemDataType | Unset = UNSET + attributes: CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -66,14 +68,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | CatalogEntityChecklistChecklistOwnersType0ItemDataType + type_: CatalogEntityChecklistChecklistOwnersType0ItemDataType | Unset 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: Unset | CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes + attributes: CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes | Unset 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 1e2f85e4..923596d6 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,16 +15,16 @@ class CatalogEntityChecklistChecklistOwnersType0ItemDataAttributes: """ Attributes: - 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): 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: Unset | str = UNSET - owner_user_id: Unset | str = UNSET - created_at: Unset | str = UNSET - updated_at: Unset | str = UNSET + catalog_entity_checklist_id: str | Unset = UNSET + owner_user_id: str | Unset = UNSET + created_at: str | Unset = UNSET + updated_at: str | Unset = UNSET 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_checklist_owners_type_0_item_data_type.py b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data_type.py index 712e9f58..ec1ea49a 100644 --- a/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data_type.py +++ b/rootly_sdk/models/catalog_entity_checklist_checklist_owners_type_0_item_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogEntityChecklistChecklistOwnersType0ItemDataType = Literal["catalog_entity_checklist_owners"] @@ -15,7 +15,7 @@ def check_catalog_entity_checklist_checklist_owners_type_0_item_data_type( if value is None: return None if value in CATALOG_ENTITY_CHECKLIST_CHECKLIST_OWNERS_TYPE_0_ITEM_DATA_TYPE_VALUES: - return cast(CatalogEntityChecklistChecklistOwnersType0ItemDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CATALOG_ENTITY_CHECKLIST_CHECKLIST_OWNERS_TYPE_0_ITEM_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/catalog_entity_checklist_list.py b/rootly_sdk/models/catalog_entity_checklist_list.py index ab8ee26d..5dae956e 100644 --- a/rootly_sdk/models/catalog_entity_checklist_list.py +++ b/rootly_sdk/models/catalog_entity_checklist_list.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,16 +22,16 @@ class CatalogEntityChecklistList: """ Attributes: - data (list['CatalogEntityChecklistListDataItem']): - links (Union[Unset, Links]): - meta (Union[Unset, Meta]): - included (Union[Unset, list['JsonapiIncludedResource']]): + data (list[CatalogEntityChecklistListDataItem]): + links (Links | Unset): + meta (Meta | Unset): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["CatalogEntityChecklistListDataItem"] - links: Union[Unset, "Links"] = UNSET - meta: Union[Unset, "Meta"] = UNSET - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[CatalogEntityChecklistListDataItem] + links: Links | Unset = UNSET + meta: Meta | Unset = UNSET + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,15 +40,15 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Unset | dict[str, Any] = UNSET + links: dict[str, Any] | Unset = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Unset | dict[str, Any] = UNSET + meta: dict[str, Any] | Unset = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,25 +87,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Unset | Links + links: Links | Unset if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Unset | Meta + meta: Meta | Unset if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) - included = [] _included = d.pop("included", UNSET) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 32e91060..5ce9263e 100644 --- a/rootly_sdk/models/catalog_entity_checklist_list_data_item.py +++ b/rootly_sdk/models/catalog_entity_checklist_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/catalog_entity_checklist_list_data_item_type.py b/rootly_sdk/models/catalog_entity_checklist_list_data_item_type.py index 4daf071b..180d634a 100644 --- a/rootly_sdk/models/catalog_entity_checklist_list_data_item_type.py +++ b/rootly_sdk/models/catalog_entity_checklist_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogEntityChecklistListDataItemType = Literal["catalog_entity_checklists"] @@ -13,7 +13,7 @@ def check_catalog_entity_checklist_list_data_item_type( if value is None: return None if value in CATALOG_ENTITY_CHECKLIST_LIST_DATA_ITEM_TYPE_VALUES: - return cast(CatalogEntityChecklistListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CATALOG_ENTITY_CHECKLIST_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/catalog_entity_checklist_response.py b/rootly_sdk/models/catalog_entity_checklist_response.py index 85097426..c15710f2 100644 --- a/rootly_sdk/models/catalog_entity_checklist_response.py +++ b/rootly_sdk/models/catalog_entity_checklist_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class CatalogEntityChecklistResponse: """ Attributes: data (CatalogEntityChecklistResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "CatalogEntityChecklistResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: CatalogEntityChecklistResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 d04912a0..8406b9e3 100644 --- a/rootly_sdk/models/catalog_entity_checklist_response_data.py +++ b/rootly_sdk/models/catalog_entity_checklist_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/catalog_entity_checklist_response_data_type.py b/rootly_sdk/models/catalog_entity_checklist_response_data_type.py index ddf9c76e..ac4a01de 100644 --- a/rootly_sdk/models/catalog_entity_checklist_response_data_type.py +++ b/rootly_sdk/models/catalog_entity_checklist_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogEntityChecklistResponseDataType = Literal["catalog_entity_checklists"] @@ -13,7 +13,7 @@ def check_catalog_entity_checklist_response_data_type( if value is None: return None if value in CATALOG_ENTITY_CHECKLIST_RESPONSE_DATA_TYPE_VALUES: - return cast(CatalogEntityChecklistResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CATALOG_ENTITY_CHECKLIST_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/catalog_entity_checklist_status.py b/rootly_sdk/models/catalog_entity_checklist_status.py index 2f34bd30..2c830fe5 100644 --- a/rootly_sdk/models/catalog_entity_checklist_status.py +++ b/rootly_sdk/models/catalog_entity_checklist_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogEntityChecklistStatus = Literal["cancelled", "completed", "in_progress", "triggered"] @@ -14,5 +14,5 @@ def check_catalog_entity_checklist_status(value: str | None) -> CatalogEntityChe if value is None: return None if value in CATALOG_ENTITY_CHECKLIST_STATUS_VALUES: - return cast(CatalogEntityChecklistStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_ENTITY_CHECKLIST_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/catalog_entity_list.py b/rootly_sdk/models/catalog_entity_list.py index 5c111e7e..35299ea5 100644 --- a/rootly_sdk/models/catalog_entity_list.py +++ b/rootly_sdk/models/catalog_entity_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class CatalogEntityList: """ Attributes: - data (list['CatalogEntityListDataItem']): + data (list[CatalogEntityListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["CatalogEntityListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[CatalogEntityListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 e71d7885..5a17fc87 100644 --- a/rootly_sdk/models/catalog_entity_list_data_item.py +++ b/rootly_sdk/models/catalog_entity_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/catalog_entity_list_data_item_type.py b/rootly_sdk/models/catalog_entity_list_data_item_type.py index 515e57b4..74b56e86 100644 --- a/rootly_sdk/models/catalog_entity_list_data_item_type.py +++ b/rootly_sdk/models/catalog_entity_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogEntityListDataItemType = Literal["catalog_entities"] @@ -11,5 +11,5 @@ def check_catalog_entity_list_data_item_type(value: str | None) -> CatalogEntity if value is None: return None if value in CATALOG_ENTITY_LIST_DATA_ITEM_TYPE_VALUES: - return cast(CatalogEntityListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_ENTITY_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/catalog_entity_managed_by.py b/rootly_sdk/models/catalog_entity_managed_by.py index 344958e6..54f09e11 100644 --- a/rootly_sdk/models/catalog_entity_managed_by.py +++ b/rootly_sdk/models/catalog_entity_managed_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogEntityManagedBy = Literal["admin_web", "api", "backstage", "catalog_sync", "pulumi", "terraform", "web"] @@ -17,5 +17,5 @@ def check_catalog_entity_managed_by(value: str | None) -> CatalogEntityManagedBy if value is None: return None if value in CATALOG_ENTITY_MANAGED_BY_VALUES: - return cast(CatalogEntityManagedBy, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_ENTITY_MANAGED_BY_VALUES!r}") diff --git a/rootly_sdk/models/catalog_entity_properties_item.py b/rootly_sdk/models/catalog_entity_properties_item.py index 4209688b..a96d631a 100644 --- a/rootly_sdk/models/catalog_entity_properties_item.py +++ b/rootly_sdk/models/catalog_entity_properties_item.py @@ -1,3 +1,5 @@ +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 28079807..36c57257 100644 --- a/rootly_sdk/models/catalog_entity_property.py +++ b/rootly_sdk/models/catalog_entity_property.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/catalog_entity_property_key.py b/rootly_sdk/models/catalog_entity_property_key.py index 29725ca6..46ec9aea 100644 --- a/rootly_sdk/models/catalog_entity_property_key.py +++ b/rootly_sdk/models/catalog_entity_property_key.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogEntityPropertyKey = Literal["catalog_entity", "slack", "text"] @@ -13,5 +13,5 @@ def check_catalog_entity_property_key(value: str | None) -> CatalogEntityPropert if value is None: return None if value in CATALOG_ENTITY_PROPERTY_KEY_VALUES: - return cast(CatalogEntityPropertyKey, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_ENTITY_PROPERTY_KEY_VALUES!r}") diff --git a/rootly_sdk/models/catalog_entity_property_list.py b/rootly_sdk/models/catalog_entity_property_list.py index 9cfd64a2..a8405a31 100644 --- a/rootly_sdk/models/catalog_entity_property_list.py +++ b/rootly_sdk/models/catalog_entity_property_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,16 +24,16 @@ 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 (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["CatalogEntityPropertyListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[CatalogEntityPropertyListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -84,12 +86,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 5296266a..283fee04 100644 --- a/rootly_sdk/models/catalog_entity_property_list_data_item.py +++ b/rootly_sdk/models/catalog_entity_property_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,7 +31,7 @@ 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]: diff --git a/rootly_sdk/models/catalog_entity_property_list_data_item_type.py b/rootly_sdk/models/catalog_entity_property_list_data_item_type.py index a3d07a69..11834aba 100644 --- a/rootly_sdk/models/catalog_entity_property_list_data_item_type.py +++ b/rootly_sdk/models/catalog_entity_property_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogEntityPropertyListDataItemType = Literal["catalog_entity_properties"] @@ -13,7 +13,7 @@ def check_catalog_entity_property_list_data_item_type( if value is None: return None if value in CATALOG_ENTITY_PROPERTY_LIST_DATA_ITEM_TYPE_VALUES: - return cast(CatalogEntityPropertyListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CATALOG_ENTITY_PROPERTY_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/catalog_entity_property_response.py b/rootly_sdk/models/catalog_entity_property_response.py index 4d5e1433..0b7b8a57 100644 --- a/rootly_sdk/models/catalog_entity_property_response.py +++ b/rootly_sdk/models/catalog_entity_property_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,17 +23,17 @@ class CatalogEntityPropertyResponse: Attributes: data (CatalogEntityPropertyResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "CatalogEntityPropertyResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: CatalogEntityPropertyResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -58,12 +60,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 2eadd03a..197549c8 100644 --- a/rootly_sdk/models/catalog_entity_property_response_data.py +++ b/rootly_sdk/models/catalog_entity_property_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,7 +31,7 @@ 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]: diff --git a/rootly_sdk/models/catalog_entity_property_response_data_type.py b/rootly_sdk/models/catalog_entity_property_response_data_type.py index b52258d4..4899110d 100644 --- a/rootly_sdk/models/catalog_entity_property_response_data_type.py +++ b/rootly_sdk/models/catalog_entity_property_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogEntityPropertyResponseDataType = Literal["catalog_entity_properties"] @@ -11,7 +11,7 @@ def check_catalog_entity_property_response_data_type(value: str | None) -> Catal if value is None: return None if value in CATALOG_ENTITY_PROPERTY_RESPONSE_DATA_TYPE_VALUES: - return cast(CatalogEntityPropertyResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CATALOG_ENTITY_PROPERTY_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/catalog_entity_response.py b/rootly_sdk/models/catalog_entity_response.py index 88a94682..81be62dd 100644 --- a/rootly_sdk/models/catalog_entity_response.py +++ b/rootly_sdk/models/catalog_entity_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class CatalogEntityResponse: """ Attributes: data (CatalogEntityResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "CatalogEntityResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: CatalogEntityResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 de40e5fb..d68be342 100644 --- a/rootly_sdk/models/catalog_entity_response_data.py +++ b/rootly_sdk/models/catalog_entity_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/catalog_entity_response_data_type.py b/rootly_sdk/models/catalog_entity_response_data_type.py index eb5e13ba..eebc4c60 100644 --- a/rootly_sdk/models/catalog_entity_response_data_type.py +++ b/rootly_sdk/models/catalog_entity_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogEntityResponseDataType = Literal["catalog_entities"] @@ -11,5 +11,5 @@ def check_catalog_entity_response_data_type(value: str | None) -> CatalogEntityR if value is None: return None if value in CATALOG_ENTITY_RESPONSE_DATA_TYPE_VALUES: - return cast(CatalogEntityResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_ENTITY_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/catalog_field.py b/rootly_sdk/models/catalog_field.py index 47e853eb..ec19027e 100644 --- a/rootly_sdk/models/catalog_field.py +++ b/rootly_sdk/models/catalog_field.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,35 +18,35 @@ class CatalogField: """ Attributes: - catalog_id (Union[None, str]): + catalog_id (None | str): name (str): kind (CatalogFieldKind): multiple (bool): Whether the attribute accepts multiple values. - position (Union[None, int]): Default position of the item when displayed in a list. + position (int | None): Default position of the item when displayed in a list. created_at (str): updated_at (str): - 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 + 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 scope. - managed_by (Union[Unset, CatalogFieldManagedBy]): Which source manages this resource (read-only). + managed_by (CatalogFieldManagedBy | Unset): Which source manages this resource (read-only). """ catalog_id: None | str name: str kind: CatalogFieldKind multiple: bool - position: None | int + position: int | None created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -57,7 +59,7 @@ def to_dict(self) -> dict[str, Any]: multiple = self.multiple - position: None | int + position: int | None position = self.position created_at = self.created_at @@ -66,7 +68,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - kind_catalog_id: None | Unset | str + kind_catalog_id: None | str | Unset if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: @@ -74,17 +76,17 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: Unset | str = UNSET + catalog_type: str | Unset = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - managed_by: Unset | str = UNSET + managed_by: str | Unset = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by @@ -133,10 +135,10 @@ def _parse_catalog_id(data: object) -> None | str: multiple = d.pop("multiple") - def _parse_position(data: object) -> None | int: + def _parse_position(data: object) -> int | None: if data is None: return data - return cast(None | int, data) + return cast(int | None, data) position = _parse_position(d.pop("position")) @@ -146,35 +148,35 @@ def _parse_position(data: object) -> None | int: slug = d.pop("slug", UNSET) - def _parse_kind_catalog_id(data: object) -> None | Unset | str: + def _parse_kind_catalog_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: Unset | CatalogFieldCatalogType + catalog_type: CatalogFieldCatalogType | Unset 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 | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) _managed_by = d.pop("managed_by", UNSET) - managed_by: Unset | CatalogFieldManagedBy + managed_by: CatalogFieldManagedBy | Unset if isinstance(_managed_by, Unset): managed_by = UNSET else: diff --git a/rootly_sdk/models/catalog_field_catalog_type.py b/rootly_sdk/models/catalog_field_catalog_type.py index 3a43602a..85873824 100644 --- a/rootly_sdk/models/catalog_field_catalog_type.py +++ b/rootly_sdk/models/catalog_field_catalog_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogFieldCatalogType = Literal[ "catalog", "cause", "environment", "functionality", "incident_type", "service", "team" @@ -19,5 +19,5 @@ def check_catalog_field_catalog_type(value: str | None) -> CatalogFieldCatalogTy if value is None: return None if value in CATALOG_FIELD_CATALOG_TYPE_VALUES: - return cast(CatalogFieldCatalogType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_FIELD_CATALOG_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/catalog_field_kind.py b/rootly_sdk/models/catalog_field_kind.py index dce1264d..c0fc7c95 100644 --- a/rootly_sdk/models/catalog_field_kind.py +++ b/rootly_sdk/models/catalog_field_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogFieldKind = Literal["reference", "text"] @@ -12,5 +12,5 @@ def check_catalog_field_kind(value: str | None) -> CatalogFieldKind | None: if value is None: return None if value in CATALOG_FIELD_KIND_VALUES: - return cast(CatalogFieldKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_FIELD_KIND_VALUES!r}") diff --git a/rootly_sdk/models/catalog_field_list.py b/rootly_sdk/models/catalog_field_list.py index 69edf3ce..9c5294ef 100644 --- a/rootly_sdk/models/catalog_field_list.py +++ b/rootly_sdk/models/catalog_field_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class CatalogFieldList: """ Attributes: - data (list['CatalogFieldListDataItem']): + data (list[CatalogFieldListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["CatalogFieldListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[CatalogFieldListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 744cc909..b5ed471d 100644 --- a/rootly_sdk/models/catalog_field_list_data_item.py +++ b/rootly_sdk/models/catalog_field_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/catalog_field_list_data_item_type.py b/rootly_sdk/models/catalog_field_list_data_item_type.py index 405e0401..41dc60ae 100644 --- a/rootly_sdk/models/catalog_field_list_data_item_type.py +++ b/rootly_sdk/models/catalog_field_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogFieldListDataItemType = Literal["catalog_properties"] @@ -11,5 +11,5 @@ def check_catalog_field_list_data_item_type(value: str | None) -> CatalogFieldLi if value is None: return None if value in CATALOG_FIELD_LIST_DATA_ITEM_TYPE_VALUES: - return cast(CatalogFieldListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_FIELD_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/catalog_field_managed_by.py b/rootly_sdk/models/catalog_field_managed_by.py index 0764812c..a8212347 100644 --- a/rootly_sdk/models/catalog_field_managed_by.py +++ b/rootly_sdk/models/catalog_field_managed_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogFieldManagedBy = Literal["admin_web", "api", "backstage", "catalog_sync", "pulumi", "terraform", "web"] @@ -17,5 +17,5 @@ def check_catalog_field_managed_by(value: str | None) -> CatalogFieldManagedBy | if value is None: return None if value in CATALOG_FIELD_MANAGED_BY_VALUES: - return cast(CatalogFieldManagedBy, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_FIELD_MANAGED_BY_VALUES!r}") diff --git a/rootly_sdk/models/catalog_field_response.py b/rootly_sdk/models/catalog_field_response.py index 18ae0ed0..3b1b5052 100644 --- a/rootly_sdk/models/catalog_field_response.py +++ b/rootly_sdk/models/catalog_field_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class CatalogFieldResponse: """ Attributes: data (CatalogFieldResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "CatalogFieldResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: CatalogFieldResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 21e16252..fcec088c 100644 --- a/rootly_sdk/models/catalog_field_response_data.py +++ b/rootly_sdk/models/catalog_field_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/catalog_field_response_data_type.py b/rootly_sdk/models/catalog_field_response_data_type.py index e60413d4..181edbda 100644 --- a/rootly_sdk/models/catalog_field_response_data_type.py +++ b/rootly_sdk/models/catalog_field_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogFieldResponseDataType = Literal["catalog_properties"] @@ -11,5 +11,5 @@ def check_catalog_field_response_data_type(value: str | None) -> CatalogFieldRes if value is None: return None if value in CATALOG_FIELD_RESPONSE_DATA_TYPE_VALUES: - return cast(CatalogFieldResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_FIELD_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/catalog_icon.py b/rootly_sdk/models/catalog_icon.py index 6f8a41a5..e4bfa98d 100644 --- a/rootly_sdk/models/catalog_icon.py +++ b/rootly_sdk/models/catalog_icon.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogIcon = Literal[ "chart-bar", "cursor-arrow-ripple", "globe-alt", "light-bulb", "server-stack", "shapes", "user-group", "users" @@ -20,5 +20,5 @@ def check_catalog_icon(value: str | None) -> CatalogIcon | None: if value is None: return None if value in CATALOG_ICON_VALUES: - return cast(CatalogIcon, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_ICON_VALUES!r}") diff --git a/rootly_sdk/models/catalog_list.py b/rootly_sdk/models/catalog_list.py index c307f652..a48e3b54 100644 --- a/rootly_sdk/models/catalog_list.py +++ b/rootly_sdk/models/catalog_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class CatalogList: """ Attributes: - data (list['CatalogListDataItem']): + data (list[CatalogListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["CatalogListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[CatalogListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 7c497c89..64ef65d2 100644 --- a/rootly_sdk/models/catalog_list_data_item.py +++ b/rootly_sdk/models/catalog_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/catalog_list_data_item_type.py b/rootly_sdk/models/catalog_list_data_item_type.py index 7c8f0c28..2aacfbf3 100644 --- a/rootly_sdk/models/catalog_list_data_item_type.py +++ b/rootly_sdk/models/catalog_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogListDataItemType = Literal["catalogs"] @@ -11,5 +11,5 @@ def check_catalog_list_data_item_type(value: str | None) -> CatalogListDataItemT if value is None: return None if value in CATALOG_LIST_DATA_ITEM_TYPE_VALUES: - return cast(CatalogListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/catalog_managed_by.py b/rootly_sdk/models/catalog_managed_by.py index 00bcf025..1044d29f 100644 --- a/rootly_sdk/models/catalog_managed_by.py +++ b/rootly_sdk/models/catalog_managed_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogManagedBy = Literal["admin_web", "api", "backstage", "catalog_sync", "pulumi", "terraform", "web"] @@ -17,5 +17,5 @@ def check_catalog_managed_by(value: str | None) -> CatalogManagedBy | None: if value is None: return None if value in CATALOG_MANAGED_BY_VALUES: - return cast(CatalogManagedBy, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_MANAGED_BY_VALUES!r}") diff --git a/rootly_sdk/models/catalog_property.py b/rootly_sdk/models/catalog_property.py index af5b8991..290c5655 100644 --- a/rootly_sdk/models/catalog_property.py +++ b/rootly_sdk/models/catalog_property.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,35 +18,35 @@ class CatalogProperty: """ Attributes: - catalog_id (Union[None, str]): + catalog_id (None | str): name (str): kind (CatalogPropertyKind): multiple (bool): Whether the attribute accepts multiple values. - position (Union[None, int]): Default position of the item when displayed in a list. + position (int | None): Default position of the item when displayed in a list. created_at (str): updated_at (str): - 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). + 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). """ catalog_id: None | str name: str kind: CatalogPropertyKind multiple: bool - position: None | int + position: int | None created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -57,7 +59,7 @@ def to_dict(self) -> dict[str, Any]: multiple = self.multiple - position: None | int + position: int | None position = self.position created_at = self.created_at @@ -66,7 +68,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - kind_catalog_id: None | Unset | str + kind_catalog_id: None | str | Unset if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: @@ -74,17 +76,17 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: Unset | str = UNSET + catalog_type: str | Unset = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - managed_by: Unset | str = UNSET + managed_by: str | Unset = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by @@ -133,10 +135,10 @@ def _parse_catalog_id(data: object) -> None | str: multiple = d.pop("multiple") - def _parse_position(data: object) -> None | int: + def _parse_position(data: object) -> int | None: if data is None: return data - return cast(None | int, data) + return cast(int | None, data) position = _parse_position(d.pop("position")) @@ -146,35 +148,35 @@ def _parse_position(data: object) -> None | int: slug = d.pop("slug", UNSET) - def _parse_kind_catalog_id(data: object) -> None | Unset | str: + def _parse_kind_catalog_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: Unset | CatalogPropertyCatalogType + catalog_type: CatalogPropertyCatalogType | Unset 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 | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) _managed_by = d.pop("managed_by", UNSET) - managed_by: Unset | CatalogPropertyManagedBy + managed_by: CatalogPropertyManagedBy | Unset if isinstance(_managed_by, Unset): managed_by = UNSET else: diff --git a/rootly_sdk/models/catalog_property_catalog_type.py b/rootly_sdk/models/catalog_property_catalog_type.py index 025e0b2c..34f40ff1 100644 --- a/rootly_sdk/models/catalog_property_catalog_type.py +++ b/rootly_sdk/models/catalog_property_catalog_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogPropertyCatalogType = Literal[ "catalog", "cause", "environment", "functionality", "incident_type", "service", "team" @@ -19,5 +19,5 @@ def check_catalog_property_catalog_type(value: str | None) -> CatalogPropertyCat if value is None: return None if value in CATALOG_PROPERTY_CATALOG_TYPE_VALUES: - return cast(CatalogPropertyCatalogType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_PROPERTY_CATALOG_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/catalog_property_kind.py b/rootly_sdk/models/catalog_property_kind.py index 862e1c8b..2f91b709 100644 --- a/rootly_sdk/models/catalog_property_kind.py +++ b/rootly_sdk/models/catalog_property_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogPropertyKind = Literal["reference", "text"] @@ -12,5 +12,5 @@ def check_catalog_property_kind(value: str | None) -> CatalogPropertyKind | None if value is None: return None if value in CATALOG_PROPERTY_KIND_VALUES: - return cast(CatalogPropertyKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_PROPERTY_KIND_VALUES!r}") diff --git a/rootly_sdk/models/catalog_property_list.py b/rootly_sdk/models/catalog_property_list.py index d61b7225..dc2f2581 100644 --- a/rootly_sdk/models/catalog_property_list.py +++ b/rootly_sdk/models/catalog_property_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class CatalogPropertyList: """ Attributes: - data (list['CatalogPropertyListDataItem']): + data (list[CatalogPropertyListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["CatalogPropertyListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[CatalogPropertyListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 4bd69137..992dea68 100644 --- a/rootly_sdk/models/catalog_property_list_data_item.py +++ b/rootly_sdk/models/catalog_property_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/catalog_property_list_data_item_type.py b/rootly_sdk/models/catalog_property_list_data_item_type.py index 6497458b..59a3c60f 100644 --- a/rootly_sdk/models/catalog_property_list_data_item_type.py +++ b/rootly_sdk/models/catalog_property_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogPropertyListDataItemType = Literal["catalog_properties"] @@ -11,5 +11,5 @@ def check_catalog_property_list_data_item_type(value: str | None) -> CatalogProp if value is None: return None if value in CATALOG_PROPERTY_LIST_DATA_ITEM_TYPE_VALUES: - return cast(CatalogPropertyListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_PROPERTY_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/catalog_property_managed_by.py b/rootly_sdk/models/catalog_property_managed_by.py index d7f860e8..429827fd 100644 --- a/rootly_sdk/models/catalog_property_managed_by.py +++ b/rootly_sdk/models/catalog_property_managed_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogPropertyManagedBy = Literal["admin_web", "api", "backstage", "catalog_sync", "pulumi", "terraform", "web"] @@ -17,5 +17,5 @@ def check_catalog_property_managed_by(value: str | None) -> CatalogPropertyManag if value is None: return None if value in CATALOG_PROPERTY_MANAGED_BY_VALUES: - return cast(CatalogPropertyManagedBy, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_PROPERTY_MANAGED_BY_VALUES!r}") diff --git a/rootly_sdk/models/catalog_property_response.py b/rootly_sdk/models/catalog_property_response.py index f4669081..183f591d 100644 --- a/rootly_sdk/models/catalog_property_response.py +++ b/rootly_sdk/models/catalog_property_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class CatalogPropertyResponse: """ Attributes: data (CatalogPropertyResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "CatalogPropertyResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: CatalogPropertyResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 9899d562..a5922b8d 100644 --- a/rootly_sdk/models/catalog_property_response_data.py +++ b/rootly_sdk/models/catalog_property_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/catalog_property_response_data_type.py b/rootly_sdk/models/catalog_property_response_data_type.py index 9a7984c7..a8bc1147 100644 --- a/rootly_sdk/models/catalog_property_response_data_type.py +++ b/rootly_sdk/models/catalog_property_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogPropertyResponseDataType = Literal["catalog_properties"] @@ -11,5 +11,5 @@ def check_catalog_property_response_data_type(value: str | None) -> CatalogPrope if value is None: return None if value in CATALOG_PROPERTY_RESPONSE_DATA_TYPE_VALUES: - return cast(CatalogPropertyResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_PROPERTY_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/catalog_response.py b/rootly_sdk/models/catalog_response.py index 77b93a64..865684d0 100644 --- a/rootly_sdk/models/catalog_response.py +++ b/rootly_sdk/models/catalog_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class CatalogResponse: """ Attributes: data (CatalogResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "CatalogResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: CatalogResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 84cb45e7..d4be5b4b 100644 --- a/rootly_sdk/models/catalog_response_data.py +++ b/rootly_sdk/models/catalog_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/catalog_response_data_type.py b/rootly_sdk/models/catalog_response_data_type.py index 7d559cdf..601cfe89 100644 --- a/rootly_sdk/models/catalog_response_data_type.py +++ b/rootly_sdk/models/catalog_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CatalogResponseDataType = Literal["catalogs"] @@ -11,5 +11,5 @@ def check_catalog_response_data_type(value: str | None) -> CatalogResponseDataTy if value is None: return None if value in CATALOG_RESPONSE_DATA_TYPE_VALUES: - return cast(CatalogResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CATALOG_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/cause.py b/rootly_sdk/models/cause.py index ac51daa7..63fbe339 100644 --- a/rootly_sdk/models/cause.py +++ b/rootly_sdk/models/cause.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -20,21 +22,21 @@ class Cause: name (str): The name of the cause created_at (str): Date of creation updated_at (str): Date of last update - 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. + slug (str | Unset): The slug of the cause + description (None | str | Unset): The description of the cause + public_description (None | str | Unset): The status page description of the cause + position (int | None | Unset): Position of the cause + properties (list[CausePropertiesItem] | Unset): Array of property values for this cause. """ name: str created_at: str updated_at: str - 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 + slug: str | Unset = UNSET + description: None | str | Unset = UNSET + public_description: None | str | Unset = UNSET + position: int | None | Unset = UNSET + properties: list[CausePropertiesItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,25 +48,25 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - properties: Unset | list[dict[str, Any]] = UNSET + properties: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -106,39 +108,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - properties = [] _properties = d.pop("properties", UNSET) - for properties_item_data in _properties or []: - properties_item = CausePropertiesItem.from_dict(properties_item_data) + 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) - properties.append(properties_item) + properties.append(properties_item) cause = cls( name=name, diff --git a/rootly_sdk/models/cause_list.py b/rootly_sdk/models/cause_list.py index b2a05e85..8d6b8ffe 100644 --- a/rootly_sdk/models/cause_list.py +++ b/rootly_sdk/models/cause_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class CauseList: """ Attributes: - data (list['CauseListDataItem']): + data (list[CauseListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["CauseListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[CauseListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 be1f6faa..56624359 100644 --- a/rootly_sdk/models/cause_list_data_item.py +++ b/rootly_sdk/models/cause_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/cause_list_data_item_type.py b/rootly_sdk/models/cause_list_data_item_type.py index 239c8f79..dbbb480c 100644 --- a/rootly_sdk/models/cause_list_data_item_type.py +++ b/rootly_sdk/models/cause_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CauseListDataItemType = Literal["causes"] @@ -11,5 +11,5 @@ def check_cause_list_data_item_type(value: str | None) -> CauseListDataItemType if value is None: return None if value in CAUSE_LIST_DATA_ITEM_TYPE_VALUES: - return cast(CauseListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CAUSE_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/cause_properties_item.py b/rootly_sdk/models/cause_properties_item.py index ab1a6e50..ada1e890 100644 --- a/rootly_sdk/models/cause_properties_item.py +++ b/rootly_sdk/models/cause_properties_item.py @@ -1,3 +1,5 @@ +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 8db75808..f893bab5 100644 --- a/rootly_sdk/models/cause_response.py +++ b/rootly_sdk/models/cause_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class CauseResponse: """ Attributes: data (CauseResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "CauseResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: CauseResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 474e138f..6249d136 100644 --- a/rootly_sdk/models/cause_response_data.py +++ b/rootly_sdk/models/cause_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/cause_response_data_type.py b/rootly_sdk/models/cause_response_data_type.py index d32b4ada..81d337d1 100644 --- a/rootly_sdk/models/cause_response_data_type.py +++ b/rootly_sdk/models/cause_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CauseResponseDataType = Literal["causes"] @@ -11,5 +11,5 @@ def check_cause_response_data_type(value: str | None) -> CauseResponseDataType | if value is None: return None if value in CAUSE_RESPONSE_DATA_TYPE_VALUES: - return cast(CauseResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CAUSE_RESPONSE_DATA_TYPE_VALUES!r}") 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 7e38b344..43517525 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -22,24 +24,24 @@ class ChangeGoogleChatSpacePrivacyTaskParams: """ Attributes: space (ChangeGoogleChatSpacePrivacyTaskParamsSpace): - task_type (Union[Unset, ChangeGoogleChatSpacePrivacyTaskParamsTaskType]): - audience (Union[None, Unset, str]): Target audience resource name (e.g. audiences/default). Leave blank to make + task_type (ChangeGoogleChatSpacePrivacyTaskParamsTaskType | Unset): + audience (None | str | Unset): Target audience resource name (e.g. audiences/default). Leave blank to make private. """ - space: "ChangeGoogleChatSpacePrivacyTaskParamsSpace" - task_type: Unset | ChangeGoogleChatSpacePrivacyTaskParamsTaskType = UNSET - audience: None | Unset | str = UNSET + space: ChangeGoogleChatSpacePrivacyTaskParamsSpace + task_type: ChangeGoogleChatSpacePrivacyTaskParamsTaskType | Unset = UNSET + audience: None | str | Unset = 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - audience: None | Unset | str + audience: None | str | Unset if isinstance(self.audience, Unset): audience = UNSET else: @@ -69,18 +71,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: Unset | ChangeGoogleChatSpacePrivacyTaskParamsTaskType + task_type: ChangeGoogleChatSpacePrivacyTaskParamsTaskType | Unset 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 | Unset | str: + def _parse_audience(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 a9116862..cf4c0984 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class ChangeGoogleChatSpacePrivacyTaskParamsSpace: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_google_chat_space_privacy_task_params_task_type.py b/rootly_sdk/models/change_google_chat_space_privacy_task_params_task_type.py index df9d0a4c..41ed0128 100644 --- a/rootly_sdk/models/change_google_chat_space_privacy_task_params_task_type.py +++ b/rootly_sdk/models/change_google_chat_space_privacy_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ChangeGoogleChatSpacePrivacyTaskParamsTaskType = Literal["change_google_chat_space_privacy"] @@ -13,7 +13,7 @@ def check_change_google_chat_space_privacy_task_params_task_type( if value is None: return None if value in CHANGE_GOOGLE_CHAT_SPACE_PRIVACY_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(ChangeGoogleChatSpacePrivacyTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CHANGE_GOOGLE_CHAT_SPACE_PRIVACY_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 3c87f256..d4c87d02 100644 --- a/rootly_sdk/models/change_slack_channel_privacy_task_params.py +++ b/rootly_sdk/models/change_slack_channel_privacy_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,12 +29,18 @@ class ChangeSlackChannelPrivacyTaskParams: Attributes: channel (ChangeSlackChannelPrivacyTaskParamsChannel): privacy (ChangeSlackChannelPrivacyTaskParamsPrivacy): - task_type (Union[Unset, ChangeSlackChannelPrivacyTaskParamsTaskType]): + task_type (ChangeSlackChannelPrivacyTaskParamsTaskType | Unset): + retry_count (int | Unset): Number of times to retry on rate-limit (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. """ - channel: "ChangeSlackChannelPrivacyTaskParamsChannel" + channel: ChangeSlackChannelPrivacyTaskParamsChannel privacy: ChangeSlackChannelPrivacyTaskParamsPrivacy - task_type: Unset | ChangeSlackChannelPrivacyTaskParamsTaskType = UNSET + task_type: ChangeSlackChannelPrivacyTaskParamsTaskType | Unset = UNSET + retry_count: int | Unset = 0 + retry_wait_time: int | Unset = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,10 +48,14 @@ def to_dict(self) -> dict[str, Any]: privacy: str = self.privacy - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type + 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( @@ -54,6 +66,10 @@ def to_dict(self) -> dict[str, Any]: ) if task_type is not UNSET: field_dict["task_type"] = task_type + 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 @@ -67,16 +83,22 @@ 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: Unset | ChangeSlackChannelPrivacyTaskParamsTaskType + task_type: ChangeSlackChannelPrivacyTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_change_slack_channel_privacy_task_params_task_type(_task_type) + retry_count = d.pop("retry_count", UNSET) + + retry_wait_time = d.pop("retry_wait_time", UNSET) + change_slack_channel_privacy_task_params = cls( channel=channel, privacy=privacy, task_type=task_type, + retry_count=retry_count, + retry_wait_time=retry_wait_time, ) change_slack_channel_privacy_task_params.additional_properties = d 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 4457d494..1dd7d904 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class ChangeSlackChannelPrivacyTaskParamsChannel: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_privacy.py b/rootly_sdk/models/change_slack_channel_privacy_task_params_privacy.py index 1e143675..6b169a29 100644 --- a/rootly_sdk/models/change_slack_channel_privacy_task_params_privacy.py +++ b/rootly_sdk/models/change_slack_channel_privacy_task_params_privacy.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ChangeSlackChannelPrivacyTaskParamsPrivacy = Literal["private", "public"] @@ -14,7 +14,7 @@ def check_change_slack_channel_privacy_task_params_privacy( if value is None: return None if value in CHANGE_SLACK_CHANNEL_PRIVACY_TASK_PARAMS_PRIVACY_VALUES: - return cast(ChangeSlackChannelPrivacyTaskParamsPrivacy, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CHANGE_SLACK_CHANNEL_PRIVACY_TASK_PARAMS_PRIVACY_VALUES!r}" ) diff --git a/rootly_sdk/models/change_slack_channel_privacy_task_params_task_type.py b/rootly_sdk/models/change_slack_channel_privacy_task_params_task_type.py index bd967611..37a77e37 100644 --- a/rootly_sdk/models/change_slack_channel_privacy_task_params_task_type.py +++ b/rootly_sdk/models/change_slack_channel_privacy_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ChangeSlackChannelPrivacyTaskParamsTaskType = Literal["change_slack_channel_privacy"] @@ -13,7 +13,7 @@ def check_change_slack_channel_privacy_task_params_task_type( if value is None: return None if value in CHANGE_SLACK_CHANNEL_PRIVACY_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(ChangeSlackChannelPrivacyTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CHANGE_SLACK_CHANNEL_PRIVACY_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/communications_group.py b/rootly_sdk/models/communications_group.py index 5c8f0903..1c187a2a 100644 --- a/rootly_sdk/models/communications_group.py +++ b/rootly_sdk/models/communications_group.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -34,14 +36,14 @@ class CommunicationsGroup: email_channel (bool): Email channel enabled created_at (str): Date of creation updated_at (str): Date of last update - 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 + 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 """ name: str @@ -52,15 +54,15 @@ class CommunicationsGroup: email_channel: bool created_at: str updated_at: str - slug: Unset | str = UNSET - description: None | Unset | str = UNSET - communication_group_conditions: None | Unset | list["CommunicationsGroupCommunicationGroupConditionsType0Item"] = ( + slug: str | Unset = UNSET + description: None | str | Unset = UNSET + communication_group_conditions: list[CommunicationsGroupCommunicationGroupConditionsType0Item] | None | Unset = ( UNSET ) - member_ids: None | Unset | list[int] = UNSET - slack_channel_ids: None | Unset | list[str] = UNSET + member_ids: list[int] | None | Unset = UNSET + slack_channel_ids: list[str] | None | Unset = UNSET communication_external_group_members: ( - None | Unset | list["CommunicationsGroupCommunicationExternalGroupMembersType0Item"] + list[CommunicationsGroupCommunicationExternalGroupMembersType0Item] | None | Unset ) = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -83,13 +85,13 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - communication_group_conditions: None | Unset | list[dict[str, Any]] + communication_group_conditions: list[dict[str, Any]] | None | Unset if isinstance(self.communication_group_conditions, Unset): communication_group_conditions = UNSET elif isinstance(self.communication_group_conditions, list): @@ -101,7 +103,7 @@ def to_dict(self) -> dict[str, Any]: else: communication_group_conditions = self.communication_group_conditions - member_ids: None | Unset | list[int] + member_ids: list[int] | None | Unset if isinstance(self.member_ids, Unset): member_ids = UNSET elif isinstance(self.member_ids, list): @@ -110,7 +112,7 @@ def to_dict(self) -> dict[str, Any]: else: member_ids = self.member_ids - slack_channel_ids: None | Unset | list[str] + slack_channel_ids: list[str] | None | Unset if isinstance(self.slack_channel_ids, Unset): slack_channel_ids = UNSET elif isinstance(self.slack_channel_ids, list): @@ -119,7 +121,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel_ids = self.slack_channel_ids - communication_external_group_members: None | Unset | list[dict[str, Any]] + communication_external_group_members: list[dict[str, Any]] | None | Unset if isinstance(self.communication_external_group_members, Unset): communication_external_group_members = UNSET elif isinstance(self.communication_external_group_members, list): @@ -190,18 +192,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) def _parse_communication_group_conditions( data: object, - ) -> None | Unset | list["CommunicationsGroupCommunicationGroupConditionsType0Item"]: + ) -> list[CommunicationsGroupCommunicationGroupConditionsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -221,15 +223,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["CommunicationsGroupCommunicationGroupConditionsType0Item"], data) + return cast(list[CommunicationsGroupCommunicationGroupConditionsType0Item] | None | Unset, data) communication_group_conditions = _parse_communication_group_conditions( d.pop("communication_group_conditions", UNSET) ) - def _parse_member_ids(data: object) -> None | Unset | list[int]: + def _parse_member_ids(data: object) -> list[int] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -240,13 +242,13 @@ def _parse_member_ids(data: object) -> None | Unset | list[int]: member_ids_type_0 = cast(list[int], data) return member_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[int], data) + return cast(list[int] | None | Unset, data) member_ids = _parse_member_ids(d.pop("member_ids", UNSET)) - def _parse_slack_channel_ids(data: object) -> None | Unset | list[str]: + def _parse_slack_channel_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -257,15 +259,15 @@ def _parse_slack_channel_ids(data: object) -> None | Unset | list[str]: slack_channel_ids_type_0 = cast(list[str], data) return slack_channel_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) slack_channel_ids = _parse_slack_channel_ids(d.pop("slack_channel_ids", UNSET)) def _parse_communication_external_group_members( data: object, - ) -> None | Unset | list["CommunicationsGroupCommunicationExternalGroupMembersType0Item"]: + ) -> list[CommunicationsGroupCommunicationExternalGroupMembersType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -287,9 +289,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["CommunicationsGroupCommunicationExternalGroupMembersType0Item"], data) + return cast(list[CommunicationsGroupCommunicationExternalGroupMembersType0Item] | None | Unset, 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 51c6093d..7edf9df3 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,16 +15,16 @@ class CommunicationsGroupCommunicationExternalGroupMembersType0Item: """ Attributes: - 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): 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: Unset | str = UNSET - name: Unset | str = UNSET - email: Unset | str = UNSET - phone_number: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET + email: str | Unset = UNSET + phone_number: str | Unset = UNSET 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 49c2521d..8f0cfd6e 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,29 +19,28 @@ class CommunicationsGroupCommunicationGroupConditionsType0Item: """ Attributes: - 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): 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: 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - property_type: Unset | str = UNSET + property_type: str | Unset = UNSET if not isinstance(self.property_type, Unset): property_type = self.property_type - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -48,7 +49,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - severity_ids: None | Unset | list[str] + severity_ids: list[str] | None | Unset if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -57,7 +58,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - functionality_ids: None | Unset | list[str] + functionality_ids: list[str] | None | Unset if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -66,7 +67,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: None | Unset | list[str] + group_ids: list[str] | None | Unset if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -75,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: None | Unset | list[str] + incident_type_ids: list[str] | None | Unset if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -106,7 +107,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: Unset | CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType + property_type: CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType | Unset if isinstance(_property_type, Unset): property_type = UNSET else: @@ -114,7 +115,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _property_type ) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -125,13 +126,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_severity_ids(data: object) -> None | Unset | list[str]: + def _parse_severity_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -142,13 +143,13 @@ def _parse_severity_ids(data: object) -> None | Unset | list[str]: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_functionality_ids(data: object) -> None | Unset | list[str]: + def _parse_functionality_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -159,13 +160,13 @@ def _parse_functionality_ids(data: object) -> None | Unset | list[str]: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> None | Unset | list[str]: + def _parse_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -176,13 +177,13 @@ def _parse_group_ids(data: object) -> None | Unset | list[str]: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: + def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -193,9 +194,9 @@ def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/communications_group_communication_group_conditions_type_0_item_property_type.py b/rootly_sdk/models/communications_group_communication_group_conditions_type_0_item_property_type.py index c1b79ea4..504cb684 100644 --- a/rootly_sdk/models/communications_group_communication_group_conditions_type_0_item_property_type.py +++ b/rootly_sdk/models/communications_group_communication_group_conditions_type_0_item_property_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType = Literal[ "functionality", "group", "incident_type", "service", "severity" @@ -21,7 +21,7 @@ def check_communications_group_communication_group_conditions_type_0_item_proper if value is None: return None if value in COMMUNICATIONS_GROUP_COMMUNICATION_GROUP_CONDITIONS_TYPE_0_ITEM_PROPERTY_TYPE_VALUES: - return cast(CommunicationsGroupCommunicationGroupConditionsType0ItemPropertyType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {COMMUNICATIONS_GROUP_COMMUNICATION_GROUP_CONDITIONS_TYPE_0_ITEM_PROPERTY_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/communications_group_condition_type.py b/rootly_sdk/models/communications_group_condition_type.py index 3e3daf8a..24391a12 100644 --- a/rootly_sdk/models/communications_group_condition_type.py +++ b/rootly_sdk/models/communications_group_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CommunicationsGroupConditionType = Literal["all", "any"] @@ -12,5 +12,5 @@ def check_communications_group_condition_type(value: str | None) -> Communicatio if value is None: return None if value in COMMUNICATIONS_GROUP_CONDITION_TYPE_VALUES: - return cast(CommunicationsGroupConditionType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {COMMUNICATIONS_GROUP_CONDITION_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/communications_group_response.py b/rootly_sdk/models/communications_group_response.py index 6c34df6d..750b59b0 100644 --- a/rootly_sdk/models/communications_group_response.py +++ b/rootly_sdk/models/communications_group_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class CommunicationsGroupResponse: """ Attributes: data (CommunicationsGroupResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "CommunicationsGroupResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: CommunicationsGroupResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 c2a3a20f..3b64c804 100644 --- a/rootly_sdk/models/communications_group_response_data.py +++ b/rootly_sdk/models/communications_group_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/communications_group_response_data_type.py b/rootly_sdk/models/communications_group_response_data_type.py index 36b60c55..6f600c78 100644 --- a/rootly_sdk/models/communications_group_response_data_type.py +++ b/rootly_sdk/models/communications_group_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CommunicationsGroupResponseDataType = Literal["communications_groups"] @@ -11,5 +11,5 @@ def check_communications_group_response_data_type(value: str | None) -> Communic if value is None: return None if value in COMMUNICATIONS_GROUP_RESPONSE_DATA_TYPE_VALUES: - return cast(CommunicationsGroupResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {COMMUNICATIONS_GROUP_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/communications_groups_response.py b/rootly_sdk/models/communications_groups_response.py index f38a5fcf..9a62f9de 100644 --- a/rootly_sdk/models/communications_groups_response.py +++ b/rootly_sdk/models/communications_groups_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,16 +22,16 @@ class CommunicationsGroupsResponse: """ Attributes: - data (list['CommunicationsGroupsResponseDataItem']): - links (Union[Unset, Links]): - meta (Union[Unset, Meta]): - included (Union[Unset, list['JsonapiIncludedResource']]): + data (list[CommunicationsGroupsResponseDataItem]): + links (Links | Unset): + meta (Meta | Unset): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["CommunicationsGroupsResponseDataItem"] - links: Union[Unset, "Links"] = UNSET - meta: Union[Unset, "Meta"] = UNSET - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[CommunicationsGroupsResponseDataItem] + links: Links | Unset = UNSET + meta: Meta | Unset = UNSET + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,15 +40,15 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Unset | dict[str, Any] = UNSET + links: dict[str, Any] | Unset = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Unset | dict[str, Any] = UNSET + meta: dict[str, Any] | Unset = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,25 +87,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Unset | Links + links: Links | Unset if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Unset | Meta + meta: Meta | Unset if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) - included = [] _included = d.pop("included", UNSET) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 137cf52e..ee9f830d 100644 --- a/rootly_sdk/models/communications_groups_response_data_item.py +++ b/rootly_sdk/models/communications_groups_response_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/communications_groups_response_data_item_type.py b/rootly_sdk/models/communications_groups_response_data_item_type.py index 57fae45d..f12d4453 100644 --- a/rootly_sdk/models/communications_groups_response_data_item_type.py +++ b/rootly_sdk/models/communications_groups_response_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CommunicationsGroupsResponseDataItemType = Literal["communications_groups"] @@ -13,7 +13,7 @@ def check_communications_groups_response_data_item_type( if value is None: return None if value in COMMUNICATIONS_GROUPS_RESPONSE_DATA_ITEM_TYPE_VALUES: - return cast(CommunicationsGroupsResponseDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {COMMUNICATIONS_GROUPS_RESPONSE_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/communications_stage.py b/rootly_sdk/models/communications_stage.py index fadd1b8c..a32faca1 100644 --- a/rootly_sdk/models/communications_stage.py +++ b/rootly_sdk/models/communications_stage.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,25 +16,25 @@ class CommunicationsStage: """ Attributes: name (str): The name of the communications stage - position (Union[None, int]): Position of the communications stage + position (int | None): Position of the communications stage created_at (str): Date of creation updated_at (str): Date of last update - slug (Union[Unset, str]): The slug of the communications stage - description (Union[None, Unset, str]): The description of the communications stage + slug (str | Unset): The slug of the communications stage + description (None | str | Unset): The description of the communications stage """ name: str - position: None | int + position: int | None created_at: str updated_at: str - slug: Unset | str = UNSET - description: None | Unset | str = UNSET + slug: str | Unset = UNSET + description: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - position: None | int + position: int | None position = self.position created_at = self.created_at @@ -41,7 +43,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -69,10 +71,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) -> None | int: + def _parse_position(data: object) -> int | None: if data is None: return data - return cast(None | int, data) + return cast(int | None, data) position = _parse_position(d.pop("position")) @@ -82,12 +84,12 @@ def _parse_position(data: object) -> None | int: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 cadf4ee8..4365b909 100644 --- a/rootly_sdk/models/communications_stage_response.py +++ b/rootly_sdk/models/communications_stage_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class CommunicationsStageResponse: """ Attributes: data (CommunicationsStageResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "CommunicationsStageResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: CommunicationsStageResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 e1c9d1b4..4d7295dd 100644 --- a/rootly_sdk/models/communications_stage_response_data.py +++ b/rootly_sdk/models/communications_stage_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/communications_stage_response_data_type.py b/rootly_sdk/models/communications_stage_response_data_type.py index c8fe92d9..67b1b5dc 100644 --- a/rootly_sdk/models/communications_stage_response_data_type.py +++ b/rootly_sdk/models/communications_stage_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CommunicationsStageResponseDataType = Literal["communications_stages"] @@ -11,5 +11,5 @@ def check_communications_stage_response_data_type(value: str | None) -> Communic if value is None: return None if value in COMMUNICATIONS_STAGE_RESPONSE_DATA_TYPE_VALUES: - return cast(CommunicationsStageResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {COMMUNICATIONS_STAGE_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/communications_stages_response.py b/rootly_sdk/models/communications_stages_response.py index 70d1fd5c..82a42588 100644 --- a/rootly_sdk/models/communications_stages_response.py +++ b/rootly_sdk/models/communications_stages_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,16 +22,16 @@ class CommunicationsStagesResponse: """ Attributes: - data (list['CommunicationsStagesResponseDataItem']): - links (Union[Unset, Links]): - meta (Union[Unset, Meta]): - included (Union[Unset, list['JsonapiIncludedResource']]): + data (list[CommunicationsStagesResponseDataItem]): + links (Links | Unset): + meta (Meta | Unset): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["CommunicationsStagesResponseDataItem"] - links: Union[Unset, "Links"] = UNSET - meta: Union[Unset, "Meta"] = UNSET - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[CommunicationsStagesResponseDataItem] + links: Links | Unset = UNSET + meta: Meta | Unset = UNSET + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,15 +40,15 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Unset | dict[str, Any] = UNSET + links: dict[str, Any] | Unset = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Unset | dict[str, Any] = UNSET + meta: dict[str, Any] | Unset = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,25 +87,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Unset | Links + links: Links | Unset if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Unset | Meta + meta: Meta | Unset if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) - included = [] _included = d.pop("included", UNSET) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 97a69037..f4cf324c 100644 --- a/rootly_sdk/models/communications_stages_response_data_item.py +++ b/rootly_sdk/models/communications_stages_response_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/communications_stages_response_data_item_type.py b/rootly_sdk/models/communications_stages_response_data_item_type.py index c6872c33..4339ac0d 100644 --- a/rootly_sdk/models/communications_stages_response_data_item_type.py +++ b/rootly_sdk/models/communications_stages_response_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CommunicationsStagesResponseDataItemType = Literal["communications_stages"] @@ -13,7 +13,7 @@ def check_communications_stages_response_data_item_type( if value is None: return None if value in COMMUNICATIONS_STAGES_RESPONSE_DATA_ITEM_TYPE_VALUES: - return cast(CommunicationsStagesResponseDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {COMMUNICATIONS_STAGES_RESPONSE_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/communications_template.py b/rootly_sdk/models/communications_template.py index 1e892142..ec359696 100644 --- a/rootly_sdk/models/communications_template.py +++ b/rootly_sdk/models/communications_template.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,34 +23,34 @@ class CommunicationsTemplate: """ Attributes: name (str): The name of the communications template - position (Union[None, int]): Position of the communications template + position (int | None): Position of the communications template created_at (str): Date of creation updated_at (str): Date of last update - 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]): + 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): """ name: str - position: None | int + position: int | None created_at: str updated_at: str - slug: Unset | str = UNSET - description: None | Unset | str = UNSET - communication_type_id: Unset | str = UNSET - communication_template_stages: None | Unset | list["CommunicationsTemplateCommunicationTemplateStagesType0Item"] = ( + slug: str | Unset = UNSET + description: None | str | Unset = UNSET + communication_type_id: str | Unset = UNSET + communication_template_stages: list[CommunicationsTemplateCommunicationTemplateStagesType0Item] | None | Unset = ( UNSET ) - communication_type: Union[Unset, "CommunicationsTemplateCommunicationType"] = UNSET + communication_type: CommunicationsTemplateCommunicationType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - position: None | int + position: int | None position = self.position created_at = self.created_at @@ -57,7 +59,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -65,7 +67,7 @@ def to_dict(self) -> dict[str, Any]: communication_type_id = self.communication_type_id - communication_template_stages: None | Unset | list[dict[str, Any]] + communication_template_stages: list[dict[str, Any]] | None | Unset if isinstance(self.communication_template_stages, Unset): communication_template_stages = UNSET elif isinstance(self.communication_template_stages, list): @@ -77,7 +79,7 @@ def to_dict(self) -> dict[str, Any]: else: communication_template_stages = self.communication_template_stages - communication_type: Unset | dict[str, Any] = UNSET + communication_type: dict[str, Any] | Unset = UNSET if not isinstance(self.communication_type, Unset): communication_type = self.communication_type.to_dict() @@ -114,10 +116,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) -> None | int: + def _parse_position(data: object) -> int | None: if data is None: return data - return cast(None | int, data) + return cast(int | None, data) position = _parse_position(d.pop("position")) @@ -127,12 +129,12 @@ def _parse_position(data: object) -> None | int: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) @@ -140,7 +142,7 @@ def _parse_description(data: object) -> None | Unset | str: def _parse_communication_template_stages( data: object, - ) -> None | Unset | list["CommunicationsTemplateCommunicationTemplateStagesType0Item"]: + ) -> list[CommunicationsTemplateCommunicationTemplateStagesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -160,16 +162,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["CommunicationsTemplateCommunicationTemplateStagesType0Item"], data) + return cast(list[CommunicationsTemplateCommunicationTemplateStagesType0Item] | None | Unset, data) communication_template_stages = _parse_communication_template_stages( d.pop("communication_template_stages", UNSET) ) _communication_type = d.pop("communication_type", UNSET) - communication_type: Unset | CommunicationsTemplateCommunicationType + communication_type: CommunicationsTemplateCommunicationType | Unset 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 94f47d8b..08867b37 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,14 +21,14 @@ class CommunicationsTemplateCommunicationTemplateStagesType0Item: """ Attributes: - data (Union[Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemData]): + data (CommunicationsTemplateCommunicationTemplateStagesType0ItemData | Unset): """ - data: Union[Unset, "CommunicationsTemplateCommunicationTemplateStagesType0ItemData"] = UNSET + data: CommunicationsTemplateCommunicationTemplateStagesType0ItemData | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Unset | dict[str, Any] = UNSET + data: dict[str, Any] | Unset = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -46,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Unset | CommunicationsTemplateCommunicationTemplateStagesType0ItemData + data: CommunicationsTemplateCommunicationTemplateStagesType0ItemData | Unset 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 318d79c6..8b36ddcb 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,24 +25,24 @@ class CommunicationsTemplateCommunicationTemplateStagesType0ItemData: """ Attributes: - id (Union[Unset, str]): ID of the communication template stage - type_ (Union[Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType]): - attributes (Union[Unset, CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes]): + id (str | Unset): ID of the communication template stage + type_ (CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType | Unset): + attributes (CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes | Unset): """ - id: Unset | str = UNSET - type_: Unset | CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType = UNSET - attributes: Union[Unset, "CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes"] = UNSET + id: str | Unset = UNSET + type_: CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType | Unset = UNSET + attributes: CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -66,14 +68,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType + type_: CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType | Unset 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: Unset | CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes + attributes: CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes | Unset 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 cabf8621..4f9dcc5b 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,52 +24,52 @@ class CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributes: """ Attributes: - 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): 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: 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - email_body: None | Unset | str + email_body: None | str | Unset if isinstance(self.email_body, Unset): email_body = UNSET else: email_body = self.email_body - email_subject: None | Unset | str + email_subject: None | str | Unset if isinstance(self.email_subject, Unset): email_subject = UNSET else: email_subject = self.email_subject - slack_content: None | Unset | str + slack_content: None | str | Unset if isinstance(self.slack_content, Unset): slack_content = UNSET else: slack_content = self.slack_content - sms_content: None | Unset | str + sms_content: None | str | Unset if isinstance(self.sms_content, Unset): sms_content = UNSET else: @@ -77,11 +79,11 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - communication_stage: Unset | dict[str, Any] = UNSET + communication_stage: dict[str, Any] | Unset = UNSET if not isinstance(self.communication_stage, Unset): communication_stage = self.communication_stage.to_dict() - communication_template: Unset | dict[str, Any] = UNSET + communication_template: dict[str, Any] | Unset = UNSET if not isinstance(self.communication_template, Unset): communication_template = self.communication_template.to_dict() @@ -118,39 +120,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_email_body(data: object) -> None | Unset | str: + def _parse_email_body(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) email_body = _parse_email_body(d.pop("email_body", UNSET)) - def _parse_email_subject(data: object) -> None | Unset | str: + def _parse_email_subject(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) email_subject = _parse_email_subject(d.pop("email_subject", UNSET)) - def _parse_slack_content(data: object) -> None | Unset | str: + def _parse_slack_content(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slack_content = _parse_slack_content(d.pop("slack_content", UNSET)) - def _parse_sms_content(data: object) -> None | Unset | str: + def _parse_sms_content(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) sms_content = _parse_sms_content(d.pop("sms_content", UNSET)) @@ -160,7 +162,7 @@ def _parse_sms_content(data: object) -> None | Unset | str: _communication_stage = d.pop("communication_stage", UNSET) communication_stage: ( - Unset | CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage + CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage | Unset ) if isinstance(_communication_stage, Unset): communication_stage = UNSET @@ -173,7 +175,7 @@ def _parse_sms_content(data: object) -> None | Unset | str: _communication_template = d.pop("communication_template", UNSET) communication_template: ( - Unset | CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate + CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate | Unset ) 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 aa63f20b..9d3a2edc 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationStage: """ Attributes: - id (Union[Unset, str]): The communication stage ID - name (Union[Unset, str]): The communication stage name + id (str | Unset): The communication stage ID + name (str | Unset): The communication stage name """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 b5b69095..b490ec24 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CommunicationsTemplateCommunicationTemplateStagesType0ItemDataAttributesCommunicationTemplate: """ Attributes: - id (Union[Unset, str]): The communication template ID - name (Union[Unset, str]): The communication template name + id (str | Unset): The communication template ID + name (str | Unset): The communication template name """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_type.py b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_type.py index edaafd8a..06e858a2 100644 --- a/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_type.py +++ b/rootly_sdk/models/communications_template_communication_template_stages_type_0_item_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType = Literal["communications_template_stages"] @@ -15,7 +15,7 @@ def check_communications_template_communication_template_stages_type_0_item_data if value is None: return None if value in COMMUNICATIONS_TEMPLATE_COMMUNICATION_TEMPLATE_STAGES_TYPE_0_ITEM_DATA_TYPE_VALUES: - return cast(CommunicationsTemplateCommunicationTemplateStagesType0ItemDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {COMMUNICATIONS_TEMPLATE_COMMUNICATION_TEMPLATE_STAGES_TYPE_0_ITEM_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/communications_template_communication_type.py b/rootly_sdk/models/communications_template_communication_type.py index 48cfce89..c4b73f8c 100644 --- a/rootly_sdk/models/communications_template_communication_type.py +++ b/rootly_sdk/models/communications_template_communication_type.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CommunicationsTemplateCommunicationType: """ Attributes: - id (Union[Unset, str]): ID of the communication type - name (Union[Unset, str]): Name of the communication type + id (str | Unset): ID of the communication type + name (str | Unset): Name of the communication type """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 cf3d8f2c..623ec96e 100644 --- a/rootly_sdk/models/communications_template_response.py +++ b/rootly_sdk/models/communications_template_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class CommunicationsTemplateResponse: """ Attributes: data (CommunicationsTemplateResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "CommunicationsTemplateResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: CommunicationsTemplateResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 26697651..0149545c 100644 --- a/rootly_sdk/models/communications_template_response_data.py +++ b/rootly_sdk/models/communications_template_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/communications_template_response_data_type.py b/rootly_sdk/models/communications_template_response_data_type.py index 5fe601df..c7774ba2 100644 --- a/rootly_sdk/models/communications_template_response_data_type.py +++ b/rootly_sdk/models/communications_template_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CommunicationsTemplateResponseDataType = Literal["communications_templates"] @@ -13,7 +13,7 @@ def check_communications_template_response_data_type( if value is None: return None if value in COMMUNICATIONS_TEMPLATE_RESPONSE_DATA_TYPE_VALUES: - return cast(CommunicationsTemplateResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {COMMUNICATIONS_TEMPLATE_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/communications_templates_response.py b/rootly_sdk/models/communications_templates_response.py index 8b0365e3..f7bba4e2 100644 --- a/rootly_sdk/models/communications_templates_response.py +++ b/rootly_sdk/models/communications_templates_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,16 +22,16 @@ class CommunicationsTemplatesResponse: """ Attributes: - data (list['CommunicationsTemplatesResponseDataItem']): - links (Union[Unset, Links]): - meta (Union[Unset, Meta]): - included (Union[Unset, list['JsonapiIncludedResource']]): + data (list[CommunicationsTemplatesResponseDataItem]): + links (Links | Unset): + meta (Meta | Unset): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["CommunicationsTemplatesResponseDataItem"] - links: Union[Unset, "Links"] = UNSET - meta: Union[Unset, "Meta"] = UNSET - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[CommunicationsTemplatesResponseDataItem] + links: Links | Unset = UNSET + meta: Meta | Unset = UNSET + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,15 +40,15 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Unset | dict[str, Any] = UNSET + links: dict[str, Any] | Unset = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Unset | dict[str, Any] = UNSET + meta: dict[str, Any] | Unset = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,25 +87,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Unset | Links + links: Links | Unset if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Unset | Meta + meta: Meta | Unset if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) - included = [] _included = d.pop("included", UNSET) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 f3bcaee6..bc9e42bf 100644 --- a/rootly_sdk/models/communications_templates_response_data_item.py +++ b/rootly_sdk/models/communications_templates_response_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/communications_templates_response_data_item_type.py b/rootly_sdk/models/communications_templates_response_data_item_type.py index 6b25d9ca..d607df3f 100644 --- a/rootly_sdk/models/communications_templates_response_data_item_type.py +++ b/rootly_sdk/models/communications_templates_response_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CommunicationsTemplatesResponseDataItemType = Literal["communications_templates"] @@ -13,7 +13,7 @@ def check_communications_templates_response_data_item_type( if value is None: return None if value in COMMUNICATIONS_TEMPLATES_RESPONSE_DATA_ITEM_TYPE_VALUES: - return cast(CommunicationsTemplatesResponseDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {COMMUNICATIONS_TEMPLATES_RESPONSE_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/communications_type.py b/rootly_sdk/models/communications_type.py index 4574bcae..0323e1ec 100644 --- a/rootly_sdk/models/communications_type.py +++ b/rootly_sdk/models/communications_type.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,12 +16,12 @@ class CommunicationsType: """ Attributes: name (str): The name of the communications type - color (Union[None, str]): The color of the communications type + color (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 (Union[Unset, str]): The slug of the communications type - description (Union[None, Unset, str]): The description of the communications type + slug (str | Unset): The slug of the communications type + description (None | str | Unset): The description of the communications type """ name: str @@ -27,8 +29,8 @@ class CommunicationsType: position: int created_at: str updated_at: str - slug: Unset | str = UNSET - description: None | Unset | str = UNSET + slug: str | Unset = UNSET + description: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,7 +47,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -89,12 +91,12 @@ def _parse_color(data: object) -> None | str: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 89cfbca7..4d2661f7 100644 --- a/rootly_sdk/models/communications_type_response.py +++ b/rootly_sdk/models/communications_type_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class CommunicationsTypeResponse: """ Attributes: data (CommunicationsTypeResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "CommunicationsTypeResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: CommunicationsTypeResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 9d97ff64..5d78c846 100644 --- a/rootly_sdk/models/communications_type_response_data.py +++ b/rootly_sdk/models/communications_type_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/communications_type_response_data_type.py b/rootly_sdk/models/communications_type_response_data_type.py index b3aabd78..25ea9198 100644 --- a/rootly_sdk/models/communications_type_response_data_type.py +++ b/rootly_sdk/models/communications_type_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CommunicationsTypeResponseDataType = Literal["communications_types"] @@ -11,5 +11,5 @@ def check_communications_type_response_data_type(value: str | None) -> Communica if value is None: return None if value in COMMUNICATIONS_TYPE_RESPONSE_DATA_TYPE_VALUES: - return cast(CommunicationsTypeResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {COMMUNICATIONS_TYPE_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/communications_types_response.py b/rootly_sdk/models/communications_types_response.py index d2583e16..3b4e388d 100644 --- a/rootly_sdk/models/communications_types_response.py +++ b/rootly_sdk/models/communications_types_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,16 +22,16 @@ class CommunicationsTypesResponse: """ Attributes: - data (list['CommunicationsTypesResponseDataItem']): - links (Union[Unset, Links]): - meta (Union[Unset, Meta]): - included (Union[Unset, list['JsonapiIncludedResource']]): + data (list[CommunicationsTypesResponseDataItem]): + links (Links | Unset): + meta (Meta | Unset): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["CommunicationsTypesResponseDataItem"] - links: Union[Unset, "Links"] = UNSET - meta: Union[Unset, "Meta"] = UNSET - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[CommunicationsTypesResponseDataItem] + links: Links | Unset = UNSET + meta: Meta | Unset = UNSET + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,15 +40,15 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Unset | dict[str, Any] = UNSET + links: dict[str, Any] | Unset = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Unset | dict[str, Any] = UNSET + meta: dict[str, Any] | Unset = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,25 +87,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Unset | Links + links: Links | Unset if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Unset | Meta + meta: Meta | Unset if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) - included = [] _included = d.pop("included", UNSET) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 ad9a0474..22874284 100644 --- a/rootly_sdk/models/communications_types_response_data_item.py +++ b/rootly_sdk/models/communications_types_response_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/communications_types_response_data_item_type.py b/rootly_sdk/models/communications_types_response_data_item_type.py index 04f1731b..0cf4e5b6 100644 --- a/rootly_sdk/models/communications_types_response_data_item_type.py +++ b/rootly_sdk/models/communications_types_response_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CommunicationsTypesResponseDataItemType = Literal["communications_types"] @@ -13,7 +13,7 @@ def check_communications_types_response_data_item_type( if value is None: return None if value in COMMUNICATIONS_TYPES_RESPONSE_DATA_ITEM_TYPE_VALUES: - return cast(CommunicationsTypesResponseDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {COMMUNICATIONS_TYPES_RESPONSE_DATA_ITEM_TYPE_VALUES!r}" ) 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 02aa62ba..e1277c8a 100644 --- a/rootly_sdk/models/create_airtable_table_record_task_params.py +++ b/rootly_sdk/models/create_airtable_table_record_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -24,15 +26,15 @@ class CreateAirtableTableRecordTaskParams: Attributes: base (CreateAirtableTableRecordTaskParamsBase): table (CreateAirtableTableRecordTaskParamsTable): - task_type (Union[Unset, CreateAirtableTableRecordTaskParamsTaskType]): - custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be + task_type (CreateAirtableTableRecordTaskParamsTaskType | Unset): + custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be valid JSON """ - base: "CreateAirtableTableRecordTaskParamsBase" - table: "CreateAirtableTableRecordTaskParamsTable" - task_type: Unset | CreateAirtableTableRecordTaskParamsTaskType = UNSET - custom_fields_mapping: None | Unset | str = UNSET + base: CreateAirtableTableRecordTaskParamsBase + table: CreateAirtableTableRecordTaskParamsTable + task_type: CreateAirtableTableRecordTaskParamsTaskType | Unset = UNSET + custom_fields_mapping: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,11 +42,11 @@ def to_dict(self) -> dict[str, Any]: table = self.table.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -76,18 +78,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: Unset | CreateAirtableTableRecordTaskParamsTaskType + task_type: CreateAirtableTableRecordTaskParamsTaskType | Unset 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 | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 e4dac884..f8402d23 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateAirtableTableRecordTaskParamsBase: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 77f8f3bb..dc5d3a10 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateAirtableTableRecordTaskParamsTable: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_airtable_table_record_task_params_task_type.py index a7e18aa9..aea9273e 100644 --- a/rootly_sdk/models/create_airtable_table_record_task_params_task_type.py +++ b/rootly_sdk/models/create_airtable_table_record_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateAirtableTableRecordTaskParamsTaskType = Literal["create_airtable_table_record"] @@ -13,7 +13,7 @@ def check_create_airtable_table_record_task_params_task_type( if value is None: return None if value in CREATE_AIRTABLE_TABLE_RECORD_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateAirtableTableRecordTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_AIRTABLE_TABLE_RECORD_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 9bae2c8b..6a6a0794 100644 --- a/rootly_sdk/models/create_anthropic_chat_completion_task_params.py +++ b/rootly_sdk/models/create_anthropic_chat_completion_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,16 +25,16 @@ class CreateAnthropicChatCompletionTaskParams: Attributes: model (CreateAnthropicChatCompletionTaskParamsModel): The Anthropic model. eg: claude-3-5-sonnet-20241022 prompt (str): The prompt to send to Anthropic - 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 + task_type (CreateAnthropicChatCompletionTaskParamsTaskType | Unset): + system_prompt (str | Unset): The system prompt to send to Anthropic (optional) + max_tokens (int | Unset): Maximum number of tokens to generate. Defaults to 4000 when omitted """ - model: "CreateAnthropicChatCompletionTaskParamsModel" + model: CreateAnthropicChatCompletionTaskParamsModel prompt: str - task_type: Unset | CreateAnthropicChatCompletionTaskParamsTaskType = UNSET - system_prompt: Unset | str = UNSET - max_tokens: Unset | int = UNSET + task_type: CreateAnthropicChatCompletionTaskParamsTaskType | Unset = UNSET + system_prompt: str | Unset = UNSET + max_tokens: int | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: prompt = self.prompt - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -77,7 +79,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: Unset | CreateAnthropicChatCompletionTaskParamsTaskType + task_type: CreateAnthropicChatCompletionTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: 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 9eeddadf..0d5723dd 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateAnthropicChatCompletionTaskParamsModel: """The Anthropic model. eg: claude-3-5-sonnet-20241022 Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_anthropic_chat_completion_task_params_task_type.py index 00596296..4fe0d223 100644 --- a/rootly_sdk/models/create_anthropic_chat_completion_task_params_task_type.py +++ b/rootly_sdk/models/create_anthropic_chat_completion_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateAnthropicChatCompletionTaskParamsTaskType = Literal["create_anthropic_chat_completion_task"] @@ -13,7 +13,7 @@ def check_create_anthropic_chat_completion_task_params_task_type( if value is None: return None if value in CREATE_ANTHROPIC_CHAT_COMPLETION_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateAnthropicChatCompletionTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_ANTHROPIC_CHAT_COMPLETION_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_asana_subtask_task_params.py b/rootly_sdk/models/create_asana_subtask_task_params.py index fc23a420..7e4076e8 100644 --- a/rootly_sdk/models/create_asana_subtask_task_params.py +++ b/rootly_sdk/models/create_asana_subtask_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -28,26 +30,26 @@ class CreateAsanaSubtaskTaskParams: parent_task_id (str): The parent task id title (str): The subtask title completion (CreateAsanaSubtaskTaskParamsCompletion): - 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 + 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 valid JSON - dependency_direction (Union[Unset, CreateAsanaSubtaskTaskParamsDependencyDirection]): Default: 'blocking'. - dependent_task_ids (Union[None, Unset, list[str]]): Dependent task ids. Supports liquid syntax + dependency_direction (CreateAsanaSubtaskTaskParamsDependencyDirection | Unset): Default: 'blocking'. + dependent_task_ids (list[str] | None | Unset): Dependent task ids. Supports liquid syntax """ parent_task_id: str title: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -57,7 +59,7 @@ def to_dict(self) -> dict[str, Any]: completion = self.completion.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -67,17 +69,17 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - dependency_direction: Unset | str = UNSET + dependency_direction: str | Unset = UNSET if not isinstance(self.dependency_direction, Unset): dependency_direction = self.dependency_direction - dependent_task_ids: None | Unset | list[str] + dependent_task_ids: list[str] | None | Unset if isinstance(self.dependent_task_ids, Unset): dependent_task_ids = UNSET elif isinstance(self.dependent_task_ids, list): @@ -124,7 +126,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: Unset | CreateAsanaSubtaskTaskParamsTaskType + task_type: CreateAsanaSubtaskTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -136,23 +138,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 | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) _dependency_direction = d.pop("dependency_direction", UNSET) - dependency_direction: Unset | CreateAsanaSubtaskTaskParamsDependencyDirection + dependency_direction: CreateAsanaSubtaskTaskParamsDependencyDirection | Unset 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) -> None | Unset | list[str]: + def _parse_dependent_task_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -163,9 +165,9 @@ def _parse_dependent_task_ids(data: object) -> None | Unset | list[str]: dependent_task_ids_type_0 = cast(list[str], data) return dependent_task_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, 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 a4a99573..1bd94c1d 100644 --- a/rootly_sdk/models/create_asana_subtask_task_params_completion.py +++ b/rootly_sdk/models/create_asana_subtask_task_params_completion.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateAsanaSubtaskTaskParamsCompletion: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_dependency_direction.py b/rootly_sdk/models/create_asana_subtask_task_params_dependency_direction.py index ed7c9402..96eb0ade 100644 --- a/rootly_sdk/models/create_asana_subtask_task_params_dependency_direction.py +++ b/rootly_sdk/models/create_asana_subtask_task_params_dependency_direction.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateAsanaSubtaskTaskParamsDependencyDirection = Literal["blocked_by", "blocking"] @@ -14,7 +14,7 @@ def check_create_asana_subtask_task_params_dependency_direction( if value is None: return None if value in CREATE_ASANA_SUBTASK_TASK_PARAMS_DEPENDENCY_DIRECTION_VALUES: - return cast(CreateAsanaSubtaskTaskParamsDependencyDirection, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_ASANA_SUBTASK_TASK_PARAMS_DEPENDENCY_DIRECTION_VALUES!r}" ) diff --git a/rootly_sdk/models/create_asana_subtask_task_params_task_type.py b/rootly_sdk/models/create_asana_subtask_task_params_task_type.py index e7c7dfb4..6bf79e12 100644 --- a/rootly_sdk/models/create_asana_subtask_task_params_task_type.py +++ b/rootly_sdk/models/create_asana_subtask_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateAsanaSubtaskTaskParamsTaskType = Literal["create_asana_subtask"] @@ -11,7 +11,7 @@ def check_create_asana_subtask_task_params_task_type(value: str | None) -> Creat if value is None: return None if value in CREATE_ASANA_SUBTASK_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateAsanaSubtaskTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_ASANA_SUBTASK_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_asana_task_task_params.py b/rootly_sdk/models/create_asana_task_task_params.py index cfb6cc5c..ca6f82fd 100644 --- a/rootly_sdk/models/create_asana_task_task_params.py +++ b/rootly_sdk/models/create_asana_task_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -28,30 +30,30 @@ class CreateAsanaTaskTaskParams: """ Attributes: workspace (CreateAsanaTaskTaskParamsWorkspace): - projects (list['CreateAsanaTaskTaskParamsProjectsItem']): + projects (list[CreateAsanaTaskTaskParamsProjectsItem]): title (str): The task title completion (CreateAsanaTaskTaskParamsCompletion): - 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 + 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 valid JSON - dependency_direction (Union[Unset, CreateAsanaTaskTaskParamsDependencyDirection]): Default: 'blocking'. - dependent_task_ids (Union[None, Unset, list[str]]): Dependent task ids. Supports liquid syntax + dependency_direction (CreateAsanaTaskTaskParamsDependencyDirection | Unset): Default: 'blocking'. + dependent_task_ids (list[str] | None | Unset): Dependent task ids. Supports liquid syntax """ - workspace: "CreateAsanaTaskTaskParamsWorkspace" - projects: list["CreateAsanaTaskTaskParamsProjectsItem"] + workspace: CreateAsanaTaskTaskParamsWorkspace + projects: list[CreateAsanaTaskTaskParamsProjectsItem] title: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -66,7 +68,7 @@ def to_dict(self) -> dict[str, Any]: completion = self.completion.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -76,17 +78,17 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - dependency_direction: Unset | str = UNSET + dependency_direction: str | Unset = UNSET if not isinstance(self.dependency_direction, Unset): dependency_direction = self.dependency_direction - dependent_task_ids: None | Unset | list[str] + dependent_task_ids: list[str] | None | Unset if isinstance(self.dependent_task_ids, Unset): dependent_task_ids = UNSET elif isinstance(self.dependent_task_ids, list): @@ -143,7 +145,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: Unset | CreateAsanaTaskTaskParamsTaskType + task_type: CreateAsanaTaskTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -155,23 +157,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 | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) _dependency_direction = d.pop("dependency_direction", UNSET) - dependency_direction: Unset | CreateAsanaTaskTaskParamsDependencyDirection + dependency_direction: CreateAsanaTaskTaskParamsDependencyDirection | Unset 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) -> None | Unset | list[str]: + def _parse_dependent_task_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -182,9 +184,9 @@ def _parse_dependent_task_ids(data: object) -> None | Unset | list[str]: dependent_task_ids_type_0 = cast(list[str], data) return dependent_task_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, 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 a64d8b2b..11ef1e82 100644 --- a/rootly_sdk/models/create_asana_task_task_params_completion.py +++ b/rootly_sdk/models/create_asana_task_task_params_completion.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateAsanaTaskTaskParamsCompletion: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_dependency_direction.py b/rootly_sdk/models/create_asana_task_task_params_dependency_direction.py index c64529ef..35b911a1 100644 --- a/rootly_sdk/models/create_asana_task_task_params_dependency_direction.py +++ b/rootly_sdk/models/create_asana_task_task_params_dependency_direction.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateAsanaTaskTaskParamsDependencyDirection = Literal["blocked_by", "blocking"] @@ -14,7 +14,7 @@ def check_create_asana_task_task_params_dependency_direction( if value is None: return None if value in CREATE_ASANA_TASK_TASK_PARAMS_DEPENDENCY_DIRECTION_VALUES: - return cast(CreateAsanaTaskTaskParamsDependencyDirection, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_ASANA_TASK_TASK_PARAMS_DEPENDENCY_DIRECTION_VALUES!r}" ) 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 88723252..41cafec6 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateAsanaTaskTaskParamsProjectsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_asana_task_task_params_task_type.py index 91cf3098..9fcfaae7 100644 --- a/rootly_sdk/models/create_asana_task_task_params_task_type.py +++ b/rootly_sdk/models/create_asana_task_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateAsanaTaskTaskParamsTaskType = Literal["create_asana_task"] @@ -11,5 +11,5 @@ def check_create_asana_task_task_params_task_type(value: str | None) -> CreateAs if value is None: return None if value in CREATE_ASANA_TASK_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateAsanaTaskTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_ASANA_TASK_TASK_PARAMS_TASK_TYPE_VALUES!r}") 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 e21ea450..4359c902 100644 --- a/rootly_sdk/models/create_asana_task_task_params_workspace.py +++ b/rootly_sdk/models/create_asana_task_task_params_workspace.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateAsanaTaskTaskParamsWorkspace: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 c7857b0d..05132e98 100644 --- a/rootly_sdk/models/create_clickup_task_task_params.py +++ b/rootly_sdk/models/create_clickup_task_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,26 +26,26 @@ class CreateClickupTaskTaskParams: Attributes: title (str): The task title 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 + 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 valid JSON - task_payload (Union[None, Unset, str]): Additional ClickUp task attributes. Will be merged into whatever was + task_payload (None | str | Unset): 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 - 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 + list_: CreateClickupTaskTaskParamsList + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,7 +53,7 @@ def to_dict(self) -> dict[str, Any]: list_ = self.list_.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -59,19 +61,19 @@ def to_dict(self) -> dict[str, Any]: tags = self.tags - priority: Unset | dict[str, Any] = UNSET + priority: dict[str, Any] | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() due_date = self.due_date - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - task_payload: None | Unset | str + task_payload: None | str | Unset if isinstance(self.task_payload, Unset): task_payload = UNSET else: @@ -113,7 +115,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: list_ = CreateClickupTaskTaskParamsList.from_dict(d.pop("list")) _task_type = d.pop("task_type", UNSET) - task_type: Unset | CreateClickupTaskTaskParamsTaskType + task_type: CreateClickupTaskTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -124,7 +126,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tags = d.pop("tags", UNSET) _priority = d.pop("priority", UNSET) - priority: Unset | CreateClickupTaskTaskParamsPriority + priority: CreateClickupTaskTaskParamsPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: @@ -132,21 +134,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 | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_task_payload(data: object) -> None | Unset | str: + def _parse_task_payload(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) task_payload = _parse_task_payload(d.pop("task_payload", UNSET)) diff --git a/rootly_sdk/models/create_clickup_task_task_params_list.py b/rootly_sdk/models/create_clickup_task_task_params_list.py index 9ca1035e..ad63eda6 100644 --- a/rootly_sdk/models/create_clickup_task_task_params_list.py +++ b/rootly_sdk/models/create_clickup_task_task_params_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateClickupTaskTaskParamsList: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_priority.py b/rootly_sdk/models/create_clickup_task_task_params_priority.py index 21c4a7c6..34e2271a 100644 --- a/rootly_sdk/models/create_clickup_task_task_params_priority.py +++ b/rootly_sdk/models/create_clickup_task_task_params_priority.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateClickupTaskTaskParamsPriority: """The priority id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_clickup_task_task_params_task_type.py index cfb2c4a8..8f3a1638 100644 --- a/rootly_sdk/models/create_clickup_task_task_params_task_type.py +++ b/rootly_sdk/models/create_clickup_task_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateClickupTaskTaskParamsTaskType = Literal["create_clickup_task"] @@ -11,5 +11,5 @@ def check_create_clickup_task_task_params_task_type(value: str | None) -> Create if value is None: return None if value in CREATE_CLICKUP_TASK_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateClickupTaskTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_CLICKUP_TASK_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/create_coda_page_task_params.py b/rootly_sdk/models/create_coda_page_task_params.py index 6819d148..2579e2d2 100644 --- a/rootly_sdk/models/create_coda_page_task_params.py +++ b/rootly_sdk/models/create_coda_page_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,31 +25,31 @@ class CreateCodaPageTaskParams: """ Attributes: title (str): The Coda page title - 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 + 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 """ title: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -59,13 +61,13 @@ def to_dict(self) -> dict[str, Any]: content = self.content - template: Unset | dict[str, Any] = UNSET + template: dict[str, Any] | Unset = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() folder_id = self.folder_id - doc: Unset | dict[str, Any] = UNSET + doc: dict[str, Any] | Unset = UNSET if not isinstance(self.doc, Unset): doc = self.doc.to_dict() @@ -104,7 +106,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: Unset | CreateCodaPageTaskParamsTaskType + task_type: CreateCodaPageTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -119,7 +121,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content", UNSET) _template = d.pop("template", UNSET) - template: Unset | CreateCodaPageTaskParamsTemplate + template: CreateCodaPageTaskParamsTemplate | Unset if isinstance(_template, Unset): template = UNSET else: @@ -128,7 +130,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: Unset | CreateCodaPageTaskParamsDoc + doc: CreateCodaPageTaskParamsDoc | Unset 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 ae70fa93..ea0354bb 100644 --- a/rootly_sdk/models/create_coda_page_task_params_doc.py +++ b/rootly_sdk/models/create_coda_page_task_params_doc.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateCodaPageTaskParamsDoc: """The Coda doc object with id and name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_coda_page_task_params_task_type.py index 19094e0f..6f4686bc 100644 --- a/rootly_sdk/models/create_coda_page_task_params_task_type.py +++ b/rootly_sdk/models/create_coda_page_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateCodaPageTaskParamsTaskType = Literal["create_coda_page"] @@ -11,5 +11,5 @@ def check_create_coda_page_task_params_task_type(value: str | None) -> CreateCod if value is None: return None if value in CREATE_CODA_PAGE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateCodaPageTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_CODA_PAGE_TASK_PARAMS_TASK_TYPE_VALUES!r}") 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 54bfee21..b2b94318 100644 --- a/rootly_sdk/models/create_coda_page_task_params_template.py +++ b/rootly_sdk/models/create_coda_page_task_params_template.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateCodaPageTaskParamsTemplate: """ Attributes: - id (Union[Unset, str]): Combined doc_id/page_id in format 'doc_id/page_id' - name (Union[Unset, str]): + id (str | Unset): Combined doc_id/page_id in format 'doc_id/page_id' + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 b05a3656..7d4baa29 100644 --- a/rootly_sdk/models/create_confluence_page_task_params.py +++ b/rootly_sdk/models/create_confluence_page_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,33 +28,33 @@ class CreateConfluencePageTaskParams: Attributes: space (CreateConfluencePageTaskParamsSpace): title (str): The page title - 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. + 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. + include_follow_ups (bool | Unset): Default: True. + create_as_live_doc (bool | Unset): Default: False. """ - space: "CreateConfluencePageTaskParamsSpace" + space: CreateConfluencePageTaskParamsSpace title: str - 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 + 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 + include_follow_ups: bool | Unset = True + create_as_live_doc: bool | Unset = False additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -60,19 +62,19 @@ def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: Unset | dict[str, Any] = UNSET + integration: dict[str, Any] | Unset = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() - ancestor: Unset | dict[str, Any] = UNSET + ancestor: dict[str, Any] | Unset = UNSET if not isinstance(self.ancestor, Unset): ancestor = self.ancestor.to_dict() - template: Unset | dict[str, Any] = UNSET + template: dict[str, Any] | Unset = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -136,28 +138,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: Unset | CreateConfluencePageTaskParamsTaskType + task_type: CreateConfluencePageTaskParamsTaskType | Unset 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: Unset | CreateConfluencePageTaskParamsIntegration + integration: CreateConfluencePageTaskParamsIntegration | Unset if isinstance(_integration, Unset): integration = UNSET else: integration = CreateConfluencePageTaskParamsIntegration.from_dict(_integration) _ancestor = d.pop("ancestor", UNSET) - ancestor: Unset | CreateConfluencePageTaskParamsAncestor + ancestor: CreateConfluencePageTaskParamsAncestor | Unset if isinstance(_ancestor, Unset): ancestor = UNSET else: ancestor = CreateConfluencePageTaskParamsAncestor.from_dict(_ancestor) _template = d.pop("template", UNSET) - template: Unset | CreateConfluencePageTaskParamsTemplate + template: CreateConfluencePageTaskParamsTemplate | Unset if isinstance(_template, Unset): template = UNSET else: 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 42829d65..2ce7713b 100644 --- a/rootly_sdk/models/create_confluence_page_task_params_ancestor.py +++ b/rootly_sdk/models/create_confluence_page_task_params_ancestor.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateConfluencePageTaskParamsAncestor: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 0479d651..8414aaf5 100644 --- a/rootly_sdk/models/create_confluence_page_task_params_integration.py +++ b/rootly_sdk/models/create_confluence_page_task_params_integration.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateConfluencePageTaskParamsIntegration: """Specify integration id if you have more than one Confluence instance Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 2e7b2651..a5ac23bd 100644 --- a/rootly_sdk/models/create_confluence_page_task_params_space.py +++ b/rootly_sdk/models/create_confluence_page_task_params_space.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateConfluencePageTaskParamsSpace: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_confluence_page_task_params_task_type.py index 7894ff64..be3a0f66 100644 --- a/rootly_sdk/models/create_confluence_page_task_params_task_type.py +++ b/rootly_sdk/models/create_confluence_page_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateConfluencePageTaskParamsTaskType = Literal["create_confluence_page"] @@ -13,7 +13,7 @@ def check_create_confluence_page_task_params_task_type( if value is None: return None if value in CREATE_CONFLUENCE_PAGE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateConfluencePageTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_CONFLUENCE_PAGE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 4b7df4c3..3c78e534 100644 --- a/rootly_sdk/models/create_confluence_page_task_params_template.py +++ b/rootly_sdk/models/create_confluence_page_task_params_template.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateConfluencePageTaskParamsTemplate: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 bf7881c1..d765ca54 100644 --- a/rootly_sdk/models/create_datadog_notebook_task_params.py +++ b/rootly_sdk/models/create_datadog_notebook_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,20 +29,20 @@ class CreateDatadogNotebookTaskParams: Attributes: title (str): The notebook title kind (CreateDatadogNotebookTaskParamsKind): The notebook kind - 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 + 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 """ title: str kind: CreateDatadogNotebookTaskParamsKind - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,7 +50,7 @@ def to_dict(self) -> dict[str, Any]: kind: str = self.kind - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -56,7 +58,7 @@ def to_dict(self) -> dict[str, Any]: mark_post_mortem_as_published = self.mark_post_mortem_as_published - template: Unset | dict[str, Any] = UNSET + template: dict[str, Any] | Unset = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -93,7 +95,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: Unset | CreateDatadogNotebookTaskParamsTaskType + task_type: CreateDatadogNotebookTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -104,7 +106,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: Unset | CreateDatadogNotebookTaskParamsTemplate + template: CreateDatadogNotebookTaskParamsTemplate | Unset if isinstance(_template, Unset): template = UNSET else: diff --git a/rootly_sdk/models/create_datadog_notebook_task_params_kind.py b/rootly_sdk/models/create_datadog_notebook_task_params_kind.py index 84a74b2c..6496c5f7 100644 --- a/rootly_sdk/models/create_datadog_notebook_task_params_kind.py +++ b/rootly_sdk/models/create_datadog_notebook_task_params_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateDatadogNotebookTaskParamsKind = Literal["documentation", "investigation", "postmortem", "report", "runbook"] @@ -15,5 +15,5 @@ def check_create_datadog_notebook_task_params_kind(value: str | None) -> CreateD if value is None: return None if value in CREATE_DATADOG_NOTEBOOK_TASK_PARAMS_KIND_VALUES: - return cast(CreateDatadogNotebookTaskParamsKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_DATADOG_NOTEBOOK_TASK_PARAMS_KIND_VALUES!r}") diff --git a/rootly_sdk/models/create_datadog_notebook_task_params_task_type.py b/rootly_sdk/models/create_datadog_notebook_task_params_task_type.py index 7fa5df8b..28b92de2 100644 --- a/rootly_sdk/models/create_datadog_notebook_task_params_task_type.py +++ b/rootly_sdk/models/create_datadog_notebook_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateDatadogNotebookTaskParamsTaskType = Literal["create_datadog_notebook"] @@ -13,7 +13,7 @@ def check_create_datadog_notebook_task_params_task_type( if value is None: return None if value in CREATE_DATADOG_NOTEBOOK_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateDatadogNotebookTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_DATADOG_NOTEBOOK_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 7191fa50..1ba885b5 100644 --- a/rootly_sdk/models/create_datadog_notebook_task_params_template.py +++ b/rootly_sdk/models/create_datadog_notebook_task_params_template.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateDatadogNotebookTaskParamsTemplate: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 4fcdee63..ff1a1fdb 100644 --- a/rootly_sdk/models/create_dropbox_paper_page_task_params.py +++ b/rootly_sdk/models/create_dropbox_paper_page_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,27 +27,27 @@ class CreateDropboxPaperPageTaskParams: """ Attributes: title (str): The page task title - 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]): + 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): """ title: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -55,11 +57,11 @@ def to_dict(self) -> dict[str, Any]: content = self.content - namespace: Unset | dict[str, Any] = UNSET + namespace: dict[str, Any] | Unset = UNSET if not isinstance(self.namespace, Unset): namespace = self.namespace.to_dict() - parent_folder: Unset | dict[str, Any] = UNSET + parent_folder: dict[str, Any] | Unset = UNSET if not isinstance(self.parent_folder, Unset): parent_folder = self.parent_folder.to_dict() @@ -96,7 +98,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: Unset | CreateDropboxPaperPageTaskParamsTaskType + task_type: CreateDropboxPaperPageTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -109,14 +111,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content", UNSET) _namespace = d.pop("namespace", UNSET) - namespace: Unset | CreateDropboxPaperPageTaskParamsNamespace + namespace: CreateDropboxPaperPageTaskParamsNamespace | Unset if isinstance(_namespace, Unset): namespace = UNSET else: namespace = CreateDropboxPaperPageTaskParamsNamespace.from_dict(_namespace) _parent_folder = d.pop("parent_folder", UNSET) - parent_folder: Unset | CreateDropboxPaperPageTaskParamsParentFolder + parent_folder: CreateDropboxPaperPageTaskParamsParentFolder | Unset 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 93b1ef98..9a83f04b 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateDropboxPaperPageTaskParamsNamespace: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 ca4e271f..5c31099d 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateDropboxPaperPageTaskParamsParentFolder: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_dropbox_paper_page_task_params_task_type.py index 7da1bb66..b22b0062 100644 --- a/rootly_sdk/models/create_dropbox_paper_page_task_params_task_type.py +++ b/rootly_sdk/models/create_dropbox_paper_page_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateDropboxPaperPageTaskParamsTaskType = Literal["create_dropbox_paper_page"] @@ -13,7 +13,7 @@ def check_create_dropbox_paper_page_task_params_task_type( if value is None: return None if value in CREATE_DROPBOX_PAPER_PAGE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateDropboxPaperPageTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_DROPBOX_PAPER_PAGE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_edge_connector_action_body.py b/rootly_sdk/models/create_edge_connector_action_body.py index b5e7af64..ed3410af 100644 --- a/rootly_sdk/models/create_edge_connector_action_body.py +++ b/rootly_sdk/models/create_edge_connector_action_body.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,14 +19,14 @@ class CreateEdgeConnectorActionBody: """ Attributes: - action (Union[Unset, CreateEdgeConnectorActionBodyAction]): + action (CreateEdgeConnectorActionBodyAction | Unset): """ - action: Union[Unset, "CreateEdgeConnectorActionBodyAction"] = UNSET + action: CreateEdgeConnectorActionBodyAction | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - action: Unset | dict[str, Any] = UNSET + action: dict[str, Any] | Unset = UNSET if not isinstance(self.action, Unset): action = self.action.to_dict() @@ -42,7 +44,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _action = d.pop("action", UNSET) - action: Unset | CreateEdgeConnectorActionBodyAction + action: CreateEdgeConnectorActionBodyAction | Unset 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 47bc8d5a..15620225 100644 --- a/rootly_sdk/models/create_edge_connector_action_body_action.py +++ b/rootly_sdk/models/create_edge_connector_action_body_action.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,12 +25,12 @@ class CreateEdgeConnectorActionBodyAction: Attributes: name (str): Action name action_type (CreateEdgeConnectorActionBodyActionActionType): Action type - metadata (Union[Unset, CreateEdgeConnectorActionBodyActionMetadata]): + metadata (CreateEdgeConnectorActionBodyActionMetadata | Unset): """ name: str action_type: CreateEdgeConnectorActionBodyActionActionType - metadata: Union[Unset, "CreateEdgeConnectorActionBodyActionMetadata"] = UNSET + metadata: CreateEdgeConnectorActionBodyActionMetadata | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +38,7 @@ def to_dict(self) -> dict[str, Any]: action_type: str = self.action_type - metadata: Unset | dict[str, Any] = UNSET + metadata: dict[str, Any] | Unset = UNSET if not isinstance(self.metadata, Unset): metadata = self.metadata.to_dict() @@ -65,7 +67,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: Unset | CreateEdgeConnectorActionBodyActionMetadata + metadata: CreateEdgeConnectorActionBodyActionMetadata | Unset if isinstance(_metadata, Unset): metadata = UNSET else: diff --git a/rootly_sdk/models/create_edge_connector_action_body_action_action_type.py b/rootly_sdk/models/create_edge_connector_action_body_action_action_type.py index cffc5553..0da88821 100644 --- a/rootly_sdk/models/create_edge_connector_action_body_action_action_type.py +++ b/rootly_sdk/models/create_edge_connector_action_body_action_action_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateEdgeConnectorActionBodyActionActionType = Literal["http", "script"] @@ -14,7 +14,7 @@ def check_create_edge_connector_action_body_action_action_type( if value is None: return None if value in CREATE_EDGE_CONNECTOR_ACTION_BODY_ACTION_ACTION_TYPE_VALUES: - return cast(CreateEdgeConnectorActionBodyActionActionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_EDGE_CONNECTOR_ACTION_BODY_ACTION_ACTION_TYPE_VALUES!r}" ) 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 e32305e3..b536dde0 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,14 +21,14 @@ class CreateEdgeConnectorActionBodyActionMetadata: """ Attributes: - description (Union[Unset, str]): - timeout (Union[Unset, int]): - parameters (Union[Unset, list['CreateEdgeConnectorActionBodyActionMetadataParametersItem']]): + description (str | Unset): + timeout (int | Unset): + parameters (list[CreateEdgeConnectorActionBodyActionMetadataParametersItem] | Unset): """ - description: Unset | str = UNSET - timeout: Unset | int = UNSET - parameters: Unset | list["CreateEdgeConnectorActionBodyActionMetadataParametersItem"] = UNSET + description: str | Unset = UNSET + timeout: int | Unset = UNSET + parameters: list[CreateEdgeConnectorActionBodyActionMetadataParametersItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: timeout = self.timeout - parameters: Unset | list[dict[str, Any]] = UNSET + parameters: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.parameters, Unset): parameters = [] for parameters_item_data in self.parameters: @@ -64,12 +66,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: timeout = d.pop("timeout", UNSET) - parameters = [] _parameters = d.pop("parameters", UNSET) - for parameters_item_data in _parameters or []: - parameters_item = CreateEdgeConnectorActionBodyActionMetadataParametersItem.from_dict(parameters_item_data) + 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 + ) - 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 8da7d329..f6694bc1 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,24 +19,24 @@ class CreateEdgeConnectorActionBodyActionMetadataParametersItem: """ Attributes: - name (Union[Unset, str]): - type_ (Union[Unset, CreateEdgeConnectorActionBodyActionMetadataParametersItemType]): - required (Union[Unset, bool]): - description (Union[Unset, str]): - options (Union[Unset, list[str]]): + name (str | Unset): + type_ (CreateEdgeConnectorActionBodyActionMetadataParametersItemType | Unset): + required (bool | Unset): + description (str | Unset): + options (list[str] | Unset): """ - name: Unset | str = UNSET - type_: Unset | CreateEdgeConnectorActionBodyActionMetadataParametersItemType = UNSET - required: Unset | bool = UNSET - description: Unset | str = UNSET - options: Unset | list[str] = UNSET + name: str | Unset = UNSET + type_: CreateEdgeConnectorActionBodyActionMetadataParametersItemType | Unset = UNSET + required: bool | Unset = UNSET + description: str | Unset = UNSET + options: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: description = self.description - options: Unset | list[str] = UNSET + options: list[str] | Unset = UNSET if not isinstance(self.options, Unset): options = self.options @@ -68,7 +70,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | CreateEdgeConnectorActionBodyActionMetadataParametersItemType + type_: CreateEdgeConnectorActionBodyActionMetadataParametersItemType | Unset if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/create_edge_connector_action_body_action_metadata_parameters_item_type.py b/rootly_sdk/models/create_edge_connector_action_body_action_metadata_parameters_item_type.py index cd2fef21..c012ee7b 100644 --- a/rootly_sdk/models/create_edge_connector_action_body_action_metadata_parameters_item_type.py +++ b/rootly_sdk/models/create_edge_connector_action_body_action_metadata_parameters_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateEdgeConnectorActionBodyActionMetadataParametersItemType = Literal["boolean", "number", "string"] @@ -17,7 +17,7 @@ def check_create_edge_connector_action_body_action_metadata_parameters_item_type if value is None: return None if value in CREATE_EDGE_CONNECTOR_ACTION_BODY_ACTION_METADATA_PARAMETERS_ITEM_TYPE_VALUES: - return cast(CreateEdgeConnectorActionBodyActionMetadataParametersItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_EDGE_CONNECTOR_ACTION_BODY_ACTION_METADATA_PARAMETERS_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_edge_connector_body.py b/rootly_sdk/models/create_edge_connector_body.py index d0719ab5..bfe6de95 100644 --- a/rootly_sdk/models/create_edge_connector_body.py +++ b/rootly_sdk/models/create_edge_connector_body.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,7 +20,7 @@ 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]: diff --git a/rootly_sdk/models/create_edge_connector_body_data.py b/rootly_sdk/models/create_edge_connector_body_data.py index 744f7e51..77191b2b 100644 --- a/rootly_sdk/models/create_edge_connector_body_data.py +++ b/rootly_sdk/models/create_edge_connector_body_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,7 +27,7 @@ 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]: 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 68321be2..36a0477b 100644 --- a/rootly_sdk/models/create_edge_connector_body_data_attributes.py +++ b/rootly_sdk/models/create_edge_connector_body_data_attributes.py @@ -1,5 +1,8 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast +from uuid import UUID from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,18 +25,20 @@ class CreateEdgeConnectorBodyDataAttributes: """ Attributes: name (str): Connector name - 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. + description (str | Unset): Connector description + status (CreateEdgeConnectorBodyDataAttributesStatus | Unset): Connector status + subscriptions (list[str] | Unset): Array of event types to subscribe to + owner_group_ids (list[UUID] | Unset): IDs of the teams (groups) that own this connector + filters (CreateEdgeConnectorBodyDataAttributesFilters | Unset): Event filters. OR within dimension, AND across + dimensions. """ name: str - description: Unset | str = UNSET - status: Unset | CreateEdgeConnectorBodyDataAttributesStatus = UNSET - subscriptions: Unset | list[str] = UNSET - filters: Union[Unset, "CreateEdgeConnectorBodyDataAttributesFilters"] = UNSET + description: str | Unset = UNSET + status: CreateEdgeConnectorBodyDataAttributesStatus | Unset = UNSET + subscriptions: list[str] | Unset = UNSET + owner_group_ids: list[UUID] | Unset = UNSET + filters: CreateEdgeConnectorBodyDataAttributesFilters | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,15 +46,22 @@ def to_dict(self) -> dict[str, Any]: description = self.description - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status - subscriptions: Unset | list[str] = UNSET + subscriptions: list[str] | Unset = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions - filters: Unset | dict[str, Any] = UNSET + owner_group_ids: list[str] | Unset = UNSET + if not isinstance(self.owner_group_ids, Unset): + owner_group_ids = [] + for owner_group_ids_item_data in self.owner_group_ids: + owner_group_ids_item = str(owner_group_ids_item_data) + owner_group_ids.append(owner_group_ids_item) + + filters: dict[str, Any] | Unset = UNSET if not isinstance(self.filters, Unset): filters = self.filters.to_dict() @@ -66,6 +78,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["status"] = status if subscriptions is not UNSET: field_dict["subscriptions"] = subscriptions + if owner_group_ids is not UNSET: + field_dict["owner_group_ids"] = owner_group_ids if filters is not UNSET: field_dict["filters"] = filters @@ -83,7 +97,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _status = d.pop("status", UNSET) - status: Unset | CreateEdgeConnectorBodyDataAttributesStatus + status: CreateEdgeConnectorBodyDataAttributesStatus | Unset if isinstance(_status, Unset): status = UNSET else: @@ -91,8 +105,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subscriptions = cast(list[str], d.pop("subscriptions", UNSET)) + _owner_group_ids = d.pop("owner_group_ids", UNSET) + owner_group_ids: list[UUID] | Unset = UNSET + if _owner_group_ids is not UNSET: + owner_group_ids = [] + for owner_group_ids_item_data in _owner_group_ids: + owner_group_ids_item = UUID(owner_group_ids_item_data) + + owner_group_ids.append(owner_group_ids_item) + _filters = d.pop("filters", UNSET) - filters: Unset | CreateEdgeConnectorBodyDataAttributesFilters + filters: CreateEdgeConnectorBodyDataAttributesFilters | Unset if isinstance(_filters, Unset): filters = UNSET else: @@ -103,6 +126,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description=description, status=status, subscriptions=subscriptions, + owner_group_ids=owner_group_ids, filters=filters, ) 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 c28b2f7b..14497423 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,31 +15,31 @@ class CreateEdgeConnectorBodyDataAttributesFilters: """Event filters. OR within dimension, AND across dimensions. Attributes: - 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): 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: Unset | list[str] = UNSET - service_ids: Unset | list[str] = UNSET - environment_ids: Unset | list[str] = UNSET - functionality_ids: Unset | list[str] = UNSET + group_ids: list[str] | Unset = UNSET + service_ids: list[str] | Unset = UNSET + environment_ids: list[str] | Unset = UNSET + functionality_ids: list[str] | Unset = UNSET def to_dict(self) -> dict[str, Any]: - group_ids: Unset | list[str] = UNSET + group_ids: list[str] | Unset = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - service_ids: Unset | list[str] = UNSET + service_ids: list[str] | Unset = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - environment_ids: Unset | list[str] = UNSET + environment_ids: list[str] | Unset = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - functionality_ids: Unset | list[str] = UNSET + functionality_ids: list[str] | Unset = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids diff --git a/rootly_sdk/models/create_edge_connector_body_data_attributes_status.py b/rootly_sdk/models/create_edge_connector_body_data_attributes_status.py index 36029c0d..628480e2 100644 --- a/rootly_sdk/models/create_edge_connector_body_data_attributes_status.py +++ b/rootly_sdk/models/create_edge_connector_body_data_attributes_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateEdgeConnectorBodyDataAttributesStatus = Literal["active", "paused"] @@ -14,7 +14,7 @@ def check_create_edge_connector_body_data_attributes_status( if value is None: return None if value in CREATE_EDGE_CONNECTOR_BODY_DATA_ATTRIBUTES_STATUS_VALUES: - return cast(CreateEdgeConnectorBodyDataAttributesStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_EDGE_CONNECTOR_BODY_DATA_ATTRIBUTES_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/create_edge_connector_body_data_type.py b/rootly_sdk/models/create_edge_connector_body_data_type.py index c1aa2d32..0da05ca8 100644 --- a/rootly_sdk/models/create_edge_connector_body_data_type.py +++ b/rootly_sdk/models/create_edge_connector_body_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateEdgeConnectorBodyDataType = Literal["edge_connectors"] @@ -11,5 +11,5 @@ def check_create_edge_connector_body_data_type(value: str | None) -> CreateEdgeC if value is None: return None if value in CREATE_EDGE_CONNECTOR_BODY_DATA_TYPE_VALUES: - return cast(CreateEdgeConnectorBodyDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_EDGE_CONNECTOR_BODY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/create_github_issue_task_params.py b/rootly_sdk/models/create_github_issue_task_params.py index 632aaccc..5e8ef7d0 100644 --- a/rootly_sdk/models/create_github_issue_task_params.py +++ b/rootly_sdk/models/create_github_issue_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,23 +27,23 @@ class CreateGithubIssueTaskParams: Attributes: title (str): The issue title repository (CreateGithubIssueTaskParamsRepository): - 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 + 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 valid JSON """ title: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -49,30 +51,30 @@ def to_dict(self) -> dict[str, Any]: repository = self.repository.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type body = self.body - labels: Unset | list[dict[str, Any]] = UNSET + labels: list[dict[str, Any]] | Unset = 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: Unset | dict[str, Any] = UNSET + issue_type: dict[str, Any] | Unset = UNSET if not isinstance(self.issue_type, Unset): issue_type = self.issue_type.to_dict() - parent_issue_number: None | Unset | str + parent_issue_number: None | str | Unset if isinstance(self.parent_issue_number, Unset): parent_issue_number = UNSET else: parent_issue_number = self.parent_issue_number - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -113,7 +115,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: Unset | CreateGithubIssueTaskParamsTaskType + task_type: CreateGithubIssueTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -121,35 +123,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: body = d.pop("body", UNSET) - labels = [] _labels = d.pop("labels", UNSET) - for labels_item_data in _labels or []: - labels_item = CreateGithubIssueTaskParamsLabelsItem.from_dict(labels_item_data) + 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) - labels.append(labels_item) + labels.append(labels_item) _issue_type = d.pop("issue_type", UNSET) - issue_type: Unset | CreateGithubIssueTaskParamsIssueType + issue_type: CreateGithubIssueTaskParamsIssueType | Unset if isinstance(_issue_type, Unset): issue_type = UNSET else: issue_type = CreateGithubIssueTaskParamsIssueType.from_dict(_issue_type) - def _parse_parent_issue_number(data: object) -> None | Unset | str: + def _parse_parent_issue_number(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) parent_issue_number = _parse_parent_issue_number(d.pop("parent_issue_number", UNSET)) - def _parse_custom_fields_mapping(data: object) -> None | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 161e025d..8dcdb1a0 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateGithubIssueTaskParamsIssueType: """The issue type Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 d3e8c024..ae8e2abb 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateGithubIssueTaskParamsLabelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 75501b1d..a46c14d5 100644 --- a/rootly_sdk/models/create_github_issue_task_params_repository.py +++ b/rootly_sdk/models/create_github_issue_task_params_repository.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateGithubIssueTaskParamsRepository: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_github_issue_task_params_task_type.py index 591e5f9a..2453a338 100644 --- a/rootly_sdk/models/create_github_issue_task_params_task_type.py +++ b/rootly_sdk/models/create_github_issue_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateGithubIssueTaskParamsTaskType = Literal["create_github_issue"] @@ -11,5 +11,5 @@ def check_create_github_issue_task_params_task_type(value: str | None) -> Create if value is None: return None if value in CREATE_GITHUB_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateGithubIssueTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_GITHUB_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/create_gitlab_issue_task_params.py b/rootly_sdk/models/create_gitlab_issue_task_params.py index ea0b548f..b1833a8e 100644 --- a/rootly_sdk/models/create_gitlab_issue_task_params.py +++ b/rootly_sdk/models/create_gitlab_issue_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -28,19 +30,19 @@ class CreateGitlabIssueTaskParams: issue_type (CreateGitlabIssueTaskParamsIssueType): The issue type title (str): The issue title repository (CreateGitlabIssueTaskParamsRepository): - 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 + task_type (CreateGitlabIssueTaskParamsTaskType | Unset): + description (str | Unset): The issue description + labels (str | Unset): The issue labels + due_date (str | Unset): The due date """ issue_type: CreateGitlabIssueTaskParamsIssueType title: str - repository: "CreateGitlabIssueTaskParamsRepository" - task_type: Unset | CreateGitlabIssueTaskParamsTaskType = UNSET - description: Unset | str = UNSET - labels: Unset | str = UNSET - due_date: Unset | str = UNSET + repository: CreateGitlabIssueTaskParamsRepository + task_type: CreateGitlabIssueTaskParamsTaskType | Unset = UNSET + description: str | Unset = UNSET + labels: str | Unset = UNSET + due_date: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,7 +52,7 @@ def to_dict(self) -> dict[str, Any]: repository = self.repository.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -92,7 +94,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: repository = CreateGitlabIssueTaskParamsRepository.from_dict(d.pop("repository")) _task_type = d.pop("task_type", UNSET) - task_type: Unset | CreateGitlabIssueTaskParamsTaskType + task_type: CreateGitlabIssueTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_gitlab_issue_task_params_issue_type.py b/rootly_sdk/models/create_gitlab_issue_task_params_issue_type.py index 739c62ff..1e295274 100644 --- a/rootly_sdk/models/create_gitlab_issue_task_params_issue_type.py +++ b/rootly_sdk/models/create_gitlab_issue_task_params_issue_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateGitlabIssueTaskParamsIssueType = Literal["incident", "issue", "task", "test_case"] @@ -14,7 +14,7 @@ def check_create_gitlab_issue_task_params_issue_type(value: str | None) -> Creat if value is None: return None if value in CREATE_GITLAB_ISSUE_TASK_PARAMS_ISSUE_TYPE_VALUES: - return cast(CreateGitlabIssueTaskParamsIssueType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_GITLAB_ISSUE_TASK_PARAMS_ISSUE_TYPE_VALUES!r}" ) 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 5b377efe..4193b887 100644 --- a/rootly_sdk/models/create_gitlab_issue_task_params_repository.py +++ b/rootly_sdk/models/create_gitlab_issue_task_params_repository.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateGitlabIssueTaskParamsRepository: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_gitlab_issue_task_params_task_type.py index 38a150bc..92ace93d 100644 --- a/rootly_sdk/models/create_gitlab_issue_task_params_task_type.py +++ b/rootly_sdk/models/create_gitlab_issue_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateGitlabIssueTaskParamsTaskType = Literal["create_gitlab_issue"] @@ -11,5 +11,5 @@ def check_create_gitlab_issue_task_params_task_type(value: str | None) -> Create if value is None: return None if value in CREATE_GITLAB_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateGitlabIssueTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_GITLAB_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES!r}") 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 5144ec0b..2b9b4c58 100644 --- a/rootly_sdk/models/create_go_to_meeting_task_params.py +++ b/rootly_sdk/models/create_go_to_meeting_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -28,34 +30,33 @@ class CreateGoToMeetingTaskParams: """ Attributes: subject (str): The meeting subject - 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']]): + 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): """ subject: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: subject = self.subject - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - conference_call_info: Unset | str = UNSET + conference_call_info: str | Unset = UNSET if not isinstance(self.conference_call_info, Unset): conference_call_info = self.conference_call_info - password_required: None | Unset | bool + password_required: bool | None | Unset if isinstance(self.password_required, Unset): password_required = UNSET else: @@ -63,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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: @@ -100,38 +101,40 @@ 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: Unset | CreateGoToMeetingTaskParamsTaskType + task_type: CreateGoToMeetingTaskParamsTaskType | Unset 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: Unset | CreateGoToMeetingTaskParamsConferenceCallInfo + conference_call_info: CreateGoToMeetingTaskParamsConferenceCallInfo | Unset 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) -> None | Unset | bool: + def _parse_password_required(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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) - 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: 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 + ) - 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_conference_call_info.py b/rootly_sdk/models/create_go_to_meeting_task_params_conference_call_info.py index 255c8347..d8e60b20 100644 --- a/rootly_sdk/models/create_go_to_meeting_task_params_conference_call_info.py +++ b/rootly_sdk/models/create_go_to_meeting_task_params_conference_call_info.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateGoToMeetingTaskParamsConferenceCallInfo = Literal["free", "hyrid", "ptsn", "voip"] @@ -16,7 +16,7 @@ def check_create_go_to_meeting_task_params_conference_call_info( if value is None: return None if value in CREATE_GO_TO_MEETING_TASK_PARAMS_CONFERENCE_CALL_INFO_VALUES: - return cast(CreateGoToMeetingTaskParamsConferenceCallInfo, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_GO_TO_MEETING_TASK_PARAMS_CONFERENCE_CALL_INFO_VALUES!r}" ) 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 fdc0eebb..f666dea2 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateGoToMeetingTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_go_to_meeting_task_params_task_type.py index 6ddfcbfc..232c3321 100644 --- a/rootly_sdk/models/create_go_to_meeting_task_params_task_type.py +++ b/rootly_sdk/models/create_go_to_meeting_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateGoToMeetingTaskParamsTaskType = Literal["create_go_to_meeting_task"] @@ -11,7 +11,7 @@ def check_create_go_to_meeting_task_params_task_type(value: str | None) -> Creat if value is None: return None if value in CREATE_GO_TO_MEETING_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateGoToMeetingTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_GO_TO_MEETING_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 fe8900b0..84ce97a8 100644 --- a/rootly_sdk/models/create_google_calendar_event_task_params.py +++ b/rootly_sdk/models/create_google_calendar_event_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -32,19 +34,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 (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 + 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 conference type attached to the meeting - post_to_incident_timeline (Union[Unset, bool]): - post_to_slack_channels (Union[Unset, list['CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem']]): + post_to_incident_timeline (bool | Unset): + post_to_slack_channels (list[CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem] | Unset): """ days_until_meeting: int @@ -52,18 +54,18 @@ class CreateGoogleCalendarEventTaskParams: meeting_duration: str summary: str description: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -77,21 +79,21 @@ def to_dict(self) -> dict[str, Any]: description = self.description - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - attendees: Unset | list[str] = UNSET + attendees: list[str] | Unset = UNSET if not isinstance(self.attendees, Unset): attendees = self.attendees - time_zone: None | Unset | str + time_zone: None | str | Unset if isinstance(self.time_zone, Unset): time_zone = UNSET else: time_zone = self.time_zone - calendar_id: None | Unset | str + calendar_id: None | str | Unset if isinstance(self.calendar_id, Unset): calendar_id = UNSET else: @@ -107,13 +109,13 @@ def to_dict(self) -> dict[str, Any]: exclude_weekends = self.exclude_weekends - conference_solution_key: Unset | str = UNSET + conference_solution_key: str | Unset = 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: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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: @@ -176,7 +178,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: Unset | CreateGoogleCalendarEventTaskParamsTaskType + task_type: CreateGoogleCalendarEventTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -184,21 +186,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 | Unset | str: + def _parse_time_zone(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) - def _parse_calendar_id(data: object) -> None | Unset | str: + def _parse_calendar_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) calendar_id = _parse_calendar_id(d.pop("calendar_id", UNSET)) @@ -213,7 +215,7 @@ def _parse_calendar_id(data: object) -> None | Unset | str: exclude_weekends = d.pop("exclude_weekends", UNSET) _conference_solution_key = d.pop("conference_solution_key", UNSET) - conference_solution_key: Unset | CreateGoogleCalendarEventTaskParamsConferenceSolutionKey + conference_solution_key: CreateGoogleCalendarEventTaskParamsConferenceSolutionKey | Unset if isinstance(_conference_solution_key, Unset): conference_solution_key = UNSET else: @@ -223,14 +225,16 @@ def _parse_calendar_id(data: object) -> None | Unset | 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) - 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: 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 + ) - 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_conference_solution_key.py b/rootly_sdk/models/create_google_calendar_event_task_params_conference_solution_key.py index 3a84f74a..d1cd6e46 100644 --- a/rootly_sdk/models/create_google_calendar_event_task_params_conference_solution_key.py +++ b/rootly_sdk/models/create_google_calendar_event_task_params_conference_solution_key.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateGoogleCalendarEventTaskParamsConferenceSolutionKey = Literal[ "addOn", "eventHangout", "eventNamedHangout", "hangoutsMeet" @@ -20,7 +20,7 @@ def check_create_google_calendar_event_task_params_conference_solution_key( if value is None: return None if value in CREATE_GOOGLE_CALENDAR_EVENT_TASK_PARAMS_CONFERENCE_SOLUTION_KEY_VALUES: - return cast(CreateGoogleCalendarEventTaskParamsConferenceSolutionKey, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_GOOGLE_CALENDAR_EVENT_TASK_PARAMS_CONFERENCE_SOLUTION_KEY_VALUES!r}" ) 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 bd006c20..0720c337 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateGoogleCalendarEventTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_google_calendar_event_task_params_task_type.py index 210542f1..50b02289 100644 --- a/rootly_sdk/models/create_google_calendar_event_task_params_task_type.py +++ b/rootly_sdk/models/create_google_calendar_event_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateGoogleCalendarEventTaskParamsTaskType = Literal["create_google_calendar_event"] @@ -13,7 +13,7 @@ def check_create_google_calendar_event_task_params_task_type( if value is None: return None if value in CREATE_GOOGLE_CALENDAR_EVENT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateGoogleCalendarEventTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_GOOGLE_CALENDAR_EVENT_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 ae1d1521..ff6a09f3 100644 --- a/rootly_sdk/models/create_google_chat_space_task_params.py +++ b/rootly_sdk/models/create_google_chat_space_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -18,22 +20,21 @@ class CreateGoogleChatSpaceTaskParams: """ Attributes: title (str): - 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. + task_type (CreateGoogleChatSpaceTaskParamsTaskType | Unset): + description (str | Unset): + audience (str | Unset): Target audience resource name (e.g. audiences/default). Leave blank for private space. """ title: str - task_type: Unset | CreateGoogleChatSpaceTaskParamsTaskType = UNSET - description: Unset | str = UNSET - audience: Unset | str = UNSET + task_type: CreateGoogleChatSpaceTaskParamsTaskType | Unset = UNSET + description: str | Unset = UNSET + audience: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,7 +64,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: Unset | CreateGoogleChatSpaceTaskParamsTaskType + task_type: CreateGoogleChatSpaceTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_google_chat_space_task_params_task_type.py b/rootly_sdk/models/create_google_chat_space_task_params_task_type.py index 90acf167..3069a9c5 100644 --- a/rootly_sdk/models/create_google_chat_space_task_params_task_type.py +++ b/rootly_sdk/models/create_google_chat_space_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateGoogleChatSpaceTaskParamsTaskType = Literal["create_google_chat_space"] @@ -13,7 +13,7 @@ def check_create_google_chat_space_task_params_task_type( if value is None: return None if value in CREATE_GOOGLE_CHAT_SPACE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateGoogleChatSpaceTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_GOOGLE_CHAT_SPACE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 aa755541..c7d11ca0 100644 --- a/rootly_sdk/models/create_google_docs_page_task_params.py +++ b/rootly_sdk/models/create_google_docs_page_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,37 +25,37 @@ class CreateGoogleDocsPageTaskParams: """ Attributes: title (str): The page title - 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. + 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. + include_follow_ups (bool | Unset): Default: True. """ title: str - 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 + 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 + include_follow_ups: bool | Unset = True additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -61,11 +63,11 @@ def to_dict(self) -> dict[str, Any]: mark_post_mortem_as_published = self.mark_post_mortem_as_published - drive: Unset | dict[str, Any] = UNSET + drive: dict[str, Any] | Unset = UNSET if not isinstance(self.drive, Unset): drive = self.drive.to_dict() - parent_folder: Unset | dict[str, Any] = UNSET + parent_folder: dict[str, Any] | Unset = UNSET if not isinstance(self.parent_folder, Unset): parent_folder = self.parent_folder.to_dict() @@ -124,7 +126,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: Unset | CreateGoogleDocsPageTaskParamsTaskType + task_type: CreateGoogleDocsPageTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -135,14 +137,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: Unset | CreateGoogleDocsPageTaskParamsDrive + drive: CreateGoogleDocsPageTaskParamsDrive | Unset if isinstance(_drive, Unset): drive = UNSET else: drive = CreateGoogleDocsPageTaskParamsDrive.from_dict(_drive) _parent_folder = d.pop("parent_folder", UNSET) - parent_folder: Unset | CreateGoogleDocsPageTaskParamsParentFolder + parent_folder: CreateGoogleDocsPageTaskParamsParentFolder | Unset if isinstance(_parent_folder, Unset): parent_folder = UNSET else: 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 9bc8cd93..ed347ba9 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateGoogleDocsPageTaskParamsDrive: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 aa73628a..0f00ca78 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateGoogleDocsPageTaskParamsParentFolder: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_google_docs_page_task_params_task_type.py index 28203891..9edfb3d1 100644 --- a/rootly_sdk/models/create_google_docs_page_task_params_task_type.py +++ b/rootly_sdk/models/create_google_docs_page_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateGoogleDocsPageTaskParamsTaskType = Literal["create_google_docs_page"] @@ -13,7 +13,7 @@ def check_create_google_docs_page_task_params_task_type( if value is None: return None if value in CREATE_GOOGLE_DOCS_PAGE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateGoogleDocsPageTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_GOOGLE_DOCS_PAGE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 90211d3f..f685b609 100644 --- a/rootly_sdk/models/create_google_docs_permissions_task_params.py +++ b/rootly_sdk/models/create_google_docs_permissions_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,16 +21,16 @@ class CreateGoogleDocsPermissionsTaskParams: Attributes: file_id (str): The Google Doc file ID permissions (str): Page permissions JSON - task_type (Union[Unset, CreateGoogleDocsPermissionsTaskParamsTaskType]): - send_notification_email (Union[Unset, bool]): - email_message (Union[None, Unset, str]): Email message notification + task_type (CreateGoogleDocsPermissionsTaskParamsTaskType | Unset): + send_notification_email (bool | Unset): + email_message (None | str | Unset): Email message notification """ file_id: str permissions: str - task_type: Unset | CreateGoogleDocsPermissionsTaskParamsTaskType = UNSET - send_notification_email: Unset | bool = UNSET - email_message: None | Unset | str = UNSET + task_type: CreateGoogleDocsPermissionsTaskParamsTaskType | Unset = UNSET + send_notification_email: bool | Unset = UNSET + email_message: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,13 +38,13 @@ def to_dict(self) -> dict[str, Any]: permissions = self.permissions - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type send_notification_email = self.send_notification_email - email_message: None | Unset | str + email_message: None | str | Unset if isinstance(self.email_message, Unset): email_message = UNSET else: @@ -73,7 +75,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: Unset | CreateGoogleDocsPermissionsTaskParamsTaskType + task_type: CreateGoogleDocsPermissionsTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -81,12 +83,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 | Unset | str: + def _parse_email_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) email_message = _parse_email_message(d.pop("email_message", UNSET)) diff --git a/rootly_sdk/models/create_google_docs_permissions_task_params_task_type.py b/rootly_sdk/models/create_google_docs_permissions_task_params_task_type.py index 037a0443..fdb80a62 100644 --- a/rootly_sdk/models/create_google_docs_permissions_task_params_task_type.py +++ b/rootly_sdk/models/create_google_docs_permissions_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateGoogleDocsPermissionsTaskParamsTaskType = Literal["create_google_docs_permissions"] @@ -13,7 +13,7 @@ def check_create_google_docs_permissions_task_params_task_type( if value is None: return None if value in CREATE_GOOGLE_DOCS_PERMISSIONS_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateGoogleDocsPermissionsTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_GOOGLE_DOCS_PERMISSIONS_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 87e49bf1..8800e746 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,14 +27,14 @@ class CreateGoogleGeminiChatCompletionTaskParams: Attributes: model (CreateGoogleGeminiChatCompletionTaskParamsModel): The Gemini model. eg: gemini-2.0-flash prompt (str): The prompt to send to Gemini - task_type (Union[Unset, CreateGoogleGeminiChatCompletionTaskParamsTaskType]): - system_prompt (Union[Unset, str]): The system prompt to send to Gemini (optional) + task_type (CreateGoogleGeminiChatCompletionTaskParamsTaskType | Unset): + system_prompt (str | Unset): The system prompt to send to Gemini (optional) """ - model: "CreateGoogleGeminiChatCompletionTaskParamsModel" + model: CreateGoogleGeminiChatCompletionTaskParamsModel prompt: str - task_type: Unset | CreateGoogleGeminiChatCompletionTaskParamsTaskType = UNSET - system_prompt: Unset | str = UNSET + task_type: CreateGoogleGeminiChatCompletionTaskParamsTaskType | Unset = UNSET + system_prompt: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: prompt = self.prompt - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -73,7 +75,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: Unset | CreateGoogleGeminiChatCompletionTaskParamsTaskType + task_type: CreateGoogleGeminiChatCompletionTaskParamsTaskType | Unset 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 c0099766..9eb379c8 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateGoogleGeminiChatCompletionTaskParamsModel: """The Gemini model. eg: gemini-2.0-flash Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_gemini_chat_completion_task_params_task_type.py b/rootly_sdk/models/create_google_gemini_chat_completion_task_params_task_type.py index c18f000e..c68ac76f 100644 --- a/rootly_sdk/models/create_google_gemini_chat_completion_task_params_task_type.py +++ b/rootly_sdk/models/create_google_gemini_chat_completion_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateGoogleGeminiChatCompletionTaskParamsTaskType = Literal["create_google_gemini_chat_completion_task"] @@ -15,7 +15,7 @@ def check_create_google_gemini_chat_completion_task_params_task_type( if value is None: return None if value in CREATE_GOOGLE_GEMINI_CHAT_COMPLETION_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateGoogleGeminiChatCompletionTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_GOOGLE_GEMINI_CHAT_COMPLETION_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_google_meeting_task_params.py b/rootly_sdk/models/create_google_meeting_task_params.py index 89e2e1e3..eb7fc496 100644 --- a/rootly_sdk/models/create_google_meeting_task_params.py +++ b/rootly_sdk/models/create_google_meeting_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -31,27 +33,33 @@ class CreateGoogleMeetingTaskParams: """ Attributes: - 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): [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): + retry_count (int | Unset): Number of times to retry on rate-limit (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. """ summary: None | str description: None | str - 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 + 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 + retry_count: int | Unset = 0 + retry_wait_time: int | Unset = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -61,29 +69,33 @@ def to_dict(self) -> dict[str, Any]: description: None | str description = self.description - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - conference_solution_key: Unset | str = UNSET + conference_solution_key: str | Unset = UNSET if not isinstance(self.conference_solution_key, Unset): conference_solution_key = self.conference_solution_key record_meeting = self.record_meeting - recording_mode: Unset | str = UNSET + recording_mode: str | Unset = 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: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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) + 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( @@ -104,6 +116,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["post_to_incident_timeline"] = post_to_incident_timeline if post_to_slack_channels is not UNSET: field_dict["post_to_slack_channels"] = post_to_slack_channels + 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 @@ -130,14 +146,14 @@ def _parse_description(data: object) -> None | str: description = _parse_description(d.pop("description")) _task_type = d.pop("task_type", UNSET) - task_type: Unset | CreateGoogleMeetingTaskParamsTaskType + task_type: CreateGoogleMeetingTaskParamsTaskType | Unset 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: Unset | CreateGoogleMeetingTaskParamsConferenceSolutionKey + conference_solution_key: CreateGoogleMeetingTaskParamsConferenceSolutionKey | Unset if isinstance(_conference_solution_key, Unset): conference_solution_key = UNSET else: @@ -148,7 +164,7 @@ def _parse_description(data: object) -> None | str: record_meeting = d.pop("record_meeting", UNSET) _recording_mode = d.pop("recording_mode", UNSET) - recording_mode: Unset | CreateGoogleMeetingTaskParamsRecordingMode + recording_mode: CreateGoogleMeetingTaskParamsRecordingMode | Unset if isinstance(_recording_mode, Unset): recording_mode = UNSET else: @@ -156,14 +172,20 @@ 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) - 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: 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 + ) + + post_to_slack_channels.append(post_to_slack_channels_item) + + retry_count = d.pop("retry_count", UNSET) - post_to_slack_channels.append(post_to_slack_channels_item) + retry_wait_time = d.pop("retry_wait_time", UNSET) create_google_meeting_task_params = cls( summary=summary, @@ -174,6 +196,8 @@ def _parse_description(data: object) -> None | str: recording_mode=recording_mode, post_to_incident_timeline=post_to_incident_timeline, post_to_slack_channels=post_to_slack_channels, + retry_count=retry_count, + retry_wait_time=retry_wait_time, ) create_google_meeting_task_params.additional_properties = d diff --git a/rootly_sdk/models/create_google_meeting_task_params_conference_solution_key.py b/rootly_sdk/models/create_google_meeting_task_params_conference_solution_key.py index 2d81b280..7fd3210f 100644 --- a/rootly_sdk/models/create_google_meeting_task_params_conference_solution_key.py +++ b/rootly_sdk/models/create_google_meeting_task_params_conference_solution_key.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateGoogleMeetingTaskParamsConferenceSolutionKey = Literal[ "addOn", "eventHangout", "eventNamedHangout", "hangoutsMeet" @@ -20,7 +20,7 @@ def check_create_google_meeting_task_params_conference_solution_key( if value is None: return None if value in CREATE_GOOGLE_MEETING_TASK_PARAMS_CONFERENCE_SOLUTION_KEY_VALUES: - return cast(CreateGoogleMeetingTaskParamsConferenceSolutionKey, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_GOOGLE_MEETING_TASK_PARAMS_CONFERENCE_SOLUTION_KEY_VALUES!r}" ) 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 596f6f21..091a9f63 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateGoogleMeetingTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_recording_mode.py b/rootly_sdk/models/create_google_meeting_task_params_recording_mode.py index 21b53984..1f6864f3 100644 --- a/rootly_sdk/models/create_google_meeting_task_params_recording_mode.py +++ b/rootly_sdk/models/create_google_meeting_task_params_recording_mode.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateGoogleMeetingTaskParamsRecordingMode = Literal["audio_only", "gallery_view", "gallery_view_v2", "speaker_view"] @@ -16,7 +16,7 @@ def check_create_google_meeting_task_params_recording_mode( if value is None: return None if value in CREATE_GOOGLE_MEETING_TASK_PARAMS_RECORDING_MODE_VALUES: - return cast(CreateGoogleMeetingTaskParamsRecordingMode, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_GOOGLE_MEETING_TASK_PARAMS_RECORDING_MODE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_google_meeting_task_params_task_type.py b/rootly_sdk/models/create_google_meeting_task_params_task_type.py index 75c9c102..44cafbca 100644 --- a/rootly_sdk/models/create_google_meeting_task_params_task_type.py +++ b/rootly_sdk/models/create_google_meeting_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateGoogleMeetingTaskParamsTaskType = Literal["create_google_meeting"] @@ -13,7 +13,7 @@ def check_create_google_meeting_task_params_task_type( if value is None: return None if value in CREATE_GOOGLE_MEETING_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateGoogleMeetingTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_GOOGLE_MEETING_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_incident_postmortem_task_params.py b/rootly_sdk/models/create_incident_postmortem_task_params.py index 1a875f38..8c8d0253 100644 --- a/rootly_sdk/models/create_incident_postmortem_task_params.py +++ b/rootly_sdk/models/create_incident_postmortem_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,16 +27,16 @@ class CreateIncidentPostmortemTaskParams: Attributes: incident_id (str): UUID of the incident that needs a retrospective title (str): The retrospective title - task_type (Union[Unset, CreateIncidentPostmortemTaskParamsTaskType]): - status (Union[None, Unset, str]): - template (Union['CreateIncidentPostmortemTaskParamsTemplateType0', None, Unset]): Retrospective template to use + task_type (CreateIncidentPostmortemTaskParamsTaskType | Unset): + status (None | str | Unset): + template (CreateIncidentPostmortemTaskParamsTemplateType0 | None | Unset): Retrospective template to use """ incident_id: str title: str - task_type: Unset | CreateIncidentPostmortemTaskParamsTaskType = UNSET - status: None | Unset | str = UNSET - template: Union["CreateIncidentPostmortemTaskParamsTemplateType0", None, Unset] = UNSET + task_type: CreateIncidentPostmortemTaskParamsTaskType | Unset = UNSET + status: None | str | Unset = UNSET + template: CreateIncidentPostmortemTaskParamsTemplateType0 | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,17 +48,17 @@ def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - status: None | Unset | str + status: None | str | Unset if isinstance(self.status, Unset): status = UNSET else: status = self.status - template: None | Unset | dict[str, Any] + template: dict[str, Any] | None | Unset if isinstance(self.template, Unset): template = UNSET elif isinstance(self.template, CreateIncidentPostmortemTaskParamsTemplateType0): @@ -93,22 +95,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: Unset | CreateIncidentPostmortemTaskParamsTaskType + task_type: CreateIncidentPostmortemTaskParamsTaskType | Unset 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 | Unset | str: + def _parse_status(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) status = _parse_status(d.pop("status", UNSET)) - def _parse_template(data: object) -> Union["CreateIncidentPostmortemTaskParamsTemplateType0", None, Unset]: + def _parse_template(data: object) -> CreateIncidentPostmortemTaskParamsTemplateType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -119,9 +121,9 @@ def _parse_template(data: object) -> Union["CreateIncidentPostmortemTaskParamsTe template_type_0 = CreateIncidentPostmortemTaskParamsTemplateType0.from_dict(data) return template_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["CreateIncidentPostmortemTaskParamsTemplateType0", None, Unset], data) + return cast(CreateIncidentPostmortemTaskParamsTemplateType0 | None | Unset, data) template = _parse_template(d.pop("template", UNSET)) diff --git a/rootly_sdk/models/create_incident_postmortem_task_params_task_type.py b/rootly_sdk/models/create_incident_postmortem_task_params_task_type.py index 3dbaccfc..0eb12c13 100644 --- a/rootly_sdk/models/create_incident_postmortem_task_params_task_type.py +++ b/rootly_sdk/models/create_incident_postmortem_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateIncidentPostmortemTaskParamsTaskType = Literal["create_incident_postmortem"] @@ -13,7 +13,7 @@ def check_create_incident_postmortem_task_params_task_type( if value is None: return None if value in CREATE_INCIDENT_POSTMORTEM_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateIncidentPostmortemTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_INCIDENT_POSTMORTEM_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 c5ad478e..5baec603 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateIncidentPostmortemTaskParamsTemplateType0: """Retrospective template to use Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 1065a82a..0431e24c 100644 --- a/rootly_sdk/models/create_incident_task_params.py +++ b/rootly_sdk/models/create_incident_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,36 +20,36 @@ class CreateIncidentTaskParams: """ Attributes: title (str): The incident title - 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 + 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 valid JSON. Use 'services', 'functionalities', or 'groups' keys with arrays of names/slugs for name/slug lookup """ title: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -55,29 +57,29 @@ def to_dict(self) -> dict[str, Any]: severity_id = self.severity_id - incident_type_ids: Unset | list[str] = UNSET + incident_type_ids: list[str] | Unset = UNSET if not isinstance(self.incident_type_ids, Unset): incident_type_ids = self.incident_type_ids - service_ids: Unset | list[str] = UNSET + service_ids: list[str] | Unset = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: Unset | list[str] = UNSET + functionality_ids: list[str] | Unset = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - environment_ids: Unset | list[str] = UNSET + environment_ids: list[str] | Unset = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - group_ids: Unset | list[str] = UNSET + group_ids: list[str] | Unset = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids private = self.private - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -119,7 +121,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: Unset | CreateIncidentTaskParamsTaskType + task_type: CreateIncidentTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -141,12 +143,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 | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/create_incident_task_params_task_type.py b/rootly_sdk/models/create_incident_task_params_task_type.py index 09fa959e..7d614540 100644 --- a/rootly_sdk/models/create_incident_task_params_task_type.py +++ b/rootly_sdk/models/create_incident_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateIncidentTaskParamsTaskType = Literal["create_incident"] @@ -11,5 +11,5 @@ def check_create_incident_task_params_task_type(value: str | None) -> CreateInci if value is None: return None if value in CREATE_INCIDENT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateIncidentTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_INCIDENT_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/create_jira_issue_task_params.py b/rootly_sdk/models/create_jira_issue_task_params.py index 462fc455..8cd6df4c 100644 --- a/rootly_sdk/models/create_jira_issue_task_params.py +++ b/rootly_sdk/models/create_jira_issue_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,41 +29,41 @@ 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 (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 + 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 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. + update_payload (None | str | Unset): Update payload. Can contain liquid markup and need to be valid JSON + retry_count (int | Unset): Number of times to retry on rate-limit (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. """ title: str project_key: str - 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 + 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 + retry_count: int | Unset = 0 + retry_wait_time: int | Unset = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -71,11 +73,11 @@ def to_dict(self) -> dict[str, Any]: issue_type = self.issue_type.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: Unset | dict[str, Any] = UNSET + integration: dict[str, Any] | Unset = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -89,21 +91,21 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - priority: Unset | dict[str, Any] = UNSET + priority: dict[str, Any] | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - status: Unset | dict[str, Any] = UNSET + status: dict[str, Any] | Unset = UNSET if not isinstance(self.status, Unset): status = self.status.to_dict() - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - update_payload: None | Unset | str + update_payload: None | str | Unset if isinstance(self.update_payload, Unset): update_payload = UNSET else: @@ -166,14 +168,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: Unset | CreateJiraIssueTaskParamsTaskType + task_type: CreateJiraIssueTaskParamsTaskType | Unset 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: Unset | CreateJiraIssueTaskParamsIntegration + integration: CreateJiraIssueTaskParamsIntegration | Unset if isinstance(_integration, Unset): integration = UNSET else: @@ -190,34 +192,34 @@ 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: Unset | CreateJiraIssueTaskParamsPriority + priority: CreateJiraIssueTaskParamsPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: priority = CreateJiraIssueTaskParamsPriority.from_dict(_priority) _status = d.pop("status", UNSET) - status: Unset | CreateJiraIssueTaskParamsStatus + status: CreateJiraIssueTaskParamsStatus | Unset if isinstance(_status, Unset): status = UNSET else: status = CreateJiraIssueTaskParamsStatus.from_dict(_status) - def _parse_custom_fields_mapping(data: object) -> None | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_update_payload(data: object) -> None | Unset | str: + def _parse_update_payload(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) update_payload = _parse_update_payload(d.pop("update_payload", UNSET)) 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 b3fe98a6..9537af66 100644 --- a/rootly_sdk/models/create_jira_issue_task_params_integration.py +++ b/rootly_sdk/models/create_jira_issue_task_params_integration.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateJiraIssueTaskParamsIntegration: """Specify integration id if you have more than one Jira instance Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 8e6dfd69..c774aed2 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateJiraIssueTaskParamsIssueType: """The issue type id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 7f761ba0..cca943f4 100644 --- a/rootly_sdk/models/create_jira_issue_task_params_priority.py +++ b/rootly_sdk/models/create_jira_issue_task_params_priority.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateJiraIssueTaskParamsPriority: """The priority id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 1fbaa1b7..719aa1ff 100644 --- a/rootly_sdk/models/create_jira_issue_task_params_status.py +++ b/rootly_sdk/models/create_jira_issue_task_params_status.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateJiraIssueTaskParamsStatus: """The status id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_jira_issue_task_params_task_type.py index 5d8ed22d..e92e1528 100644 --- a/rootly_sdk/models/create_jira_issue_task_params_task_type.py +++ b/rootly_sdk/models/create_jira_issue_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateJiraIssueTaskParamsTaskType = Literal["create_jira_issue"] @@ -11,5 +11,5 @@ def check_create_jira_issue_task_params_task_type(value: str | None) -> CreateJi if value is None: return None if value in CREATE_JIRA_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateJiraIssueTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_JIRA_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/create_jira_subtask_task_params.py b/rootly_sdk/models/create_jira_subtask_task_params.py index ce6f02e8..2bf5d816 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params.py +++ b/rootly_sdk/models/create_jira_subtask_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,42 +30,42 @@ 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 (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 + 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 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. + update_payload (None | str | Unset): Update payload. Can contain liquid markup and need to be valid JSON + retry_count (int | Unset): Number of times to retry on rate-limit (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. """ project_key: str parent_issue_id: str title: str - 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 + 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 + retry_count: int | Unset = 0 + retry_wait_time: int | Unset = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -75,11 +77,11 @@ def to_dict(self) -> dict[str, Any]: subtask_issue_type = self.subtask_issue_type.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: Unset | dict[str, Any] = UNSET + integration: dict[str, Any] | Unset = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -93,21 +95,21 @@ def to_dict(self) -> dict[str, Any]: reporter_user_email = self.reporter_user_email - priority: Unset | dict[str, Any] = UNSET + priority: dict[str, Any] | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - status: Unset | dict[str, Any] = UNSET + status: dict[str, Any] | Unset = UNSET if not isinstance(self.status, Unset): status = self.status.to_dict() - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - update_payload: None | Unset | str + update_payload: None | str | Unset if isinstance(self.update_payload, Unset): update_payload = UNSET else: @@ -175,14 +177,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: Unset | CreateJiraSubtaskTaskParamsTaskType + task_type: CreateJiraSubtaskTaskParamsTaskType | Unset 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: Unset | CreateJiraSubtaskTaskParamsIntegration + integration: CreateJiraSubtaskTaskParamsIntegration | Unset if isinstance(_integration, Unset): integration = UNSET else: @@ -199,34 +201,34 @@ 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: Unset | CreateJiraSubtaskTaskParamsPriority + priority: CreateJiraSubtaskTaskParamsPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: priority = CreateJiraSubtaskTaskParamsPriority.from_dict(_priority) _status = d.pop("status", UNSET) - status: Unset | CreateJiraSubtaskTaskParamsStatus + status: CreateJiraSubtaskTaskParamsStatus | Unset if isinstance(_status, Unset): status = UNSET else: status = CreateJiraSubtaskTaskParamsStatus.from_dict(_status) - def _parse_custom_fields_mapping(data: object) -> None | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_update_payload(data: object) -> None | Unset | str: + def _parse_update_payload(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) update_payload = _parse_update_payload(d.pop("update_payload", UNSET)) 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 da42dd97..7ce38be3 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params_integration.py +++ b/rootly_sdk/models/create_jira_subtask_task_params_integration.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateJiraSubtaskTaskParamsIntegration: """Specify integration id if you have more than one Jira instance Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 0c90227e..d6f31b38 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params_priority.py +++ b/rootly_sdk/models/create_jira_subtask_task_params_priority.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateJiraSubtaskTaskParamsPriority: """The priority id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 3bc133f4..5c9cbdd1 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params_status.py +++ b/rootly_sdk/models/create_jira_subtask_task_params_status.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateJiraSubtaskTaskParamsStatus: """The status id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 dd079064..a99b33ac 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateJiraSubtaskTaskParamsSubtaskIssueType: """The issue type id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_jira_subtask_task_params_task_type.py index 58653b0f..bd30d2dc 100644 --- a/rootly_sdk/models/create_jira_subtask_task_params_task_type.py +++ b/rootly_sdk/models/create_jira_subtask_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateJiraSubtaskTaskParamsTaskType = Literal["create_jira_subtask"] @@ -11,5 +11,5 @@ def check_create_jira_subtask_task_params_task_type(value: str | None) -> Create if value is None: return None if value in CREATE_JIRA_SUBTASK_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateJiraSubtaskTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_JIRA_SUBTASK_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/create_jsmops_alert_task_params.py b/rootly_sdk/models/create_jsmops_alert_task_params.py index 1d88845f..10b48b77 100644 --- a/rootly_sdk/models/create_jsmops_alert_task_params.py +++ b/rootly_sdk/models/create_jsmops_alert_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -29,74 +31,74 @@ class CreateJsmopsAlertTaskParams: """ Attributes: message (str): Message of the alert - 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 + 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 """ message: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: message = self.message - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - teams: Unset | list[dict[str, Any]] = UNSET + teams: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + users: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + schedules: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + escalations: list[dict[str, Any]] | Unset = 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: Unset | str = UNSET + priority: str | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority - details: None | Unset | str + details: None | str | Unset if isinstance(self.details, Unset): details = UNSET else: @@ -139,62 +141,70 @@ 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: Unset | CreateJsmopsAlertTaskParamsTaskType + task_type: CreateJsmopsAlertTaskParamsTaskType | Unset 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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - teams = [] _teams = d.pop("teams", UNSET) - for teams_item_data in _teams or []: - teams_item = CreateJsmopsAlertTaskParamsTeamsItem.from_dict(teams_item_data) + 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) - teams.append(teams_item) + teams.append(teams_item) - users = [] _users = d.pop("users", UNSET) - for users_item_data in _users or []: - users_item = CreateJsmopsAlertTaskParamsUsersItem.from_dict(users_item_data) + 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) - users.append(users_item) + users.append(users_item) - schedules = [] _schedules = d.pop("schedules", UNSET) - for schedules_item_data in _schedules or []: - schedules_item = CreateJsmopsAlertTaskParamsSchedulesItem.from_dict(schedules_item_data) + 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) - schedules.append(schedules_item) + schedules.append(schedules_item) - escalations = [] _escalations = d.pop("escalations", UNSET) - for escalations_item_data in _escalations or []: - escalations_item = CreateJsmopsAlertTaskParamsEscalationsItem.from_dict(escalations_item_data) + 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) - escalations.append(escalations_item) + escalations.append(escalations_item) _priority = d.pop("priority", UNSET) - priority: Unset | CreateJsmopsAlertTaskParamsPriority + priority: CreateJsmopsAlertTaskParamsPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: priority = check_create_jsmops_alert_task_params_priority(_priority) - def _parse_details(data: object) -> None | Unset | str: + def _parse_details(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 c1b887fa..933c82bf 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateJsmopsAlertTaskParamsEscalationsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_priority.py b/rootly_sdk/models/create_jsmops_alert_task_params_priority.py index 46747de0..20b6e84b 100644 --- a/rootly_sdk/models/create_jsmops_alert_task_params_priority.py +++ b/rootly_sdk/models/create_jsmops_alert_task_params_priority.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateJsmopsAlertTaskParamsPriority = Literal["auto", "P1", "P2", "P3", "P4", "P5"] @@ -16,5 +16,5 @@ def check_create_jsmops_alert_task_params_priority(value: str | None) -> CreateJ if value is None: return None if value in CREATE_JSMOPS_ALERT_TASK_PARAMS_PRIORITY_VALUES: - return cast(CreateJsmopsAlertTaskParamsPriority, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_JSMOPS_ALERT_TASK_PARAMS_PRIORITY_VALUES!r}") 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 d17d7e27..0ab25c3f 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateJsmopsAlertTaskParamsSchedulesItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_jsmops_alert_task_params_task_type.py index b8902253..4eba6e71 100644 --- a/rootly_sdk/models/create_jsmops_alert_task_params_task_type.py +++ b/rootly_sdk/models/create_jsmops_alert_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateJsmopsAlertTaskParamsTaskType = Literal["create_jsmops_alert"] @@ -11,5 +11,5 @@ def check_create_jsmops_alert_task_params_task_type(value: str | None) -> Create if value is None: return None if value in CREATE_JSMOPS_ALERT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateJsmopsAlertTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_JSMOPS_ALERT_TASK_PARAMS_TASK_TYPE_VALUES!r}") 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 8b6fd019..802141da 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateJsmopsAlertTaskParamsTeamsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 32e54d1d..92d7c0a2 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateJsmopsAlertTaskParamsUsersItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 85aa5e0e..7bd6f8ce 100644 --- a/rootly_sdk/models/create_linear_issue_comment_task_params.py +++ b/rootly_sdk/models/create_linear_issue_comment_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -19,12 +21,12 @@ class CreateLinearIssueCommentTaskParams: Attributes: issue_id (str): The issue id body (str): The issue description - task_type (Union[Unset, CreateLinearIssueCommentTaskParamsTaskType]): + task_type (CreateLinearIssueCommentTaskParamsTaskType | Unset): """ issue_id: str body: str - task_type: Unset | CreateLinearIssueCommentTaskParamsTaskType = UNSET + task_type: CreateLinearIssueCommentTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: body = self.body - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -57,7 +59,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: Unset | CreateLinearIssueCommentTaskParamsTaskType + task_type: CreateLinearIssueCommentTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_linear_issue_comment_task_params_task_type.py b/rootly_sdk/models/create_linear_issue_comment_task_params_task_type.py index 5a7edb37..26515d42 100644 --- a/rootly_sdk/models/create_linear_issue_comment_task_params_task_type.py +++ b/rootly_sdk/models/create_linear_issue_comment_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateLinearIssueCommentTaskParamsTaskType = Literal["create_linear_issue_comment"] @@ -13,7 +13,7 @@ def check_create_linear_issue_comment_task_params_task_type( if value is None: return None if value in CREATE_LINEAR_ISSUE_COMMENT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateLinearIssueCommentTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_LINEAR_ISSUE_COMMENT_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_linear_issue_task_params.py b/rootly_sdk/models/create_linear_issue_task_params.py index ac4336dc..62cb0c4c 100644 --- a/rootly_sdk/models/create_linear_issue_task_params.py +++ b/rootly_sdk/models/create_linear_issue_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,26 +30,26 @@ 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 (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 + 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 valid JSON """ title: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -57,30 +59,30 @@ def to_dict(self) -> dict[str, Any]: state = self.state.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - project: Unset | dict[str, Any] = UNSET + project: dict[str, Any] | Unset = UNSET if not isinstance(self.project, Unset): project = self.project.to_dict() - labels: Unset | list[dict[str, Any]] = UNSET + labels: list[dict[str, Any]] | Unset = 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: Unset | dict[str, Any] = UNSET + priority: dict[str, Any] | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() assign_user_email = self.assign_user_email - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -128,7 +130,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: Unset | CreateLinearIssueTaskParamsTaskType + task_type: CreateLinearIssueTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -137,21 +139,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _project = d.pop("project", UNSET) - project: Unset | CreateLinearIssueTaskParamsProject + project: CreateLinearIssueTaskParamsProject | Unset if isinstance(_project, Unset): project = UNSET else: project = CreateLinearIssueTaskParamsProject.from_dict(_project) - labels = [] _labels = d.pop("labels", UNSET) - for labels_item_data in _labels or []: - labels_item = CreateLinearIssueTaskParamsLabelsItem.from_dict(labels_item_data) + 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) - labels.append(labels_item) + labels.append(labels_item) _priority = d.pop("priority", UNSET) - priority: Unset | CreateLinearIssueTaskParamsPriority + priority: CreateLinearIssueTaskParamsPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: @@ -159,12 +163,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 | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 7caa9c5c..d2c67738 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateLinearIssueTaskParamsLabelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 fd8fe0cb..d281895e 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_priority.py +++ b/rootly_sdk/models/create_linear_issue_task_params_priority.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateLinearIssueTaskParamsPriority: """The priority id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 44dcbb73..02bf0115 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_project.py +++ b/rootly_sdk/models/create_linear_issue_task_params_project.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateLinearIssueTaskParamsProject: """The project id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 8b9b28bb..4bbea5fa 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_state.py +++ b/rootly_sdk/models/create_linear_issue_task_params_state.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateLinearIssueTaskParamsState: """The state id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_linear_issue_task_params_task_type.py index e0825f4d..008e0af0 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_task_type.py +++ b/rootly_sdk/models/create_linear_issue_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateLinearIssueTaskParamsTaskType = Literal["create_linear_issue"] @@ -11,5 +11,5 @@ def check_create_linear_issue_task_params_task_type(value: str | None) -> Create if value is None: return None if value in CREATE_LINEAR_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateLinearIssueTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_LINEAR_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES!r}") 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 b87cee57..6a4aaa55 100644 --- a/rootly_sdk/models/create_linear_issue_task_params_team.py +++ b/rootly_sdk/models/create_linear_issue_task_params_team.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateLinearIssueTaskParamsTeam: """The team id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 62bf2363..d00066a0 100644 --- a/rootly_sdk/models/create_linear_subtask_issue_task_params.py +++ b/rootly_sdk/models/create_linear_subtask_issue_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,24 +30,24 @@ class CreateLinearSubtaskIssueTaskParams: parent_issue_id (str): The parent issue title (str): The issue title state (CreateLinearSubtaskIssueTaskParamsState): The state id and display name - 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 + 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 valid JSON """ parent_issue_id: str title: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -55,17 +57,17 @@ def to_dict(self) -> dict[str, Any]: state = self.state.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - priority: Unset | dict[str, Any] = UNSET + priority: dict[str, Any] | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - labels: Unset | list[dict[str, Any]] = UNSET + labels: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: @@ -74,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: assign_user_email = self.assign_user_email - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -120,7 +122,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: Unset | CreateLinearSubtaskIssueTaskParamsTaskType + task_type: CreateLinearSubtaskIssueTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -129,27 +131,29 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _priority = d.pop("priority", UNSET) - priority: Unset | CreateLinearSubtaskIssueTaskParamsPriority + priority: CreateLinearSubtaskIssueTaskParamsPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: priority = CreateLinearSubtaskIssueTaskParamsPriority.from_dict(_priority) - labels = [] _labels = d.pop("labels", UNSET) - for labels_item_data in _labels or []: - labels_item = CreateLinearSubtaskIssueTaskParamsLabelsItem.from_dict(labels_item_data) + 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) - 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 | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 21339bcd..ca04ec13 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateLinearSubtaskIssueTaskParamsLabelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 93f710e2..d605d101 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateLinearSubtaskIssueTaskParamsPriority: """The priority id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 1a12777e..8c1e27be 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateLinearSubtaskIssueTaskParamsState: """The state id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_linear_subtask_issue_task_params_task_type.py index fef263c9..929fb209 100644 --- a/rootly_sdk/models/create_linear_subtask_issue_task_params_task_type.py +++ b/rootly_sdk/models/create_linear_subtask_issue_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateLinearSubtaskIssueTaskParamsTaskType = Literal["create_linear_subtask_issue"] @@ -13,7 +13,7 @@ def check_create_linear_subtask_issue_task_params_task_type( if value is None: return None if value in CREATE_LINEAR_SUBTASK_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateLinearSubtaskIssueTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_LINEAR_SUBTASK_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_meeting_recording_platform.py b/rootly_sdk/models/create_meeting_recording_platform.py index c8072539..a022a4e9 100644 --- a/rootly_sdk/models/create_meeting_recording_platform.py +++ b/rootly_sdk/models/create_meeting_recording_platform.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateMeetingRecordingPlatform = Literal["google_meet", "microsoft_teams", "webex", "zoom"] @@ -14,5 +14,5 @@ def check_create_meeting_recording_platform(value: str | None) -> CreateMeetingR if value is None: return None if value in CREATE_MEETING_RECORDING_PLATFORM_VALUES: - return cast(CreateMeetingRecordingPlatform, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_MEETING_RECORDING_PLATFORM_VALUES!r}") 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 f991a56e..3edd8002 100644 --- a/rootly_sdk/models/create_microsoft_teams_channel_task_params.py +++ b/rootly_sdk/models/create_microsoft_teams_channel_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,16 +29,16 @@ class CreateMicrosoftTeamsChannelTaskParams: Attributes: team (CreateMicrosoftTeamsChannelTaskParamsTeam): title (str): Microsoft Team channel title - task_type (Union[Unset, CreateMicrosoftTeamsChannelTaskParamsTaskType]): - description (Union[Unset, str]): Microsoft Team channel description - private (Union[Unset, CreateMicrosoftTeamsChannelTaskParamsPrivate]): Default: 'auto'. + task_type (CreateMicrosoftTeamsChannelTaskParamsTaskType | Unset): + description (str | Unset): Microsoft Team channel description + private (CreateMicrosoftTeamsChannelTaskParamsPrivate | Unset): Default: 'auto'. """ - team: "CreateMicrosoftTeamsChannelTaskParamsTeam" + team: CreateMicrosoftTeamsChannelTaskParamsTeam title: str - task_type: Unset | CreateMicrosoftTeamsChannelTaskParamsTaskType = UNSET - description: Unset | str = UNSET - private: Unset | CreateMicrosoftTeamsChannelTaskParamsPrivate = "auto" + task_type: CreateMicrosoftTeamsChannelTaskParamsTaskType | Unset = UNSET + description: str | Unset = UNSET + private: CreateMicrosoftTeamsChannelTaskParamsPrivate | Unset = "auto" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +46,13 @@ def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - private: Unset | str = UNSET + private: str | Unset = UNSET if not isinstance(self.private, Unset): private = self.private @@ -81,7 +83,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: Unset | CreateMicrosoftTeamsChannelTaskParamsTaskType + task_type: CreateMicrosoftTeamsChannelTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -90,7 +92,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _private = d.pop("private", UNSET) - private: Unset | CreateMicrosoftTeamsChannelTaskParamsPrivate + private: CreateMicrosoftTeamsChannelTaskParamsPrivate | Unset if isinstance(_private, Unset): private = UNSET else: diff --git a/rootly_sdk/models/create_microsoft_teams_channel_task_params_private.py b/rootly_sdk/models/create_microsoft_teams_channel_task_params_private.py index 007f3e49..ab9cea2a 100644 --- a/rootly_sdk/models/create_microsoft_teams_channel_task_params_private.py +++ b/rootly_sdk/models/create_microsoft_teams_channel_task_params_private.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateMicrosoftTeamsChannelTaskParamsPrivate = Literal["auto", "false", "true"] @@ -15,7 +15,7 @@ def check_create_microsoft_teams_channel_task_params_private( if value is None: return None if value in CREATE_MICROSOFT_TEAMS_CHANNEL_TASK_PARAMS_PRIVATE_VALUES: - return cast(CreateMicrosoftTeamsChannelTaskParamsPrivate, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_MICROSOFT_TEAMS_CHANNEL_TASK_PARAMS_PRIVATE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_microsoft_teams_channel_task_params_task_type.py b/rootly_sdk/models/create_microsoft_teams_channel_task_params_task_type.py index 9f583b8a..24d158e1 100644 --- a/rootly_sdk/models/create_microsoft_teams_channel_task_params_task_type.py +++ b/rootly_sdk/models/create_microsoft_teams_channel_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateMicrosoftTeamsChannelTaskParamsTaskType = Literal["create_microsoft_teams_channel"] @@ -13,7 +13,7 @@ def check_create_microsoft_teams_channel_task_params_task_type( if value is None: return None if value in CREATE_MICROSOFT_TEAMS_CHANNEL_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateMicrosoftTeamsChannelTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_MICROSOFT_TEAMS_CHANNEL_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 32f51411..3d7128e5 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateMicrosoftTeamsChannelTaskParamsTeam: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 b02e3b4a..00563ed0 100644 --- a/rootly_sdk/models/create_microsoft_teams_chat_task_params.py +++ b/rootly_sdk/models/create_microsoft_teams_chat_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -27,16 +29,16 @@ class CreateMicrosoftTeamsChatTaskParams: """ Attributes: - 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]): 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"] - task_type: Unset | CreateMicrosoftTeamsChatTaskParamsTaskType = UNSET - topic: None | Unset | str = UNSET - chat_type: Unset | CreateMicrosoftTeamsChatTaskParamsChatType = "group" + members: list[CreateMicrosoftTeamsChatTaskParamsMembersItem] + task_type: CreateMicrosoftTeamsChatTaskParamsTaskType | Unset = UNSET + topic: None | str | Unset = UNSET + chat_type: CreateMicrosoftTeamsChatTaskParamsChatType | Unset = "group" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,17 +47,17 @@ def to_dict(self) -> dict[str, Any]: members_item = members_item_data.to_dict() members.append(members_item) - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - topic: None | Unset | str + topic: None | str | Unset if isinstance(self.topic, Unset): topic = UNSET else: topic = self.topic - chat_type: Unset | str = UNSET + chat_type: str | Unset = UNSET if not isinstance(self.chat_type, Unset): chat_type = self.chat_type @@ -90,23 +92,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: Unset | CreateMicrosoftTeamsChatTaskParamsTaskType + task_type: CreateMicrosoftTeamsChatTaskParamsTaskType | Unset 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 | Unset | str: + def _parse_topic(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) topic = _parse_topic(d.pop("topic", UNSET)) _chat_type = d.pop("chat_type", UNSET) - chat_type: Unset | CreateMicrosoftTeamsChatTaskParamsChatType + chat_type: CreateMicrosoftTeamsChatTaskParamsChatType | Unset if isinstance(_chat_type, Unset): chat_type = UNSET else: diff --git a/rootly_sdk/models/create_microsoft_teams_chat_task_params_chat_type.py b/rootly_sdk/models/create_microsoft_teams_chat_task_params_chat_type.py index ade8de9a..2f59354b 100644 --- a/rootly_sdk/models/create_microsoft_teams_chat_task_params_chat_type.py +++ b/rootly_sdk/models/create_microsoft_teams_chat_task_params_chat_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateMicrosoftTeamsChatTaskParamsChatType = Literal["group", "oneOnOne"] @@ -14,7 +14,7 @@ def check_create_microsoft_teams_chat_task_params_chat_type( if value is None: return None if value in CREATE_MICROSOFT_TEAMS_CHAT_TASK_PARAMS_CHAT_TYPE_VALUES: - return cast(CreateMicrosoftTeamsChatTaskParamsChatType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_MICROSOFT_TEAMS_CHAT_TASK_PARAMS_CHAT_TYPE_VALUES!r}" ) 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 5c2b3733..714d243e 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateMicrosoftTeamsChatTaskParamsMembersItem: """ Attributes: - email (Union[Unset, str]): - name (Union[Unset, str]): + email (str | Unset): + name (str | Unset): """ - email: Unset | str = UNSET - name: Unset | str = UNSET + email: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_microsoft_teams_chat_task_params_task_type.py index 5598ad12..34a74977 100644 --- a/rootly_sdk/models/create_microsoft_teams_chat_task_params_task_type.py +++ b/rootly_sdk/models/create_microsoft_teams_chat_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateMicrosoftTeamsChatTaskParamsTaskType = Literal["create_microsoft_teams_chat"] @@ -13,7 +13,7 @@ def check_create_microsoft_teams_chat_task_params_task_type( if value is None: return None if value in CREATE_MICROSOFT_TEAMS_CHAT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateMicrosoftTeamsChatTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_MICROSOFT_TEAMS_CHAT_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 af680a85..96f5022e 100644 --- a/rootly_sdk/models/create_microsoft_teams_meeting_task_params.py +++ b/rootly_sdk/models/create_microsoft_teams_meeting_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,22 +31,22 @@ class CreateMicrosoftTeamsMeetingTaskParams: Attributes: name (str): The meeting name subject (str): The meeting subject - 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']]): + 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): """ name: str subject: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -52,19 +54,19 @@ def to_dict(self) -> dict[str, Any]: subject = self.subject - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type record_meeting = self.record_meeting - recording_mode: Unset | str = UNSET + recording_mode: str | Unset = 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: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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: @@ -104,7 +106,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: Unset | CreateMicrosoftTeamsMeetingTaskParamsTaskType + task_type: CreateMicrosoftTeamsMeetingTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -113,7 +115,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: Unset | CreateMicrosoftTeamsMeetingTaskParamsRecordingMode + recording_mode: CreateMicrosoftTeamsMeetingTaskParamsRecordingMode | Unset if isinstance(_recording_mode, Unset): recording_mode = UNSET else: @@ -121,14 +123,16 @@ 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) - 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: 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 + ) - 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 7e910bdb..dc99a191 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateMicrosoftTeamsMeetingTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_recording_mode.py b/rootly_sdk/models/create_microsoft_teams_meeting_task_params_recording_mode.py index d703c032..7cc8210a 100644 --- a/rootly_sdk/models/create_microsoft_teams_meeting_task_params_recording_mode.py +++ b/rootly_sdk/models/create_microsoft_teams_meeting_task_params_recording_mode.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateMicrosoftTeamsMeetingTaskParamsRecordingMode = Literal[ "audio_only", "gallery_view", "gallery_view_v2", "speaker_view" @@ -20,7 +20,7 @@ def check_create_microsoft_teams_meeting_task_params_recording_mode( if value is None: return None if value in CREATE_MICROSOFT_TEAMS_MEETING_TASK_PARAMS_RECORDING_MODE_VALUES: - return cast(CreateMicrosoftTeamsMeetingTaskParamsRecordingMode, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_MICROSOFT_TEAMS_MEETING_TASK_PARAMS_RECORDING_MODE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_microsoft_teams_meeting_task_params_task_type.py b/rootly_sdk/models/create_microsoft_teams_meeting_task_params_task_type.py index f56cc7f6..a458d13f 100644 --- a/rootly_sdk/models/create_microsoft_teams_meeting_task_params_task_type.py +++ b/rootly_sdk/models/create_microsoft_teams_meeting_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateMicrosoftTeamsMeetingTaskParamsTaskType = Literal["create_microsoft_teams_meeting"] @@ -13,7 +13,7 @@ def check_create_microsoft_teams_meeting_task_params_task_type( if value is None: return None if value in CREATE_MICROSOFT_TEAMS_MEETING_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateMicrosoftTeamsMeetingTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_MICROSOFT_TEAMS_MEETING_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 efd67bc9..98d6bef7 100644 --- a/rootly_sdk/models/create_mistral_chat_completion_task_params.py +++ b/rootly_sdk/models/create_mistral_chat_completion_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,20 +25,20 @@ class CreateMistralChatCompletionTaskParams: Attributes: model (CreateMistralChatCompletionTaskParamsModel): The Mistral model. eg: mistral-large-latest prompt (str): The prompt to send to Mistral - 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) + 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) """ - model: "CreateMistralChatCompletionTaskParamsModel" + model: CreateMistralChatCompletionTaskParamsModel prompt: str - task_type: Unset | CreateMistralChatCompletionTaskParamsTaskType = UNSET - system_prompt: Unset | str = UNSET - temperature: Unset | float = UNSET - max_tokens: Unset | int = UNSET - top_p: Unset | float = UNSET + task_type: CreateMistralChatCompletionTaskParamsTaskType | Unset = UNSET + system_prompt: str | Unset = UNSET + temperature: float | Unset = UNSET + max_tokens: int | Unset = UNSET + top_p: float | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: prompt = self.prompt - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -87,7 +89,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: Unset | CreateMistralChatCompletionTaskParamsTaskType + task_type: CreateMistralChatCompletionTaskParamsTaskType | Unset 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 aa4b56d8..7cda8fef 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateMistralChatCompletionTaskParamsModel: """The Mistral model. eg: mistral-large-latest Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_mistral_chat_completion_task_params_task_type.py index 6a67504b..cfdea0cb 100644 --- a/rootly_sdk/models/create_mistral_chat_completion_task_params_task_type.py +++ b/rootly_sdk/models/create_mistral_chat_completion_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateMistralChatCompletionTaskParamsTaskType = Literal["create_mistral_chat_completion_task"] @@ -13,7 +13,7 @@ def check_create_mistral_chat_completion_task_params_task_type( if value is None: return None if value in CREATE_MISTRAL_CHAT_COMPLETION_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateMistralChatCompletionTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_MISTRAL_CHAT_COMPLETION_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_motion_task_task_params.py b/rootly_sdk/models/create_motion_task_task_params.py index 287d06ef..2abddc33 100644 --- a/rootly_sdk/models/create_motion_task_task_params.py +++ b/rootly_sdk/models/create_motion_task_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,26 +28,26 @@ class CreateMotionTaskTaskParams: Attributes: workspace (CreateMotionTaskTaskParamsWorkspace): title (str): The task title - 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 + task_type (CreateMotionTaskTaskParamsTaskType | Unset): + project (CreateMotionTaskTaskParamsProject | Unset): + status (CreateMotionTaskTaskParamsStatus | Unset): + description (str | Unset): The task description + labels (str | Unset): The task labels + 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 """ - workspace: "CreateMotionTaskTaskParamsWorkspace" + workspace: CreateMotionTaskTaskParamsWorkspace title: str - 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 + task_type: CreateMotionTaskTaskParamsTaskType | Unset = UNSET + project: CreateMotionTaskTaskParamsProject | Unset = UNSET + status: CreateMotionTaskTaskParamsStatus | Unset = UNSET + description: str | Unset = UNSET + labels: str | Unset = UNSET + priority: CreateMotionTaskTaskParamsPriority | Unset = UNSET + duration: str | Unset = UNSET + due_date: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -53,15 +55,15 @@ def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - project: Unset | dict[str, Any] = UNSET + project: dict[str, Any] | Unset = UNSET if not isinstance(self.project, Unset): project = self.project.to_dict() - status: Unset | dict[str, Any] = UNSET + status: dict[str, Any] | Unset = UNSET if not isinstance(self.status, Unset): status = self.status.to_dict() @@ -69,7 +71,7 @@ def to_dict(self) -> dict[str, Any]: labels = self.labels - priority: Unset | dict[str, Any] = UNSET + priority: dict[str, Any] | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() @@ -117,21 +119,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: Unset | CreateMotionTaskTaskParamsTaskType + task_type: CreateMotionTaskTaskParamsTaskType | Unset 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: Unset | CreateMotionTaskTaskParamsProject + project: CreateMotionTaskTaskParamsProject | Unset if isinstance(_project, Unset): project = UNSET else: project = CreateMotionTaskTaskParamsProject.from_dict(_project) _status = d.pop("status", UNSET) - status: Unset | CreateMotionTaskTaskParamsStatus + status: CreateMotionTaskTaskParamsStatus | Unset if isinstance(_status, Unset): status = UNSET else: @@ -142,7 +144,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: labels = d.pop("labels", UNSET) _priority = d.pop("priority", UNSET) - priority: Unset | CreateMotionTaskTaskParamsPriority + priority: CreateMotionTaskTaskParamsPriority | Unset 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 e8a31af7..493c01f5 100644 --- a/rootly_sdk/models/create_motion_task_task_params_priority.py +++ b/rootly_sdk/models/create_motion_task_task_params_priority.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateMotionTaskTaskParamsPriority: """The priority id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 a76a9455..4843b381 100644 --- a/rootly_sdk/models/create_motion_task_task_params_project.py +++ b/rootly_sdk/models/create_motion_task_task_params_project.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateMotionTaskTaskParamsProject: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 43522fa2..97abb0ea 100644 --- a/rootly_sdk/models/create_motion_task_task_params_status.py +++ b/rootly_sdk/models/create_motion_task_task_params_status.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateMotionTaskTaskParamsStatus: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_motion_task_task_params_task_type.py index d12dedc2..6f38860f 100644 --- a/rootly_sdk/models/create_motion_task_task_params_task_type.py +++ b/rootly_sdk/models/create_motion_task_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateMotionTaskTaskParamsTaskType = Literal["create_motion_task"] @@ -11,5 +11,5 @@ def check_create_motion_task_task_params_task_type(value: str | None) -> CreateM if value is None: return None if value in CREATE_MOTION_TASK_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateMotionTaskTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_MOTION_TASK_TASK_PARAMS_TASK_TYPE_VALUES!r}") 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 ff425137..13cf3220 100644 --- a/rootly_sdk/models/create_motion_task_task_params_workspace.py +++ b/rootly_sdk/models/create_motion_task_task_params_workspace.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateMotionTaskTaskParamsWorkspace: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 28bae0df..e07077d6 100644 --- a/rootly_sdk/models/create_notion_page_task_params.py +++ b/rootly_sdk/models/create_notion_page_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,23 +25,23 @@ class CreateNotionPageTaskParams: Attributes: title (str): The Notion page title parent_page (CreateNotionPageTaskParamsParentPage): The parent page id and display name - 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]): + 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): """ title: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -47,7 +49,7 @@ def to_dict(self) -> dict[str, Any]: parent_page = self.parent_page.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -94,7 +96,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: Unset | CreateNotionPageTaskParamsTaskType + task_type: CreateNotionPageTaskParamsTaskType | Unset 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 21c4244a..08a6d60c 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateNotionPageTaskParamsParentPage: """The parent page id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_notion_page_task_params_task_type.py index b0bd9f3e..12a0accb 100644 --- a/rootly_sdk/models/create_notion_page_task_params_task_type.py +++ b/rootly_sdk/models/create_notion_page_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateNotionPageTaskParamsTaskType = Literal["create_notion_page"] @@ -11,5 +11,5 @@ def check_create_notion_page_task_params_task_type(value: str | None) -> CreateN if value is None: return None if value in CREATE_NOTION_PAGE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateNotionPageTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_NOTION_PAGE_TASK_PARAMS_TASK_TYPE_VALUES!r}") 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 a917e34d..03ea154c 100644 --- a/rootly_sdk/models/create_openai_chat_completion_task_params.py +++ b/rootly_sdk/models/create_openai_chat_completion_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -31,26 +33,26 @@ class CreateOpenaiChatCompletionTaskParams: Attributes: model (CreateOpenaiChatCompletionTaskParamsModel): The OpenAI model. eg: gpt-5-nano prompt (str): The prompt to send to OpenAI - 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 + 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 performed by the model for GPT-5 and o-series models """ - model: "CreateOpenaiChatCompletionTaskParamsModel" + model: CreateOpenaiChatCompletionTaskParamsModel prompt: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -58,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: prompt = self.prompt - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,11 +72,11 @@ def to_dict(self) -> dict[str, Any]: top_p = self.top_p - reasoning_effort: Unset | str = UNSET + reasoning_effort: str | Unset = UNSET if not isinstance(self.reasoning_effort, Unset): reasoning_effort = self.reasoning_effort - reasoning_summary: Unset | str = UNSET + reasoning_summary: str | Unset = UNSET if not isinstance(self.reasoning_summary, Unset): reasoning_summary = self.reasoning_summary @@ -113,7 +115,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: Unset | CreateOpenaiChatCompletionTaskParamsTaskType + task_type: CreateOpenaiChatCompletionTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -128,14 +130,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: Unset | CreateOpenaiChatCompletionTaskParamsReasoningEffort + reasoning_effort: CreateOpenaiChatCompletionTaskParamsReasoningEffort | Unset 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: Unset | CreateOpenaiChatCompletionTaskParamsReasoningSummary + reasoning_summary: CreateOpenaiChatCompletionTaskParamsReasoningSummary | Unset 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 9e40d263..927f4f61 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateOpenaiChatCompletionTaskParamsModel: """The OpenAI model. eg: gpt-5-nano Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_reasoning_effort.py b/rootly_sdk/models/create_openai_chat_completion_task_params_reasoning_effort.py index 7b7abdcf..9edad239 100644 --- a/rootly_sdk/models/create_openai_chat_completion_task_params_reasoning_effort.py +++ b/rootly_sdk/models/create_openai_chat_completion_task_params_reasoning_effort.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateOpenaiChatCompletionTaskParamsReasoningEffort = Literal["high", "low", "medium", "minimal"] @@ -18,7 +18,7 @@ def check_create_openai_chat_completion_task_params_reasoning_effort( if value is None: return None if value in CREATE_OPENAI_CHAT_COMPLETION_TASK_PARAMS_REASONING_EFFORT_VALUES: - return cast(CreateOpenaiChatCompletionTaskParamsReasoningEffort, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_OPENAI_CHAT_COMPLETION_TASK_PARAMS_REASONING_EFFORT_VALUES!r}" ) diff --git a/rootly_sdk/models/create_openai_chat_completion_task_params_reasoning_summary.py b/rootly_sdk/models/create_openai_chat_completion_task_params_reasoning_summary.py index 3a26f2ed..7efb3d03 100644 --- a/rootly_sdk/models/create_openai_chat_completion_task_params_reasoning_summary.py +++ b/rootly_sdk/models/create_openai_chat_completion_task_params_reasoning_summary.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateOpenaiChatCompletionTaskParamsReasoningSummary = Literal["auto", "concise", "detailed"] @@ -17,7 +17,7 @@ def check_create_openai_chat_completion_task_params_reasoning_summary( if value is None: return None if value in CREATE_OPENAI_CHAT_COMPLETION_TASK_PARAMS_REASONING_SUMMARY_VALUES: - return cast(CreateOpenaiChatCompletionTaskParamsReasoningSummary, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_OPENAI_CHAT_COMPLETION_TASK_PARAMS_REASONING_SUMMARY_VALUES!r}" ) diff --git a/rootly_sdk/models/create_openai_chat_completion_task_params_task_type.py b/rootly_sdk/models/create_openai_chat_completion_task_params_task_type.py index d648062c..be9ef2a8 100644 --- a/rootly_sdk/models/create_openai_chat_completion_task_params_task_type.py +++ b/rootly_sdk/models/create_openai_chat_completion_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateOpenaiChatCompletionTaskParamsTaskType = Literal["openai_chat_completion"] @@ -13,7 +13,7 @@ def check_create_openai_chat_completion_task_params_task_type( if value is None: return None if value in CREATE_OPENAI_CHAT_COMPLETION_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateOpenaiChatCompletionTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_OPENAI_CHAT_COMPLETION_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_opsgenie_alert_task_params.py b/rootly_sdk/models/create_opsgenie_alert_task_params.py index fa9ee991..47f1806c 100644 --- a/rootly_sdk/models/create_opsgenie_alert_task_params.py +++ b/rootly_sdk/models/create_opsgenie_alert_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -29,70 +31,70 @@ class CreateOpsgenieAlertTaskParams: """ Attributes: message (str): Message of the alert - task_type (Union[Unset, CreateOpsgenieAlertTaskParamsTaskType]): - description (Union[Unset, str]): Description field of the alert that is generally used to provide a detailed + task_type (CreateOpsgenieAlertTaskParamsTaskType | Unset): + description (str | Unset): Description field of the alert that is generally used to provide a detailed information about the alert - 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 + 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 """ message: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: message = self.message - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - teams: Unset | list[dict[str, Any]] = UNSET + teams: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + users: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + schedules: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + escalations: list[dict[str, Any]] | Unset = 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: Unset | str = UNSET + priority: str | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority - details: None | Unset | str + details: None | str | Unset if isinstance(self.details, Unset): details = UNSET else: @@ -137,7 +139,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: Unset | CreateOpsgenieAlertTaskParamsTaskType + task_type: CreateOpsgenieAlertTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -145,47 +147,55 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) - teams = [] _teams = d.pop("teams", UNSET) - for teams_item_data in _teams or []: - teams_item = CreateOpsgenieAlertTaskParamsTeamsItem.from_dict(teams_item_data) + 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) - teams.append(teams_item) + teams.append(teams_item) - users = [] _users = d.pop("users", UNSET) - for users_item_data in _users or []: - users_item = CreateOpsgenieAlertTaskParamsUsersItem.from_dict(users_item_data) + 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) - users.append(users_item) + users.append(users_item) - schedules = [] _schedules = d.pop("schedules", UNSET) - for schedules_item_data in _schedules or []: - schedules_item = CreateOpsgenieAlertTaskParamsSchedulesItem.from_dict(schedules_item_data) + 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) - schedules.append(schedules_item) + schedules.append(schedules_item) - escalations = [] _escalations = d.pop("escalations", UNSET) - for escalations_item_data in _escalations or []: - escalations_item = CreateOpsgenieAlertTaskParamsEscalationsItem.from_dict(escalations_item_data) + 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) - escalations.append(escalations_item) + escalations.append(escalations_item) _priority = d.pop("priority", UNSET) - priority: Unset | CreateOpsgenieAlertTaskParamsPriority + priority: CreateOpsgenieAlertTaskParamsPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: priority = check_create_opsgenie_alert_task_params_priority(_priority) - def _parse_details(data: object) -> None | Unset | str: + def _parse_details(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 23830de1..57756e03 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateOpsgenieAlertTaskParamsEscalationsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_priority.py b/rootly_sdk/models/create_opsgenie_alert_task_params_priority.py index 0a98f510..ab815f96 100644 --- a/rootly_sdk/models/create_opsgenie_alert_task_params_priority.py +++ b/rootly_sdk/models/create_opsgenie_alert_task_params_priority.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateOpsgenieAlertTaskParamsPriority = Literal["auto", "P1", "P2", "P3", "P4", "P5"] @@ -16,7 +16,7 @@ def check_create_opsgenie_alert_task_params_priority(value: str | None) -> Creat if value is None: return None if value in CREATE_OPSGENIE_ALERT_TASK_PARAMS_PRIORITY_VALUES: - return cast(CreateOpsgenieAlertTaskParamsPriority, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_OPSGENIE_ALERT_TASK_PARAMS_PRIORITY_VALUES!r}" ) 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 8e712954..47a772c1 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateOpsgenieAlertTaskParamsSchedulesItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_opsgenie_alert_task_params_task_type.py index cd639b6c..2a222b26 100644 --- a/rootly_sdk/models/create_opsgenie_alert_task_params_task_type.py +++ b/rootly_sdk/models/create_opsgenie_alert_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateOpsgenieAlertTaskParamsTaskType = Literal["create_opsgenie_alert"] @@ -13,7 +13,7 @@ def check_create_opsgenie_alert_task_params_task_type( if value is None: return None if value in CREATE_OPSGENIE_ALERT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateOpsgenieAlertTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_OPSGENIE_ALERT_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 9da5b53b..4a3bbc40 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateOpsgenieAlertTaskParamsTeamsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 f631ad3d..940b0635 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateOpsgenieAlertTaskParamsUsersItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 ff18c799..585ca1e6 100644 --- a/rootly_sdk/models/create_outlook_event_task_params.py +++ b/rootly_sdk/models/create_outlook_event_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -30,28 +32,28 @@ 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 (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']]): + 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): """ - calendar: "CreateOutlookEventTaskParamsCalendar" + calendar: CreateOutlookEventTaskParamsCalendar days_until_meeting: int time_of_meeting: str meeting_duration: str summary: str description: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -67,15 +69,15 @@ def to_dict(self) -> dict[str, Any]: description = self.description - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - attendees: Unset | list[str] = UNSET + attendees: list[str] | Unset = UNSET if not isinstance(self.attendees, Unset): attendees = self.attendees - time_zone: None | Unset | str + time_zone: None | str | Unset if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -87,7 +89,7 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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: @@ -144,7 +146,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: Unset | CreateOutlookEventTaskParamsTaskType + task_type: CreateOutlookEventTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -152,12 +154,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 | Unset | str: + def _parse_time_zone(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) @@ -167,14 +169,16 @@ def _parse_time_zone(data: object) -> None | Unset | 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) - 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: 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 + ) - 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 5f79c9ee..887dfaf4 100644 --- a/rootly_sdk/models/create_outlook_event_task_params_calendar.py +++ b/rootly_sdk/models/create_outlook_event_task_params_calendar.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateOutlookEventTaskParamsCalendar: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 2349ee5e..fefe788e 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateOutlookEventTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_outlook_event_task_params_task_type.py index a16110bb..d6ca4ff3 100644 --- a/rootly_sdk/models/create_outlook_event_task_params_task_type.py +++ b/rootly_sdk/models/create_outlook_event_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateOutlookEventTaskParamsTaskType = Literal["create_outlook_event"] @@ -11,7 +11,7 @@ def check_create_outlook_event_task_params_task_type(value: str | None) -> Creat if value is None: return None if value in CREATE_OUTLOOK_EVENT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateOutlookEventTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_OUTLOOK_EVENT_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 f836a566..f40fb4aa 100644 --- a/rootly_sdk/models/create_pagerduty_status_update_task_params.py +++ b/rootly_sdk/models/create_pagerduty_status_update_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -19,12 +21,12 @@ class CreatePagerdutyStatusUpdateTaskParams: Attributes: pagerduty_incident_id (str): PagerDuty incident id message (str): A message outlining the incident's resolution in PagerDuty - task_type (Union[Unset, CreatePagerdutyStatusUpdateTaskParamsTaskType]): + task_type (CreatePagerdutyStatusUpdateTaskParamsTaskType | Unset): """ pagerduty_incident_id: str message: str - task_type: Unset | CreatePagerdutyStatusUpdateTaskParamsTaskType = UNSET + task_type: CreatePagerdutyStatusUpdateTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: message = self.message - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -57,7 +59,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: Unset | CreatePagerdutyStatusUpdateTaskParamsTaskType + task_type: CreatePagerdutyStatusUpdateTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_pagerduty_status_update_task_params_task_type.py b/rootly_sdk/models/create_pagerduty_status_update_task_params_task_type.py index 2ab8fbd7..cf99a648 100644 --- a/rootly_sdk/models/create_pagerduty_status_update_task_params_task_type.py +++ b/rootly_sdk/models/create_pagerduty_status_update_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreatePagerdutyStatusUpdateTaskParamsTaskType = Literal["create_pagerduty_status_update"] @@ -13,7 +13,7 @@ def check_create_pagerduty_status_update_task_params_task_type( if value is None: return None if value in CREATE_PAGERDUTY_STATUS_UPDATE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreatePagerdutyStatusUpdateTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_PAGERDUTY_STATUS_UPDATE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_pagertree_alert_task_params.py b/rootly_sdk/models/create_pagertree_alert_task_params.py index 78a31a09..8ea30592 100644 --- a/rootly_sdk/models/create_pagertree_alert_task_params.py +++ b/rootly_sdk/models/create_pagertree_alert_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -30,28 +32,28 @@ class CreatePagertreeAlertTaskParams: """ Attributes: - 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): + 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: 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -59,22 +61,22 @@ def to_dict(self) -> dict[str, Any]: description = self.description - urgency: Unset | str = UNSET + urgency: str | Unset = UNSET if not isinstance(self.urgency, Unset): urgency = self.urgency - severity: Unset | str = UNSET + severity: str | Unset = UNSET if not isinstance(self.severity, Unset): severity = self.severity - teams: Unset | list[dict[str, Any]] = UNSET + teams: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + users: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: @@ -112,7 +114,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: Unset | CreatePagertreeAlertTaskParamsTaskType + task_type: CreatePagertreeAlertTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -123,32 +125,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _urgency = d.pop("urgency", UNSET) - urgency: Unset | CreatePagertreeAlertTaskParamsUrgency + urgency: CreatePagertreeAlertTaskParamsUrgency | Unset if isinstance(_urgency, Unset): urgency = UNSET else: urgency = check_create_pagertree_alert_task_params_urgency(_urgency) _severity = d.pop("severity", UNSET) - severity: Unset | CreatePagertreeAlertTaskParamsSeverity + severity: CreatePagertreeAlertTaskParamsSeverity | Unset if isinstance(_severity, Unset): severity = UNSET else: severity = check_create_pagertree_alert_task_params_severity(_severity) - teams = [] _teams = d.pop("teams", UNSET) - for teams_item_data in _teams or []: - teams_item = CreatePagertreeAlertTaskParamsTeamsItem.from_dict(teams_item_data) + 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) - teams.append(teams_item) + teams.append(teams_item) - users = [] _users = d.pop("users", UNSET) - for users_item_data in _users or []: - users_item = CreatePagertreeAlertTaskParamsUsersItem.from_dict(users_item_data) + 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) - users.append(users_item) + users.append(users_item) incident = d.pop("incident", UNSET) diff --git a/rootly_sdk/models/create_pagertree_alert_task_params_severity.py b/rootly_sdk/models/create_pagertree_alert_task_params_severity.py index 4722ecb5..03937815 100644 --- a/rootly_sdk/models/create_pagertree_alert_task_params_severity.py +++ b/rootly_sdk/models/create_pagertree_alert_task_params_severity.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreatePagertreeAlertTaskParamsSeverity = Literal["auto", "SEV-1", "SEV-2", "SEV-3", "SEV-4"] @@ -17,7 +17,7 @@ def check_create_pagertree_alert_task_params_severity( if value is None: return None if value in CREATE_PAGERTREE_ALERT_TASK_PARAMS_SEVERITY_VALUES: - return cast(CreatePagertreeAlertTaskParamsSeverity, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_PAGERTREE_ALERT_TASK_PARAMS_SEVERITY_VALUES!r}" ) diff --git a/rootly_sdk/models/create_pagertree_alert_task_params_task_type.py b/rootly_sdk/models/create_pagertree_alert_task_params_task_type.py index 151e873e..2a9383f8 100644 --- a/rootly_sdk/models/create_pagertree_alert_task_params_task_type.py +++ b/rootly_sdk/models/create_pagertree_alert_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreatePagertreeAlertTaskParamsTaskType = Literal["create_pagertree_alert"] @@ -13,7 +13,7 @@ def check_create_pagertree_alert_task_params_task_type( if value is None: return None if value in CREATE_PAGERTREE_ALERT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreatePagertreeAlertTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_PAGERTREE_ALERT_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 b863b3bb..5d81a118 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreatePagertreeAlertTaskParamsTeamsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_urgency.py b/rootly_sdk/models/create_pagertree_alert_task_params_urgency.py index e95a1003..e1f8f056 100644 --- a/rootly_sdk/models/create_pagertree_alert_task_params_urgency.py +++ b/rootly_sdk/models/create_pagertree_alert_task_params_urgency.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreatePagertreeAlertTaskParamsUrgency = Literal["auto", "critical", "high", "low", "medium"] @@ -15,7 +15,7 @@ def check_create_pagertree_alert_task_params_urgency(value: str | None) -> Creat if value is None: return None if value in CREATE_PAGERTREE_ALERT_TASK_PARAMS_URGENCY_VALUES: - return cast(CreatePagertreeAlertTaskParamsUrgency, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_PAGERTREE_ALERT_TASK_PARAMS_URGENCY_VALUES!r}" ) 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 2855febc..bfe6bbb0 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreatePagertreeAlertTaskParamsUsersItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 619a1f99..9265d881 100644 --- a/rootly_sdk/models/create_quip_page_task_params.py +++ b/rootly_sdk/models/create_quip_page_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -18,27 +20,27 @@ class CreateQuipPageTaskParams: """ Attributes: title (str): The page title - 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. + 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. """ title: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -80,7 +82,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: Unset | CreateQuipPageTaskParamsTaskType + task_type: CreateQuipPageTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_quip_page_task_params_task_type.py b/rootly_sdk/models/create_quip_page_task_params_task_type.py index b3b31eb2..a8b6bb41 100644 --- a/rootly_sdk/models/create_quip_page_task_params_task_type.py +++ b/rootly_sdk/models/create_quip_page_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateQuipPageTaskParamsTaskType = Literal["create_google_docs_page"] @@ -11,5 +11,5 @@ def check_create_quip_page_task_params_task_type(value: str | None) -> CreateQui if value is None: return None if value in CREATE_QUIP_PAGE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateQuipPageTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_QUIP_PAGE_TASK_PARAMS_TASK_TYPE_VALUES!r}") 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 14cdd261..a6f71fb9 100644 --- a/rootly_sdk/models/create_service_now_incident_task_params.py +++ b/rootly_sdk/models/create_service_now_incident_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,40 +25,40 @@ class CreateServiceNowIncidentTaskParams: """ Attributes: title (str): The incident title - 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 + 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 valid JSON """ title: str - 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 + task_type: CreateServiceNowIncidentTaskParamsTaskType | Unset = UNSET + description: str | Unset = UNSET + priority: CreateServiceNowIncidentTaskParamsPriority | Unset = UNSET + completion: CreateServiceNowIncidentTaskParamsCompletion | Unset = UNSET + custom_fields_mapping: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type description = self.description - priority: Unset | dict[str, Any] = UNSET + priority: dict[str, Any] | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - completion: Unset | dict[str, Any] = UNSET + completion: dict[str, Any] | Unset = UNSET if not isinstance(self.completion, Unset): completion = self.completion.to_dict() - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -93,7 +95,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: Unset | CreateServiceNowIncidentTaskParamsTaskType + task_type: CreateServiceNowIncidentTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -102,25 +104,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _priority = d.pop("priority", UNSET) - priority: Unset | CreateServiceNowIncidentTaskParamsPriority + priority: CreateServiceNowIncidentTaskParamsPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: priority = CreateServiceNowIncidentTaskParamsPriority.from_dict(_priority) _completion = d.pop("completion", UNSET) - completion: Unset | CreateServiceNowIncidentTaskParamsCompletion + completion: CreateServiceNowIncidentTaskParamsCompletion | Unset if isinstance(_completion, Unset): completion = UNSET else: completion = CreateServiceNowIncidentTaskParamsCompletion.from_dict(_completion) - def _parse_custom_fields_mapping(data: object) -> None | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 ec01454d..550f0f18 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateServiceNowIncidentTaskParamsCompletion: """The completion id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 b1d196e4..186be050 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateServiceNowIncidentTaskParamsPriority: """The priority id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_service_now_incident_task_params_task_type.py index 3f11a70e..f0279e0e 100644 --- a/rootly_sdk/models/create_service_now_incident_task_params_task_type.py +++ b/rootly_sdk/models/create_service_now_incident_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateServiceNowIncidentTaskParamsTaskType = Literal["create_service_now_incident"] @@ -13,7 +13,7 @@ def check_create_service_now_incident_task_params_task_type( if value is None: return None if value in CREATE_SERVICE_NOW_INCIDENT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateServiceNowIncidentTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_SERVICE_NOW_INCIDENT_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_sharepoint_page_task_params.py b/rootly_sdk/models/create_sharepoint_page_task_params.py index b75eb1f2..d914148c 100644 --- a/rootly_sdk/models/create_sharepoint_page_task_params.py +++ b/rootly_sdk/models/create_sharepoint_page_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,23 +28,23 @@ class CreateSharepointPageTaskParams: title (str): The page title site (CreateSharepointPageTaskParamsSite): drive (CreateSharepointPageTaskParamsDrive): - 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 + 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 """ title: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -52,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: drive = self.drive.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -60,7 +62,7 @@ def to_dict(self) -> dict[str, Any]: mark_post_mortem_as_published = self.mark_post_mortem_as_published - parent_folder: Unset | dict[str, Any] = UNSET + parent_folder: dict[str, Any] | Unset = UNSET if not isinstance(self.parent_folder, Unset): parent_folder = self.parent_folder.to_dict() @@ -106,7 +108,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: Unset | CreateSharepointPageTaskParamsTaskType + task_type: CreateSharepointPageTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -117,7 +119,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: Unset | CreateSharepointPageTaskParamsParentFolder + parent_folder: CreateSharepointPageTaskParamsParentFolder | Unset 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 eb8f611c..cbf15f10 100644 --- a/rootly_sdk/models/create_sharepoint_page_task_params_drive.py +++ b/rootly_sdk/models/create_sharepoint_page_task_params_drive.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateSharepointPageTaskParamsDrive: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 8bf706ee..16f35526 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateSharepointPageTaskParamsParentFolder: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 10269545..638cc4f0 100644 --- a/rootly_sdk/models/create_sharepoint_page_task_params_site.py +++ b/rootly_sdk/models/create_sharepoint_page_task_params_site.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateSharepointPageTaskParamsSite: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_sharepoint_page_task_params_task_type.py index 7695fd9f..44523dec 100644 --- a/rootly_sdk/models/create_sharepoint_page_task_params_task_type.py +++ b/rootly_sdk/models/create_sharepoint_page_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateSharepointPageTaskParamsTaskType = Literal["create_sharepoint_page"] @@ -13,7 +13,7 @@ def check_create_sharepoint_page_task_params_task_type( if value is None: return None if value in CREATE_SHAREPOINT_PAGE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateSharepointPageTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_SHAREPOINT_PAGE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 b27655da..1f749fa3 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateShortcutStoryTaskParamsType0Project: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 ee086426..cf311fb3 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateShortcutStoryTaskParamsType1WorkflowState: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 13958785..be8cd214 100644 --- a/rootly_sdk/models/create_shortcut_task_task_params.py +++ b/rootly_sdk/models/create_shortcut_task_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,13 +26,13 @@ class CreateShortcutTaskTaskParams: parent_story_id (str): The parent story description (str): The task description completion (CreateShortcutTaskTaskParamsCompletion): The completion id and display name - task_type (Union[Unset, CreateShortcutTaskTaskParamsTaskType]): + task_type (CreateShortcutTaskTaskParamsTaskType | Unset): """ parent_story_id: str description: str - completion: "CreateShortcutTaskTaskParamsCompletion" - task_type: Unset | CreateShortcutTaskTaskParamsTaskType = UNSET + completion: CreateShortcutTaskTaskParamsCompletion + task_type: CreateShortcutTaskTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: completion = self.completion.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,7 +72,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: Unset | CreateShortcutTaskTaskParamsTaskType + task_type: CreateShortcutTaskTaskParamsTaskType | Unset 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 be24cd42..01333610 100644 --- a/rootly_sdk/models/create_shortcut_task_task_params_completion.py +++ b/rootly_sdk/models/create_shortcut_task_task_params_completion.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateShortcutTaskTaskParamsCompletion: """The completion id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_shortcut_task_task_params_task_type.py index e4e926fb..9cc107bb 100644 --- a/rootly_sdk/models/create_shortcut_task_task_params_task_type.py +++ b/rootly_sdk/models/create_shortcut_task_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateShortcutTaskTaskParamsTaskType = Literal["create_shortcut_task"] @@ -11,7 +11,7 @@ def check_create_shortcut_task_task_params_task_type(value: str | None) -> Creat if value is None: return None if value in CREATE_SHORTCUT_TASK_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateShortcutTaskTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_SHORTCUT_TASK_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_slack_canvas_task_params.py b/rootly_sdk/models/create_slack_canvas_task_params.py new file mode 100644 index 00000000..60f6d468 --- /dev/null +++ b/rootly_sdk/models/create_slack_canvas_task_params.py @@ -0,0 +1,129 @@ +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.create_slack_canvas_task_params_task_type import ( + CreateSlackCanvasTaskParamsTaskType, + check_create_slack_canvas_task_params_task_type, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.create_slack_canvas_task_params_channel import CreateSlackCanvasTaskParamsChannel + + +T = TypeVar("T", bound="CreateSlackCanvasTaskParams") + + +@_attrs_define +class CreateSlackCanvasTaskParams: + """Create a canvas in a Slack channel, preserving an existing canvas. The connected Slack app must have Canvas + permissions. + + Attributes: + channel (CreateSlackCanvasTaskParamsChannel): Slack channel containing the canvas. Channel IDs support Liquid + variables. + title (str): The canvas title. Supports Liquid variables. + content (str): The initial canvas content in Markdown. Supports Liquid variables. An existing channel canvas is + preserved. + task_type (CreateSlackCanvasTaskParamsTaskType | Unset): + retry_count (int | Unset): Number of times to retry on rate-limit (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. + """ + + channel: CreateSlackCanvasTaskParamsChannel + title: str + content: str + task_type: CreateSlackCanvasTaskParamsTaskType | Unset = UNSET + retry_count: int | Unset = 0 + retry_wait_time: int | Unset = 1 + 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 + + content = self.content + + task_type: str | Unset = UNSET + if not isinstance(self.task_type, Unset): + task_type = self.task_type + + 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( + { + "channel": channel, + "title": title, + "content": content, + } + ) + if task_type is not UNSET: + field_dict["task_type"] = task_type + 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 + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.create_slack_canvas_task_params_channel import CreateSlackCanvasTaskParamsChannel + + d = dict(src_dict) + channel = CreateSlackCanvasTaskParamsChannel.from_dict(d.pop("channel")) + + title = d.pop("title") + + content = d.pop("content") + + _task_type = d.pop("task_type", UNSET) + task_type: CreateSlackCanvasTaskParamsTaskType | Unset + if isinstance(_task_type, Unset): + task_type = UNSET + else: + task_type = check_create_slack_canvas_task_params_task_type(_task_type) + + retry_count = d.pop("retry_count", UNSET) + + retry_wait_time = d.pop("retry_wait_time", UNSET) + + create_slack_canvas_task_params = cls( + channel=channel, + title=title, + content=content, + task_type=task_type, + retry_count=retry_count, + retry_wait_time=retry_wait_time, + ) + + create_slack_canvas_task_params.additional_properties = d + return create_slack_canvas_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/create_slack_canvas_task_params_channel.py b/rootly_sdk/models/create_slack_canvas_task_params_channel.py new file mode 100644 index 00000000..fc5b7f04 --- /dev/null +++ b/rootly_sdk/models/create_slack_canvas_task_params_channel.py @@ -0,0 +1,51 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="CreateSlackCanvasTaskParamsChannel") + + +@_attrs_define +class CreateSlackCanvasTaskParamsChannel: + """Slack channel containing the canvas. Channel IDs support Liquid variables. + + Attributes: + id (str): Slack channel ID. Example: {{ incident.slack_channel_id }}. + name (str): Channel display name. Example: incident-channel. + """ + + id: str + name: str + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "id": id, + "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") + + name = d.pop("name") + + create_slack_canvas_task_params_channel = cls( + id=id, + name=name, + ) + + return create_slack_canvas_task_params_channel diff --git a/rootly_sdk/models/create_slack_canvas_task_params_task_type.py b/rootly_sdk/models/create_slack_canvas_task_params_task_type.py new file mode 100644 index 00000000..5d9ad487 --- /dev/null +++ b/rootly_sdk/models/create_slack_canvas_task_params_task_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +CreateSlackCanvasTaskParamsTaskType = Literal["create_slack_canvas"] + +CREATE_SLACK_CANVAS_TASK_PARAMS_TASK_TYPE_VALUES: set[CreateSlackCanvasTaskParamsTaskType] = { + "create_slack_canvas", +} + + +def check_create_slack_canvas_task_params_task_type(value: str | None) -> CreateSlackCanvasTaskParamsTaskType | None: + if value is None: + return None + if value in CREATE_SLACK_CANVAS_TASK_PARAMS_TASK_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_SLACK_CANVAS_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/create_slack_channel_task_params.py b/rootly_sdk/models/create_slack_channel_task_params.py index 18954329..6e97ebde 100644 --- a/rootly_sdk/models/create_slack_channel_task_params.py +++ b/rootly_sdk/models/create_slack_channel_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,14 +29,20 @@ class CreateSlackChannelTaskParams: Attributes: workspace (CreateSlackChannelTaskParamsWorkspace): title (str): Slack channel title - task_type (Union[Unset, CreateSlackChannelTaskParamsTaskType]): - private (Union[Unset, CreateSlackChannelTaskParamsPrivate]): Default: 'auto'. + task_type (CreateSlackChannelTaskParamsTaskType | Unset): + private (CreateSlackChannelTaskParamsPrivate | Unset): Default: 'auto'. + retry_count (int | Unset): Number of times to retry on rate-limit (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. """ - workspace: "CreateSlackChannelTaskParamsWorkspace" + workspace: CreateSlackChannelTaskParamsWorkspace title: str - task_type: Unset | CreateSlackChannelTaskParamsTaskType = UNSET - private: Unset | CreateSlackChannelTaskParamsPrivate = "auto" + task_type: CreateSlackChannelTaskParamsTaskType | Unset = UNSET + private: CreateSlackChannelTaskParamsPrivate | Unset = "auto" + retry_count: int | Unset = 0 + retry_wait_time: int | Unset = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,14 +50,18 @@ def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - private: Unset | str = UNSET + private: str | Unset = UNSET if not isinstance(self.private, Unset): private = self.private + 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( @@ -62,6 +74,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["task_type"] = task_type if private is not UNSET: field_dict["private"] = private + 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 @@ -75,24 +91,30 @@ 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: Unset | CreateSlackChannelTaskParamsTaskType + task_type: CreateSlackChannelTaskParamsTaskType | Unset 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: Unset | CreateSlackChannelTaskParamsPrivate + private: CreateSlackChannelTaskParamsPrivate | Unset if isinstance(_private, Unset): private = UNSET else: private = check_create_slack_channel_task_params_private(_private) + retry_count = d.pop("retry_count", UNSET) + + retry_wait_time = d.pop("retry_wait_time", UNSET) + create_slack_channel_task_params = cls( workspace=workspace, title=title, task_type=task_type, private=private, + retry_count=retry_count, + retry_wait_time=retry_wait_time, ) create_slack_channel_task_params.additional_properties = d diff --git a/rootly_sdk/models/create_slack_channel_task_params_private.py b/rootly_sdk/models/create_slack_channel_task_params_private.py index faf54d00..cee14953 100644 --- a/rootly_sdk/models/create_slack_channel_task_params_private.py +++ b/rootly_sdk/models/create_slack_channel_task_params_private.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateSlackChannelTaskParamsPrivate = Literal["auto", "false", "true"] @@ -13,5 +13,5 @@ def check_create_slack_channel_task_params_private(value: str | None) -> CreateS if value is None: return None if value in CREATE_SLACK_CHANNEL_TASK_PARAMS_PRIVATE_VALUES: - return cast(CreateSlackChannelTaskParamsPrivate, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_SLACK_CHANNEL_TASK_PARAMS_PRIVATE_VALUES!r}") diff --git a/rootly_sdk/models/create_slack_channel_task_params_task_type.py b/rootly_sdk/models/create_slack_channel_task_params_task_type.py index c3513c8e..269be5a7 100644 --- a/rootly_sdk/models/create_slack_channel_task_params_task_type.py +++ b/rootly_sdk/models/create_slack_channel_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateSlackChannelTaskParamsTaskType = Literal["create_slack_channel"] @@ -11,7 +11,7 @@ def check_create_slack_channel_task_params_task_type(value: str | None) -> Creat if value is None: return None if value in CREATE_SLACK_CHANNEL_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateSlackChannelTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_SLACK_CHANNEL_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 c2f64805..6c6f4e33 100644 --- a/rootly_sdk/models/create_slack_channel_task_params_workspace.py +++ b/rootly_sdk/models/create_slack_channel_task_params_workspace.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateSlackChannelTaskParamsWorkspace: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 4a0a9236..0f2a0359 100644 --- a/rootly_sdk/models/create_sub_incident_task_params.py +++ b/rootly_sdk/models/create_sub_incident_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -18,19 +20,19 @@ class CreateSubIncidentTaskParams: """ Attributes: title (str): The sub incident title - task_type (Union[Unset, CreateSubIncidentTaskParamsTaskType]): - summary (Union[Unset, str]): The sub incident summary + task_type (CreateSubIncidentTaskParamsTaskType | Unset): + summary (str | Unset): The sub incident summary """ title: str - task_type: Unset | CreateSubIncidentTaskParamsTaskType = UNSET - summary: Unset | str = UNSET + task_type: CreateSubIncidentTaskParamsTaskType | Unset = UNSET + summary: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -56,7 +58,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: Unset | CreateSubIncidentTaskParamsTaskType + task_type: CreateSubIncidentTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_sub_incident_task_params_task_type.py b/rootly_sdk/models/create_sub_incident_task_params_task_type.py index 21211fd5..ae887278 100644 --- a/rootly_sdk/models/create_sub_incident_task_params_task_type.py +++ b/rootly_sdk/models/create_sub_incident_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateSubIncidentTaskParamsTaskType = Literal["create_sub_incident"] @@ -11,5 +11,5 @@ def check_create_sub_incident_task_params_task_type(value: str | None) -> Create if value is None: return None if value in CREATE_SUB_INCIDENT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateSubIncidentTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_SUB_INCIDENT_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/create_trello_card_task_params.py b/rootly_sdk/models/create_trello_card_task_params.py index af6370a8..8522b681 100644 --- a/rootly_sdk/models/create_trello_card_task_params.py +++ b/rootly_sdk/models/create_trello_card_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,21 +29,21 @@ 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 (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 + 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 """ title: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,7 +53,7 @@ def to_dict(self) -> dict[str, Any]: list_ = self.list_.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -59,14 +61,14 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - labels: Unset | list[dict[str, Any]] = UNSET + labels: list[dict[str, Any]] | Unset = 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: Unset | dict[str, Any] = UNSET + archivation: dict[str, Any] | Unset = UNSET if not isinstance(self.archivation, Unset): archivation = self.archivation.to_dict() @@ -107,7 +109,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: Unset | CreateTrelloCardTaskParamsTaskType + task_type: CreateTrelloCardTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -117,15 +119,17 @@ 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) - for labels_item_data in _labels or []: - labels_item = CreateTrelloCardTaskParamsLabelsItem.from_dict(labels_item_data) + 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) - labels.append(labels_item) + labels.append(labels_item) _archivation = d.pop("archivation", UNSET) - archivation: Unset | CreateTrelloCardTaskParamsArchivation + archivation: CreateTrelloCardTaskParamsArchivation | Unset 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 34647fb8..156c86c7 100644 --- a/rootly_sdk/models/create_trello_card_task_params_archivation.py +++ b/rootly_sdk/models/create_trello_card_task_params_archivation.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateTrelloCardTaskParamsArchivation: """The archivation id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 792a44b2..358d9808 100644 --- a/rootly_sdk/models/create_trello_card_task_params_board.py +++ b/rootly_sdk/models/create_trello_card_task_params_board.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateTrelloCardTaskParamsBoard: """The board id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 75cb16c4..42ad31bb 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateTrelloCardTaskParamsLabelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 7c2b9197..6c584b6b 100644 --- a/rootly_sdk/models/create_trello_card_task_params_list.py +++ b/rootly_sdk/models/create_trello_card_task_params_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateTrelloCardTaskParamsList: """The list id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_trello_card_task_params_task_type.py index 46077664..6a957dab 100644 --- a/rootly_sdk/models/create_trello_card_task_params_task_type.py +++ b/rootly_sdk/models/create_trello_card_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateTrelloCardTaskParamsTaskType = Literal["create_trello_card"] @@ -11,5 +11,5 @@ def check_create_trello_card_task_params_task_type(value: str | None) -> CreateT if value is None: return None if value in CREATE_TRELLO_CARD_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateTrelloCardTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_TRELLO_CARD_TASK_PARAMS_TASK_TYPE_VALUES!r}") 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 ecf53077..ddc592bc 100644 --- a/rootly_sdk/models/create_watsonx_chat_completion_task_params.py +++ b/rootly_sdk/models/create_watsonx_chat_completion_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,15 +26,15 @@ 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 (Union[Unset, CreateWatsonxChatCompletionTaskParamsTaskType]): - system_prompt (Union[Unset, str]): The system prompt to send to WatsonX (optional) + task_type (CreateWatsonxChatCompletionTaskParamsTaskType | Unset): + system_prompt (str | Unset): The system prompt to send to WatsonX (optional) """ - model: "CreateWatsonxChatCompletionTaskParamsModel" + model: CreateWatsonxChatCompletionTaskParamsModel prompt: str project_id: str - task_type: Unset | CreateWatsonxChatCompletionTaskParamsTaskType = UNSET - system_prompt: Unset | str = UNSET + task_type: CreateWatsonxChatCompletionTaskParamsTaskType | Unset = UNSET + system_prompt: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: project_id = self.project_id - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -76,7 +78,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: Unset | CreateWatsonxChatCompletionTaskParamsTaskType + task_type: CreateWatsonxChatCompletionTaskParamsTaskType | Unset 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 1a1b5d64..e26a08fb 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateWatsonxChatCompletionTaskParamsModel: """The WatsonX model. eg: ibm/granite-3-b8b-instruct Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_watsonx_chat_completion_task_params_task_type.py index 1e7bfa8a..a8d03e14 100644 --- a/rootly_sdk/models/create_watsonx_chat_completion_task_params_task_type.py +++ b/rootly_sdk/models/create_watsonx_chat_completion_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateWatsonxChatCompletionTaskParamsTaskType = Literal["create_watsonx_chat_completion_task"] @@ -13,7 +13,7 @@ def check_create_watsonx_chat_completion_task_params_task_type( if value is None: return None if value in CREATE_WATSONX_CHAT_COMPLETION_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateWatsonxChatCompletionTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_WATSONX_CHAT_COMPLETION_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_webex_meeting_task_params.py b/rootly_sdk/models/create_webex_meeting_task_params.py index 895ac35f..cffd1878 100644 --- a/rootly_sdk/models/create_webex_meeting_task_params.py +++ b/rootly_sdk/models/create_webex_meeting_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -28,29 +30,29 @@ class CreateWebexMeetingTaskParams: """ Attributes: topic (str): The meeting topic - 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']]): + 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): """ topic: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: topic = self.topic - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -58,13 +60,13 @@ def to_dict(self) -> dict[str, Any]: record_meeting = self.record_meeting - recording_mode: Unset | str = UNSET + recording_mode: str | Unset = 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: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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,7 +105,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: Unset | CreateWebexMeetingTaskParamsTaskType + task_type: CreateWebexMeetingTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -114,7 +116,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: Unset | CreateWebexMeetingTaskParamsRecordingMode + recording_mode: CreateWebexMeetingTaskParamsRecordingMode | Unset if isinstance(_recording_mode, Unset): recording_mode = UNSET else: @@ -122,14 +124,16 @@ 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) - 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: 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 + ) - 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 8ed5a6db..6e3cd47d 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateWebexMeetingTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_recording_mode.py b/rootly_sdk/models/create_webex_meeting_task_params_recording_mode.py index e40e8b78..a62b3cc3 100644 --- a/rootly_sdk/models/create_webex_meeting_task_params_recording_mode.py +++ b/rootly_sdk/models/create_webex_meeting_task_params_recording_mode.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateWebexMeetingTaskParamsRecordingMode = Literal["audio_only", "gallery_view", "gallery_view_v2", "speaker_view"] @@ -16,7 +16,7 @@ def check_create_webex_meeting_task_params_recording_mode( if value is None: return None if value in CREATE_WEBEX_MEETING_TASK_PARAMS_RECORDING_MODE_VALUES: - return cast(CreateWebexMeetingTaskParamsRecordingMode, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_WEBEX_MEETING_TASK_PARAMS_RECORDING_MODE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_webex_meeting_task_params_task_type.py b/rootly_sdk/models/create_webex_meeting_task_params_task_type.py index 6718e7fc..0e074a41 100644 --- a/rootly_sdk/models/create_webex_meeting_task_params_task_type.py +++ b/rootly_sdk/models/create_webex_meeting_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateWebexMeetingTaskParamsTaskType = Literal["create_webex_meeting"] @@ -11,7 +11,7 @@ def check_create_webex_meeting_task_params_task_type(value: str | None) -> Creat if value is None: return None if value in CREATE_WEBEX_MEETING_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateWebexMeetingTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_WEBEX_MEETING_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 26ac50a0..79171b39 100644 --- a/rootly_sdk/models/create_zendesk_jira_link_task_params.py +++ b/rootly_sdk/models/create_zendesk_jira_link_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -20,13 +22,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 (Union[Unset, CreateZendeskJiraLinkTaskParamsTaskType]): + task_type (CreateZendeskJiraLinkTaskParamsTaskType | Unset): """ jira_issue_id: str jira_issue_key: str zendesk_ticket_id: str - task_type: Unset | CreateZendeskJiraLinkTaskParamsTaskType = UNSET + task_type: CreateZendeskJiraLinkTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +38,7 @@ def to_dict(self) -> dict[str, Any]: zendesk_ticket_id = self.zendesk_ticket_id - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -64,7 +66,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: Unset | CreateZendeskJiraLinkTaskParamsTaskType + task_type: CreateZendeskJiraLinkTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/create_zendesk_jira_link_task_params_task_type.py b/rootly_sdk/models/create_zendesk_jira_link_task_params_task_type.py index 72d04b53..cb7ac42a 100644 --- a/rootly_sdk/models/create_zendesk_jira_link_task_params_task_type.py +++ b/rootly_sdk/models/create_zendesk_jira_link_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateZendeskJiraLinkTaskParamsTaskType = Literal["create_zendesk_jira_link"] @@ -13,7 +13,7 @@ def check_create_zendesk_jira_link_task_params_task_type( if value is None: return None if value in CREATE_ZENDESK_JIRA_LINK_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateZendeskJiraLinkTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_ZENDESK_JIRA_LINK_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_zendesk_ticket_task_params.py b/rootly_sdk/models/create_zendesk_ticket_task_params.py index 8e5038ed..e0358ab7 100644 --- a/rootly_sdk/models/create_zendesk_ticket_task_params.py +++ b/rootly_sdk/models/create_zendesk_ticket_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,26 +30,26 @@ class CreateZendeskTicketTaskParams: Attributes: kind (CreateZendeskTicketTaskParamsKind): subject (str): The ticket subject - 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 + 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 valid JSON - ticket_payload (Union[None, Unset, str]): Additional Zendesk ticket attributes. Will be merged into whatever was + ticket_payload (None | str | Unset): 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: 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -55,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: subject = self.subject - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,21 +65,21 @@ def to_dict(self) -> dict[str, Any]: tags = self.tags - priority: Unset | dict[str, Any] = UNSET + priority: dict[str, Any] | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - completion: Unset | dict[str, Any] = UNSET + completion: dict[str, Any] | Unset = UNSET if not isinstance(self.completion, Unset): completion = self.completion.to_dict() - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - ticket_payload: None | Unset | str + ticket_payload: None | str | Unset if isinstance(self.ticket_payload, Unset): ticket_payload = UNSET else: @@ -119,7 +121,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: Unset | CreateZendeskTicketTaskParamsTaskType + task_type: CreateZendeskTicketTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -130,34 +132,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tags = d.pop("tags", UNSET) _priority = d.pop("priority", UNSET) - priority: Unset | CreateZendeskTicketTaskParamsPriority + priority: CreateZendeskTicketTaskParamsPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: priority = CreateZendeskTicketTaskParamsPriority.from_dict(_priority) _completion = d.pop("completion", UNSET) - completion: Unset | CreateZendeskTicketTaskParamsCompletion + completion: CreateZendeskTicketTaskParamsCompletion | Unset if isinstance(_completion, Unset): completion = UNSET else: completion = CreateZendeskTicketTaskParamsCompletion.from_dict(_completion) - def _parse_custom_fields_mapping(data: object) -> None | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_ticket_payload(data: object) -> None | Unset | str: + def _parse_ticket_payload(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 e6192bfd..2554ba85 100644 --- a/rootly_sdk/models/create_zendesk_ticket_task_params_completion.py +++ b/rootly_sdk/models/create_zendesk_ticket_task_params_completion.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateZendeskTicketTaskParamsCompletion: """The completion id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_kind.py b/rootly_sdk/models/create_zendesk_ticket_task_params_kind.py index 075bbd67..8922fcd9 100644 --- a/rootly_sdk/models/create_zendesk_ticket_task_params_kind.py +++ b/rootly_sdk/models/create_zendesk_ticket_task_params_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateZendeskTicketTaskParamsKind = Literal["incident", "problem", "question", "task"] @@ -14,5 +14,5 @@ def check_create_zendesk_ticket_task_params_kind(value: str | None) -> CreateZen if value is None: return None if value in CREATE_ZENDESK_TICKET_TASK_PARAMS_KIND_VALUES: - return cast(CreateZendeskTicketTaskParamsKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_ZENDESK_TICKET_TASK_PARAMS_KIND_VALUES!r}") 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 eaeb09b3..8a7902cb 100644 --- a/rootly_sdk/models/create_zendesk_ticket_task_params_priority.py +++ b/rootly_sdk/models/create_zendesk_ticket_task_params_priority.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class CreateZendeskTicketTaskParamsPriority: """The priority id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/create_zendesk_ticket_task_params_task_type.py index abc5577b..cfb89727 100644 --- a/rootly_sdk/models/create_zendesk_ticket_task_params_task_type.py +++ b/rootly_sdk/models/create_zendesk_ticket_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateZendeskTicketTaskParamsTaskType = Literal["create_zendesk_ticket"] @@ -13,7 +13,7 @@ def check_create_zendesk_ticket_task_params_task_type( if value is None: return None if value in CREATE_ZENDESK_TICKET_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateZendeskTicketTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_ZENDESK_TICKET_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_zoom_meeting_task_params.py b/rootly_sdk/models/create_zoom_meeting_task_params.py index 9aa314b4..c9bd2054 100644 --- a/rootly_sdk/models/create_zoom_meeting_task_params.py +++ b/rootly_sdk/models/create_zoom_meeting_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -32,38 +34,44 @@ class CreateZoomMeetingTaskParams: """ Attributes: topic (str): The meeting topic - 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 + 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 approval - post_to_incident_timeline (Union[Unset, bool]): - post_to_slack_channels (Union[Unset, list['CreateZoomMeetingTaskParamsPostToSlackChannelsItem']]): + post_to_incident_timeline (bool | Unset): + post_to_slack_channels (list[CreateZoomMeetingTaskParamsPostToSlackChannelsItem] | Unset): + retry_count (int | Unset): Number of times to retry on rate-limit (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. """ topic: str - 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 + 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 + retry_count: int | Unset = 0 + retry_wait_time: int | Unset = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: topic = self.topic - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -71,17 +79,17 @@ def to_dict(self) -> dict[str, Any]: create_as_email = self.create_as_email - alternative_hosts: Unset | list[str] = UNSET + alternative_hosts: list[str] | Unset = UNSET if not isinstance(self.alternative_hosts, Unset): alternative_hosts = self.alternative_hosts - auto_recording: Unset | str = UNSET + auto_recording: str | Unset = UNSET if not isinstance(self.auto_recording, Unset): auto_recording = self.auto_recording record_meeting = self.record_meeting - recording_mode: Unset | str = UNSET + recording_mode: str | Unset = UNSET if not isinstance(self.recording_mode, Unset): recording_mode = self.recording_mode @@ -89,13 +97,17 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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) + 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( @@ -123,6 +135,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["post_to_incident_timeline"] = post_to_incident_timeline if post_to_slack_channels is not UNSET: field_dict["post_to_slack_channels"] = post_to_slack_channels + 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 @@ -136,7 +152,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: Unset | CreateZoomMeetingTaskParamsTaskType + task_type: CreateZoomMeetingTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -149,7 +165,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: Unset | CreateZoomMeetingTaskParamsAutoRecording + auto_recording: CreateZoomMeetingTaskParamsAutoRecording | Unset if isinstance(_auto_recording, Unset): auto_recording = UNSET else: @@ -158,7 +174,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: Unset | CreateZoomMeetingTaskParamsRecordingMode + recording_mode: CreateZoomMeetingTaskParamsRecordingMode | Unset if isinstance(_recording_mode, Unset): recording_mode = UNSET else: @@ -168,14 +184,20 @@ 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) - 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: 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 + ) + + post_to_slack_channels.append(post_to_slack_channels_item) + + retry_count = d.pop("retry_count", UNSET) - post_to_slack_channels.append(post_to_slack_channels_item) + retry_wait_time = d.pop("retry_wait_time", UNSET) create_zoom_meeting_task_params = cls( topic=topic, @@ -189,6 +211,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: enable_zoom_bot_auto_join=enable_zoom_bot_auto_join, post_to_incident_timeline=post_to_incident_timeline, post_to_slack_channels=post_to_slack_channels, + retry_count=retry_count, + retry_wait_time=retry_wait_time, ) create_zoom_meeting_task_params.additional_properties = d diff --git a/rootly_sdk/models/create_zoom_meeting_task_params_auto_recording.py b/rootly_sdk/models/create_zoom_meeting_task_params_auto_recording.py index 35de63eb..27e3a8b6 100644 --- a/rootly_sdk/models/create_zoom_meeting_task_params_auto_recording.py +++ b/rootly_sdk/models/create_zoom_meeting_task_params_auto_recording.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateZoomMeetingTaskParamsAutoRecording = Literal["cloud", "local", "none"] @@ -15,7 +15,7 @@ def check_create_zoom_meeting_task_params_auto_recording( if value is None: return None if value in CREATE_ZOOM_MEETING_TASK_PARAMS_AUTO_RECORDING_VALUES: - return cast(CreateZoomMeetingTaskParamsAutoRecording, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_ZOOM_MEETING_TASK_PARAMS_AUTO_RECORDING_VALUES!r}" ) 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 e468c08c..7a669f7c 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class CreateZoomMeetingTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_recording_mode.py b/rootly_sdk/models/create_zoom_meeting_task_params_recording_mode.py index d519b648..820f26ba 100644 --- a/rootly_sdk/models/create_zoom_meeting_task_params_recording_mode.py +++ b/rootly_sdk/models/create_zoom_meeting_task_params_recording_mode.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateZoomMeetingTaskParamsRecordingMode = Literal["audio_only", "gallery_view", "gallery_view_v2", "speaker_view"] @@ -16,7 +16,7 @@ def check_create_zoom_meeting_task_params_recording_mode( if value is None: return None if value in CREATE_ZOOM_MEETING_TASK_PARAMS_RECORDING_MODE_VALUES: - return cast(CreateZoomMeetingTaskParamsRecordingMode, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {CREATE_ZOOM_MEETING_TASK_PARAMS_RECORDING_MODE_VALUES!r}" ) diff --git a/rootly_sdk/models/create_zoom_meeting_task_params_task_type.py b/rootly_sdk/models/create_zoom_meeting_task_params_task_type.py index 3274f789..74780b33 100644 --- a/rootly_sdk/models/create_zoom_meeting_task_params_task_type.py +++ b/rootly_sdk/models/create_zoom_meeting_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CreateZoomMeetingTaskParamsTaskType = Literal["create_zoom_meeting"] @@ -11,5 +11,5 @@ def check_create_zoom_meeting_task_params_task_type(value: str | None) -> Create if value is None: return None if value in CREATE_ZOOM_MEETING_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(CreateZoomMeetingTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CREATE_ZOOM_MEETING_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/custom_field.py b/rootly_sdk/models/custom_field.py index 3396bd0b..9f088097 100644 --- a/rootly_sdk/models/custom_field.py +++ b/rootly_sdk/models/custom_field.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -21,30 +23,30 @@ class CustomField: Attributes: label (str): The name of the custom_field shown (list[CustomFieldShownItem]): - required (Union[None, list[CustomFieldRequiredType0Item]]): + required (list[CustomFieldRequiredType0Item] | None): position (int): The position of the custom_field created_at (str): Date of creation updated_at (str): Date of last update - 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 + 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 + resource_type (CustomFieldResourceType | Unset): The resource type this field belongs to + description (None | str | Unset): The description of the custom_field + default (None | str | Unset): The default value for text field kinds """ label: str shown: list[CustomFieldShownItem] - required: None | list[CustomFieldRequiredType0Item] + required: list[CustomFieldRequiredType0Item] | None position: int created_at: str updated_at: str - 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 + kind: str | Unset = UNSET + enabled: bool | Unset = UNSET + slug: str | Unset = UNSET + resource_type: CustomFieldResourceType | Unset = UNSET + description: None | str | Unset = UNSET + default: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -55,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: shown_item: str = shown_item_data shown.append(shown_item) - required: None | list[str] + required: list[str] | None if isinstance(self.required, list): required = [] for required_type_0_item_data in self.required: @@ -77,17 +79,17 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - resource_type: Unset | str = UNSET + resource_type: str | Unset = UNSET if not isinstance(self.resource_type, Unset): resource_type = self.resource_type - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - default: None | Unset | str + default: None | str | Unset if isinstance(self.default, Unset): default = UNSET else: @@ -132,7 +134,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: shown.append(shown_item) - def _parse_required(data: object) -> None | list[CustomFieldRequiredType0Item]: + def _parse_required(data: object) -> list[CustomFieldRequiredType0Item] | None: if data is None: return data try: @@ -146,9 +148,9 @@ def _parse_required(data: object) -> None | list[CustomFieldRequiredType0Item]: required_type_0.append(required_type_0_item) return required_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | list[CustomFieldRequiredType0Item], data) + return cast(list[CustomFieldRequiredType0Item] | None, data) required = _parse_required(d.pop("required")) @@ -165,27 +167,27 @@ def _parse_required(data: object) -> None | list[CustomFieldRequiredType0Item]: slug = d.pop("slug", UNSET) _resource_type = d.pop("resource_type", UNSET) - resource_type: Unset | CustomFieldResourceType + resource_type: CustomFieldResourceType | Unset 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: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_default(data: object) -> None | Unset | str: + def _parse_default(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) default = _parse_default(d.pop("default", UNSET)) diff --git a/rootly_sdk/models/custom_field_list.py b/rootly_sdk/models/custom_field_list.py index 6e733b5a..9dc15693 100644 --- a/rootly_sdk/models/custom_field_list.py +++ b/rootly_sdk/models/custom_field_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class CustomFieldList: """ Attributes: - data (list['CustomFieldListDataItem']): + data (list[CustomFieldListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["CustomFieldListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[CustomFieldListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 608b0c38..51f85834 100644 --- a/rootly_sdk/models/custom_field_list_data_item.py +++ b/rootly_sdk/models/custom_field_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/custom_field_list_data_item_type.py b/rootly_sdk/models/custom_field_list_data_item_type.py index c47777a1..183fd9e8 100644 --- a/rootly_sdk/models/custom_field_list_data_item_type.py +++ b/rootly_sdk/models/custom_field_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CustomFieldListDataItemType = Literal["custom_fields"] @@ -11,5 +11,5 @@ def check_custom_field_list_data_item_type(value: str | None) -> CustomFieldList if value is None: return None if value in CUSTOM_FIELD_LIST_DATA_ITEM_TYPE_VALUES: - return cast(CustomFieldListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CUSTOM_FIELD_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/custom_field_option.py b/rootly_sdk/models/custom_field_option.py index 68edd831..74f9d516 100644 --- a/rootly_sdk/models/custom_field_option.py +++ b/rootly_sdk/models/custom_field_option.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -18,8 +20,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 (Union[Unset, int]): The ID of the parent custom field - default (Union[Unset, bool]): + custom_field_id (int | Unset): The ID of the parent custom field + default (bool | Unset): """ value: str @@ -27,8 +29,8 @@ class CustomFieldOption: position: int created_at: str updated_at: str - custom_field_id: Unset | int = UNSET - default: Unset | bool = UNSET + custom_field_id: int | Unset = UNSET + default: bool | Unset = UNSET 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 c6152167..e4133435 100644 --- a/rootly_sdk/models/custom_field_option_list.py +++ b/rootly_sdk/models/custom_field_option_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class CustomFieldOptionList: """ Attributes: - data (list['CustomFieldOptionListDataItem']): + data (list[CustomFieldOptionListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["CustomFieldOptionListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[CustomFieldOptionListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 1807c6b6..43e459bf 100644 --- a/rootly_sdk/models/custom_field_option_list_data_item.py +++ b/rootly_sdk/models/custom_field_option_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/custom_field_option_list_data_item_type.py b/rootly_sdk/models/custom_field_option_list_data_item_type.py index 90cf2e85..0a1714c6 100644 --- a/rootly_sdk/models/custom_field_option_list_data_item_type.py +++ b/rootly_sdk/models/custom_field_option_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CustomFieldOptionListDataItemType = Literal["custom_field_options"] @@ -11,5 +11,5 @@ def check_custom_field_option_list_data_item_type(value: str | None) -> CustomFi if value is None: return None if value in CUSTOM_FIELD_OPTION_LIST_DATA_ITEM_TYPE_VALUES: - return cast(CustomFieldOptionListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CUSTOM_FIELD_OPTION_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/custom_field_option_response.py b/rootly_sdk/models/custom_field_option_response.py index 3e9da894..fe43976f 100644 --- a/rootly_sdk/models/custom_field_option_response.py +++ b/rootly_sdk/models/custom_field_option_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class CustomFieldOptionResponse: """ Attributes: data (CustomFieldOptionResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "CustomFieldOptionResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: CustomFieldOptionResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 93ea8892..4255f099 100644 --- a/rootly_sdk/models/custom_field_option_response_data.py +++ b/rootly_sdk/models/custom_field_option_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/custom_field_option_response_data_type.py b/rootly_sdk/models/custom_field_option_response_data_type.py index 8b08b5e9..c4bd7581 100644 --- a/rootly_sdk/models/custom_field_option_response_data_type.py +++ b/rootly_sdk/models/custom_field_option_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CustomFieldOptionResponseDataType = Literal["custom_field_options"] @@ -11,5 +11,5 @@ def check_custom_field_option_response_data_type(value: str | None) -> CustomFie if value is None: return None if value in CUSTOM_FIELD_OPTION_RESPONSE_DATA_TYPE_VALUES: - return cast(CustomFieldOptionResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CUSTOM_FIELD_OPTION_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/custom_field_required_type_0_item.py b/rootly_sdk/models/custom_field_required_type_0_item.py index 662a02f2..fd35a8ad 100644 --- a/rootly_sdk/models/custom_field_required_type_0_item.py +++ b/rootly_sdk/models/custom_field_required_type_0_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CustomFieldRequiredType0Item = Literal[ "incident_form", @@ -25,5 +25,5 @@ def check_custom_field_required_type_0_item(value: str | None) -> CustomFieldReq if value is None: return None if value in CUSTOM_FIELD_REQUIRED_TYPE_0_ITEM_VALUES: - return cast(CustomFieldRequiredType0Item, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CUSTOM_FIELD_REQUIRED_TYPE_0_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/custom_field_resource_type.py b/rootly_sdk/models/custom_field_resource_type.py index b3fab9ba..8db36650 100644 --- a/rootly_sdk/models/custom_field_resource_type.py +++ b/rootly_sdk/models/custom_field_resource_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CustomFieldResourceType = Literal["incident", "problem"] @@ -12,5 +12,5 @@ def check_custom_field_resource_type(value: str | None) -> CustomFieldResourceTy if value is None: return None if value in CUSTOM_FIELD_RESOURCE_TYPE_VALUES: - return cast(CustomFieldResourceType, value) + return 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 751fb9c3..178a023a 100644 --- a/rootly_sdk/models/custom_field_response.py +++ b/rootly_sdk/models/custom_field_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class CustomFieldResponse: """ Attributes: data (CustomFieldResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "CustomFieldResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: CustomFieldResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 a33f5985..54ea82aa 100644 --- a/rootly_sdk/models/custom_field_response_data.py +++ b/rootly_sdk/models/custom_field_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/custom_field_response_data_type.py b/rootly_sdk/models/custom_field_response_data_type.py index 0790e119..1300e972 100644 --- a/rootly_sdk/models/custom_field_response_data_type.py +++ b/rootly_sdk/models/custom_field_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CustomFieldResponseDataType = Literal["custom_fields"] @@ -11,5 +11,5 @@ def check_custom_field_response_data_type(value: str | None) -> CustomFieldRespo if value is None: return None if value in CUSTOM_FIELD_RESPONSE_DATA_TYPE_VALUES: - return cast(CustomFieldResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CUSTOM_FIELD_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/custom_field_shown_item.py b/rootly_sdk/models/custom_field_shown_item.py index b5202b2c..9f90d4a1 100644 --- a/rootly_sdk/models/custom_field_shown_item.py +++ b/rootly_sdk/models/custom_field_shown_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CustomFieldShownItem = Literal[ "incident_form", @@ -27,5 +27,5 @@ def check_custom_field_shown_item(value: str | None) -> CustomFieldShownItem | N if value is None: return None if value in CUSTOM_FIELD_SHOWN_ITEM_VALUES: - return cast(CustomFieldShownItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CUSTOM_FIELD_SHOWN_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/custom_form.py b/rootly_sdk/models/custom_form.py index 5e5b7092..78ee24bb 100644 --- a/rootly_sdk/models/custom_form.py +++ b/rootly_sdk/models/custom_form.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,9 +20,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 (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]): + 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): """ name: str @@ -28,8 +30,8 @@ class CustomForm: command: str created_at: str updated_at: str - slug: Unset | str = UNSET - description: None | Unset | str = UNSET + slug: str | Unset = UNSET + description: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,7 +47,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -84,12 +86,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 4f876e98..b6a063bb 100644 --- a/rootly_sdk/models/custom_form_list.py +++ b/rootly_sdk/models/custom_form_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class CustomFormList: """ Attributes: - data (list['CustomFormListDataItem']): + data (list[CustomFormListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["CustomFormListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[CustomFormListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 3f36ae0d..ecf82fbb 100644 --- a/rootly_sdk/models/custom_form_list_data_item.py +++ b/rootly_sdk/models/custom_form_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/custom_form_list_data_item_type.py b/rootly_sdk/models/custom_form_list_data_item_type.py index 82c6793c..ca890d8f 100644 --- a/rootly_sdk/models/custom_form_list_data_item_type.py +++ b/rootly_sdk/models/custom_form_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CustomFormListDataItemType = Literal["custom_forms"] @@ -11,5 +11,5 @@ def check_custom_form_list_data_item_type(value: str | None) -> CustomFormListDa if value is None: return None if value in CUSTOM_FORM_LIST_DATA_ITEM_TYPE_VALUES: - return cast(CustomFormListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CUSTOM_FORM_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/custom_form_response.py b/rootly_sdk/models/custom_form_response.py index 1d2dd1cc..16be7f10 100644 --- a/rootly_sdk/models/custom_form_response.py +++ b/rootly_sdk/models/custom_form_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class CustomFormResponse: """ Attributes: data (CustomFormResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "CustomFormResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: CustomFormResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 ae29c003..fb42a220 100644 --- a/rootly_sdk/models/custom_form_response_data.py +++ b/rootly_sdk/models/custom_form_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/custom_form_response_data_type.py b/rootly_sdk/models/custom_form_response_data_type.py index 4c4814de..8cdcc39e 100644 --- a/rootly_sdk/models/custom_form_response_data_type.py +++ b/rootly_sdk/models/custom_form_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal CustomFormResponseDataType = Literal["custom_forms"] @@ -11,5 +11,5 @@ def check_custom_form_response_data_type(value: str | None) -> CustomFormRespons if value is None: return None if value in CUSTOM_FORM_RESPONSE_DATA_TYPE_VALUES: - return cast(CustomFormResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {CUSTOM_FORM_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/dashboard.py b/rootly_sdk/models/dashboard.py index ce1b6222..f83fc0c9 100644 --- a/rootly_sdk/models/dashboard.py +++ b/rootly_sdk/models/dashboard.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,31 +20,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 (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 + 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 """ name: str owner: DashboardOwner public: bool - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,25 +56,25 @@ def to_dict(self) -> dict[str, Any]: team_id = self.team_id - user_id: None | Unset | int + user_id: int | None | Unset if isinstance(self.user_id, Unset): user_id = UNSET else: user_id = self.user_id - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - range_: None | Unset | str + range_: None | str | Unset if isinstance(self.range_, Unset): range_ = UNSET else: range_ = self.range_ - period: None | Unset | str + period: None | str | Unset if isinstance(self.period, Unset): period = UNSET else: @@ -80,7 +82,7 @@ def to_dict(self) -> dict[str, Any]: auto_refresh = self.auto_refresh - color: Unset | str = UNSET + color: str | Unset = UNSET if not isinstance(self.color, Unset): color = self.color @@ -133,46 +135,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) -> None | Unset | int: + def _parse_user_id(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) user_id = _parse_user_id(d.pop("user_id", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_range_(data: object) -> None | Unset | str: + def _parse_range_(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) range_ = _parse_range_(d.pop("range", UNSET)) - def _parse_period(data: object) -> None | Unset | str: + def _parse_period(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) period = _parse_period(d.pop("period", UNSET)) auto_refresh = d.pop("auto_refresh", UNSET) _color = d.pop("color", UNSET) - color: Unset | DashboardColor + color: DashboardColor | Unset if isinstance(_color, Unset): color = UNSET else: diff --git a/rootly_sdk/models/dashboard_color.py b/rootly_sdk/models/dashboard_color.py index f5770f92..d79743d7 100644 --- a/rootly_sdk/models/dashboard_color.py +++ b/rootly_sdk/models/dashboard_color.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal DashboardColor = Literal["#D7F5E1", "#E9E2FF", "#FAE6E8", "#FAEEE6", "#FCF2CF"] @@ -15,5 +15,5 @@ def check_dashboard_color(value: str | None) -> DashboardColor | None: if value is None: return None if value in DASHBOARD_COLOR_VALUES: - return cast(DashboardColor, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {DASHBOARD_COLOR_VALUES!r}") diff --git a/rootly_sdk/models/dashboard_list.py b/rootly_sdk/models/dashboard_list.py index ff4b99da..e3712b8c 100644 --- a/rootly_sdk/models/dashboard_list.py +++ b/rootly_sdk/models/dashboard_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class DashboardList: """ Attributes: - data (list['DashboardListDataItem']): + data (list[DashboardListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["DashboardListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[DashboardListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 86d1b13b..af7c1f78 100644 --- a/rootly_sdk/models/dashboard_list_data_item.py +++ b/rootly_sdk/models/dashboard_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/dashboard_list_data_item_type.py b/rootly_sdk/models/dashboard_list_data_item_type.py index dea35c16..1c88cebe 100644 --- a/rootly_sdk/models/dashboard_list_data_item_type.py +++ b/rootly_sdk/models/dashboard_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal DashboardListDataItemType = Literal["dashboards"] @@ -11,5 +11,5 @@ def check_dashboard_list_data_item_type(value: str | None) -> DashboardListDataI if value is None: return None if value in DASHBOARD_LIST_DATA_ITEM_TYPE_VALUES: - return cast(DashboardListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {DASHBOARD_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/dashboard_owner.py b/rootly_sdk/models/dashboard_owner.py index 07a564bc..4f45f1d4 100644 --- a/rootly_sdk/models/dashboard_owner.py +++ b/rootly_sdk/models/dashboard_owner.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal DashboardOwner = Literal["team", "user"] @@ -12,5 +12,5 @@ def check_dashboard_owner(value: str | None) -> DashboardOwner | None: if value is None: return None if value in DASHBOARD_OWNER_VALUES: - return cast(DashboardOwner, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {DASHBOARD_OWNER_VALUES!r}") diff --git a/rootly_sdk/models/dashboard_panel.py b/rootly_sdk/models/dashboard_panel.py index 26995283..4cd0dbe5 100644 --- a/rootly_sdk/models/dashboard_panel.py +++ b/rootly_sdk/models/dashboard_panel.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,17 +22,17 @@ class DashboardPanel: """ Attributes: params (DashboardPanelParams): - 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']]): + 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): """ - params: "DashboardPanelParams" - dashboard_id: Unset | str = UNSET - name: None | Unset | str = UNSET - position: Union["DashboardPanelPositionType0", None, Unset] = UNSET - data: Unset | list["DashboardPanelDataItem"] = UNSET + params: DashboardPanelParams + dashboard_id: str | Unset = UNSET + name: None | str | Unset = UNSET + position: DashboardPanelPositionType0 | None | Unset = UNSET + data: list[DashboardPanelDataItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,13 +42,13 @@ def to_dict(self) -> dict[str, Any]: dashboard_id = self.dashboard_id - name: None | Unset | str + name: None | str | Unset if isinstance(self.name, Unset): name = UNSET else: name = self.name - position: None | Unset | dict[str, Any] + position: dict[str, Any] | None | Unset if isinstance(self.position, Unset): position = UNSET elif isinstance(self.position, DashboardPanelPositionType0): @@ -54,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: else: position = self.position - data: Unset | list[dict[str, Any]] = UNSET + data: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.data, Unset): data = [] for data_item_data in self.data: @@ -90,16 +92,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 | Unset | str: + def _parse_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) name = _parse_name(d.pop("name", UNSET)) - def _parse_position(data: object) -> Union["DashboardPanelPositionType0", None, Unset]: + def _parse_position(data: object) -> DashboardPanelPositionType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -110,18 +112,20 @@ def _parse_position(data: object) -> Union["DashboardPanelPositionType0", None, position_type_0 = DashboardPanelPositionType0.from_dict(data) return position_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["DashboardPanelPositionType0", None, Unset], data) + return cast(DashboardPanelPositionType0 | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - data = [] _data = d.pop("data", UNSET) - for data_item_data in _data or []: - data_item = DashboardPanelDataItem.from_dict(data_item_data) + 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) - 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 67ba809f..3e9c8030 100644 --- a/rootly_sdk/models/dashboard_panel_data_item.py +++ b/rootly_sdk/models/dashboard_panel_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 fa664bcd..70ed39ef 100644 --- a/rootly_sdk/models/dashboard_panel_list.py +++ b/rootly_sdk/models/dashboard_panel_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class DashboardPanelList: """ Attributes: - data (list['DashboardPanelListDataItem']): + data (list[DashboardPanelListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["DashboardPanelListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[DashboardPanelListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 e773636f..dcb89dd9 100644 --- a/rootly_sdk/models/dashboard_panel_list_data_item.py +++ b/rootly_sdk/models/dashboard_panel_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/dashboard_panel_list_data_item_type.py b/rootly_sdk/models/dashboard_panel_list_data_item_type.py index 3c27e21a..ab48e9fc 100644 --- a/rootly_sdk/models/dashboard_panel_list_data_item_type.py +++ b/rootly_sdk/models/dashboard_panel_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal DashboardPanelListDataItemType = Literal["dashboard_panels"] @@ -11,5 +11,5 @@ def check_dashboard_panel_list_data_item_type(value: str | None) -> DashboardPan if value is None: return None if value in DASHBOARD_PANEL_LIST_DATA_ITEM_TYPE_VALUES: - return cast(DashboardPanelListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {DASHBOARD_PANEL_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/dashboard_panel_params.py b/rootly_sdk/models/dashboard_panel_params.py index 14a50bbc..90a15121 100644 --- a/rootly_sdk/models/dashboard_panel_params.py +++ b/rootly_sdk/models/dashboard_panel_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,42 +22,42 @@ class DashboardPanelParams: """ Attributes: - 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): + description (str | Unset): + table_fields (list[str] | Unset): + legend (DashboardPanelParamsLegend | Unset): + datalabels (DashboardPanelParamsDatalabels | Unset): + datasets (list[DashboardPanelParamsDatasetsItem] | 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - display: Unset | str = UNSET + display: str | Unset = UNSET if not isinstance(self.display, Unset): display = self.display description = self.description - table_fields: Unset | list[str] = UNSET + table_fields: list[str] | Unset = UNSET if not isinstance(self.table_fields, Unset): table_fields = self.table_fields - legend: Unset | dict[str, Any] = UNSET + legend: dict[str, Any] | Unset = UNSET if not isinstance(self.legend, Unset): legend = self.legend.to_dict() - datalabels: Unset | dict[str, Any] = UNSET + datalabels: dict[str, Any] | Unset = UNSET if not isinstance(self.datalabels, Unset): datalabels = self.datalabels.to_dict() - datasets: Unset | list[dict[str, Any]] = UNSET + datasets: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.datasets, Unset): datasets = [] for datasets_item_data in self.datasets: @@ -88,7 +90,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _display = d.pop("display", UNSET) - display: Unset | DashboardPanelParamsDisplay + display: DashboardPanelParamsDisplay | Unset if isinstance(_display, Unset): display = UNSET else: @@ -99,25 +101,27 @@ 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: Unset | DashboardPanelParamsLegend + legend: DashboardPanelParamsLegend | Unset if isinstance(_legend, Unset): legend = UNSET else: legend = DashboardPanelParamsLegend.from_dict(_legend) _datalabels = d.pop("datalabels", UNSET) - datalabels: Unset | DashboardPanelParamsDatalabels + datalabels: DashboardPanelParamsDatalabels | Unset if isinstance(_datalabels, Unset): datalabels = UNSET else: datalabels = DashboardPanelParamsDatalabels.from_dict(_datalabels) - datasets = [] _datasets = d.pop("datasets", UNSET) - for datasets_item_data in _datasets or []: - datasets_item = DashboardPanelParamsDatasetsItem.from_dict(datasets_item_data) + 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) - 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 c1e1055e..be9de80e 100644 --- a/rootly_sdk/models/dashboard_panel_params_datalabels.py +++ b/rootly_sdk/models/dashboard_panel_params_datalabels.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,10 +15,10 @@ class DashboardPanelParamsDatalabels: """ Attributes: - enabled (Union[Unset, bool]): + enabled (bool | Unset): """ - enabled: Unset | bool = UNSET + enabled: bool | Unset = UNSET 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 36291daf..21e85bab 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,18 +29,18 @@ class DashboardPanelParamsDatasetsItem: """ Attributes: - 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): + collection (DashboardPanelParamsDatasetsItemCollection | Unset): + filter_ (list[DashboardPanelParamsDatasetsItemFilterItem] | Unset): + group_by (DashboardPanelParamsDatasetsItemGroupByType1Type0 | None | str | Unset): + aggregate (DashboardPanelParamsDatasetsItemAggregateType0 | None | 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -49,24 +51,24 @@ def to_dict(self) -> dict[str, Any]: DashboardPanelParamsDatasetsItemGroupByType1Type0, ) - name: None | Unset | str + name: None | str | Unset if isinstance(self.name, Unset): name = UNSET else: name = self.name - collection: Unset | str = UNSET + collection: str | Unset = UNSET if not isinstance(self.collection, Unset): collection = self.collection - filter_: Unset | list[dict[str, Any]] = UNSET + filter_: list[dict[str, Any]] | Unset = 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: None | Unset | dict[str, Any] | str + group_by: dict[str, Any] | None | str | Unset if isinstance(self.group_by, Unset): group_by = UNSET elif isinstance(self.group_by, DashboardPanelParamsDatasetsItemGroupByType1Type0): @@ -74,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: group_by = self.group_by - aggregate: None | Unset | dict[str, Any] + aggregate: dict[str, Any] | None | Unset if isinstance(self.aggregate, Unset): aggregate = UNSET elif isinstance(self.aggregate, DashboardPanelParamsDatasetsItemAggregateType0): @@ -110,32 +112,32 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> None | Unset | str: + def _parse_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) name = _parse_name(d.pop("name", UNSET)) _collection = d.pop("collection", UNSET) - collection: Unset | DashboardPanelParamsDatasetsItemCollection + collection: DashboardPanelParamsDatasetsItemCollection | Unset if isinstance(_collection, Unset): collection = UNSET else: collection = check_dashboard_panel_params_datasets_item_collection(_collection) - filter_ = [] _filter_ = d.pop("filter", UNSET) - for filter_item_data in _filter_ or []: - filter_item = DashboardPanelParamsDatasetsItemFilterItem.from_dict(filter_item_data) + 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) - filter_.append(filter_item) + filter_.append(filter_item) - def _parse_group_by( - data: object, - ) -> Union["DashboardPanelParamsDatasetsItemGroupByType1Type0", None, Unset, str]: + def _parse_group_by(data: object) -> DashboardPanelParamsDatasetsItemGroupByType1Type0 | None | str | Unset: if data is None: return data if isinstance(data, Unset): @@ -146,13 +148,13 @@ def _parse_group_by( group_by_type_1_type_0 = DashboardPanelParamsDatasetsItemGroupByType1Type0.from_dict(data) return group_by_type_1_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["DashboardPanelParamsDatasetsItemGroupByType1Type0", None, Unset, str], data) + return cast(DashboardPanelParamsDatasetsItemGroupByType1Type0 | None | str | Unset, data) group_by = _parse_group_by(d.pop("group_by", UNSET)) - def _parse_aggregate(data: object) -> Union["DashboardPanelParamsDatasetsItemAggregateType0", None, Unset]: + def _parse_aggregate(data: object) -> DashboardPanelParamsDatasetsItemAggregateType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -163,9 +165,9 @@ def _parse_aggregate(data: object) -> Union["DashboardPanelParamsDatasetsItemAgg aggregate_type_0 = DashboardPanelParamsDatasetsItemAggregateType0.from_dict(data) return aggregate_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["DashboardPanelParamsDatasetsItemAggregateType0", None, Unset], data) + return cast(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 3cd5dba9..1c0d2a95 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,28 +19,28 @@ class DashboardPanelParamsDatasetsItemAggregateType0: """ Attributes: - operation (Union[Unset, DashboardPanelParamsDatasetsItemAggregateType0Operation]): - key (Union[None, Unset, str]): - cumulative (Union[None, Unset, bool]): + operation (DashboardPanelParamsDatasetsItemAggregateType0Operation | Unset): + key (None | str | Unset): + cumulative (bool | None | Unset): """ - operation: Unset | DashboardPanelParamsDatasetsItemAggregateType0Operation = UNSET - key: None | Unset | str = UNSET - cumulative: None | Unset | bool = UNSET + operation: DashboardPanelParamsDatasetsItemAggregateType0Operation | Unset = UNSET + key: None | str | Unset = UNSET + cumulative: bool | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: Unset | str = UNSET + operation: str | Unset = UNSET if not isinstance(self.operation, Unset): operation = self.operation - key: None | Unset | str + key: None | str | Unset if isinstance(self.key, Unset): key = UNSET else: key = self.key - cumulative: None | Unset | bool + cumulative: bool | None | Unset if isinstance(self.cumulative, Unset): cumulative = UNSET else: @@ -60,27 +62,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: Unset | DashboardPanelParamsDatasetsItemAggregateType0Operation + operation: DashboardPanelParamsDatasetsItemAggregateType0Operation | Unset 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 | Unset | str: + def _parse_key(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) key = _parse_key(d.pop("key", UNSET)) - def _parse_cumulative(data: object) -> None | Unset | bool: + def _parse_cumulative(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) cumulative = _parse_cumulative(d.pop("cumulative", UNSET)) diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item_aggregate_type_0_operation.py b/rootly_sdk/models/dashboard_panel_params_datasets_item_aggregate_type_0_operation.py index 0a95c4c1..8e10cccb 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item_aggregate_type_0_operation.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item_aggregate_type_0_operation.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal DashboardPanelParamsDatasetsItemAggregateType0Operation = Literal["average", "count", "sum"] @@ -17,7 +17,7 @@ def check_dashboard_panel_params_datasets_item_aggregate_type_0_operation( if value is None: return None if value in DASHBOARD_PANEL_PARAMS_DATASETS_ITEM_AGGREGATE_TYPE_0_OPERATION_VALUES: - return cast(DashboardPanelParamsDatasetsItemAggregateType0Operation, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {DASHBOARD_PANEL_PARAMS_DATASETS_ITEM_AGGREGATE_TYPE_0_OPERATION_VALUES!r}" ) diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item_collection.py b/rootly_sdk/models/dashboard_panel_params_datasets_item_collection.py index 0950b6f6..c86ed499 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item_collection.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item_collection.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal DashboardPanelParamsDatasetsItemCollection = Literal[ "alerts", "incident_action_items", "incident_post_mortems", "incidents", "users" @@ -19,7 +19,7 @@ def check_dashboard_panel_params_datasets_item_collection( if value is None: return None if value in DASHBOARD_PANEL_PARAMS_DATASETS_ITEM_COLLECTION_VALUES: - return cast(DashboardPanelParamsDatasetsItemCollection, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {DASHBOARD_PANEL_PARAMS_DATASETS_ITEM_COLLECTION_VALUES!r}" ) 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 fc6cf609..7d73ee70 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,20 +25,20 @@ class DashboardPanelParamsDatasetsItemFilterItem: """ Attributes: - operation (Union[Unset, DashboardPanelParamsDatasetsItemFilterItemOperation]): - rules (Union[Unset, list['DashboardPanelParamsDatasetsItemFilterItemRulesItem']]): + operation (DashboardPanelParamsDatasetsItemFilterItemOperation | Unset): + rules (list[DashboardPanelParamsDatasetsItemFilterItemRulesItem] | Unset): """ - operation: Unset | DashboardPanelParamsDatasetsItemFilterItemOperation = UNSET - rules: Unset | list["DashboardPanelParamsDatasetsItemFilterItemRulesItem"] = UNSET + operation: DashboardPanelParamsDatasetsItemFilterItemOperation | Unset = UNSET + rules: list[DashboardPanelParamsDatasetsItemFilterItemRulesItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: Unset | str = UNSET + operation: str | Unset = UNSET if not isinstance(self.operation, Unset): operation = self.operation - rules: Unset | list[dict[str, Any]] = UNSET + rules: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -61,18 +63,20 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: Unset | DashboardPanelParamsDatasetsItemFilterItemOperation + operation: DashboardPanelParamsDatasetsItemFilterItemOperation | Unset if isinstance(_operation, Unset): operation = UNSET else: operation = check_dashboard_panel_params_datasets_item_filter_item_operation(_operation) - rules = [] _rules = d.pop("rules", UNSET) - for rules_item_data in _rules or []: - rules_item = DashboardPanelParamsDatasetsItemFilterItemRulesItem.from_dict(rules_item_data) + 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) - 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_operation.py b/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_operation.py index 5d98faee..be6355b1 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_operation.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_operation.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal DashboardPanelParamsDatasetsItemFilterItemOperation = Literal["and", "or"] @@ -16,7 +16,7 @@ def check_dashboard_panel_params_datasets_item_filter_item_operation( if value is None: return None if value in DASHBOARD_PANEL_PARAMS_DATASETS_ITEM_FILTER_ITEM_OPERATION_VALUES: - return cast(DashboardPanelParamsDatasetsItemFilterItemOperation, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {DASHBOARD_PANEL_PARAMS_DATASETS_ITEM_FILTER_ITEM_OPERATION_VALUES!r}" ) 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 172edea7..8358c43c 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -21,24 +23,24 @@ class DashboardPanelParamsDatasetsItemFilterItemRulesItem: """ Attributes: - operation (Union[Unset, DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation]): - condition (Union[Unset, DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition]): - key (Union[Unset, str]): - value (Union[Unset, str]): + operation (DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation | Unset): + condition (DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition | Unset): + key (str | Unset): + value (str | Unset): """ - operation: Unset | DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation = UNSET - condition: Unset | DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition = UNSET - key: Unset | str = UNSET - value: Unset | str = UNSET + operation: DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation | Unset = UNSET + condition: DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition | Unset = UNSET + key: str | Unset = UNSET + value: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: Unset | str = UNSET + operation: str | Unset = UNSET if not isinstance(self.operation, Unset): operation = self.operation - condition: Unset | str = UNSET + condition: str | Unset = UNSET if not isinstance(self.condition, Unset): condition = self.condition @@ -64,14 +66,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: Unset | DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation + operation: DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation | Unset 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: Unset | DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition + condition: DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition | Unset if isinstance(_condition, Unset): condition = UNSET else: diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item_condition.py b/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item_condition.py index 8b920d56..dc8921f7 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item_condition.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition = Literal[ "!=", "<=", "=", ">=", "assigned", "contains", "exists", "not_contains", "not_exists", "unassigned" @@ -26,7 +26,7 @@ def check_dashboard_panel_params_datasets_item_filter_item_rules_item_condition( if value is None: return None if value in DASHBOARD_PANEL_PARAMS_DATASETS_ITEM_FILTER_ITEM_RULES_ITEM_CONDITION_VALUES: - return cast(DashboardPanelParamsDatasetsItemFilterItemRulesItemCondition, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {DASHBOARD_PANEL_PARAMS_DATASETS_ITEM_FILTER_ITEM_RULES_ITEM_CONDITION_VALUES!r}" ) diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item_operation.py b/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item_operation.py index f8126ebf..b26b8cee 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item_operation.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item_filter_item_rules_item_operation.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation = Literal["and", "or"] @@ -16,7 +16,7 @@ def check_dashboard_panel_params_datasets_item_filter_item_rules_item_operation( if value is None: return None if value in DASHBOARD_PANEL_PARAMS_DATASETS_ITEM_FILTER_ITEM_RULES_ITEM_OPERATION_VALUES: - return cast(DashboardPanelParamsDatasetsItemFilterItemRulesItemOperation, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {DASHBOARD_PANEL_PARAMS_DATASETS_ITEM_FILTER_ITEM_RULES_ITEM_OPERATION_VALUES!r}" ) 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 cbafb095..2bbe0ace 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/dashboard_panel_params_datasets_item_group_by_type_1_type_0_key.py b/rootly_sdk/models/dashboard_panel_params_datasets_item_group_by_type_1_type_0_key.py index ef31aadb..ebf710d2 100644 --- a/rootly_sdk/models/dashboard_panel_params_datasets_item_group_by_type_1_type_0_key.py +++ b/rootly_sdk/models/dashboard_panel_params_datasets_item_group_by_type_1_type_0_key.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal DashboardPanelParamsDatasetsItemGroupByType1Type0Key = Literal["alert_field", "custom_field", "incident_role"] @@ -17,7 +17,7 @@ def check_dashboard_panel_params_datasets_item_group_by_type_1_type_0_key( if value is None: return None if value in DASHBOARD_PANEL_PARAMS_DATASETS_ITEM_GROUP_BY_TYPE_1_TYPE_0_KEY_VALUES: - return cast(DashboardPanelParamsDatasetsItemGroupByType1Type0Key, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {DASHBOARD_PANEL_PARAMS_DATASETS_ITEM_GROUP_BY_TYPE_1_TYPE_0_KEY_VALUES!r}" ) diff --git a/rootly_sdk/models/dashboard_panel_params_display.py b/rootly_sdk/models/dashboard_panel_params_display.py index 95900bcc..1f55fc23 100644 --- a/rootly_sdk/models/dashboard_panel_params_display.py +++ b/rootly_sdk/models/dashboard_panel_params_display.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal DashboardPanelParamsDisplay = Literal[ "aggregate_value", @@ -27,5 +27,5 @@ def check_dashboard_panel_params_display(value: str | None) -> DashboardPanelPar if value is None: return None if value in DASHBOARD_PANEL_PARAMS_DISPLAY_VALUES: - return cast(DashboardPanelParamsDisplay, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {DASHBOARD_PANEL_PARAMS_DISPLAY_VALUES!r}") diff --git a/rootly_sdk/models/dashboard_panel_params_legend.py b/rootly_sdk/models/dashboard_panel_params_legend.py index 51b35f9d..e39a194f 100644 --- a/rootly_sdk/models/dashboard_panel_params_legend.py +++ b/rootly_sdk/models/dashboard_panel_params_legend.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -17,14 +19,14 @@ class DashboardPanelParamsLegend: """ Attributes: - groups (Union[Unset, DashboardPanelParamsLegendGroups]): Default: 'all'. + groups (DashboardPanelParamsLegendGroups | Unset): Default: 'all'. """ - groups: Unset | DashboardPanelParamsLegendGroups = "all" + groups: DashboardPanelParamsLegendGroups | Unset = "all" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - groups: Unset | str = UNSET + groups: str | Unset = UNSET if not isinstance(self.groups, Unset): groups = self.groups @@ -40,7 +42,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: Unset | DashboardPanelParamsLegendGroups + groups: DashboardPanelParamsLegendGroups | Unset if isinstance(_groups, Unset): groups = UNSET else: diff --git a/rootly_sdk/models/dashboard_panel_params_legend_groups.py b/rootly_sdk/models/dashboard_panel_params_legend_groups.py index 1d324306..dfeea5ee 100644 --- a/rootly_sdk/models/dashboard_panel_params_legend_groups.py +++ b/rootly_sdk/models/dashboard_panel_params_legend_groups.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal DashboardPanelParamsLegendGroups = Literal["all", "charted"] @@ -12,5 +12,5 @@ def check_dashboard_panel_params_legend_groups(value: str | None) -> DashboardPa if value is None: return None if value in DASHBOARD_PANEL_PARAMS_LEGEND_GROUPS_VALUES: - return cast(DashboardPanelParamsLegendGroups, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {DASHBOARD_PANEL_PARAMS_LEGEND_GROUPS_VALUES!r}") diff --git a/rootly_sdk/models/dashboard_panel_position_type_0.py b/rootly_sdk/models/dashboard_panel_position_type_0.py index 29f03cc9..f64f7720 100644 --- a/rootly_sdk/models/dashboard_panel_position_type_0.py +++ b/rootly_sdk/models/dashboard_panel_position_type_0.py @@ -1,3 +1,5 @@ +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 f4667135..91d108e2 100644 --- a/rootly_sdk/models/dashboard_panel_response.py +++ b/rootly_sdk/models/dashboard_panel_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class DashboardPanelResponse: """ Attributes: data (DashboardPanelResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "DashboardPanelResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: DashboardPanelResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 f60ca138..5e5cd3ee 100644 --- a/rootly_sdk/models/dashboard_panel_response_data.py +++ b/rootly_sdk/models/dashboard_panel_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/dashboard_panel_response_data_type.py b/rootly_sdk/models/dashboard_panel_response_data_type.py index 67f19fc0..4bed1bcf 100644 --- a/rootly_sdk/models/dashboard_panel_response_data_type.py +++ b/rootly_sdk/models/dashboard_panel_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal DashboardPanelResponseDataType = Literal["dashboard_panels"] @@ -11,5 +11,5 @@ def check_dashboard_panel_response_data_type(value: str | None) -> DashboardPane if value is None: return None if value in DASHBOARD_PANEL_RESPONSE_DATA_TYPE_VALUES: - return cast(DashboardPanelResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {DASHBOARD_PANEL_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/dashboard_response.py b/rootly_sdk/models/dashboard_response.py index 8f5c6935..7ba57151 100644 --- a/rootly_sdk/models/dashboard_response.py +++ b/rootly_sdk/models/dashboard_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class DashboardResponse: """ Attributes: data (DashboardResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "DashboardResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: DashboardResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 cf64ee80..a650842b 100644 --- a/rootly_sdk/models/dashboard_response_data.py +++ b/rootly_sdk/models/dashboard_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/dashboard_response_data_type.py b/rootly_sdk/models/dashboard_response_data_type.py index 5c4fb6fc..bcf3b085 100644 --- a/rootly_sdk/models/dashboard_response_data_type.py +++ b/rootly_sdk/models/dashboard_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal DashboardResponseDataType = Literal["dashboards"] @@ -11,5 +11,5 @@ def check_dashboard_response_data_type(value: str | None) -> DashboardResponseDa if value is None: return None if value in DASHBOARD_RESPONSE_DATA_TYPE_VALUES: - return cast(DashboardResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {DASHBOARD_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/delete_alert_route_response_200.py b/rootly_sdk/models/delete_alert_route_response_200.py index 01c2a996..87303581 100644 --- a/rootly_sdk/models/delete_alert_route_response_200.py +++ b/rootly_sdk/models/delete_alert_route_response_200.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,14 +19,14 @@ class DeleteAlertRouteResponse200: """ Attributes: - data (Union[Unset, DeleteAlertRouteResponse200Data]): + data (DeleteAlertRouteResponse200Data | Unset): """ - data: Union[Unset, "DeleteAlertRouteResponse200Data"] = UNSET + data: DeleteAlertRouteResponse200Data | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Unset | dict[str, Any] = UNSET + data: dict[str, Any] | Unset = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +44,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Unset | DeleteAlertRouteResponse200Data + data: DeleteAlertRouteResponse200Data | Unset 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 4d975e7f..2913fe1f 100644 --- a/rootly_sdk/models/delete_alert_route_response_200_data.py +++ b/rootly_sdk/models/delete_alert_route_response_200_data.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,14 +19,14 @@ class DeleteAlertRouteResponse200Data: """ Attributes: - id (Union[Unset, str]): - type_ (Union[Unset, str]): - attributes (Union[Unset, DeleteAlertRouteResponse200DataAttributes]): + id (str | Unset): + type_ (str | Unset): + attributes (DeleteAlertRouteResponse200DataAttributes | Unset): """ - id: Unset | str = UNSET - type_: Unset | str = UNSET - attributes: Union[Unset, "DeleteAlertRouteResponse200DataAttributes"] = UNSET + id: str | Unset = UNSET + type_: str | Unset = UNSET + attributes: DeleteAlertRouteResponse200DataAttributes | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: type_ = self.type_ - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -58,7 +60,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_ = d.pop("type", UNSET) _attributes = d.pop("attributes", UNSET) - attributes: Unset | DeleteAlertRouteResponse200DataAttributes + attributes: DeleteAlertRouteResponse200DataAttributes | Unset 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 1010554d..a811a57e 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,10 +15,10 @@ class DeleteAlertRouteResponse200DataAttributes: """ Attributes: - deleted (Union[Unset, bool]): + deleted (bool | Unset): """ - deleted: Unset | bool = UNSET + deleted: bool | Unset = UNSET 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 f750b447..4864d96b 100644 --- a/rootly_sdk/models/duplicate_incident.py +++ b/rootly_sdk/models/duplicate_incident.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.duplicate_incident_data import DuplicateIncidentData @@ -18,14 +19,13 @@ class DuplicateIncident: data (DuplicateIncidentData): """ - data: "DuplicateIncidentData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: DuplicateIncidentData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - duplicate_incident.additional_properties = d return duplicate_incident - - @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/duplicate_incident_data.py b/rootly_sdk/models/duplicate_incident_data.py index aab0a6cb..489f9aa6 100644 --- a/rootly_sdk/models/duplicate_incident_data.py +++ b/rootly_sdk/models/duplicate_incident_data.py @@ -1,8 +1,9 @@ +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.duplicate_incident_data_type import DuplicateIncidentDataType, check_duplicate_incident_data_type @@ -22,8 +23,7 @@ class DuplicateIncidentData: """ type_: DuplicateIncidentDataType - attributes: "DuplicateIncidentDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: DuplicateIncidentDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - duplicate_incident_data.additional_properties = d return duplicate_incident_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/duplicate_incident_data_attributes.py b/rootly_sdk/models/duplicate_incident_data_attributes.py index 3ff52dac..61946c43 100644 --- a/rootly_sdk/models/duplicate_incident_data_attributes.py +++ b/rootly_sdk/models/duplicate_incident_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,25 +14,25 @@ class DuplicateIncidentDataAttributes: """ Attributes: - 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): + auto_cancel_incident (bool | None | Unset): Default: True. + reason_for_cancellation (None | str | Unset): Why was the incident cancelled? """ - duplicate_incident_id: Unset | str = UNSET - auto_cancel_incident: None | Unset | bool = True - reason_for_cancellation: None | Unset | str = UNSET + duplicate_incident_id: str | Unset = UNSET + auto_cancel_incident: bool | None | Unset = True + reason_for_cancellation: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: duplicate_incident_id = self.duplicate_incident_id - auto_cancel_incident: None | Unset | bool + auto_cancel_incident: bool | None | Unset if isinstance(self.auto_cancel_incident, Unset): auto_cancel_incident = UNSET else: auto_cancel_incident = self.auto_cancel_incident - reason_for_cancellation: None | Unset | str + reason_for_cancellation: None | str | Unset if isinstance(self.reason_for_cancellation, Unset): reason_for_cancellation = UNSET else: @@ -53,21 +55,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) -> None | Unset | bool: + def _parse_auto_cancel_incident(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) auto_cancel_incident = _parse_auto_cancel_incident(d.pop("auto_cancel_incident", UNSET)) - def _parse_reason_for_cancellation(data: object) -> None | Unset | str: + def _parse_reason_for_cancellation(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) reason_for_cancellation = _parse_reason_for_cancellation(d.pop("reason_for_cancellation", UNSET)) diff --git a/rootly_sdk/models/duplicate_incident_data_type.py b/rootly_sdk/models/duplicate_incident_data_type.py index c133211a..a84eb8bb 100644 --- a/rootly_sdk/models/duplicate_incident_data_type.py +++ b/rootly_sdk/models/duplicate_incident_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal DuplicateIncidentDataType = Literal["incidents"] @@ -11,5 +11,5 @@ def check_duplicate_incident_data_type(value: str | None) -> DuplicateIncidentDa if value is None: return None if value in DUPLICATE_INCIDENT_DATA_TYPE_VALUES: - return cast(DuplicateIncidentDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {DUPLICATE_INCIDENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/edge_connector.py b/rootly_sdk/models/edge_connector.py index d58e562c..c2289131 100644 --- a/rootly_sdk/models/edge_connector.py +++ b/rootly_sdk/models/edge_connector.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,7 +20,7 @@ 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]: diff --git a/rootly_sdk/models/edge_connector_action.py b/rootly_sdk/models/edge_connector_action.py index 9876c156..c805f1fa 100644 --- a/rootly_sdk/models/edge_connector_action.py +++ b/rootly_sdk/models/edge_connector_action.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,7 +20,7 @@ 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]: diff --git a/rootly_sdk/models/edge_connector_action_data.py b/rootly_sdk/models/edge_connector_action_data.py index 591a761b..91db467a 100644 --- a/rootly_sdk/models/edge_connector_action_data.py +++ b/rootly_sdk/models/edge_connector_action_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -25,7 +27,7 @@ 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]: diff --git a/rootly_sdk/models/edge_connector_action_data_attributes.py b/rootly_sdk/models/edge_connector_action_data_attributes.py index 4ab3bd1f..15763e62 100644 --- a/rootly_sdk/models/edge_connector_action_data_attributes.py +++ b/rootly_sdk/models/edge_connector_action_data_attributes.py @@ -1,10 +1,11 @@ +from __future__ import annotations + 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.edge_connector_action_data_attributes_action_type import ( EdgeConnectorActionDataAttributesActionType, @@ -31,27 +32,26 @@ class EdgeConnectorActionDataAttributes: Attributes: name (str): Action name action_type (EdgeConnectorActionDataAttributesActionType): Action type - 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]): + 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): """ name: str action_type: EdgeConnectorActionDataAttributesActionType - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -61,23 +61,23 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - icon: Unset | str = UNSET + icon: str | Unset = UNSET if not isinstance(self.icon, Unset): icon = self.icon - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - timeout: None | Unset | int + timeout: int | None | Unset if isinstance(self.timeout, Unset): timeout = UNSET else: timeout = self.timeout - parameters: None | Unset | list[dict[str, Any]] + parameters: list[dict[str, Any]] | None | Unset if isinstance(self.parameters, Unset): parameters = UNSET elif isinstance(self.parameters, list): @@ -89,7 +89,7 @@ def to_dict(self) -> dict[str, Any]: else: parameters = self.parameters - last_executed_at: None | Unset | str + last_executed_at: None | str | Unset if isinstance(self.last_executed_at, Unset): last_executed_at = UNSET elif isinstance(self.last_executed_at, datetime.datetime): @@ -97,11 +97,11 @@ def to_dict(self) -> dict[str, Any]: else: last_executed_at = self.last_executed_at - created_at: Unset | str = UNSET + created_at: str | Unset = UNSET if not isinstance(self.created_at, Unset): created_at = self.created_at.isoformat() - updated_at: Unset | str = UNSET + updated_at: str | Unset = UNSET if not isinstance(self.updated_at, Unset): updated_at = self.updated_at.isoformat() @@ -146,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: Unset | EdgeConnectorActionDataAttributesIcon + icon: EdgeConnectorActionDataAttributesIcon | Unset if isinstance(_icon, Unset): icon = UNSET else: icon = check_edge_connector_action_data_attributes_icon(_icon) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_timeout(data: object) -> None | Unset | int: + def _parse_timeout(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) timeout = _parse_timeout(d.pop("timeout", UNSET)) def _parse_parameters( data: object, - ) -> None | Unset | list["EdgeConnectorActionDataAttributesParametersType0Item"]: + ) -> list[EdgeConnectorActionDataAttributesParametersType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -190,13 +190,13 @@ def _parse_parameters( parameters_type_0.append(parameters_type_0_item) return parameters_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["EdgeConnectorActionDataAttributesParametersType0Item"], data) + return cast(list[EdgeConnectorActionDataAttributesParametersType0Item] | None | Unset, data) parameters = _parse_parameters(d.pop("parameters", UNSET)) - def _parse_last_executed_at(data: object) -> None | Unset | datetime.datetime: + def _parse_last_executed_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -204,28 +204,28 @@ def _parse_last_executed_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - last_executed_at_type_0 = isoparse(data) + last_executed_at_type_0 = datetime.datetime.fromisoformat(data) return last_executed_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) last_executed_at = _parse_last_executed_at(d.pop("last_executed_at", UNSET)) _created_at = d.pop("created_at", UNSET) - created_at: Unset | datetime.datetime + created_at: datetime.datetime | Unset if isinstance(_created_at, Unset): created_at = UNSET else: - created_at = isoparse(_created_at) + created_at = datetime.datetime.fromisoformat(_created_at) _updated_at = d.pop("updated_at", UNSET) - updated_at: Unset | datetime.datetime + updated_at: datetime.datetime | Unset if isinstance(_updated_at, Unset): updated_at = UNSET else: - updated_at = isoparse(_updated_at) + updated_at = datetime.datetime.fromisoformat(_updated_at) edge_connector_action_data_attributes = cls( name=name, diff --git a/rootly_sdk/models/edge_connector_action_data_attributes_action_type.py b/rootly_sdk/models/edge_connector_action_data_attributes_action_type.py index 5596899e..9f389ee0 100644 --- a/rootly_sdk/models/edge_connector_action_data_attributes_action_type.py +++ b/rootly_sdk/models/edge_connector_action_data_attributes_action_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EdgeConnectorActionDataAttributesActionType = Literal["http", "script"] @@ -14,7 +14,7 @@ def check_edge_connector_action_data_attributes_action_type( if value is None: return None if value in EDGE_CONNECTOR_ACTION_DATA_ATTRIBUTES_ACTION_TYPE_VALUES: - return cast(EdgeConnectorActionDataAttributesActionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {EDGE_CONNECTOR_ACTION_DATA_ATTRIBUTES_ACTION_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/edge_connector_action_data_attributes_icon.py b/rootly_sdk/models/edge_connector_action_data_attributes_icon.py index 8d396dec..2d60ab79 100644 --- a/rootly_sdk/models/edge_connector_action_data_attributes_icon.py +++ b/rootly_sdk/models/edge_connector_action_data_attributes_icon.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EdgeConnectorActionDataAttributesIcon = Literal[ "arrow-path", @@ -35,7 +35,7 @@ def check_edge_connector_action_data_attributes_icon(value: str | None) -> EdgeC if value is None: return None if value in EDGE_CONNECTOR_ACTION_DATA_ATTRIBUTES_ICON_VALUES: - return cast(EdgeConnectorActionDataAttributesIcon, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {EDGE_CONNECTOR_ACTION_DATA_ATTRIBUTES_ICON_VALUES!r}" ) 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 1f89cdc2..b7212cb9 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,44 +19,44 @@ class EdgeConnectorActionDataAttributesParametersType0Item: """ Attributes: - 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): + type_ (EdgeConnectorActionDataAttributesParametersType0ItemType | Unset): + required (bool | Unset): + description (None | str | Unset): + default (None | str | Unset): Default value (any type) + options (list[str] | None | 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ required = self.required - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - default: None | Unset | str + default: None | str | Unset if isinstance(self.default, Unset): default = UNSET else: default = self.default - options: None | Unset | list[str] + options: list[str] | None | Unset if isinstance(self.options, Unset): options = UNSET elif isinstance(self.options, list): @@ -87,7 +89,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | EdgeConnectorActionDataAttributesParametersType0ItemType + type_: EdgeConnectorActionDataAttributesParametersType0ItemType | Unset if isinstance(_type_, Unset): type_ = UNSET else: @@ -95,25 +97,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: required = d.pop("required", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_default(data: object) -> None | Unset | str: + def _parse_default(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) default = _parse_default(d.pop("default", UNSET)) - def _parse_options(data: object) -> None | Unset | list[str]: + def _parse_options(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -124,9 +126,9 @@ def _parse_options(data: object) -> None | Unset | list[str]: options_type_0 = cast(list[str], data) return options_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) options = _parse_options(d.pop("options", UNSET)) diff --git a/rootly_sdk/models/edge_connector_action_data_attributes_parameters_type_0_item_type.py b/rootly_sdk/models/edge_connector_action_data_attributes_parameters_type_0_item_type.py index ba19ced4..d502fe90 100644 --- a/rootly_sdk/models/edge_connector_action_data_attributes_parameters_type_0_item_type.py +++ b/rootly_sdk/models/edge_connector_action_data_attributes_parameters_type_0_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EdgeConnectorActionDataAttributesParametersType0ItemType = Literal["boolean", "number", "string"] @@ -17,7 +17,7 @@ def check_edge_connector_action_data_attributes_parameters_type_0_item_type( if value is None: return None if value in EDGE_CONNECTOR_ACTION_DATA_ATTRIBUTES_PARAMETERS_TYPE_0_ITEM_TYPE_VALUES: - return cast(EdgeConnectorActionDataAttributesParametersType0ItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {EDGE_CONNECTOR_ACTION_DATA_ATTRIBUTES_PARAMETERS_TYPE_0_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/edge_connector_action_data_type.py b/rootly_sdk/models/edge_connector_action_data_type.py index c8988750..a5a9a387 100644 --- a/rootly_sdk/models/edge_connector_action_data_type.py +++ b/rootly_sdk/models/edge_connector_action_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EdgeConnectorActionDataType = Literal["edge_connector_actions"] @@ -11,5 +11,5 @@ def check_edge_connector_action_data_type(value: str | None) -> EdgeConnectorAct if value is None: return None if value in EDGE_CONNECTOR_ACTION_DATA_TYPE_VALUES: - return cast(EdgeConnectorActionDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {EDGE_CONNECTOR_ACTION_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/edge_connector_data.py b/rootly_sdk/models/edge_connector_data.py index be9d7e20..dc408332 100644 --- a/rootly_sdk/models/edge_connector_data.py +++ b/rootly_sdk/models/edge_connector_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -25,7 +27,7 @@ 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]: diff --git a/rootly_sdk/models/edge_connector_data_attributes.py b/rootly_sdk/models/edge_connector_data_attributes.py index 07ae460c..67137cd1 100644 --- a/rootly_sdk/models/edge_connector_data_attributes.py +++ b/rootly_sdk/models/edge_connector_data_attributes.py @@ -1,10 +1,12 @@ +from __future__ import annotations + import datetime 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 dateutil.parser import isoparse from ..models.edge_connector_data_attributes_status import ( EdgeConnectorDataAttributesStatus, @@ -21,32 +23,35 @@ class EdgeConnectorDataAttributes: Attributes: name (str): Connector name status (EdgeConnectorDataAttributesStatus): Connector status - 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]): + description (None | str | Unset): Connector description + subscriptions (list[str] | Unset): Array of event types to subscribe to + owner_group_ids (list[UUID] | Unset): IDs of the teams (groups) that own this connector. Empty means the + connector is not scoped to a team + 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): """ name: str status: EdgeConnectorDataAttributesStatus - 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 + description: None | str | Unset = UNSET + subscriptions: list[str] | Unset = UNSET + owner_group_ids: list[UUID] | 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,17 +59,24 @@ def to_dict(self) -> dict[str, Any]: status: str = self.status - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - subscriptions: Unset | list[str] = UNSET + subscriptions: list[str] | Unset = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions - last_poll_at: None | Unset | str + owner_group_ids: list[str] | Unset = UNSET + if not isinstance(self.owner_group_ids, Unset): + owner_group_ids = [] + for owner_group_ids_item_data in self.owner_group_ids: + owner_group_ids_item = str(owner_group_ids_item_data) + owner_group_ids.append(owner_group_ids_item) + + last_poll_at: None | str | Unset if isinstance(self.last_poll_at, Unset): last_poll_at = UNSET elif isinstance(self.last_poll_at, datetime.datetime): @@ -84,11 +96,11 @@ def to_dict(self) -> dict[str, Any]: deliveries_failed_count = self.deliveries_failed_count - created_at: Unset | str = UNSET + created_at: str | Unset = UNSET if not isinstance(self.created_at, Unset): created_at = self.created_at.isoformat() - updated_at: Unset | str = UNSET + updated_at: str | Unset = UNSET if not isinstance(self.updated_at, Unset): updated_at = self.updated_at.isoformat() @@ -104,6 +116,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if subscriptions is not UNSET: field_dict["subscriptions"] = subscriptions + if owner_group_ids is not UNSET: + field_dict["owner_group_ids"] = owner_group_ids if last_poll_at is not UNSET: field_dict["last_poll_at"] = last_poll_at if online is not UNSET: @@ -132,18 +146,27 @@ 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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) subscriptions = cast(list[str], d.pop("subscriptions", UNSET)) - def _parse_last_poll_at(data: object) -> None | Unset | datetime.datetime: + _owner_group_ids = d.pop("owner_group_ids", UNSET) + owner_group_ids: list[UUID] | Unset = UNSET + if _owner_group_ids is not UNSET: + owner_group_ids = [] + for owner_group_ids_item_data in _owner_group_ids: + owner_group_ids_item = UUID(owner_group_ids_item_data) + + owner_group_ids.append(owner_group_ids_item) + + def _parse_last_poll_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -151,12 +174,12 @@ def _parse_last_poll_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - last_poll_at_type_0 = isoparse(data) + last_poll_at_type_0 = datetime.datetime.fromisoformat(data) return last_poll_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) last_poll_at = _parse_last_poll_at(d.pop("last_poll_at", UNSET)) @@ -173,24 +196,25 @@ def _parse_last_poll_at(data: object) -> None | Unset | datetime.datetime: deliveries_failed_count = d.pop("deliveries_failed_count", UNSET) _created_at = d.pop("created_at", UNSET) - created_at: Unset | datetime.datetime + created_at: datetime.datetime | Unset if isinstance(_created_at, Unset): created_at = UNSET else: - created_at = isoparse(_created_at) + created_at = datetime.datetime.fromisoformat(_created_at) _updated_at = d.pop("updated_at", UNSET) - updated_at: Unset | datetime.datetime + updated_at: datetime.datetime | Unset if isinstance(_updated_at, Unset): updated_at = UNSET else: - updated_at = isoparse(_updated_at) + updated_at = datetime.datetime.fromisoformat(_updated_at) edge_connector_data_attributes = cls( name=name, status=status, description=description, subscriptions=subscriptions, + owner_group_ids=owner_group_ids, last_poll_at=last_poll_at, online=online, deliveries_count=deliveries_count, diff --git a/rootly_sdk/models/edge_connector_data_attributes_status.py b/rootly_sdk/models/edge_connector_data_attributes_status.py index 8740de58..3e974d2d 100644 --- a/rootly_sdk/models/edge_connector_data_attributes_status.py +++ b/rootly_sdk/models/edge_connector_data_attributes_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EdgeConnectorDataAttributesStatus = Literal["active", "paused"] @@ -12,5 +12,5 @@ def check_edge_connector_data_attributes_status(value: str | None) -> EdgeConnec if value is None: return None if value in EDGE_CONNECTOR_DATA_ATTRIBUTES_STATUS_VALUES: - return cast(EdgeConnectorDataAttributesStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {EDGE_CONNECTOR_DATA_ATTRIBUTES_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/edge_connector_data_type.py b/rootly_sdk/models/edge_connector_data_type.py index 299ba84b..68c6f0b5 100644 --- a/rootly_sdk/models/edge_connector_data_type.py +++ b/rootly_sdk/models/edge_connector_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EdgeConnectorDataType = Literal["edge_connectors"] @@ -11,5 +11,5 @@ def check_edge_connector_data_type(value: str | None) -> EdgeConnectorDataType | if value is None: return None if value in EDGE_CONNECTOR_DATA_TYPE_VALUES: - return cast(EdgeConnectorDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {EDGE_CONNECTOR_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/environment.py b/rootly_sdk/models/environment.py index 06b0a454..5906aeea 100644 --- a/rootly_sdk/models/environment.py +++ b/rootly_sdk/models/environment.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -23,37 +25,36 @@ class Environment: name (str): The name of the environment created_at (str): Date of creation updated_at (str): Date of last update - 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 + 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 + public_description (None | str | Unset): The status page 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 environment - properties (Union[None, Unset, list['EnvironmentPropertiesType0Item']]): Array of property values for this - environment. + properties (list[EnvironmentPropertiesType0Item] | None | Unset): Array of property values for this environment. """ name: str created_at: str updated_at: str - 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 + slug: str | Unset = UNSET + managed_by: EnvironmentManagedBy | Unset = UNSET + external_id: None | 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 + slack_channels: list[EnvironmentSlackChannelsType0Item] | None | Unset = UNSET + slack_aliases: list[EnvironmentSlackAliasesType0Item] | None | Unset = UNSET + properties: list[EnvironmentPropertiesType0Item] | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -65,29 +66,29 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - managed_by: Unset | str = UNSET + managed_by: str | Unset = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -96,19 +97,19 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - slack_channels: None | Unset | list[dict[str, Any]] + slack_channels: list[dict[str, Any]] | None | Unset if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -120,7 +121,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: None | Unset | list[dict[str, Any]] + slack_aliases: list[dict[str, Any]] | None | Unset if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -132,7 +133,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: None | Unset | list[dict[str, Any]] + properties: list[dict[str, Any]] | None | Unset if isinstance(self.properties, Unset): properties = UNSET elif isinstance(self.properties, list): @@ -194,40 +195,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: Unset | EnvironmentManagedBy + managed_by: EnvironmentManagedBy | Unset if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_environment_managed_by(_managed_by) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -238,31 +239,31 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_slack_channels(data: object) -> None | Unset | list["EnvironmentSlackChannelsType0Item"]: + def _parse_slack_channels(data: object) -> list[EnvironmentSlackChannelsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -280,13 +281,13 @@ def _parse_slack_channels(data: object) -> None | Unset | list["EnvironmentSlack slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["EnvironmentSlackChannelsType0Item"], data) + return cast(list[EnvironmentSlackChannelsType0Item] | None | Unset, data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> None | Unset | list["EnvironmentSlackAliasesType0Item"]: + def _parse_slack_aliases(data: object) -> list[EnvironmentSlackAliasesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -304,13 +305,13 @@ def _parse_slack_aliases(data: object) -> None | Unset | list["EnvironmentSlackA slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["EnvironmentSlackAliasesType0Item"], data) + return cast(list[EnvironmentSlackAliasesType0Item] | None | Unset, data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_properties(data: object) -> None | Unset | list["EnvironmentPropertiesType0Item"]: + def _parse_properties(data: object) -> list[EnvironmentPropertiesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -326,9 +327,9 @@ def _parse_properties(data: object) -> None | Unset | list["EnvironmentPropertie properties_type_0.append(properties_type_0_item) return properties_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["EnvironmentPropertiesType0Item"], data) + return cast(list[EnvironmentPropertiesType0Item] | None | Unset, data) properties = _parse_properties(d.pop("properties", UNSET)) diff --git a/rootly_sdk/models/environment_list.py b/rootly_sdk/models/environment_list.py index 2df8b7b3..351ab8aa 100644 --- a/rootly_sdk/models/environment_list.py +++ b/rootly_sdk/models/environment_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class EnvironmentList: """ Attributes: - data (list['EnvironmentListDataItem']): + data (list[EnvironmentListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["EnvironmentListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[EnvironmentListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 b139edc2..59cbd582 100644 --- a/rootly_sdk/models/environment_list_data_item.py +++ b/rootly_sdk/models/environment_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/environment_list_data_item_type.py b/rootly_sdk/models/environment_list_data_item_type.py index 76c40e1c..de6f4603 100644 --- a/rootly_sdk/models/environment_list_data_item_type.py +++ b/rootly_sdk/models/environment_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EnvironmentListDataItemType = Literal["environments"] @@ -11,5 +11,5 @@ def check_environment_list_data_item_type(value: str | None) -> EnvironmentListD if value is None: return None if value in ENVIRONMENT_LIST_DATA_ITEM_TYPE_VALUES: - return cast(EnvironmentListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ENVIRONMENT_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/environment_managed_by.py b/rootly_sdk/models/environment_managed_by.py index ee5a4ff5..03bca805 100644 --- a/rootly_sdk/models/environment_managed_by.py +++ b/rootly_sdk/models/environment_managed_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EnvironmentManagedBy = Literal["admin_web", "api", "backstage", "catalog_sync", "pulumi", "terraform", "web"] @@ -17,5 +17,5 @@ def check_environment_managed_by(value: str | None) -> EnvironmentManagedBy | No if value is None: return None if value in ENVIRONMENT_MANAGED_BY_VALUES: - return cast(EnvironmentManagedBy, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ENVIRONMENT_MANAGED_BY_VALUES!r}") diff --git a/rootly_sdk/models/environment_properties_type_0_item.py b/rootly_sdk/models/environment_properties_type_0_item.py index a45b603f..1e6c007a 100644 --- a/rootly_sdk/models/environment_properties_type_0_item.py +++ b/rootly_sdk/models/environment_properties_type_0_item.py @@ -1,3 +1,5 @@ +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 de2f9bd3..974949c9 100644 --- a/rootly_sdk/models/environment_response.py +++ b/rootly_sdk/models/environment_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class EnvironmentResponse: """ Attributes: data (EnvironmentResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "EnvironmentResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: EnvironmentResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 96dfb328..5202818b 100644 --- a/rootly_sdk/models/environment_response_data.py +++ b/rootly_sdk/models/environment_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/environment_response_data_type.py b/rootly_sdk/models/environment_response_data_type.py index 128d63eb..cc231aa1 100644 --- a/rootly_sdk/models/environment_response_data_type.py +++ b/rootly_sdk/models/environment_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EnvironmentResponseDataType = Literal["environments"] @@ -11,5 +11,5 @@ def check_environment_response_data_type(value: str | None) -> EnvironmentRespon if value is None: return None if value in ENVIRONMENT_RESPONSE_DATA_TYPE_VALUES: - return cast(EnvironmentResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ENVIRONMENT_RESPONSE_DATA_TYPE_VALUES!r}") 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 01439b1b..35b6c464 100644 --- a/rootly_sdk/models/environment_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/environment_slack_aliases_type_0_item.py @@ -1,3 +1,5 @@ +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 9d2d54a7..aab61759 100644 --- a/rootly_sdk/models/environment_slack_channels_type_0_item.py +++ b/rootly_sdk/models/environment_slack_channels_type_0_item.py @@ -1,3 +1,5 @@ +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 af2abffb..eb0f6933 100644 --- a/rootly_sdk/models/errors_list.py +++ b/rootly_sdk/models/errors_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -17,14 +19,14 @@ class ErrorsList: """ Attributes: - errors (Union[Unset, list['ErrorsListErrorsItem']]): + errors (list[ErrorsListErrorsItem] | Unset): """ - errors: Unset | list["ErrorsListErrorsItem"] = UNSET + errors: list[ErrorsListErrorsItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - errors: Unset | list[dict[str, Any]] = UNSET + errors: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.errors, Unset): errors = [] for errors_item_data in self.errors: @@ -44,12 +46,14 @@ 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) - for errors_item_data in _errors or []: - errors_item = ErrorsListErrorsItem.from_dict(errors_item_data) + 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) - 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 d4a4f5c2..55c41afb 100644 --- a/rootly_sdk/models/errors_list_errors_item.py +++ b/rootly_sdk/models/errors_list_errors_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,14 +17,14 @@ class ErrorsListErrorsItem: Attributes: title (str): status (str): - code (Union[None, Unset, str]): - detail (Union[None, Unset, str]): + code (None | str | Unset): + detail (None | str | Unset): """ title: str status: str - code: None | Unset | str = UNSET - detail: None | Unset | str = UNSET + code: None | str | Unset = UNSET + detail: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -30,13 +32,13 @@ def to_dict(self) -> dict[str, Any]: status = self.status - code: None | Unset | str + code: None | str | Unset if isinstance(self.code, Unset): code = UNSET else: code = self.code - detail: None | Unset | str + detail: None | str | Unset if isinstance(self.detail, Unset): detail = UNSET else: @@ -64,21 +66,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = d.pop("status") - def _parse_code(data: object) -> None | Unset | str: + def _parse_code(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) code = _parse_code(d.pop("code", UNSET)) - def _parse_detail(data: object) -> None | Unset | str: + def _parse_detail(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 a42c7953..97d4f382 100644 --- a/rootly_sdk/models/escalate_alert.py +++ b/rootly_sdk/models/escalate_alert.py @@ -1,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -17,19 +18,18 @@ class EscalateAlert: """ Attributes: - data (Union[Unset, EscalateAlertData]): + data (EscalateAlertData | Unset): """ - data: Union[Unset, "EscalateAlertData"] = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: EscalateAlertData | Unset = UNSET def to_dict(self) -> dict[str, Any]: - data: Unset | dict[str, Any] = UNSET + data: dict[str, Any] | Unset = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if data is not UNSET: field_dict["data"] = data @@ -42,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: Unset | EscalateAlertData + data: EscalateAlertData | Unset if isinstance(_data, Unset): data = UNSET else: @@ -52,21 +52,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - escalate_alert.additional_properties = d return escalate_alert - - @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/escalate_alert_data.py b/rootly_sdk/models/escalate_alert_data.py index 8f065bd2..fa071e28 100644 --- a/rootly_sdk/models/escalate_alert_data.py +++ b/rootly_sdk/models/escalate_alert_data.py @@ -1,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.escalate_alert_data_type import EscalateAlertDataType, check_escalate_alert_data_type from ..types import UNSET, Unset @@ -18,25 +19,24 @@ class EscalateAlertData: """ Attributes: - type_ (Union[Unset, EscalateAlertDataType]): - attributes (Union[Unset, EscalateAlertDataAttributes]): + type_ (EscalateAlertDataType | Unset): + attributes (EscalateAlertDataAttributes | Unset): """ - type_: Unset | EscalateAlertDataType = UNSET - attributes: Union[Unset, "EscalateAlertDataAttributes"] = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + type_: EscalateAlertDataType | Unset = UNSET + attributes: EscalateAlertDataAttributes | Unset = UNSET def to_dict(self) -> dict[str, Any]: - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if type_ is not UNSET: field_dict["type"] = type_ @@ -51,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_: Unset | EscalateAlertDataType + type_: EscalateAlertDataType | Unset if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_escalate_alert_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Unset | EscalateAlertDataAttributes + attributes: EscalateAlertDataAttributes | Unset if isinstance(_attributes, Unset): attributes = UNSET else: @@ -69,21 +69,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - escalate_alert_data.additional_properties = d return escalate_alert_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/escalate_alert_data_attributes.py b/rootly_sdk/models/escalate_alert_data_attributes.py index 5eae0b81..332174c1 100644 --- a/rootly_sdk/models/escalate_alert_data_attributes.py +++ b/rootly_sdk/models/escalate_alert_data_attributes.py @@ -1,10 +1,21 @@ +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 ..types import UNSET, Unset +if TYPE_CHECKING: + from ..models.escalate_alert_data_attributes_actor_type_0 import EscalateAlertDataAttributesActorType0 + from ..models.escalate_alert_data_attributes_actor_type_1 import EscalateAlertDataAttributesActorType1 + from ..models.escalate_alert_data_attributes_actor_type_2_type_0 import EscalateAlertDataAttributesActorType2Type0 + from ..models.escalate_alert_data_attributes_actor_type_2_type_1 import EscalateAlertDataAttributesActorType2Type1 + from ..models.escalate_alert_data_attributes_actor_type_3_type_0 import EscalateAlertDataAttributesActorType3Type0 + from ..models.escalate_alert_data_attributes_actor_type_3_type_1 import EscalateAlertDataAttributesActorType3Type1 + + T = TypeVar("T", bound="EscalateAlertDataAttributes") @@ -12,21 +23,64 @@ class EscalateAlertDataAttributes: """ Attributes: - 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): 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). + actor (EscalateAlertDataAttributesActorType0 | EscalateAlertDataAttributesActorType1 | + EscalateAlertDataAttributesActorType2Type0 | EscalateAlertDataAttributesActorType2Type1 | + EscalateAlertDataAttributesActorType3Type0 | EscalateAlertDataAttributesActorType3Type1 | Unset): The user to + record as performing this action. Only available when actor attribution is enabled for the organization; + otherwise it is ignored. Only supported with Global and Team API keys; with a Team API key the user must belong + to one of the key's teams. When omitted or null, the action is attributed to the API key. Otherwise provide + either `email` or `user_id`, not both. """ - escalation_policy_id: Unset | str = UNSET - escalation_policy_level: Unset | int = UNSET + escalation_policy_id: str | Unset = UNSET + escalation_policy_level: int | Unset = UNSET + actor: ( + EscalateAlertDataAttributesActorType0 + | EscalateAlertDataAttributesActorType1 + | EscalateAlertDataAttributesActorType2Type0 + | EscalateAlertDataAttributesActorType2Type1 + | EscalateAlertDataAttributesActorType3Type0 + | EscalateAlertDataAttributesActorType3Type1 + | Unset + ) = UNSET def to_dict(self) -> dict[str, Any]: + from ..models.escalate_alert_data_attributes_actor_type_0 import EscalateAlertDataAttributesActorType0 + from ..models.escalate_alert_data_attributes_actor_type_1 import EscalateAlertDataAttributesActorType1 + from ..models.escalate_alert_data_attributes_actor_type_2_type_0 import ( + EscalateAlertDataAttributesActorType2Type0, + ) + from ..models.escalate_alert_data_attributes_actor_type_2_type_1 import ( + EscalateAlertDataAttributesActorType2Type1, + ) + from ..models.escalate_alert_data_attributes_actor_type_3_type_0 import ( + EscalateAlertDataAttributesActorType3Type0, + ) + escalation_policy_id = self.escalation_policy_id escalation_policy_level = self.escalation_policy_level + actor: dict[str, Any] | Unset + if isinstance(self.actor, Unset): + actor = UNSET + elif isinstance(self.actor, EscalateAlertDataAttributesActorType0): + actor = self.actor.to_dict() + elif isinstance(self.actor, EscalateAlertDataAttributesActorType1): + actor = self.actor.to_dict() + elif isinstance(self.actor, EscalateAlertDataAttributesActorType2Type0): + actor = self.actor.to_dict() + elif isinstance(self.actor, EscalateAlertDataAttributesActorType2Type1): + actor = self.actor.to_dict() + elif isinstance(self.actor, EscalateAlertDataAttributesActorType3Type0): + actor = self.actor.to_dict() + else: + actor = self.actor.to_dict() + field_dict: dict[str, Any] = {} field_dict.update({}) @@ -34,19 +88,98 @@ def to_dict(self) -> dict[str, Any]: field_dict["escalation_policy_id"] = escalation_policy_id if escalation_policy_level is not UNSET: field_dict["escalation_policy_level"] = escalation_policy_level + if actor is not UNSET: + field_dict["actor"] = actor return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.escalate_alert_data_attributes_actor_type_0 import EscalateAlertDataAttributesActorType0 + from ..models.escalate_alert_data_attributes_actor_type_1 import EscalateAlertDataAttributesActorType1 + from ..models.escalate_alert_data_attributes_actor_type_2_type_0 import ( + EscalateAlertDataAttributesActorType2Type0, + ) + from ..models.escalate_alert_data_attributes_actor_type_2_type_1 import ( + EscalateAlertDataAttributesActorType2Type1, + ) + from ..models.escalate_alert_data_attributes_actor_type_3_type_0 import ( + EscalateAlertDataAttributesActorType3Type0, + ) + from ..models.escalate_alert_data_attributes_actor_type_3_type_1 import ( + EscalateAlertDataAttributesActorType3Type1, + ) + d = dict(src_dict) escalation_policy_id = d.pop("escalation_policy_id", UNSET) escalation_policy_level = d.pop("escalation_policy_level", UNSET) + def _parse_actor( + data: object, + ) -> ( + EscalateAlertDataAttributesActorType0 + | EscalateAlertDataAttributesActorType1 + | EscalateAlertDataAttributesActorType2Type0 + | EscalateAlertDataAttributesActorType2Type1 + | EscalateAlertDataAttributesActorType3Type0 + | EscalateAlertDataAttributesActorType3Type1 + | Unset + ): + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_0 = EscalateAlertDataAttributesActorType0.from_dict(data) + + return actor_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_1 = EscalateAlertDataAttributesActorType1.from_dict(data) + + return actor_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_2_type_0 = EscalateAlertDataAttributesActorType2Type0.from_dict(data) + + return actor_type_2_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_2_type_1 = EscalateAlertDataAttributesActorType2Type1.from_dict(data) + + return actor_type_2_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_3_type_0 = EscalateAlertDataAttributesActorType3Type0.from_dict(data) + + return actor_type_3_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + actor_type_3_type_1 = EscalateAlertDataAttributesActorType3Type1.from_dict(data) + + return actor_type_3_type_1 + + actor = _parse_actor(d.pop("actor", UNSET)) + escalate_alert_data_attributes = cls( escalation_policy_id=escalation_policy_id, escalation_policy_level=escalation_policy_level, + actor=actor, ) return escalate_alert_data_attributes diff --git a/rootly_sdk/models/escalate_alert_data_attributes_actor_type_0.py b/rootly_sdk/models/escalate_alert_data_attributes_actor_type_0.py new file mode 100644 index 00000000..f92104f5 --- /dev/null +++ b/rootly_sdk/models/escalate_alert_data_attributes_actor_type_0.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="EscalateAlertDataAttributesActorType0") + + +@_attrs_define +class EscalateAlertDataAttributesActorType0: + """ + Attributes: + email (str): Email of the user, including verified secondary emails. + """ + + email: str + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + escalate_alert_data_attributes_actor_type_0 = cls( + email=email, + ) + + return escalate_alert_data_attributes_actor_type_0 diff --git a/rootly_sdk/models/escalate_alert_data_attributes_actor_type_1.py b/rootly_sdk/models/escalate_alert_data_attributes_actor_type_1.py new file mode 100644 index 00000000..a80fb7a3 --- /dev/null +++ b/rootly_sdk/models/escalate_alert_data_attributes_actor_type_1.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="EscalateAlertDataAttributesActorType1") + + +@_attrs_define +class EscalateAlertDataAttributesActorType1: + """ + Attributes: + user_id (str): Rootly ID of the user. + """ + + user_id: str + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user_id": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("user_id") + + escalate_alert_data_attributes_actor_type_1 = cls( + user_id=user_id, + ) + + return escalate_alert_data_attributes_actor_type_1 diff --git a/rootly_sdk/models/escalate_alert_data_attributes_actor_type_2_type_0.py b/rootly_sdk/models/escalate_alert_data_attributes_actor_type_2_type_0.py new file mode 100644 index 00000000..350b3bd5 --- /dev/null +++ b/rootly_sdk/models/escalate_alert_data_attributes_actor_type_2_type_0.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="EscalateAlertDataAttributesActorType2Type0") + + +@_attrs_define +class EscalateAlertDataAttributesActorType2Type0: + """ + Attributes: + email (str): Email of the user, including verified secondary emails. + """ + + email: str + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + escalate_alert_data_attributes_actor_type_2_type_0 = cls( + email=email, + ) + + return escalate_alert_data_attributes_actor_type_2_type_0 diff --git a/rootly_sdk/models/escalate_alert_data_attributes_actor_type_2_type_1.py b/rootly_sdk/models/escalate_alert_data_attributes_actor_type_2_type_1.py new file mode 100644 index 00000000..7b36023c --- /dev/null +++ b/rootly_sdk/models/escalate_alert_data_attributes_actor_type_2_type_1.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="EscalateAlertDataAttributesActorType2Type1") + + +@_attrs_define +class EscalateAlertDataAttributesActorType2Type1: + """ + Attributes: + user_id (str): Rootly ID of the user. + """ + + user_id: str + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user_id": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("user_id") + + escalate_alert_data_attributes_actor_type_2_type_1 = cls( + user_id=user_id, + ) + + return escalate_alert_data_attributes_actor_type_2_type_1 diff --git a/rootly_sdk/models/escalate_alert_data_attributes_actor_type_3_type_0.py b/rootly_sdk/models/escalate_alert_data_attributes_actor_type_3_type_0.py new file mode 100644 index 00000000..6a9714e4 --- /dev/null +++ b/rootly_sdk/models/escalate_alert_data_attributes_actor_type_3_type_0.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="EscalateAlertDataAttributesActorType3Type0") + + +@_attrs_define +class EscalateAlertDataAttributesActorType3Type0: + """ + Attributes: + email (str): Email of the user, including verified secondary emails. + """ + + email: str + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + escalate_alert_data_attributes_actor_type_3_type_0 = cls( + email=email, + ) + + return escalate_alert_data_attributes_actor_type_3_type_0 diff --git a/rootly_sdk/models/escalate_alert_data_attributes_actor_type_3_type_1.py b/rootly_sdk/models/escalate_alert_data_attributes_actor_type_3_type_1.py new file mode 100644 index 00000000..56a68584 --- /dev/null +++ b/rootly_sdk/models/escalate_alert_data_attributes_actor_type_3_type_1.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="EscalateAlertDataAttributesActorType3Type1") + + +@_attrs_define +class EscalateAlertDataAttributesActorType3Type1: + """ + Attributes: + user_id (str): Rootly ID of the user. + """ + + user_id: str + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user_id": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("user_id") + + escalate_alert_data_attributes_actor_type_3_type_1 = cls( + user_id=user_id, + ) + + return escalate_alert_data_attributes_actor_type_3_type_1 diff --git a/rootly_sdk/models/escalate_alert_data_type.py b/rootly_sdk/models/escalate_alert_data_type.py index 55b7c819..bb8cd284 100644 --- a/rootly_sdk/models/escalate_alert_data_type.py +++ b/rootly_sdk/models/escalate_alert_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalateAlertDataType = Literal["alerts"] @@ -11,5 +11,5 @@ def check_escalate_alert_data_type(value: str | None) -> EscalateAlertDataType | if value is None: return None if value in ESCALATE_ALERT_DATA_TYPE_VALUES: - return cast(EscalateAlertDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ESCALATE_ALERT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/escalation_path_rule_alert_urgency.py b/rootly_sdk/models/escalation_path_rule_alert_urgency.py new file mode 100644 index 00000000..963c071a --- /dev/null +++ b/rootly_sdk/models/escalation_path_rule_alert_urgency.py @@ -0,0 +1,96 @@ +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.escalation_path_rule_alert_urgency_operator import ( + EscalationPathRuleAlertUrgencyOperator, + check_escalation_path_rule_alert_urgency_operator, +) +from ..models.escalation_path_rule_alert_urgency_rule_type import ( + EscalationPathRuleAlertUrgencyRuleType, + check_escalation_path_rule_alert_urgency_rule_type, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="EscalationPathRuleAlertUrgency") + + +@_attrs_define +class EscalationPathRuleAlertUrgency: + """ + Attributes: + rule_type (EscalationPathRuleAlertUrgencyRuleType): The type of the escalation path rule + urgency_ids (list[str]): Alert urgency ids for which this escalation path should be used + operator (EscalationPathRuleAlertUrgencyOperator | Unset): How the alert's urgency should be matched. is and + is_not take exactly one id Default: 'is_one_of'. + """ + + rule_type: EscalationPathRuleAlertUrgencyRuleType + urgency_ids: list[str] + operator: EscalationPathRuleAlertUrgencyOperator | Unset = "is_one_of" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + rule_type: str = self.rule_type + + urgency_ids = self.urgency_ids + + operator: str | Unset = UNSET + if not isinstance(self.operator, Unset): + operator = self.operator + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "rule_type": rule_type, + "urgency_ids": urgency_ids, + } + ) + if operator is not UNSET: + field_dict["operator"] = operator + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + rule_type = check_escalation_path_rule_alert_urgency_rule_type(d.pop("rule_type")) + + urgency_ids = cast(list[str], d.pop("urgency_ids")) + + _operator = d.pop("operator", UNSET) + operator: EscalationPathRuleAlertUrgencyOperator | Unset + if isinstance(_operator, Unset): + operator = UNSET + else: + operator = check_escalation_path_rule_alert_urgency_operator(_operator) + + escalation_path_rule_alert_urgency = cls( + rule_type=rule_type, + urgency_ids=urgency_ids, + operator=operator, + ) + + escalation_path_rule_alert_urgency.additional_properties = d + return escalation_path_rule_alert_urgency + + @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/escalation_path_rule_alert_urgency_operator.py b/rootly_sdk/models/escalation_path_rule_alert_urgency_operator.py new file mode 100644 index 00000000..0e459f72 --- /dev/null +++ b/rootly_sdk/models/escalation_path_rule_alert_urgency_operator.py @@ -0,0 +1,22 @@ +from typing import Literal + +EscalationPathRuleAlertUrgencyOperator = Literal["is", "is_not", "is_not_one_of", "is_one_of"] + +ESCALATION_PATH_RULE_ALERT_URGENCY_OPERATOR_VALUES: set[EscalationPathRuleAlertUrgencyOperator] = { + "is", + "is_not", + "is_not_one_of", + "is_one_of", +} + + +def check_escalation_path_rule_alert_urgency_operator( + value: str | None, +) -> EscalationPathRuleAlertUrgencyOperator | None: + if value is None: + return None + if value in ESCALATION_PATH_RULE_ALERT_URGENCY_OPERATOR_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_PATH_RULE_ALERT_URGENCY_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_path_rule_alert_urgency_rule_type.py b/rootly_sdk/models/escalation_path_rule_alert_urgency_rule_type.py new file mode 100644 index 00000000..7ffb6873 --- /dev/null +++ b/rootly_sdk/models/escalation_path_rule_alert_urgency_rule_type.py @@ -0,0 +1,19 @@ +from typing import Literal + +EscalationPathRuleAlertUrgencyRuleType = Literal["alert_urgency"] + +ESCALATION_PATH_RULE_ALERT_URGENCY_RULE_TYPE_VALUES: set[EscalationPathRuleAlertUrgencyRuleType] = { + "alert_urgency", +} + + +def check_escalation_path_rule_alert_urgency_rule_type( + value: str | None, +) -> EscalationPathRuleAlertUrgencyRuleType | None: + if value is None: + return None + if value in ESCALATION_PATH_RULE_ALERT_URGENCY_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_PATH_RULE_ALERT_URGENCY_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_5.py b/rootly_sdk/models/escalation_path_rule_deferral_window.py similarity index 52% rename from rootly_sdk/models/escalation_policy_path_rules_item_type_5.py rename to rootly_sdk/models/escalation_path_rule_deferral_window.py index c03dd7a2..d495663f 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_5.py +++ b/rootly_sdk/models/escalation_path_rule_deferral_window.py @@ -1,40 +1,42 @@ +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.escalation_policy_path_rules_item_type_5_rule_type import ( - EscalationPolicyPathRulesItemType5RuleType, - check_escalation_policy_path_rules_item_type_5_rule_type, +from ..models.escalation_path_rule_deferral_window_rule_type import ( + EscalationPathRuleDeferralWindowRuleType, + check_escalation_path_rule_deferral_window_rule_type, ) -from ..models.escalation_policy_path_rules_item_type_5_time_zone import ( - EscalationPolicyPathRulesItemType5TimeZone, - check_escalation_policy_path_rules_item_type_5_time_zone, +from ..models.escalation_path_rule_deferral_window_time_zone import ( + EscalationPathRuleDeferralWindowTimeZone, + check_escalation_path_rule_deferral_window_time_zone, ) if TYPE_CHECKING: - from ..models.escalation_policy_path_rules_item_type_5_time_blocks_item import ( - EscalationPolicyPathRulesItemType5TimeBlocksItem, + from ..models.escalation_path_rule_deferral_window_time_blocks_item import ( + EscalationPathRuleDeferralWindowTimeBlocksItem, ) -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType5") +T = TypeVar("T", bound="EscalationPathRuleDeferralWindow") @_attrs_define -class EscalationPolicyPathRulesItemType5: +class EscalationPathRuleDeferralWindow: """ 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 + rule_type (EscalationPathRuleDeferralWindowRuleType): The type of the escalation path rule + time_zone (EscalationPathRuleDeferralWindowTimeZone): Time zone for the deferral window + time_blocks (list[EscalationPathRuleDeferralWindowTimeBlocksItem]): Time windows during which alerts are deferred """ - rule_type: EscalationPolicyPathRulesItemType5RuleType - time_zone: EscalationPolicyPathRulesItemType5TimeZone - time_blocks: list["EscalationPolicyPathRulesItemType5TimeBlocksItem"] + rule_type: EscalationPathRuleDeferralWindowRuleType + time_zone: EscalationPathRuleDeferralWindowTimeZone + time_blocks: list[EscalationPathRuleDeferralWindowTimeBlocksItem] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -61,30 +63,30 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.escalation_policy_path_rules_item_type_5_time_blocks_item import ( - EscalationPolicyPathRulesItemType5TimeBlocksItem, + from ..models.escalation_path_rule_deferral_window_time_blocks_item import ( + EscalationPathRuleDeferralWindowTimeBlocksItem, ) d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_5_rule_type(d.pop("rule_type")) + rule_type = check_escalation_path_rule_deferral_window_rule_type(d.pop("rule_type")) - time_zone = check_escalation_policy_path_rules_item_type_5_time_zone(d.pop("time_zone")) + time_zone = check_escalation_path_rule_deferral_window_time_zone(d.pop("time_zone")) time_blocks = [] _time_blocks = d.pop("time_blocks") for time_blocks_item_data in _time_blocks: - time_blocks_item = EscalationPolicyPathRulesItemType5TimeBlocksItem.from_dict(time_blocks_item_data) + time_blocks_item = EscalationPathRuleDeferralWindowTimeBlocksItem.from_dict(time_blocks_item_data) time_blocks.append(time_blocks_item) - escalation_policy_path_rules_item_type_5 = cls( + escalation_path_rule_deferral_window = cls( rule_type=rule_type, time_zone=time_zone, time_blocks=time_blocks, ) - escalation_policy_path_rules_item_type_5.additional_properties = d - return escalation_policy_path_rules_item_type_5 + escalation_path_rule_deferral_window.additional_properties = d + return escalation_path_rule_deferral_window @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/escalation_path_rule_deferral_window_rule_type.py b/rootly_sdk/models/escalation_path_rule_deferral_window_rule_type.py new file mode 100644 index 00000000..51d7911f --- /dev/null +++ b/rootly_sdk/models/escalation_path_rule_deferral_window_rule_type.py @@ -0,0 +1,19 @@ +from typing import Literal + +EscalationPathRuleDeferralWindowRuleType = Literal["deferral_window"] + +ESCALATION_PATH_RULE_DEFERRAL_WINDOW_RULE_TYPE_VALUES: set[EscalationPathRuleDeferralWindowRuleType] = { + "deferral_window", +} + + +def check_escalation_path_rule_deferral_window_rule_type( + value: str | None, +) -> EscalationPathRuleDeferralWindowRuleType | None: + if value is None: + return None + if value in ESCALATION_PATH_RULE_DEFERRAL_WINDOW_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_PATH_RULE_DEFERRAL_WINDOW_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_time_blocks_item.py b/rootly_sdk/models/escalation_path_rule_deferral_window_time_blocks_item.py similarity index 60% rename from rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_time_blocks_item.py rename to rootly_sdk/models/escalation_path_rule_deferral_window_time_blocks_item.py index 98a58ca4..a52bdf85 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_time_blocks_item.py +++ b/rootly_sdk/models/escalation_path_rule_deferral_window_time_blocks_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -6,40 +8,48 @@ from ..types import UNSET, Unset -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType8Type5TimeBlocksItem") +T = TypeVar("T", bound="EscalationPathRuleDeferralWindowTimeBlocksItem") @_attrs_define -class EscalationPolicyPathRulesItemType8Type5TimeBlocksItem: +class EscalationPathRuleDeferralWindowTimeBlocksItem: """ Attributes: - 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]): + id (str | Unset): Unique ID of the time block + 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): Order of this time block, starting at 1. Defaults to the block's 1-based position + in time_blocks when omitted. + ends_next_day (bool | Unset): Whether the window crosses midnight. Derived from start_time and end_time; + accepted and ignored on write. """ - 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 + id: str | Unset = UNSET + 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 + ends_next_day: bool | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + id = self.id + monday = self.monday tuesday = self.tuesday @@ -60,15 +70,19 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position + ends_next_day = self.ends_next_day + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id if monday is not UNSET: field_dict["monday"] = monday if tuesday is not UNSET: @@ -91,12 +105,16 @@ def to_dict(self) -> dict[str, Any]: field_dict["all_day"] = all_day if position is not UNSET: field_dict["position"] = position + if ends_next_day is not UNSET: + field_dict["ends_next_day"] = ends_next_day 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) + monday = d.pop("monday", UNSET) tuesday = d.pop("tuesday", UNSET) @@ -117,16 +135,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - escalation_policy_path_rules_item_type_8_type_5_time_blocks_item = cls( + ends_next_day = d.pop("ends_next_day", UNSET) + + escalation_path_rule_deferral_window_time_blocks_item = cls( + id=id, monday=monday, tuesday=tuesday, wednesday=wednesday, @@ -138,10 +159,11 @@ def _parse_position(data: object) -> None | Unset | int: end_time=end_time, all_day=all_day, position=position, + ends_next_day=ends_next_day, ) - escalation_policy_path_rules_item_type_8_type_5_time_blocks_item.additional_properties = d - return escalation_policy_path_rules_item_type_8_type_5_time_blocks_item + escalation_path_rule_deferral_window_time_blocks_item.additional_properties = d + return escalation_path_rule_deferral_window_time_blocks_item @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_5_time_zone.py b/rootly_sdk/models/escalation_path_rule_deferral_window_time_zone.py similarity index 95% rename from rootly_sdk/models/escalation_policy_path_rules_item_type_5_time_zone.py rename to rootly_sdk/models/escalation_path_rule_deferral_window_time_zone.py index 670be050..adae8045 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_5_time_zone.py +++ b/rootly_sdk/models/escalation_path_rule_deferral_window_time_zone.py @@ -1,6 +1,6 @@ -from typing import Literal, cast +from typing import Literal -EscalationPolicyPathRulesItemType5TimeZone = Literal[ +EscalationPathRuleDeferralWindowTimeZone = Literal[ "Abu Dhabi", "Adelaide", "Africa/Algiers", @@ -84,6 +84,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -157,6 +158,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -308,7 +310,7 @@ "Zurich", ] -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_5_TIME_ZONE_VALUES: set[EscalationPolicyPathRulesItemType5TimeZone] = { +ESCALATION_PATH_RULE_DEFERRAL_WINDOW_TIME_ZONE_VALUES: set[EscalationPathRuleDeferralWindowTimeZone] = { "Abu Dhabi", "Adelaide", "Africa/Algiers", @@ -392,6 +394,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -465,6 +468,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -617,13 +621,13 @@ } -def check_escalation_policy_path_rules_item_type_5_time_zone( +def check_escalation_path_rule_deferral_window_time_zone( value: str | None, -) -> EscalationPolicyPathRulesItemType5TimeZone | None: +) -> EscalationPathRuleDeferralWindowTimeZone | None: if value is None: return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_5_TIME_ZONE_VALUES: - return cast(EscalationPolicyPathRulesItemType5TimeZone, value) + if value in ESCALATION_PATH_RULE_DEFERRAL_WINDOW_TIME_ZONE_VALUES: + return value raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_5_TIME_ZONE_VALUES!r}" + f"Unexpected value {value!r}. Expected one of {ESCALATION_PATH_RULE_DEFERRAL_WINDOW_TIME_ZONE_VALUES!r}" ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_3.py b/rootly_sdk/models/escalation_path_rule_field.py similarity index 62% rename from rootly_sdk/models/escalation_policy_path_rules_item_type_3.py rename to rootly_sdk/models/escalation_path_rule_field.py index 3ed06c03..3df46e2c 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_3.py +++ b/rootly_sdk/models/escalation_path_rule_field.py @@ -1,38 +1,40 @@ +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.escalation_policy_path_rules_item_type_3_operator import ( - EscalationPolicyPathRulesItemType3Operator, - check_escalation_policy_path_rules_item_type_3_operator, +from ..models.escalation_path_rule_field_operator import ( + EscalationPathRuleFieldOperator, + check_escalation_path_rule_field_operator, ) -from ..models.escalation_policy_path_rules_item_type_3_rule_type import ( - EscalationPolicyPathRulesItemType3RuleType, - check_escalation_policy_path_rules_item_type_3_rule_type, +from ..models.escalation_path_rule_field_rule_type import ( + EscalationPathRuleFieldRuleType, + check_escalation_path_rule_field_rule_type, ) from ..types import UNSET, Unset -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType3") +T = TypeVar("T", bound="EscalationPathRuleField") @_attrs_define -class EscalationPolicyPathRulesItemType3: +class EscalationPathRuleField: """ Attributes: - rule_type (EscalationPolicyPathRulesItemType3RuleType): The type of the escalation path rule + rule_type (EscalationPathRuleFieldRuleType): The type of the escalation path rule 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 (Union[Unset, list[str]]): Values to match against + operator (EscalationPathRuleFieldOperator): How the alert field value should be matched + values (list[str] | Unset): Values to match against """ - rule_type: EscalationPolicyPathRulesItemType3RuleType + rule_type: EscalationPathRuleFieldRuleType fieldable_type: str fieldable_id: str - operator: EscalationPolicyPathRulesItemType3Operator - values: Unset | list[str] = UNSET + operator: EscalationPathRuleFieldOperator + values: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values @@ -66,17 +68,17 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_3_rule_type(d.pop("rule_type")) + rule_type = check_escalation_path_rule_field_rule_type(d.pop("rule_type")) fieldable_type = d.pop("fieldable_type") fieldable_id = d.pop("fieldable_id") - operator = check_escalation_policy_path_rules_item_type_3_operator(d.pop("operator")) + operator = check_escalation_path_rule_field_operator(d.pop("operator")) values = cast(list[str], d.pop("values", UNSET)) - escalation_policy_path_rules_item_type_3 = cls( + escalation_path_rule_field = cls( rule_type=rule_type, fieldable_type=fieldable_type, fieldable_id=fieldable_id, @@ -84,8 +86,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: values=values, ) - escalation_policy_path_rules_item_type_3.additional_properties = d - return escalation_policy_path_rules_item_type_3 + escalation_path_rule_field.additional_properties = d + return escalation_path_rule_field @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/escalation_path_rule_field_operator.py b/rootly_sdk/models/escalation_path_rule_field_operator.py new file mode 100644 index 00000000..46e1547e --- /dev/null +++ b/rootly_sdk/models/escalation_path_rule_field_operator.py @@ -0,0 +1,43 @@ +from typing import Literal + +EscalationPathRuleFieldOperator = Literal[ + "contains", + "contains_key", + "does_not_contain", + "does_not_contain_key", + "does_not_match", + "does_not_start_with", + "is", + "is_empty", + "is_not", + "is_not_empty", + "is_not_one_of", + "is_one_of", + "matches", + "starts_with", +] + +ESCALATION_PATH_RULE_FIELD_OPERATOR_VALUES: set[EscalationPathRuleFieldOperator] = { + "contains", + "contains_key", + "does_not_contain", + "does_not_contain_key", + "does_not_match", + "does_not_start_with", + "is", + "is_empty", + "is_not", + "is_not_empty", + "is_not_one_of", + "is_one_of", + "matches", + "starts_with", +} + + +def check_escalation_path_rule_field_operator(value: str | None) -> EscalationPathRuleFieldOperator | None: + if value is None: + return None + if value in ESCALATION_PATH_RULE_FIELD_OPERATOR_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ESCALATION_PATH_RULE_FIELD_OPERATOR_VALUES!r}") diff --git a/rootly_sdk/models/escalation_path_rule_field_rule_type.py b/rootly_sdk/models/escalation_path_rule_field_rule_type.py new file mode 100644 index 00000000..32061d87 --- /dev/null +++ b/rootly_sdk/models/escalation_path_rule_field_rule_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +EscalationPathRuleFieldRuleType = Literal["field"] + +ESCALATION_PATH_RULE_FIELD_RULE_TYPE_VALUES: set[EscalationPathRuleFieldRuleType] = { + "field", +} + + +def check_escalation_path_rule_field_rule_type(value: str | None) -> EscalationPathRuleFieldRuleType | None: + if value is None: + return None + if value in ESCALATION_PATH_RULE_FIELD_RULE_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ESCALATION_PATH_RULE_FIELD_RULE_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_2.py b/rootly_sdk/models/escalation_path_rule_json_path.py similarity index 58% rename from rootly_sdk/models/escalation_policy_path_rules_item_type_2.py rename to rootly_sdk/models/escalation_path_rule_json_path.py index 567cf452..31951043 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_2.py +++ b/rootly_sdk/models/escalation_path_rule_json_path.py @@ -1,38 +1,40 @@ +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.escalation_policy_path_rules_item_type_2_operator import ( - EscalationPolicyPathRulesItemType2Operator, - check_escalation_policy_path_rules_item_type_2_operator, +from ..models.escalation_path_rule_json_path_operator import ( + EscalationPathRuleJsonPathOperator, + check_escalation_path_rule_json_path_operator, ) -from ..models.escalation_policy_path_rules_item_type_2_rule_type import ( - EscalationPolicyPathRulesItemType2RuleType, - check_escalation_policy_path_rules_item_type_2_rule_type, +from ..models.escalation_path_rule_json_path_rule_type import ( + EscalationPathRuleJsonPathRuleType, + check_escalation_path_rule_json_path_rule_type, ) from ..types import UNSET, Unset -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType2") +T = TypeVar("T", bound="EscalationPathRuleJsonPath") @_attrs_define -class EscalationPolicyPathRulesItemType2: +class EscalationPathRuleJsonPath: """ Attributes: - rule_type (EscalationPolicyPathRulesItemType2RuleType): The type of the escalation path rule + rule_type (EscalationPathRuleJsonPathRuleType): 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 (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) + operator (EscalationPathRuleJsonPathOperator): 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) """ - rule_type: EscalationPolicyPathRulesItemType2RuleType + rule_type: EscalationPathRuleJsonPathRuleType json_path: str - operator: EscalationPolicyPathRulesItemType2Operator - value: None | Unset | str = UNSET - values: Unset | list[str] = UNSET + operator: EscalationPathRuleJsonPathOperator + value: None | str | Unset = UNSET + values: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,13 +44,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: None | Unset | str + value: None | str | Unset if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values @@ -71,24 +73,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) - rule_type = check_escalation_policy_path_rules_item_type_2_rule_type(d.pop("rule_type")) + rule_type = check_escalation_path_rule_json_path_rule_type(d.pop("rule_type")) json_path = d.pop("json_path") - operator = check_escalation_policy_path_rules_item_type_2_operator(d.pop("operator")) + operator = check_escalation_path_rule_json_path_operator(d.pop("operator")) - def _parse_value(data: object) -> None | Unset | str: + def _parse_value(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) value = _parse_value(d.pop("value", UNSET)) values = cast(list[str], d.pop("values", UNSET)) - escalation_policy_path_rules_item_type_2 = cls( + escalation_path_rule_json_path = cls( rule_type=rule_type, json_path=json_path, operator=operator, @@ -96,8 +98,8 @@ def _parse_value(data: object) -> None | Unset | str: values=values, ) - escalation_policy_path_rules_item_type_2.additional_properties = d - return escalation_policy_path_rules_item_type_2 + escalation_path_rule_json_path.additional_properties = d + return escalation_path_rule_json_path @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/escalation_path_rule_json_path_operator.py b/rootly_sdk/models/escalation_path_rule_json_path_operator.py new file mode 100644 index 00000000..c63d01ad --- /dev/null +++ b/rootly_sdk/models/escalation_path_rule_json_path_operator.py @@ -0,0 +1,43 @@ +from typing import Literal + +EscalationPathRuleJsonPathOperator = Literal[ + "contains", + "contains_key", + "does_not_contain", + "does_not_contain_key", + "does_not_match", + "does_not_start_with", + "is", + "is_not", + "is_not_one_of", + "is_not_set", + "is_one_of", + "is_set", + "matches", + "starts_with", +] + +ESCALATION_PATH_RULE_JSON_PATH_OPERATOR_VALUES: set[EscalationPathRuleJsonPathOperator] = { + "contains", + "contains_key", + "does_not_contain", + "does_not_contain_key", + "does_not_match", + "does_not_start_with", + "is", + "is_not", + "is_not_one_of", + "is_not_set", + "is_one_of", + "is_set", + "matches", + "starts_with", +} + + +def check_escalation_path_rule_json_path_operator(value: str | None) -> EscalationPathRuleJsonPathOperator | None: + if value is None: + return None + if value in ESCALATION_PATH_RULE_JSON_PATH_OPERATOR_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ESCALATION_PATH_RULE_JSON_PATH_OPERATOR_VALUES!r}") diff --git a/rootly_sdk/models/escalation_path_rule_json_path_rule_type.py b/rootly_sdk/models/escalation_path_rule_json_path_rule_type.py new file mode 100644 index 00000000..7b966e23 --- /dev/null +++ b/rootly_sdk/models/escalation_path_rule_json_path_rule_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +EscalationPathRuleJsonPathRuleType = Literal["json_path"] + +ESCALATION_PATH_RULE_JSON_PATH_RULE_TYPE_VALUES: set[EscalationPathRuleJsonPathRuleType] = { + "json_path", +} + + +def check_escalation_path_rule_json_path_rule_type(value: str | None) -> EscalationPathRuleJsonPathRuleType | None: + if value is None: + return None + if value in ESCALATION_PATH_RULE_JSON_PATH_RULE_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ESCALATION_PATH_RULE_JSON_PATH_RULE_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/escalation_path_rule_service.py b/rootly_sdk/models/escalation_path_rule_service.py new file mode 100644 index 00000000..f99dc378 --- /dev/null +++ b/rootly_sdk/models/escalation_path_rule_service.py @@ -0,0 +1,96 @@ +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.escalation_path_rule_service_operator import ( + EscalationPathRuleServiceOperator, + check_escalation_path_rule_service_operator, +) +from ..models.escalation_path_rule_service_rule_type import ( + EscalationPathRuleServiceRuleType, + check_escalation_path_rule_service_rule_type, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="EscalationPathRuleService") + + +@_attrs_define +class EscalationPathRuleService: + """ + Attributes: + rule_type (EscalationPathRuleServiceRuleType): The type of the escalation path rule + service_ids (list[str]): Service ids for which this escalation path should be used + operator (EscalationPathRuleServiceOperator | Unset): How the alert's services should be matched. is and is_not + take exactly one id Default: 'is_one_of'. + """ + + rule_type: EscalationPathRuleServiceRuleType + service_ids: list[str] + operator: EscalationPathRuleServiceOperator | Unset = "is_one_of" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + rule_type: str = self.rule_type + + service_ids = self.service_ids + + operator: str | Unset = UNSET + if not isinstance(self.operator, Unset): + operator = self.operator + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "rule_type": rule_type, + "service_ids": service_ids, + } + ) + if operator is not UNSET: + field_dict["operator"] = operator + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + rule_type = check_escalation_path_rule_service_rule_type(d.pop("rule_type")) + + service_ids = cast(list[str], d.pop("service_ids")) + + _operator = d.pop("operator", UNSET) + operator: EscalationPathRuleServiceOperator | Unset + if isinstance(_operator, Unset): + operator = UNSET + else: + operator = check_escalation_path_rule_service_operator(_operator) + + escalation_path_rule_service = cls( + rule_type=rule_type, + service_ids=service_ids, + operator=operator, + ) + + escalation_path_rule_service.additional_properties = d + return escalation_path_rule_service + + @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/escalation_path_rule_service_operator.py b/rootly_sdk/models/escalation_path_rule_service_operator.py new file mode 100644 index 00000000..f05a784c --- /dev/null +++ b/rootly_sdk/models/escalation_path_rule_service_operator.py @@ -0,0 +1,18 @@ +from typing import Literal + +EscalationPathRuleServiceOperator = Literal["is", "is_not", "is_not_one_of", "is_one_of"] + +ESCALATION_PATH_RULE_SERVICE_OPERATOR_VALUES: set[EscalationPathRuleServiceOperator] = { + "is", + "is_not", + "is_not_one_of", + "is_one_of", +} + + +def check_escalation_path_rule_service_operator(value: str | None) -> EscalationPathRuleServiceOperator | None: + if value is None: + return None + if value in ESCALATION_PATH_RULE_SERVICE_OPERATOR_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ESCALATION_PATH_RULE_SERVICE_OPERATOR_VALUES!r}") diff --git a/rootly_sdk/models/escalation_path_rule_service_rule_type.py b/rootly_sdk/models/escalation_path_rule_service_rule_type.py new file mode 100644 index 00000000..c987b17c --- /dev/null +++ b/rootly_sdk/models/escalation_path_rule_service_rule_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +EscalationPathRuleServiceRuleType = Literal["service"] + +ESCALATION_PATH_RULE_SERVICE_RULE_TYPE_VALUES: set[EscalationPathRuleServiceRuleType] = { + "service", +} + + +def check_escalation_path_rule_service_rule_type(value: str | None) -> EscalationPathRuleServiceRuleType | None: + if value is None: + return None + if value in ESCALATION_PATH_RULE_SERVICE_RULE_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ESCALATION_PATH_RULE_SERVICE_RULE_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_1.py b/rootly_sdk/models/escalation_path_rule_working_hour.py similarity index 68% rename from rootly_sdk/models/escalation_policy_path_rules_item_type_1.py rename to rootly_sdk/models/escalation_path_rule_working_hour.py index a9321684..c48901b4 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_1.py +++ b/rootly_sdk/models/escalation_path_rule_working_hour.py @@ -1,26 +1,28 @@ +from __future__ import annotations + 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.escalation_policy_path_rules_item_type_1_rule_type import ( - EscalationPolicyPathRulesItemType1RuleType, - check_escalation_policy_path_rules_item_type_1_rule_type, +from ..models.escalation_path_rule_working_hour_rule_type import ( + EscalationPathRuleWorkingHourRuleType, + check_escalation_path_rule_working_hour_rule_type, ) -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType1") +T = TypeVar("T", bound="EscalationPathRuleWorkingHour") @_attrs_define -class EscalationPolicyPathRulesItemType1: +class EscalationPathRuleWorkingHour: """ Attributes: - rule_type (EscalationPolicyPathRulesItemType1RuleType): The type of the escalation path rule + rule_type (EscalationPathRuleWorkingHourRuleType): The type of the escalation path rule within_working_hour (bool): Whether the escalation path should be used within working hours """ - rule_type: EscalationPolicyPathRulesItemType1RuleType + rule_type: EscalationPathRuleWorkingHourRuleType within_working_hour: bool additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -43,17 +45,17 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_1_rule_type(d.pop("rule_type")) + rule_type = check_escalation_path_rule_working_hour_rule_type(d.pop("rule_type")) within_working_hour = d.pop("within_working_hour") - escalation_policy_path_rules_item_type_1 = cls( + escalation_path_rule_working_hour = cls( rule_type=rule_type, within_working_hour=within_working_hour, ) - escalation_policy_path_rules_item_type_1.additional_properties = d - return escalation_policy_path_rules_item_type_1 + escalation_path_rule_working_hour.additional_properties = d + return escalation_path_rule_working_hour @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/escalation_path_rule_working_hour_rule_type.py b/rootly_sdk/models/escalation_path_rule_working_hour_rule_type.py new file mode 100644 index 00000000..e6cff8eb --- /dev/null +++ b/rootly_sdk/models/escalation_path_rule_working_hour_rule_type.py @@ -0,0 +1,19 @@ +from typing import Literal + +EscalationPathRuleWorkingHourRuleType = Literal["working_hour"] + +ESCALATION_PATH_RULE_WORKING_HOUR_RULE_TYPE_VALUES: set[EscalationPathRuleWorkingHourRuleType] = { + "working_hour", +} + + +def check_escalation_path_rule_working_hour_rule_type( + value: str | None, +) -> EscalationPathRuleWorkingHourRuleType | None: + if value is None: + return None + if value in ESCALATION_PATH_RULE_WORKING_HOUR_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_PATH_RULE_WORKING_HOUR_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy.py b/rootly_sdk/models/escalation_policy.py index 5e7daa37..222eaa40 100644 --- a/rootly_sdk/models/escalation_policy.py +++ b/rootly_sdk/models/escalation_policy.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,25 +22,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 (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 + 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 """ name: str repeat_count: int created_by_user_id: int - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,7 +52,7 @@ def to_dict(self) -> dict[str, Any]: created_by_user_id = self.created_by_user_id - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -58,15 +60,15 @@ def to_dict(self) -> dict[str, Any]: last_updated_by_user_id = self.last_updated_by_user_id - group_ids: Unset | list[str] = UNSET + group_ids: list[str] | Unset = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - service_ids: Unset | list[str] = UNSET + service_ids: list[str] | Unset = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - business_hours: None | Unset | dict[str, Any] + business_hours: dict[str, Any] | None | Unset if isinstance(self.business_hours, Unset): business_hours = UNSET elif isinstance(self.business_hours, EscalationPolicyBusinessHoursType0): @@ -115,12 +117,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) @@ -130,7 +132,7 @@ def _parse_description(data: object) -> None | Unset | str: service_ids = cast(list[str], d.pop("service_ids", UNSET)) - def _parse_business_hours(data: object) -> Union["EscalationPolicyBusinessHoursType0", None, Unset]: + def _parse_business_hours(data: object) -> EscalationPolicyBusinessHoursType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -141,9 +143,9 @@ def _parse_business_hours(data: object) -> Union["EscalationPolicyBusinessHoursT business_hours_type_0 = EscalationPolicyBusinessHoursType0.from_dict(data) return business_hours_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["EscalationPolicyBusinessHoursType0", None, Unset], data) + return cast(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 e5081210..2312ee81 100644 --- a/rootly_sdk/models/escalation_policy_business_hours_type_0.py +++ b/rootly_sdk/models/escalation_policy_business_hours_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -21,24 +23,24 @@ class EscalationPolicyBusinessHoursType0: """ Attributes: - 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): 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: Unset | EscalationPolicyBusinessHoursType0TimeZone = UNSET - days: None | Unset | list[EscalationPolicyBusinessHoursType0DaysType0Item] = UNSET - start_time: None | Unset | str = UNSET - end_time: None | Unset | str = UNSET + time_zone: EscalationPolicyBusinessHoursType0TimeZone | Unset = UNSET + days: list[EscalationPolicyBusinessHoursType0DaysType0Item] | None | Unset = UNSET + start_time: None | str | Unset = UNSET + end_time: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - time_zone: Unset | str = UNSET + time_zone: str | Unset = UNSET if not isinstance(self.time_zone, Unset): time_zone = self.time_zone - days: None | Unset | list[str] + days: list[str] | None | Unset if isinstance(self.days, Unset): days = UNSET elif isinstance(self.days, list): @@ -50,13 +52,13 @@ def to_dict(self) -> dict[str, Any]: else: days = self.days - start_time: None | Unset | str + start_time: None | str | Unset if isinstance(self.start_time, Unset): start_time = UNSET else: start_time = self.start_time - end_time: None | Unset | str + end_time: None | str | Unset if isinstance(self.end_time, Unset): end_time = UNSET else: @@ -80,13 +82,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: Unset | EscalationPolicyBusinessHoursType0TimeZone + time_zone: EscalationPolicyBusinessHoursType0TimeZone | Unset 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) -> None | Unset | list[EscalationPolicyBusinessHoursType0DaysType0Item]: + def _parse_days(data: object) -> list[EscalationPolicyBusinessHoursType0DaysType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -104,27 +106,27 @@ def _parse_days(data: object) -> None | Unset | list[EscalationPolicyBusinessHou days_type_0.append(days_type_0_item) return days_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[EscalationPolicyBusinessHoursType0DaysType0Item], data) + return cast(list[EscalationPolicyBusinessHoursType0DaysType0Item] | None | Unset, data) days = _parse_days(d.pop("days", UNSET)) - def _parse_start_time(data: object) -> None | Unset | str: + def _parse_start_time(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> None | Unset | str: + def _parse_end_time(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) end_time = _parse_end_time(d.pop("end_time", UNSET)) diff --git a/rootly_sdk/models/escalation_policy_business_hours_type_0_days_type_0_item.py b/rootly_sdk/models/escalation_policy_business_hours_type_0_days_type_0_item.py index b86a0a16..810037ad 100644 --- a/rootly_sdk/models/escalation_policy_business_hours_type_0_days_type_0_item.py +++ b/rootly_sdk/models/escalation_policy_business_hours_type_0_days_type_0_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalationPolicyBusinessHoursType0DaysType0Item = Literal["F", "M", "R", "S", "T", "U", "W"] @@ -21,7 +21,7 @@ def check_escalation_policy_business_hours_type_0_days_type_0_item( if value is None: return None if value in ESCALATION_POLICY_BUSINESS_HOURS_TYPE_0_DAYS_TYPE_0_ITEM_VALUES: - return cast(EscalationPolicyBusinessHoursType0DaysType0Item, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_BUSINESS_HOURS_TYPE_0_DAYS_TYPE_0_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/escalation_policy_business_hours_type_0_time_zone.py b/rootly_sdk/models/escalation_policy_business_hours_type_0_time_zone.py index e8841516..2744d821 100644 --- a/rootly_sdk/models/escalation_policy_business_hours_type_0_time_zone.py +++ b/rootly_sdk/models/escalation_policy_business_hours_type_0_time_zone.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalationPolicyBusinessHoursType0TimeZone = Literal[ "Abu Dhabi", @@ -84,6 +84,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -157,6 +158,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -392,6 +394,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -465,6 +468,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -623,7 +627,7 @@ def check_escalation_policy_business_hours_type_0_time_zone( if value is None: return None if value in ESCALATION_POLICY_BUSINESS_HOURS_TYPE_0_TIME_ZONE_VALUES: - return cast(EscalationPolicyBusinessHoursType0TimeZone, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_BUSINESS_HOURS_TYPE_0_TIME_ZONE_VALUES!r}" ) diff --git a/rootly_sdk/models/escalation_policy_level.py b/rootly_sdk/models/escalation_policy_level.py index 15e38d09..425d04c7 100644 --- a/rootly_sdk/models/escalation_policy_level.py +++ b/rootly_sdk/models/escalation_policy_level.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -38,47 +40,45 @@ 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[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 + 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 belong to. If nothing is specified it will add the level to your default path. - paging_strategy_configuration_strategy (Union[Unset, EscalationPolicyLevelPagingStrategyConfigurationStrategy]): + paging_strategy_configuration_strategy (EscalationPolicyLevelPagingStrategyConfigurationStrategy | Unset): Default: 'default'. - 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 + paging_strategy_configuration_schedule_strategy + (EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy | Unset): Default: 'on_call_only'. + paging_strategy_configuration_repeats (int | None | Unset): Number of times to rotate through the roster (cycle- + based round robin). + paging_strategy_configuration_repeats_mode (EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode | + Unset): Controls how repeats are interpreted: 'users' pages exactly N users, 'all' pages everyone once. + paging_strategy_configuration_rotation_scope (EscalationPolicyLevelPagingStrategyConfigurationRotationScope | + Unset): Scope of rotation ordering: active rotation members only, or entire schedule. + paging_strategy_configuration_page_users_count (int | None | Unset): Number of users to page at a time (cycle- + based round robin). + created_at (str | Unset): Date of creation + updated_at (str | Unset): Date of last update """ escalation_policy_id: str delay: int position: int - notification_target_params: list[Union["EscalationPolicyLevelNotificationTargetParamsItemType0", None]] - escalation_policy_path_id: None | Unset | str = UNSET - paging_strategy_configuration_strategy: Unset | EscalationPolicyLevelPagingStrategyConfigurationStrategy = "default" + notification_target_params: list[EscalationPolicyLevelNotificationTargetParamsItemType0 | None] + escalation_policy_path_id: None | str | Unset = UNSET + paging_strategy_configuration_strategy: EscalationPolicyLevelPagingStrategyConfigurationStrategy | Unset = "default" paging_strategy_configuration_schedule_strategy: ( - Unset | EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy + EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy | Unset ) = "on_call_only" - paging_strategy_configuration_repeats: None | Unset | int = UNSET - paging_strategy_configuration_repeats_mode: Unset | EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode = ( + paging_strategy_configuration_repeats: int | None | Unset = UNSET + paging_strategy_configuration_repeats_mode: EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode | Unset = ( UNSET ) paging_strategy_configuration_rotation_scope: ( - Unset | EscalationPolicyLevelPagingStrategyConfigurationRotationScope + EscalationPolicyLevelPagingStrategyConfigurationRotationScope | Unset ) = UNSET - paging_strategy_configuration_page_users_count: None | Unset | int = UNSET - created_at: Unset | str = UNSET - updated_at: Unset | str = UNSET + paging_strategy_configuration_page_users_count: int | None | Unset = UNSET + created_at: str | Unset = UNSET + updated_at: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -94,42 +94,42 @@ 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: None | dict[str, Any] + notification_target_params_item: dict[str, Any] | None 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 | Unset | str + escalation_policy_path_id: None | str | Unset 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: Unset | str = UNSET + paging_strategy_configuration_strategy: str | Unset = UNSET if not isinstance(self.paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = self.paging_strategy_configuration_strategy - paging_strategy_configuration_schedule_strategy: Unset | str = UNSET + paging_strategy_configuration_schedule_strategy: str | Unset = 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 + paging_strategy_configuration_repeats: int | None | Unset 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 + paging_strategy_configuration_repeats_mode: str | Unset = 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 + paging_strategy_configuration_rotation_scope: str | Unset = 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 + paging_strategy_configuration_page_users_count: int | None | Unset if isinstance(self.paging_strategy_configuration_page_users_count, Unset): paging_strategy_configuration_page_users_count = UNSET else: @@ -193,7 +193,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_notification_target_params_item( data: object, - ) -> Union["EscalationPolicyLevelNotificationTargetParamsItemType0", None]: + ) -> EscalationPolicyLevelNotificationTargetParamsItemType0 | None: if data is None: return data try: @@ -204,9 +204,9 @@ def _parse_notification_target_params_item( ) return notification_target_params_item_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["EscalationPolicyLevelNotificationTargetParamsItemType0", None], data) + return cast(EscalationPolicyLevelNotificationTargetParamsItemType0 | None, data) notification_target_params_item = _parse_notification_target_params_item( notification_target_params_item_data @@ -214,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 | Unset | str: + def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: Unset | EscalationPolicyLevelPagingStrategyConfigurationStrategy + paging_strategy_configuration_strategy: EscalationPolicyLevelPagingStrategyConfigurationStrategy | Unset if isinstance(_paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = UNSET else: @@ -238,7 +238,7 @@ def _parse_escalation_policy_path_id(data: object) -> None | Unset | str: "paging_strategy_configuration_schedule_strategy", UNSET ) paging_strategy_configuration_schedule_strategy: ( - Unset | EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy + EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy | Unset ) if isinstance(_paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = UNSET @@ -249,19 +249,19 @@ def _parse_escalation_policy_path_id(data: object) -> None | Unset | str: ) ) - def _parse_paging_strategy_configuration_repeats(data: object) -> None | Unset | int: + def _parse_paging_strategy_configuration_repeats(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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 + paging_strategy_configuration_repeats_mode: EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode | Unset if isinstance(_paging_strategy_configuration_repeats_mode, Unset): paging_strategy_configuration_repeats_mode = UNSET else: @@ -273,7 +273,7 @@ def _parse_paging_strategy_configuration_repeats(data: object) -> None | Unset | _paging_strategy_configuration_rotation_scope = d.pop("paging_strategy_configuration_rotation_scope", UNSET) paging_strategy_configuration_rotation_scope: ( - Unset | EscalationPolicyLevelPagingStrategyConfigurationRotationScope + EscalationPolicyLevelPagingStrategyConfigurationRotationScope | Unset ) if isinstance(_paging_strategy_configuration_rotation_scope, Unset): paging_strategy_configuration_rotation_scope = UNSET @@ -284,12 +284,12 @@ def _parse_paging_strategy_configuration_repeats(data: object) -> None | Unset | ) ) - def _parse_paging_strategy_configuration_page_users_count(data: object) -> None | Unset | int: + def _parse_paging_strategy_configuration_page_users_count(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) paging_strategy_configuration_page_users_count = _parse_paging_strategy_configuration_page_users_count( d.pop("paging_strategy_configuration_page_users_count", UNSET) diff --git a/rootly_sdk/models/escalation_policy_level_list.py b/rootly_sdk/models/escalation_policy_level_list.py index 3e8b9295..14ac2b1c 100644 --- a/rootly_sdk/models/escalation_policy_level_list.py +++ b/rootly_sdk/models/escalation_policy_level_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class EscalationPolicyLevelList: """ Attributes: - data (list['EscalationPolicyLevelListDataItem']): + data (list[EscalationPolicyLevelListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["EscalationPolicyLevelListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[EscalationPolicyLevelListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 478e845f..de6c1f8a 100644 --- a/rootly_sdk/models/escalation_policy_level_list_data_item.py +++ b/rootly_sdk/models/escalation_policy_level_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,7 +22,7 @@ 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]: 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 6fc369bc..da88f065 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -23,13 +25,13 @@ class EscalationPolicyLevelNotificationTargetParamsItemType0: Attributes: id (str): The ID of notification target type_ (EscalationPolicyLevelNotificationTargetParamsItemType0Type): The type of the notification target - team_members (Union[Unset, EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers]): For targets with + team_members (EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers | Unset): For targets with type=team, controls whether to notify admins, all team members, or escalate to team EP. """ id: str type_: EscalationPolicyLevelNotificationTargetParamsItemType0Type - team_members: Unset | EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers = UNSET + team_members: EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -37,7 +39,7 @@ def to_dict(self) -> dict[str, Any]: type_: str = self.type_ - team_members: Unset | str = UNSET + team_members: str | Unset = UNSET if not isinstance(self.team_members, Unset): team_members = self.team_members @@ -62,7 +64,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: Unset | EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers + team_members: EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers | Unset if isinstance(_team_members, Unset): team_members = UNSET else: diff --git a/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0_team_members.py b/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0_team_members.py index c90afb96..1e629fc1 100644 --- a/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0_team_members.py +++ b/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0_team_members.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers = Literal["admins", "all", "escalate"] @@ -17,7 +17,7 @@ def check_escalation_policy_level_notification_target_params_item_type_0_team_me if value is None: return None if value in ESCALATION_POLICY_LEVEL_NOTIFICATION_TARGET_PARAMS_ITEM_TYPE_0_TEAM_MEMBERS_VALUES: - return cast(EscalationPolicyLevelNotificationTargetParamsItemType0TeamMembers, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_LEVEL_NOTIFICATION_TARGET_PARAMS_ITEM_TYPE_0_TEAM_MEMBERS_VALUES!r}" ) diff --git a/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0_type.py b/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0_type.py index eaeda31d..e30f1f3a 100644 --- a/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0_type.py +++ b/rootly_sdk/models/escalation_policy_level_notification_target_params_item_type_0_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalationPolicyLevelNotificationTargetParamsItemType0Type = Literal[ "microsoft_teams_channel", "schedule", "service", "slack_channel", "team", "user" @@ -22,7 +22,7 @@ def check_escalation_policy_level_notification_target_params_item_type_0_type( if value is None: return None if value in ESCALATION_POLICY_LEVEL_NOTIFICATION_TARGET_PARAMS_ITEM_TYPE_0_TYPE_VALUES: - return cast(EscalationPolicyLevelNotificationTargetParamsItemType0Type, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_LEVEL_NOTIFICATION_TARGET_PARAMS_ITEM_TYPE_0_TYPE_VALUES!r}" ) 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 index a488a4c5..e7dcb45b 100644 --- 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 @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode = Literal["all", "users"] @@ -16,7 +16,7 @@ def check_escalation_policy_level_paging_strategy_configuration_repeats_mode( if value is None: return None if value in ESCALATION_POLICY_LEVEL_PAGING_STRATEGY_CONFIGURATION_REPEATS_MODE_VALUES: - return cast(EscalationPolicyLevelPagingStrategyConfigurationRepeatsMode, value) + return 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 index bb018dc6..dc615891 100644 --- 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 @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalationPolicyLevelPagingStrategyConfigurationRotationScope = Literal["active_rotation", "entire_schedule"] @@ -16,7 +16,7 @@ def check_escalation_policy_level_paging_strategy_configuration_rotation_scope( if value is None: return None if value in ESCALATION_POLICY_LEVEL_PAGING_STRATEGY_CONFIGURATION_ROTATION_SCOPE_VALUES: - return cast(EscalationPolicyLevelPagingStrategyConfigurationRotationScope, value) + return 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_paging_strategy_configuration_schedule_strategy.py b/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_schedule_strategy.py index ef262e90..8f23c158 100644 --- a/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_schedule_strategy.py +++ b/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_schedule_strategy.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy = Literal["everyone", "on_call_only"] @@ -16,7 +16,7 @@ def check_escalation_policy_level_paging_strategy_configuration_schedule_strateg if value is None: return None if value in ESCALATION_POLICY_LEVEL_PAGING_STRATEGY_CONFIGURATION_SCHEDULE_STRATEGY_VALUES: - return cast(EscalationPolicyLevelPagingStrategyConfigurationScheduleStrategy, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_LEVEL_PAGING_STRATEGY_CONFIGURATION_SCHEDULE_STRATEGY_VALUES!r}" ) diff --git a/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_strategy.py b/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_strategy.py index e8490d77..6a4b16f3 100644 --- a/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_strategy.py +++ b/rootly_sdk/models/escalation_policy_level_paging_strategy_configuration_strategy.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalationPolicyLevelPagingStrategyConfigurationStrategy = Literal["alert", "cycle", "default", "random"] @@ -18,7 +18,7 @@ def check_escalation_policy_level_paging_strategy_configuration_strategy( if value is None: return None if value in ESCALATION_POLICY_LEVEL_PAGING_STRATEGY_CONFIGURATION_STRATEGY_VALUES: - return cast(EscalationPolicyLevelPagingStrategyConfigurationStrategy, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_LEVEL_PAGING_STRATEGY_CONFIGURATION_STRATEGY_VALUES!r}" ) diff --git a/rootly_sdk/models/escalation_policy_level_response.py b/rootly_sdk/models/escalation_policy_level_response.py index 9976067b..9b275380 100644 --- a/rootly_sdk/models/escalation_policy_level_response.py +++ b/rootly_sdk/models/escalation_policy_level_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class EscalationPolicyLevelResponse: """ Attributes: data (EscalationPolicyLevelResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "EscalationPolicyLevelResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: EscalationPolicyLevelResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 430b5a17..49803990 100644 --- a/rootly_sdk/models/escalation_policy_level_response_data.py +++ b/rootly_sdk/models/escalation_policy_level_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,12 +25,12 @@ class EscalationPolicyLevelResponseData: Attributes: id (str): Unique ID of the escalation policy level attributes (EscalationPolicyLevel): - type_ (Union[Unset, EscalationPolicyLevelResponseDataType]): + type_ (EscalationPolicyLevelResponseDataType | Unset): """ id: str - attributes: "EscalationPolicyLevel" - type_: Unset | EscalationPolicyLevelResponseDataType = UNSET + attributes: EscalationPolicyLevel + type_: EscalationPolicyLevelResponseDataType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +38,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -63,7 +65,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_: Unset | EscalationPolicyLevelResponseDataType + type_: EscalationPolicyLevelResponseDataType | Unset if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/escalation_policy_level_response_data_type.py b/rootly_sdk/models/escalation_policy_level_response_data_type.py index d3239606..6da6cc82 100644 --- a/rootly_sdk/models/escalation_policy_level_response_data_type.py +++ b/rootly_sdk/models/escalation_policy_level_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalationPolicyLevelResponseDataType = Literal["escalation_levels"] @@ -11,7 +11,7 @@ def check_escalation_policy_level_response_data_type(value: str | None) -> Escal if value is None: return None if value in ESCALATION_POLICY_LEVEL_RESPONSE_DATA_TYPE_VALUES: - return cast(EscalationPolicyLevelResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_LEVEL_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/escalation_policy_list.py b/rootly_sdk/models/escalation_policy_list.py index 4e153033..f0050840 100644 --- a/rootly_sdk/models/escalation_policy_list.py +++ b/rootly_sdk/models/escalation_policy_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class EscalationPolicyList: """ Attributes: - data (list['EscalationPolicyListDataItem']): + data (list[EscalationPolicyListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["EscalationPolicyListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[EscalationPolicyListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 e9ef02d6..3d4758cf 100644 --- a/rootly_sdk/models/escalation_policy_list_data_item.py +++ b/rootly_sdk/models/escalation_policy_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/escalation_policy_list_data_item_type.py b/rootly_sdk/models/escalation_policy_list_data_item_type.py index ccbfa667..aca2ce9d 100644 --- a/rootly_sdk/models/escalation_policy_list_data_item_type.py +++ b/rootly_sdk/models/escalation_policy_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalationPolicyListDataItemType = Literal["escalation_policies"] @@ -11,5 +11,5 @@ def check_escalation_policy_list_data_item_type(value: str | None) -> Escalation if value is None: return None if value in ESCALATION_POLICY_LIST_DATA_ITEM_TYPE_VALUES: - return cast(EscalationPolicyListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/escalation_policy_path.py b/rootly_sdk/models/escalation_policy_path.py index 6273b8ba..fa548274 100644 --- a/rootly_sdk/models/escalation_policy_path.py +++ b/rootly_sdk/models/escalation_policy_path.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -12,6 +14,10 @@ EscalationPolicyPathMatchMode, check_escalation_policy_path_match_mode, ) +from ..models.escalation_policy_path_notification_type_fallback import ( + EscalationPolicyPathNotificationTypeFallback, + check_escalation_policy_path_notification_type_fallback, +) from ..models.escalation_policy_path_path_type import ( EscalationPolicyPathPathType, check_escalation_policy_path_path_type, @@ -23,30 +29,15 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.escalation_policy_path_rules_item_type_0 import EscalationPolicyPathRulesItemType0 - from ..models.escalation_policy_path_rules_item_type_1 import EscalationPolicyPathRulesItemType1 - from ..models.escalation_policy_path_rules_item_type_2 import EscalationPolicyPathRulesItemType2 - from ..models.escalation_policy_path_rules_item_type_3 import EscalationPolicyPathRulesItemType3 - from ..models.escalation_policy_path_rules_item_type_4 import EscalationPolicyPathRulesItemType4 - from ..models.escalation_policy_path_rules_item_type_5 import EscalationPolicyPathRulesItemType5 - from ..models.escalation_policy_path_rules_item_type_6 import EscalationPolicyPathRulesItemType6 - from ..models.escalation_policy_path_rules_item_type_7 import EscalationPolicyPathRulesItemType7 - from ..models.escalation_policy_path_rules_item_type_8_type_0 import EscalationPolicyPathRulesItemType8Type0 - from ..models.escalation_policy_path_rules_item_type_8_type_1 import EscalationPolicyPathRulesItemType8Type1 - from ..models.escalation_policy_path_rules_item_type_8_type_2 import EscalationPolicyPathRulesItemType8Type2 - from ..models.escalation_policy_path_rules_item_type_8_type_3 import EscalationPolicyPathRulesItemType8Type3 - from ..models.escalation_policy_path_rules_item_type_8_type_4 import EscalationPolicyPathRulesItemType8Type4 - from ..models.escalation_policy_path_rules_item_type_8_type_5 import EscalationPolicyPathRulesItemType8Type5 - from ..models.escalation_policy_path_rules_item_type_8_type_6 import EscalationPolicyPathRulesItemType8Type6 - from ..models.escalation_policy_path_rules_item_type_8_type_7 import EscalationPolicyPathRulesItemType8Type7 - from ..models.escalation_policy_path_rules_item_type_9_type_0 import EscalationPolicyPathRulesItemType9Type0 - from ..models.escalation_policy_path_rules_item_type_9_type_1 import EscalationPolicyPathRulesItemType9Type1 - from ..models.escalation_policy_path_rules_item_type_9_type_2 import EscalationPolicyPathRulesItemType9Type2 - from ..models.escalation_policy_path_rules_item_type_9_type_3 import EscalationPolicyPathRulesItemType9Type3 - from ..models.escalation_policy_path_rules_item_type_9_type_4 import EscalationPolicyPathRulesItemType9Type4 - from ..models.escalation_policy_path_rules_item_type_9_type_5 import EscalationPolicyPathRulesItemType9Type5 - from ..models.escalation_policy_path_rules_item_type_9_type_6 import EscalationPolicyPathRulesItemType9Type6 - from ..models.escalation_policy_path_rules_item_type_9_type_7 import EscalationPolicyPathRulesItemType9Type7 + from ..models.escalation_path_rule_alert_urgency import EscalationPathRuleAlertUrgency + from ..models.escalation_path_rule_deferral_window import EscalationPathRuleDeferralWindow + from ..models.escalation_path_rule_field import EscalationPathRuleField + from ..models.escalation_path_rule_json_path import EscalationPathRuleJsonPath + from ..models.escalation_path_rule_service import EscalationPathRuleService + from ..models.escalation_path_rule_working_hour import EscalationPathRuleWorkingHour + from ..models.escalation_policy_path_notification_type_rules_item import ( + EscalationPolicyPathNotificationTypeRulesItem, + ) from ..models.escalation_policy_path_time_restrictions_item import EscalationPolicyPathTimeRestrictionsItem @@ -61,113 +52,77 @@ 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 (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 + 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 after_deferral_behavior is execute_path - 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 + 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). + retrigger_timeout_minutes (int | None | Unset): Re-trigger acknowledged alerts on this path after N minutes; + null inherits the urgency/workspace default, -1 = never. + created_at (str | Unset): Date of creation + updated_at (str | Unset): Date of last update + rules (list[EscalationPathRuleAlertUrgency | EscalationPathRuleDeferralWindow | EscalationPathRuleField | + EscalationPathRuleJsonPath | EscalationPathRuleService | EscalationPathRuleWorkingHour | None] | Unset): + Escalation path rules + notification_type_rules (list[EscalationPolicyPathNotificationTypeRulesItem] | Unset): Rules deciding whether an + alert pages audible or quiet, evaluated in order — the first matching rule's notification_type wins, otherwise + notification_type_fallback applies. When present, the path's notification_type is aligned to + notification_type_fallback. Only available when notification type conditions are enabled for the team. + notification_type_fallback (EscalationPolicyPathNotificationTypeFallback | Unset): Paged when no notification + type rule matches. Considered only when notification_type_rules are present — the path's notification_type is + aligned to it; without rules it is aligned to notification_type instead. Only available when notification type + conditions are enabled for the team. Default: 'audible'. + time_restriction_time_zone (EscalationPolicyPathTimeRestrictionTimeZone | Unset): Time zone used for time restrictions. - 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. + 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. """ name: str default: bool notification_type: str escalation_policy_id: str - 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 + 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 + retrigger_timeout_minutes: int | None | Unset = UNSET + created_at: str | Unset = UNSET + updated_at: str | Unset = UNSET rules: ( - 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", - ] + list[ + EscalationPathRuleAlertUrgency + | EscalationPathRuleDeferralWindow + | EscalationPathRuleField + | EscalationPathRuleJsonPath + | EscalationPathRuleService + | EscalationPathRuleWorkingHour + | None ] + | Unset ) = UNSET - time_restriction_time_zone: Unset | EscalationPolicyPathTimeRestrictionTimeZone = UNSET - time_restrictions: Unset | list["EscalationPolicyPathTimeRestrictionsItem"] = UNSET + notification_type_rules: list[EscalationPolicyPathNotificationTypeRulesItem] | Unset = UNSET + notification_type_fallback: EscalationPolicyPathNotificationTypeFallback | Unset = "audible" + time_restriction_time_zone: EscalationPolicyPathTimeRestrictionTimeZone | Unset = UNSET + time_restrictions: list[EscalationPolicyPathTimeRestrictionsItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - from ..models.escalation_policy_path_rules_item_type_0 import EscalationPolicyPathRulesItemType0 - from ..models.escalation_policy_path_rules_item_type_1 import EscalationPolicyPathRulesItemType1 - from ..models.escalation_policy_path_rules_item_type_2 import EscalationPolicyPathRulesItemType2 - from ..models.escalation_policy_path_rules_item_type_3 import EscalationPolicyPathRulesItemType3 - from ..models.escalation_policy_path_rules_item_type_4 import EscalationPolicyPathRulesItemType4 - from ..models.escalation_policy_path_rules_item_type_5 import EscalationPolicyPathRulesItemType5 - from ..models.escalation_policy_path_rules_item_type_6 import EscalationPolicyPathRulesItemType6 - from ..models.escalation_policy_path_rules_item_type_7 import EscalationPolicyPathRulesItemType7 - from ..models.escalation_policy_path_rules_item_type_8_type_0 import EscalationPolicyPathRulesItemType8Type0 - from ..models.escalation_policy_path_rules_item_type_8_type_1 import EscalationPolicyPathRulesItemType8Type1 - from ..models.escalation_policy_path_rules_item_type_8_type_2 import EscalationPolicyPathRulesItemType8Type2 - from ..models.escalation_policy_path_rules_item_type_8_type_3 import EscalationPolicyPathRulesItemType8Type3 - from ..models.escalation_policy_path_rules_item_type_8_type_4 import EscalationPolicyPathRulesItemType8Type4 - from ..models.escalation_policy_path_rules_item_type_8_type_5 import EscalationPolicyPathRulesItemType8Type5 - from ..models.escalation_policy_path_rules_item_type_8_type_6 import EscalationPolicyPathRulesItemType8Type6 - from ..models.escalation_policy_path_rules_item_type_8_type_7 import EscalationPolicyPathRulesItemType8Type7 - from ..models.escalation_policy_path_rules_item_type_9_type_0 import EscalationPolicyPathRulesItemType9Type0 - from ..models.escalation_policy_path_rules_item_type_9_type_1 import EscalationPolicyPathRulesItemType9Type1 - from ..models.escalation_policy_path_rules_item_type_9_type_2 import EscalationPolicyPathRulesItemType9Type2 - from ..models.escalation_policy_path_rules_item_type_9_type_3 import EscalationPolicyPathRulesItemType9Type3 - from ..models.escalation_policy_path_rules_item_type_9_type_4 import EscalationPolicyPathRulesItemType9Type4 - from ..models.escalation_policy_path_rules_item_type_9_type_5 import EscalationPolicyPathRulesItemType9Type5 - from ..models.escalation_policy_path_rules_item_type_9_type_6 import EscalationPolicyPathRulesItemType9Type6 + from ..models.escalation_path_rule_alert_urgency import EscalationPathRuleAlertUrgency + from ..models.escalation_path_rule_deferral_window import EscalationPathRuleDeferralWindow + from ..models.escalation_path_rule_field import EscalationPathRuleField + from ..models.escalation_path_rule_json_path import EscalationPathRuleJsonPath + from ..models.escalation_path_rule_service import EscalationPathRuleService + from ..models.escalation_path_rule_working_hour import EscalationPathRuleWorkingHour name = self.name @@ -177,27 +132,27 @@ def to_dict(self) -> dict[str, Any]: escalation_policy_id = self.escalation_policy_id - repeat: None | bool + repeat: bool | None repeat = self.repeat - repeat_count: None | int + repeat_count: int | None repeat_count = self.repeat_count - path_type: Unset | str = UNSET + path_type: str | Unset = UNSET if not isinstance(self.path_type, Unset): path_type = self.path_type - after_deferral_behavior: Unset | str = UNSET + after_deferral_behavior: str | Unset = UNSET if not isinstance(self.after_deferral_behavior, Unset): after_deferral_behavior = self.after_deferral_behavior - after_deferral_path_id: None | Unset | str + after_deferral_path_id: None | str | Unset 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: Unset | str = UNSET + match_mode: str | Unset = UNSET if not isinstance(self.match_mode, Unset): match_mode = self.match_mode @@ -205,7 +160,7 @@ def to_dict(self) -> dict[str, Any]: initial_delay = self.initial_delay - retrigger_timeout_minutes: None | Unset | int + retrigger_timeout_minutes: int | None | Unset if isinstance(self.retrigger_timeout_minutes, Unset): retrigger_timeout_minutes = UNSET else: @@ -215,67 +170,43 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - rules: Unset | list[dict[str, Any]] = UNSET + rules: list[dict[str, Any] | None] | Unset = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: - rules_item: dict[str, Any] - if isinstance(rules_item_data, EscalationPolicyPathRulesItemType0): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType1): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType2): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType3): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType4): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType5): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType6): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType7): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType8Type0): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType8Type1): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType8Type2): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType8Type3): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType8Type4): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType8Type5): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType8Type6): + rules_item: dict[str, Any] | None + if isinstance(rules_item_data, EscalationPathRuleAlertUrgency): rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType8Type7): + elif isinstance(rules_item_data, EscalationPathRuleWorkingHour): rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType9Type0): + elif isinstance(rules_item_data, EscalationPathRuleJsonPath): rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType9Type1): + elif isinstance(rules_item_data, EscalationPathRuleField): rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType9Type2): + elif isinstance(rules_item_data, EscalationPathRuleService): rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType9Type3): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType9Type4): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType9Type5): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, EscalationPolicyPathRulesItemType9Type6): + elif isinstance(rules_item_data, EscalationPathRuleDeferralWindow): rules_item = rules_item_data.to_dict() else: - rules_item = rules_item_data.to_dict() - + rules_item = rules_item_data rules.append(rules_item) - time_restriction_time_zone: Unset | str = UNSET + notification_type_rules: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.notification_type_rules, Unset): + notification_type_rules = [] + for notification_type_rules_item_data in self.notification_type_rules: + notification_type_rules_item = notification_type_rules_item_data.to_dict() + notification_type_rules.append(notification_type_rules_item) + + notification_type_fallback: str | Unset = UNSET + if not isinstance(self.notification_type_fallback, Unset): + notification_type_fallback = self.notification_type_fallback + + time_restriction_time_zone: str | Unset = UNSET if not isinstance(self.time_restriction_time_zone, Unset): time_restriction_time_zone = self.time_restriction_time_zone - time_restrictions: Unset | list[dict[str, Any]] = UNSET + time_restrictions: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.time_restrictions, Unset): time_restrictions = [] for time_restrictions_item_data in self.time_restrictions: @@ -314,6 +245,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["updated_at"] = updated_at if rules is not UNSET: field_dict["rules"] = rules + if notification_type_rules is not UNSET: + field_dict["notification_type_rules"] = notification_type_rules + if notification_type_fallback is not UNSET: + field_dict["notification_type_fallback"] = notification_type_fallback if time_restriction_time_zone is not UNSET: field_dict["time_restriction_time_zone"] = time_restriction_time_zone if time_restrictions is not UNSET: @@ -323,30 +258,15 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.escalation_policy_path_rules_item_type_0 import EscalationPolicyPathRulesItemType0 - from ..models.escalation_policy_path_rules_item_type_1 import EscalationPolicyPathRulesItemType1 - from ..models.escalation_policy_path_rules_item_type_2 import EscalationPolicyPathRulesItemType2 - from ..models.escalation_policy_path_rules_item_type_3 import EscalationPolicyPathRulesItemType3 - from ..models.escalation_policy_path_rules_item_type_4 import EscalationPolicyPathRulesItemType4 - from ..models.escalation_policy_path_rules_item_type_5 import EscalationPolicyPathRulesItemType5 - from ..models.escalation_policy_path_rules_item_type_6 import EscalationPolicyPathRulesItemType6 - from ..models.escalation_policy_path_rules_item_type_7 import EscalationPolicyPathRulesItemType7 - from ..models.escalation_policy_path_rules_item_type_8_type_0 import EscalationPolicyPathRulesItemType8Type0 - from ..models.escalation_policy_path_rules_item_type_8_type_1 import EscalationPolicyPathRulesItemType8Type1 - from ..models.escalation_policy_path_rules_item_type_8_type_2 import EscalationPolicyPathRulesItemType8Type2 - from ..models.escalation_policy_path_rules_item_type_8_type_3 import EscalationPolicyPathRulesItemType8Type3 - from ..models.escalation_policy_path_rules_item_type_8_type_4 import EscalationPolicyPathRulesItemType8Type4 - from ..models.escalation_policy_path_rules_item_type_8_type_5 import EscalationPolicyPathRulesItemType8Type5 - from ..models.escalation_policy_path_rules_item_type_8_type_6 import EscalationPolicyPathRulesItemType8Type6 - from ..models.escalation_policy_path_rules_item_type_8_type_7 import EscalationPolicyPathRulesItemType8Type7 - from ..models.escalation_policy_path_rules_item_type_9_type_0 import EscalationPolicyPathRulesItemType9Type0 - from ..models.escalation_policy_path_rules_item_type_9_type_1 import EscalationPolicyPathRulesItemType9Type1 - from ..models.escalation_policy_path_rules_item_type_9_type_2 import EscalationPolicyPathRulesItemType9Type2 - from ..models.escalation_policy_path_rules_item_type_9_type_3 import EscalationPolicyPathRulesItemType9Type3 - from ..models.escalation_policy_path_rules_item_type_9_type_4 import EscalationPolicyPathRulesItemType9Type4 - from ..models.escalation_policy_path_rules_item_type_9_type_5 import EscalationPolicyPathRulesItemType9Type5 - from ..models.escalation_policy_path_rules_item_type_9_type_6 import EscalationPolicyPathRulesItemType9Type6 - from ..models.escalation_policy_path_rules_item_type_9_type_7 import EscalationPolicyPathRulesItemType9Type7 + from ..models.escalation_path_rule_alert_urgency import EscalationPathRuleAlertUrgency + from ..models.escalation_path_rule_deferral_window import EscalationPathRuleDeferralWindow + from ..models.escalation_path_rule_field import EscalationPathRuleField + from ..models.escalation_path_rule_json_path import EscalationPathRuleJsonPath + from ..models.escalation_path_rule_service import EscalationPathRuleService + from ..models.escalation_path_rule_working_hour import EscalationPathRuleWorkingHour + from ..models.escalation_policy_path_notification_type_rules_item import ( + EscalationPolicyPathNotificationTypeRulesItem, + ) from ..models.escalation_policy_path_time_restrictions_item import EscalationPolicyPathTimeRestrictionsItem d = dict(src_dict) @@ -358,45 +278,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) -> None | bool: + def _parse_repeat(data: object) -> bool | None: if data is None: return data - return cast(None | bool, data) + return cast(bool | None, data) repeat = _parse_repeat(d.pop("repeat")) - def _parse_repeat_count(data: object) -> None | int: + def _parse_repeat_count(data: object) -> int | None: if data is None: return data - return cast(None | int, data) + return cast(int | None, data) repeat_count = _parse_repeat_count(d.pop("repeat_count")) _path_type = d.pop("path_type", UNSET) - path_type: Unset | EscalationPolicyPathPathType + path_type: EscalationPolicyPathPathType | Unset 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: Unset | EscalationPolicyPathAfterDeferralBehavior + after_deferral_behavior: EscalationPolicyPathAfterDeferralBehavior | Unset 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 | Unset | str: + def _parse_after_deferral_path_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: Unset | EscalationPolicyPathMatchMode + match_mode: EscalationPolicyPathMatchMode | Unset if isinstance(_match_mode, Unset): match_mode = UNSET else: @@ -406,12 +326,12 @@ def _parse_after_deferral_path_id(data: object) -> None | Unset | str: initial_delay = d.pop("initial_delay", UNSET) - def _parse_retrigger_timeout_minutes(data: object) -> None | Unset | int: + def _parse_retrigger_timeout_minutes(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) retrigger_timeout_minutes = _parse_retrigger_timeout_minutes(d.pop("retrigger_timeout_minutes", UNSET)) @@ -419,234 +339,121 @@ def _parse_retrigger_timeout_minutes(data: object) -> None | Unset | int: updated_at = d.pop("updated_at", UNSET) - rules = [] _rules = d.pop("rules", UNSET) - 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_0 = EscalationPolicyPathRulesItemType0.from_dict(data) - - 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) - - 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) - - 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) + rules: ( + list[ + EscalationPathRuleAlertUrgency + | EscalationPathRuleDeferralWindow + | EscalationPathRuleField + | EscalationPathRuleJsonPath + | EscalationPathRuleService + | EscalationPathRuleWorkingHour + | None + ] + | Unset + ) = UNSET + if _rules is not UNSET: + rules = [] + for rules_item_data in _rules: + + def _parse_rules_item( + data: object, + ) -> ( + EscalationPathRuleAlertUrgency + | EscalationPathRuleDeferralWindow + | EscalationPathRuleField + | EscalationPathRuleJsonPath + | EscalationPathRuleService + | EscalationPathRuleWorkingHour + | None + ): + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_0 = EscalationPathRuleAlertUrgency.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 = EscalationPathRuleWorkingHour.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 = EscalationPathRuleJsonPath.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 = EscalationPathRuleField.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 = EscalationPathRuleService.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 = EscalationPathRuleDeferralWindow.from_dict(data) + + return rules_item_type_5 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast( + EscalationPathRuleAlertUrgency + | EscalationPathRuleDeferralWindow + | EscalationPathRuleField + | EscalationPathRuleJsonPath + | EscalationPathRuleService + | EscalationPathRuleWorkingHour + | None, + data, + ) + + rules_item = _parse_rules_item(rules_item_data) + + rules.append(rules_item) + + _notification_type_rules = d.pop("notification_type_rules", UNSET) + notification_type_rules: list[EscalationPolicyPathNotificationTypeRulesItem] | Unset = UNSET + if _notification_type_rules is not UNSET: + notification_type_rules = [] + for notification_type_rules_item_data in _notification_type_rules: + notification_type_rules_item = EscalationPolicyPathNotificationTypeRulesItem.from_dict( + notification_type_rules_item_data + ) + + notification_type_rules.append(notification_type_rules_item) + + _notification_type_fallback = d.pop("notification_type_fallback", UNSET) + notification_type_fallback: EscalationPolicyPathNotificationTypeFallback | Unset + if isinstance(_notification_type_fallback, Unset): + notification_type_fallback = UNSET + else: + notification_type_fallback = check_escalation_policy_path_notification_type_fallback( + _notification_type_fallback + ) _time_restriction_time_zone = d.pop("time_restriction_time_zone", UNSET) - time_restriction_time_zone: Unset | EscalationPolicyPathTimeRestrictionTimeZone + time_restriction_time_zone: EscalationPolicyPathTimeRestrictionTimeZone | Unset if isinstance(_time_restriction_time_zone, Unset): time_restriction_time_zone = UNSET else: @@ -654,12 +461,14 @@ def _parse_rules_item( _time_restriction_time_zone ) - time_restrictions = [] _time_restrictions = d.pop("time_restrictions", UNSET) - for time_restrictions_item_data in _time_restrictions or []: - time_restrictions_item = EscalationPolicyPathTimeRestrictionsItem.from_dict(time_restrictions_item_data) + 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) - time_restrictions.append(time_restrictions_item) + time_restrictions.append(time_restrictions_item) escalation_policy_path = cls( name=name, @@ -678,6 +487,8 @@ def _parse_rules_item( created_at=created_at, updated_at=updated_at, rules=rules, + notification_type_rules=notification_type_rules, + notification_type_fallback=notification_type_fallback, time_restriction_time_zone=time_restriction_time_zone, time_restrictions=time_restrictions, ) diff --git a/rootly_sdk/models/escalation_policy_path_after_deferral_behavior.py b/rootly_sdk/models/escalation_policy_path_after_deferral_behavior.py index 3e9fd9b7..b0bb9bf8 100644 --- a/rootly_sdk/models/escalation_policy_path_after_deferral_behavior.py +++ b/rootly_sdk/models/escalation_policy_path_after_deferral_behavior.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalationPolicyPathAfterDeferralBehavior = Literal["execute_path", "re_evaluate"] @@ -14,7 +14,7 @@ def check_escalation_policy_path_after_deferral_behavior( if value is None: return None if value in ESCALATION_POLICY_PATH_AFTER_DEFERRAL_BEHAVIOR_VALUES: - return cast(EscalationPolicyPathAfterDeferralBehavior, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_AFTER_DEFERRAL_BEHAVIOR_VALUES!r}" ) diff --git a/rootly_sdk/models/escalation_policy_path_list.py b/rootly_sdk/models/escalation_policy_path_list.py index 2ce01f9c..3d378afb 100644 --- a/rootly_sdk/models/escalation_policy_path_list.py +++ b/rootly_sdk/models/escalation_policy_path_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class EscalationPolicyPathList: """ Attributes: - data (list['EscalationPolicyPathListDataItem']): + data (list[EscalationPolicyPathListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["EscalationPolicyPathListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[EscalationPolicyPathListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 5807ada6..7d50c763 100644 --- a/rootly_sdk/models/escalation_policy_path_list_data_item.py +++ b/rootly_sdk/models/escalation_policy_path_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,7 +22,7 @@ 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]: diff --git a/rootly_sdk/models/escalation_policy_path_match_mode.py b/rootly_sdk/models/escalation_policy_path_match_mode.py index 3c45f7e0..eeb15146 100644 --- a/rootly_sdk/models/escalation_policy_path_match_mode.py +++ b/rootly_sdk/models/escalation_policy_path_match_mode.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalationPolicyPathMatchMode = Literal["match-all-rules", "match-any-rule"] @@ -12,5 +12,5 @@ def check_escalation_policy_path_match_mode(value: str | None) -> EscalationPoli if value is None: return None if value in ESCALATION_POLICY_PATH_MATCH_MODE_VALUES: - return cast(EscalationPolicyPathMatchMode, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_MATCH_MODE_VALUES!r}") diff --git a/rootly_sdk/models/escalation_policy_path_notification_type_fallback.py b/rootly_sdk/models/escalation_policy_path_notification_type_fallback.py new file mode 100644 index 00000000..0051d7d0 --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_fallback.py @@ -0,0 +1,20 @@ +from typing import Literal + +EscalationPolicyPathNotificationTypeFallback = Literal["audible", "quiet"] + +ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_FALLBACK_VALUES: set[EscalationPolicyPathNotificationTypeFallback] = { + "audible", + "quiet", +} + + +def check_escalation_policy_path_notification_type_fallback( + value: str | None, +) -> EscalationPolicyPathNotificationTypeFallback | None: + if value is None: + return None + if value in ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_FALLBACK_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_FALLBACK_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_path_notification_type_rules_item.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item.py new file mode 100644 index 00000000..890b5757 --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item.py @@ -0,0 +1,310 @@ +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.escalation_policy_path_notification_type_rules_item_match_mode import ( + EscalationPolicyPathNotificationTypeRulesItemMatchMode, + check_escalation_policy_path_notification_type_rules_item_match_mode, +) +from ..models.escalation_policy_path_notification_type_rules_item_notification_type import ( + EscalationPolicyPathNotificationTypeRulesItemNotificationType, + check_escalation_policy_path_notification_type_rules_item_notification_type, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.escalation_policy_path_notification_type_rules_item_alert_field import ( + EscalationPolicyPathNotificationTypeRulesItemAlertField, + ) + from ..models.escalation_policy_path_notification_type_rules_item_alert_source import ( + EscalationPolicyPathNotificationTypeRulesItemAlertSource, + ) + from ..models.escalation_policy_path_notification_type_rules_item_alert_urgency import ( + EscalationPolicyPathNotificationTypeRulesItemAlertUrgency, + ) + from ..models.escalation_policy_path_notification_type_rules_item_deferral_window import ( + EscalationPolicyPathNotificationTypeRulesItemDeferralWindow, + ) + from ..models.escalation_policy_path_notification_type_rules_item_json_path import ( + EscalationPolicyPathNotificationTypeRulesItemJSONPath, + ) + from ..models.escalation_policy_path_notification_type_rules_item_related_incidents import ( + EscalationPolicyPathNotificationTypeRulesItemRelatedIncidents, + ) + from ..models.escalation_policy_path_notification_type_rules_item_service import ( + EscalationPolicyPathNotificationTypeRulesItemService, + ) + from ..models.escalation_policy_path_notification_type_rules_item_working_hours import ( + EscalationPolicyPathNotificationTypeRulesItemWorkingHours, + ) + + +T = TypeVar("T", bound="EscalationPolicyPathNotificationTypeRulesItem") + + +@_attrs_define +class EscalationPolicyPathNotificationTypeRulesItem: + """ + Attributes: + conditions (list[EscalationPolicyPathNotificationTypeRulesItemAlertField | + EscalationPolicyPathNotificationTypeRulesItemAlertSource | + EscalationPolicyPathNotificationTypeRulesItemAlertUrgency | + EscalationPolicyPathNotificationTypeRulesItemDeferralWindow | + EscalationPolicyPathNotificationTypeRulesItemJSONPath | + EscalationPolicyPathNotificationTypeRulesItemRelatedIncidents | + EscalationPolicyPathNotificationTypeRulesItemService | + EscalationPolicyPathNotificationTypeRulesItemWorkingHours]): Conditions combined per match_mode, at least one + per rule. A deferral_window condition matches when the alert falls inside its time blocks. + notification_type (EscalationPolicyPathNotificationTypeRulesItemNotificationType | Unset): Outcome when this + rule matches Default: 'audible'. + match_mode (EscalationPolicyPathNotificationTypeRulesItemMatchMode | Unset): Whether all or any of the rule's + conditions must match Default: 'match-all-rules'. + """ + + conditions: list[ + EscalationPolicyPathNotificationTypeRulesItemAlertField + | EscalationPolicyPathNotificationTypeRulesItemAlertSource + | EscalationPolicyPathNotificationTypeRulesItemAlertUrgency + | EscalationPolicyPathNotificationTypeRulesItemDeferralWindow + | EscalationPolicyPathNotificationTypeRulesItemJSONPath + | EscalationPolicyPathNotificationTypeRulesItemRelatedIncidents + | EscalationPolicyPathNotificationTypeRulesItemService + | EscalationPolicyPathNotificationTypeRulesItemWorkingHours + ] + notification_type: EscalationPolicyPathNotificationTypeRulesItemNotificationType | Unset = "audible" + match_mode: EscalationPolicyPathNotificationTypeRulesItemMatchMode | Unset = "match-all-rules" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.escalation_policy_path_notification_type_rules_item_alert_field import ( + EscalationPolicyPathNotificationTypeRulesItemAlertField, + ) + from ..models.escalation_policy_path_notification_type_rules_item_alert_source import ( + EscalationPolicyPathNotificationTypeRulesItemAlertSource, + ) + from ..models.escalation_policy_path_notification_type_rules_item_alert_urgency import ( + EscalationPolicyPathNotificationTypeRulesItemAlertUrgency, + ) + from ..models.escalation_policy_path_notification_type_rules_item_deferral_window import ( + EscalationPolicyPathNotificationTypeRulesItemDeferralWindow, + ) + from ..models.escalation_policy_path_notification_type_rules_item_json_path import ( + EscalationPolicyPathNotificationTypeRulesItemJSONPath, + ) + from ..models.escalation_policy_path_notification_type_rules_item_service import ( + EscalationPolicyPathNotificationTypeRulesItemService, + ) + from ..models.escalation_policy_path_notification_type_rules_item_working_hours import ( + EscalationPolicyPathNotificationTypeRulesItemWorkingHours, + ) + + conditions = [] + for conditions_item_data in self.conditions: + conditions_item: dict[str, Any] + if isinstance(conditions_item_data, EscalationPolicyPathNotificationTypeRulesItemAlertUrgency): + conditions_item = conditions_item_data.to_dict() + elif isinstance(conditions_item_data, EscalationPolicyPathNotificationTypeRulesItemWorkingHours): + conditions_item = conditions_item_data.to_dict() + elif isinstance(conditions_item_data, EscalationPolicyPathNotificationTypeRulesItemJSONPath): + conditions_item = conditions_item_data.to_dict() + elif isinstance(conditions_item_data, EscalationPolicyPathNotificationTypeRulesItemAlertField): + conditions_item = conditions_item_data.to_dict() + elif isinstance(conditions_item_data, EscalationPolicyPathNotificationTypeRulesItemService): + conditions_item = conditions_item_data.to_dict() + elif isinstance(conditions_item_data, EscalationPolicyPathNotificationTypeRulesItemDeferralWindow): + conditions_item = conditions_item_data.to_dict() + elif isinstance(conditions_item_data, EscalationPolicyPathNotificationTypeRulesItemAlertSource): + conditions_item = conditions_item_data.to_dict() + else: + conditions_item = conditions_item_data.to_dict() + + conditions.append(conditions_item) + + notification_type: str | Unset = UNSET + if not isinstance(self.notification_type, Unset): + notification_type = self.notification_type + + match_mode: str | Unset = UNSET + if not isinstance(self.match_mode, Unset): + match_mode = self.match_mode + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "conditions": conditions, + } + ) + if notification_type is not UNSET: + field_dict["notification_type"] = notification_type + if match_mode is not UNSET: + field_dict["match_mode"] = match_mode + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.escalation_policy_path_notification_type_rules_item_alert_field import ( + EscalationPolicyPathNotificationTypeRulesItemAlertField, + ) + from ..models.escalation_policy_path_notification_type_rules_item_alert_source import ( + EscalationPolicyPathNotificationTypeRulesItemAlertSource, + ) + from ..models.escalation_policy_path_notification_type_rules_item_alert_urgency import ( + EscalationPolicyPathNotificationTypeRulesItemAlertUrgency, + ) + from ..models.escalation_policy_path_notification_type_rules_item_deferral_window import ( + EscalationPolicyPathNotificationTypeRulesItemDeferralWindow, + ) + from ..models.escalation_policy_path_notification_type_rules_item_json_path import ( + EscalationPolicyPathNotificationTypeRulesItemJSONPath, + ) + from ..models.escalation_policy_path_notification_type_rules_item_related_incidents import ( + EscalationPolicyPathNotificationTypeRulesItemRelatedIncidents, + ) + from ..models.escalation_policy_path_notification_type_rules_item_service import ( + EscalationPolicyPathNotificationTypeRulesItemService, + ) + from ..models.escalation_policy_path_notification_type_rules_item_working_hours import ( + EscalationPolicyPathNotificationTypeRulesItemWorkingHours, + ) + + d = dict(src_dict) + conditions = [] + _conditions = d.pop("conditions") + for conditions_item_data in _conditions: + + def _parse_conditions_item( + data: object, + ) -> ( + EscalationPolicyPathNotificationTypeRulesItemAlertField + | EscalationPolicyPathNotificationTypeRulesItemAlertSource + | EscalationPolicyPathNotificationTypeRulesItemAlertUrgency + | EscalationPolicyPathNotificationTypeRulesItemDeferralWindow + | EscalationPolicyPathNotificationTypeRulesItemJSONPath + | EscalationPolicyPathNotificationTypeRulesItemRelatedIncidents + | EscalationPolicyPathNotificationTypeRulesItemService + | EscalationPolicyPathNotificationTypeRulesItemWorkingHours + ): + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_alert_urgency = EscalationPolicyPathNotificationTypeRulesItemAlertUrgency.from_dict( + data + ) + + return conditions_item_alert_urgency + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_working_hours = EscalationPolicyPathNotificationTypeRulesItemWorkingHours.from_dict( + data + ) + + return conditions_item_working_hours + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_json_path = EscalationPolicyPathNotificationTypeRulesItemJSONPath.from_dict(data) + + return conditions_item_json_path + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_alert_field = EscalationPolicyPathNotificationTypeRulesItemAlertField.from_dict( + data + ) + + return conditions_item_alert_field + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_service = EscalationPolicyPathNotificationTypeRulesItemService.from_dict(data) + + return conditions_item_service + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_deferral_window = ( + EscalationPolicyPathNotificationTypeRulesItemDeferralWindow.from_dict(data) + ) + + return conditions_item_deferral_window + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_alert_source = EscalationPolicyPathNotificationTypeRulesItemAlertSource.from_dict( + data + ) + + return conditions_item_alert_source + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + conditions_item_related_incidents = ( + EscalationPolicyPathNotificationTypeRulesItemRelatedIncidents.from_dict(data) + ) + + return conditions_item_related_incidents + + conditions_item = _parse_conditions_item(conditions_item_data) + + conditions.append(conditions_item) + + _notification_type = d.pop("notification_type", UNSET) + notification_type: EscalationPolicyPathNotificationTypeRulesItemNotificationType | Unset + if isinstance(_notification_type, Unset): + notification_type = UNSET + else: + notification_type = check_escalation_policy_path_notification_type_rules_item_notification_type( + _notification_type + ) + + _match_mode = d.pop("match_mode", UNSET) + match_mode: EscalationPolicyPathNotificationTypeRulesItemMatchMode | Unset + if isinstance(_match_mode, Unset): + match_mode = UNSET + else: + match_mode = check_escalation_policy_path_notification_type_rules_item_match_mode(_match_mode) + + escalation_policy_path_notification_type_rules_item = cls( + conditions=conditions, + notification_type=notification_type, + match_mode=match_mode, + ) + + escalation_policy_path_notification_type_rules_item.additional_properties = d + return escalation_policy_path_notification_type_rules_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_escalation_policy_path_data_attributes_rules_item_type_3.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_field.py similarity index 56% rename from rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3.py rename to rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_field.py index e5bc643d..1515dc9e 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3.py +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_field.py @@ -1,39 +1,42 @@ +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.new_escalation_policy_path_data_attributes_rules_item_type_3_operator import ( - NewEscalationPolicyPathDataAttributesRulesItemType3Operator, - check_new_escalation_policy_path_data_attributes_rules_item_type_3_operator, +from ..models.escalation_policy_path_notification_type_rules_item_alert_field_operator import ( + EscalationPolicyPathNotificationTypeRulesItemAlertFieldOperator, + check_escalation_policy_path_notification_type_rules_item_alert_field_operator, ) -from ..models.new_escalation_policy_path_data_attributes_rules_item_type_3_rule_type import ( - NewEscalationPolicyPathDataAttributesRulesItemType3RuleType, - check_new_escalation_policy_path_data_attributes_rules_item_type_3_rule_type, +from ..models.escalation_policy_path_notification_type_rules_item_alert_field_rule_type import ( + EscalationPolicyPathNotificationTypeRulesItemAlertFieldRuleType, + check_escalation_policy_path_notification_type_rules_item_alert_field_rule_type, ) from ..types import UNSET, Unset -T = TypeVar("T", bound="NewEscalationPolicyPathDataAttributesRulesItemType3") +T = TypeVar("T", bound="EscalationPolicyPathNotificationTypeRulesItemAlertField") @_attrs_define -class NewEscalationPolicyPathDataAttributesRulesItemType3: +class EscalationPolicyPathNotificationTypeRulesItemAlertField: """ Attributes: - rule_type (NewEscalationPolicyPathDataAttributesRulesItemType3RuleType): The type of the escalation path rule + rule_type (EscalationPolicyPathNotificationTypeRulesItemAlertFieldRuleType): The type of the escalation path + rule fieldable_type (str): The type of the fieldable (e.g., AlertField) fieldable_id (str): The ID of the alert field - operator (NewEscalationPolicyPathDataAttributesRulesItemType3Operator): How the alert field value should be + operator (EscalationPolicyPathNotificationTypeRulesItemAlertFieldOperator): How the alert field value should be matched - values (Union[Unset, list[str]]): Values to match against + values (list[str] | Unset): Values to match against """ - rule_type: NewEscalationPolicyPathDataAttributesRulesItemType3RuleType + rule_type: EscalationPolicyPathNotificationTypeRulesItemAlertFieldRuleType fieldable_type: str fieldable_id: str - operator: NewEscalationPolicyPathDataAttributesRulesItemType3Operator - values: Unset | list[str] = UNSET + operator: EscalationPolicyPathNotificationTypeRulesItemAlertFieldOperator + values: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values @@ -67,17 +70,17 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - rule_type = check_new_escalation_policy_path_data_attributes_rules_item_type_3_rule_type(d.pop("rule_type")) + rule_type = check_escalation_policy_path_notification_type_rules_item_alert_field_rule_type(d.pop("rule_type")) fieldable_type = d.pop("fieldable_type") fieldable_id = d.pop("fieldable_id") - operator = check_new_escalation_policy_path_data_attributes_rules_item_type_3_operator(d.pop("operator")) + operator = check_escalation_policy_path_notification_type_rules_item_alert_field_operator(d.pop("operator")) values = cast(list[str], d.pop("values", UNSET)) - new_escalation_policy_path_data_attributes_rules_item_type_3 = cls( + escalation_policy_path_notification_type_rules_item_alert_field = cls( rule_type=rule_type, fieldable_type=fieldable_type, fieldable_id=fieldable_id, @@ -85,8 +88,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: values=values, ) - new_escalation_policy_path_data_attributes_rules_item_type_3.additional_properties = d - return new_escalation_policy_path_data_attributes_rules_item_type_3 + escalation_policy_path_notification_type_rules_item_alert_field.additional_properties = d + return escalation_policy_path_notification_type_rules_item_alert_field @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_3_operator.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_field_operator.py similarity index 53% rename from rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_3_operator.py rename to rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_field_operator.py index 0ec9653c..350c2285 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_3_operator.py +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_field_operator.py @@ -1,6 +1,6 @@ -from typing import Literal, cast +from typing import Literal -EscalationPolicyPathRulesItemType9Type3Operator = Literal[ +EscalationPolicyPathNotificationTypeRulesItemAlertFieldOperator = Literal[ "contains", "contains_key", "does_not_contain", @@ -17,8 +17,8 @@ "starts_with", ] -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_3_OPERATOR_VALUES: set[ - EscalationPolicyPathRulesItemType9Type3Operator +ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_ALERT_FIELD_OPERATOR_VALUES: set[ + EscalationPolicyPathNotificationTypeRulesItemAlertFieldOperator ] = { "contains", "contains_key", @@ -37,13 +37,13 @@ } -def check_escalation_policy_path_rules_item_type_9_type_3_operator( +def check_escalation_policy_path_notification_type_rules_item_alert_field_operator( value: str | None, -) -> EscalationPolicyPathRulesItemType9Type3Operator | None: +) -> EscalationPolicyPathNotificationTypeRulesItemAlertFieldOperator | None: if value is None: return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_3_OPERATOR_VALUES: - return cast(EscalationPolicyPathRulesItemType9Type3Operator, value) + if value in ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_ALERT_FIELD_OPERATOR_VALUES: + return value raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_3_OPERATOR_VALUES!r}" + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_ALERT_FIELD_OPERATOR_VALUES!r}" ) diff --git a/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_field_rule_type.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_field_rule_type.py new file mode 100644 index 00000000..a9252878 --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_field_rule_type.py @@ -0,0 +1,21 @@ +from typing import Literal + +EscalationPolicyPathNotificationTypeRulesItemAlertFieldRuleType = Literal["field"] + +ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_ALERT_FIELD_RULE_TYPE_VALUES: set[ + EscalationPolicyPathNotificationTypeRulesItemAlertFieldRuleType +] = { + "field", +} + + +def check_escalation_policy_path_notification_type_rules_item_alert_field_rule_type( + value: str | None, +) -> EscalationPolicyPathNotificationTypeRulesItemAlertFieldRuleType | None: + if value is None: + return None + if value in ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_ALERT_FIELD_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_ALERT_FIELD_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_6.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_source.py similarity index 50% rename from rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_6.py rename to rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_source.py index 764b5182..87bfd4fa 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_6.py +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_source.py @@ -1,33 +1,36 @@ +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.update_escalation_policy_path_data_attributes_rules_item_type_6_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType6Operator, - check_update_escalation_policy_path_data_attributes_rules_item_type_6_operator, +from ..models.escalation_policy_path_notification_type_rules_item_alert_source_operator import ( + EscalationPolicyPathNotificationTypeRulesItemAlertSourceOperator, + check_escalation_policy_path_notification_type_rules_item_alert_source_operator, ) -from ..models.update_escalation_policy_path_data_attributes_rules_item_type_6_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType6RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_6_rule_type, +from ..models.escalation_policy_path_notification_type_rules_item_alert_source_rule_type import ( + EscalationPolicyPathNotificationTypeRulesItemAlertSourceRuleType, + check_escalation_policy_path_notification_type_rules_item_alert_source_rule_type, ) -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType6") +T = TypeVar("T", bound="EscalationPolicyPathNotificationTypeRulesItemAlertSource") @_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType6: +class EscalationPolicyPathNotificationTypeRulesItemAlertSource: """ Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType6RuleType): The type of the escalation path rule - operator (UpdateEscalationPolicyPathDataAttributesRulesItemType6Operator): How the alert source should be + rule_type (EscalationPolicyPathNotificationTypeRulesItemAlertSourceRuleType): The type of the escalation path + rule + operator (EscalationPolicyPathNotificationTypeRulesItemAlertSourceOperator): How the alert source should be matched values (list[str]): Alert source values to match against (e.g., manual, datadog) """ - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType6RuleType - operator: UpdateEscalationPolicyPathDataAttributesRulesItemType6Operator + rule_type: EscalationPolicyPathNotificationTypeRulesItemAlertSourceRuleType + operator: EscalationPolicyPathNotificationTypeRulesItemAlertSourceOperator values: list[str] additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -53,20 +56,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) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_6_rule_type(d.pop("rule_type")) + rule_type = check_escalation_policy_path_notification_type_rules_item_alert_source_rule_type(d.pop("rule_type")) - operator = check_update_escalation_policy_path_data_attributes_rules_item_type_6_operator(d.pop("operator")) + operator = check_escalation_policy_path_notification_type_rules_item_alert_source_operator(d.pop("operator")) values = cast(list[str], d.pop("values")) - update_escalation_policy_path_data_attributes_rules_item_type_6 = cls( + escalation_policy_path_notification_type_rules_item_alert_source = cls( rule_type=rule_type, operator=operator, values=values, ) - update_escalation_policy_path_data_attributes_rules_item_type_6.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_6 + escalation_policy_path_notification_type_rules_item_alert_source.additional_properties = d + return escalation_policy_path_notification_type_rules_item_alert_source @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_source_operator.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_source_operator.py new file mode 100644 index 00000000..3e6c2e52 --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_source_operator.py @@ -0,0 +1,24 @@ +from typing import Literal + +EscalationPolicyPathNotificationTypeRulesItemAlertSourceOperator = Literal["is", "is_not", "is_not_one_of", "is_one_of"] + +ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_ALERT_SOURCE_OPERATOR_VALUES: set[ + EscalationPolicyPathNotificationTypeRulesItemAlertSourceOperator +] = { + "is", + "is_not", + "is_not_one_of", + "is_one_of", +} + + +def check_escalation_policy_path_notification_type_rules_item_alert_source_operator( + value: str | None, +) -> EscalationPolicyPathNotificationTypeRulesItemAlertSourceOperator | None: + if value is None: + return None + if value in ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_ALERT_SOURCE_OPERATOR_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_ALERT_SOURCE_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_source_rule_type.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_source_rule_type.py new file mode 100644 index 00000000..b2f8e125 --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_source_rule_type.py @@ -0,0 +1,21 @@ +from typing import Literal + +EscalationPolicyPathNotificationTypeRulesItemAlertSourceRuleType = Literal["source"] + +ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_ALERT_SOURCE_RULE_TYPE_VALUES: set[ + EscalationPolicyPathNotificationTypeRulesItemAlertSourceRuleType +] = { + "source", +} + + +def check_escalation_policy_path_notification_type_rules_item_alert_source_rule_type( + value: str | None, +) -> EscalationPolicyPathNotificationTypeRulesItemAlertSourceRuleType | None: + if value is None: + return None + if value in ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_ALERT_SOURCE_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_ALERT_SOURCE_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_urgency.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_urgency.py new file mode 100644 index 00000000..19497001 --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_urgency.py @@ -0,0 +1,99 @@ +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.escalation_policy_path_notification_type_rules_item_alert_urgency_operator import ( + EscalationPolicyPathNotificationTypeRulesItemAlertUrgencyOperator, + check_escalation_policy_path_notification_type_rules_item_alert_urgency_operator, +) +from ..models.escalation_policy_path_notification_type_rules_item_alert_urgency_rule_type import ( + EscalationPolicyPathNotificationTypeRulesItemAlertUrgencyRuleType, + check_escalation_policy_path_notification_type_rules_item_alert_urgency_rule_type, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="EscalationPolicyPathNotificationTypeRulesItemAlertUrgency") + + +@_attrs_define +class EscalationPolicyPathNotificationTypeRulesItemAlertUrgency: + """ + Attributes: + rule_type (EscalationPolicyPathNotificationTypeRulesItemAlertUrgencyRuleType): The type of the escalation path + rule + urgency_ids (list[str]): Alert urgency ids for which this escalation path should be used + operator (EscalationPolicyPathNotificationTypeRulesItemAlertUrgencyOperator | Unset): How the alert's urgency + should be matched. is and is_not take exactly one id Default: 'is_one_of'. + """ + + rule_type: EscalationPolicyPathNotificationTypeRulesItemAlertUrgencyRuleType + urgency_ids: list[str] + operator: EscalationPolicyPathNotificationTypeRulesItemAlertUrgencyOperator | Unset = "is_one_of" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + rule_type: str = self.rule_type + + urgency_ids = self.urgency_ids + + operator: str | Unset = UNSET + if not isinstance(self.operator, Unset): + operator = self.operator + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "rule_type": rule_type, + "urgency_ids": urgency_ids, + } + ) + if operator is not UNSET: + field_dict["operator"] = operator + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + rule_type = check_escalation_policy_path_notification_type_rules_item_alert_urgency_rule_type( + d.pop("rule_type") + ) + + urgency_ids = cast(list[str], d.pop("urgency_ids")) + + _operator = d.pop("operator", UNSET) + operator: EscalationPolicyPathNotificationTypeRulesItemAlertUrgencyOperator | Unset + if isinstance(_operator, Unset): + operator = UNSET + else: + operator = check_escalation_policy_path_notification_type_rules_item_alert_urgency_operator(_operator) + + escalation_policy_path_notification_type_rules_item_alert_urgency = cls( + rule_type=rule_type, + urgency_ids=urgency_ids, + operator=operator, + ) + + escalation_policy_path_notification_type_rules_item_alert_urgency.additional_properties = d + return escalation_policy_path_notification_type_rules_item_alert_urgency + + @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/escalation_policy_path_notification_type_rules_item_alert_urgency_operator.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_urgency_operator.py new file mode 100644 index 00000000..27affc1d --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_urgency_operator.py @@ -0,0 +1,26 @@ +from typing import Literal + +EscalationPolicyPathNotificationTypeRulesItemAlertUrgencyOperator = Literal[ + "is", "is_not", "is_not_one_of", "is_one_of" +] + +ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_ALERT_URGENCY_OPERATOR_VALUES: set[ + EscalationPolicyPathNotificationTypeRulesItemAlertUrgencyOperator +] = { + "is", + "is_not", + "is_not_one_of", + "is_one_of", +} + + +def check_escalation_policy_path_notification_type_rules_item_alert_urgency_operator( + value: str | None, +) -> EscalationPolicyPathNotificationTypeRulesItemAlertUrgencyOperator | None: + if value is None: + return None + if value in ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_ALERT_URGENCY_OPERATOR_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_ALERT_URGENCY_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_urgency_rule_type.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_urgency_rule_type.py new file mode 100644 index 00000000..02457530 --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_alert_urgency_rule_type.py @@ -0,0 +1,21 @@ +from typing import Literal + +EscalationPolicyPathNotificationTypeRulesItemAlertUrgencyRuleType = Literal["alert_urgency"] + +ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_ALERT_URGENCY_RULE_TYPE_VALUES: set[ + EscalationPolicyPathNotificationTypeRulesItemAlertUrgencyRuleType +] = { + "alert_urgency", +} + + +def check_escalation_policy_path_notification_type_rules_item_alert_urgency_rule_type( + value: str | None, +) -> EscalationPolicyPathNotificationTypeRulesItemAlertUrgencyRuleType | None: + if value is None: + return None + if value in ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_ALERT_URGENCY_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_ALERT_URGENCY_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_deferral_window.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_deferral_window.py new file mode 100644 index 00000000..36332c29 --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_deferral_window.py @@ -0,0 +1,113 @@ +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.escalation_policy_path_notification_type_rules_item_deferral_window_rule_type import ( + EscalationPolicyPathNotificationTypeRulesItemDeferralWindowRuleType, + check_escalation_policy_path_notification_type_rules_item_deferral_window_rule_type, +) +from ..models.escalation_policy_path_notification_type_rules_item_deferral_window_time_zone import ( + EscalationPolicyPathNotificationTypeRulesItemDeferralWindowTimeZone, + check_escalation_policy_path_notification_type_rules_item_deferral_window_time_zone, +) + +if TYPE_CHECKING: + from ..models.escalation_policy_path_notification_type_rules_item_deferral_window_time_blocks_item import ( + EscalationPolicyPathNotificationTypeRulesItemDeferralWindowTimeBlocksItem, + ) + + +T = TypeVar("T", bound="EscalationPolicyPathNotificationTypeRulesItemDeferralWindow") + + +@_attrs_define +class EscalationPolicyPathNotificationTypeRulesItemDeferralWindow: + """ + Attributes: + rule_type (EscalationPolicyPathNotificationTypeRulesItemDeferralWindowRuleType): The type of the escalation path + rule + time_zone (EscalationPolicyPathNotificationTypeRulesItemDeferralWindowTimeZone): Time zone for the deferral + window + time_blocks (list[EscalationPolicyPathNotificationTypeRulesItemDeferralWindowTimeBlocksItem]): Time windows + during which alerts are deferred + """ + + rule_type: EscalationPolicyPathNotificationTypeRulesItemDeferralWindowRuleType + time_zone: EscalationPolicyPathNotificationTypeRulesItemDeferralWindowTimeZone + time_blocks: list[EscalationPolicyPathNotificationTypeRulesItemDeferralWindowTimeBlocksItem] + 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 + + time_blocks = [] + for time_blocks_item_data in self.time_blocks: + time_blocks_item = time_blocks_item_data.to_dict() + time_blocks.append(time_blocks_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "rule_type": rule_type, + "time_zone": time_zone, + "time_blocks": time_blocks, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.escalation_policy_path_notification_type_rules_item_deferral_window_time_blocks_item import ( + EscalationPolicyPathNotificationTypeRulesItemDeferralWindowTimeBlocksItem, + ) + + d = dict(src_dict) + rule_type = check_escalation_policy_path_notification_type_rules_item_deferral_window_rule_type( + d.pop("rule_type") + ) + + time_zone = check_escalation_policy_path_notification_type_rules_item_deferral_window_time_zone( + d.pop("time_zone") + ) + + time_blocks = [] + _time_blocks = d.pop("time_blocks") + for time_blocks_item_data in _time_blocks: + time_blocks_item = EscalationPolicyPathNotificationTypeRulesItemDeferralWindowTimeBlocksItem.from_dict( + time_blocks_item_data + ) + + time_blocks.append(time_blocks_item) + + escalation_policy_path_notification_type_rules_item_deferral_window = cls( + rule_type=rule_type, + time_zone=time_zone, + time_blocks=time_blocks, + ) + + escalation_policy_path_notification_type_rules_item_deferral_window.additional_properties = d + return escalation_policy_path_notification_type_rules_item_deferral_window + + @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/escalation_policy_path_notification_type_rules_item_deferral_window_rule_type.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_deferral_window_rule_type.py new file mode 100644 index 00000000..8942fecf --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_deferral_window_rule_type.py @@ -0,0 +1,21 @@ +from typing import Literal + +EscalationPolicyPathNotificationTypeRulesItemDeferralWindowRuleType = Literal["deferral_window"] + +ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_DEFERRAL_WINDOW_RULE_TYPE_VALUES: set[ + EscalationPolicyPathNotificationTypeRulesItemDeferralWindowRuleType +] = { + "deferral_window", +} + + +def check_escalation_policy_path_notification_type_rules_item_deferral_window_rule_type( + value: str | None, +) -> EscalationPolicyPathNotificationTypeRulesItemDeferralWindowRuleType | None: + if value is None: + return None + if value in ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_DEFERRAL_WINDOW_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_DEFERRAL_WINDOW_RULE_TYPE_VALUES!r}" + ) 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_notification_type_rules_item_deferral_window_time_blocks_item.py similarity index 58% rename from rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5_time_blocks_item.py rename to rootly_sdk/models/escalation_policy_path_notification_type_rules_item_deferral_window_time_blocks_item.py index a369c539..b7275056 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_notification_type_rules_item_deferral_window_time_blocks_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -6,40 +8,48 @@ from ..types import UNSET, Unset -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType9Type5TimeBlocksItem") +T = TypeVar("T", bound="EscalationPolicyPathNotificationTypeRulesItemDeferralWindowTimeBlocksItem") @_attrs_define -class EscalationPolicyPathRulesItemType9Type5TimeBlocksItem: +class EscalationPolicyPathNotificationTypeRulesItemDeferralWindowTimeBlocksItem: """ Attributes: - 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]): + id (str | Unset): Unique ID of the time block + 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): Order of this time block, starting at 1. Defaults to the block's 1-based position + in time_blocks when omitted. + ends_next_day (bool | Unset): Whether the window crosses midnight. Derived from start_time and end_time; + accepted and ignored on write. """ - 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 + id: str | Unset = UNSET + 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 + ends_next_day: bool | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + id = self.id + monday = self.monday tuesday = self.tuesday @@ -60,15 +70,19 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position + ends_next_day = self.ends_next_day + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id if monday is not UNSET: field_dict["monday"] = monday if tuesday is not UNSET: @@ -91,12 +105,16 @@ def to_dict(self) -> dict[str, Any]: field_dict["all_day"] = all_day if position is not UNSET: field_dict["position"] = position + if ends_next_day is not UNSET: + field_dict["ends_next_day"] = ends_next_day 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) + monday = d.pop("monday", UNSET) tuesday = d.pop("tuesday", UNSET) @@ -117,16 +135,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - escalation_policy_path_rules_item_type_9_type_5_time_blocks_item = cls( + ends_next_day = d.pop("ends_next_day", UNSET) + + escalation_policy_path_notification_type_rules_item_deferral_window_time_blocks_item = cls( + id=id, monday=monday, tuesday=tuesday, wednesday=wednesday, @@ -138,10 +159,11 @@ def _parse_position(data: object) -> None | Unset | int: end_time=end_time, all_day=all_day, position=position, + ends_next_day=ends_next_day, ) - escalation_policy_path_rules_item_type_9_type_5_time_blocks_item.additional_properties = d - return escalation_policy_path_rules_item_type_9_type_5_time_blocks_item + escalation_policy_path_notification_type_rules_item_deferral_window_time_blocks_item.additional_properties = d + return escalation_policy_path_notification_type_rules_item_deferral_window_time_blocks_item @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_time_zone.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_deferral_window_time_zone.py similarity index 94% rename from rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_time_zone.py rename to rootly_sdk/models/escalation_policy_path_notification_type_rules_item_deferral_window_time_zone.py index 7606e2c9..d53b1394 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_time_zone.py +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_deferral_window_time_zone.py @@ -1,6 +1,6 @@ -from typing import Literal, cast +from typing import Literal -EscalationPolicyPathRulesItemType8Type5TimeZone = Literal[ +EscalationPolicyPathNotificationTypeRulesItemDeferralWindowTimeZone = Literal[ "Abu Dhabi", "Adelaide", "Africa/Algiers", @@ -84,6 +84,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -157,6 +158,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -308,8 +310,8 @@ "Zurich", ] -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_5_TIME_ZONE_VALUES: set[ - EscalationPolicyPathRulesItemType8Type5TimeZone +ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_DEFERRAL_WINDOW_TIME_ZONE_VALUES: set[ + EscalationPolicyPathNotificationTypeRulesItemDeferralWindowTimeZone ] = { "Abu Dhabi", "Adelaide", @@ -394,6 +396,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -467,6 +470,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -619,13 +623,13 @@ } -def check_escalation_policy_path_rules_item_type_8_type_5_time_zone( +def check_escalation_policy_path_notification_type_rules_item_deferral_window_time_zone( value: str | None, -) -> EscalationPolicyPathRulesItemType8Type5TimeZone | None: +) -> EscalationPolicyPathNotificationTypeRulesItemDeferralWindowTimeZone | None: if value is None: return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_5_TIME_ZONE_VALUES: - return cast(EscalationPolicyPathRulesItemType8Type5TimeZone, value) + if value in ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_DEFERRAL_WINDOW_TIME_ZONE_VALUES: + return value raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_5_TIME_ZONE_VALUES!r}" + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_DEFERRAL_WINDOW_TIME_ZONE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_json_path.py similarity index 53% rename from rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2.py rename to rootly_sdk/models/escalation_policy_path_notification_type_rules_item_json_path.py index 173fe30c..5f3fe0aa 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2.py +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_json_path.py @@ -1,38 +1,40 @@ +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.new_escalation_policy_path_data_attributes_rules_item_type_2_operator import ( - NewEscalationPolicyPathDataAttributesRulesItemType2Operator, - check_new_escalation_policy_path_data_attributes_rules_item_type_2_operator, +from ..models.escalation_policy_path_notification_type_rules_item_json_path_operator import ( + EscalationPolicyPathNotificationTypeRulesItemJSONPathOperator, + check_escalation_policy_path_notification_type_rules_item_json_path_operator, ) -from ..models.new_escalation_policy_path_data_attributes_rules_item_type_2_rule_type import ( - NewEscalationPolicyPathDataAttributesRulesItemType2RuleType, - check_new_escalation_policy_path_data_attributes_rules_item_type_2_rule_type, +from ..models.escalation_policy_path_notification_type_rules_item_json_path_rule_type import ( + EscalationPolicyPathNotificationTypeRulesItemJSONPathRuleType, + check_escalation_policy_path_notification_type_rules_item_json_path_rule_type, ) from ..types import UNSET, Unset -T = TypeVar("T", bound="NewEscalationPolicyPathDataAttributesRulesItemType2") +T = TypeVar("T", bound="EscalationPolicyPathNotificationTypeRulesItemJSONPath") @_attrs_define -class NewEscalationPolicyPathDataAttributesRulesItemType2: +class EscalationPolicyPathNotificationTypeRulesItemJSONPath: """ Attributes: - rule_type (NewEscalationPolicyPathDataAttributesRulesItemType2RuleType): The type of the escalation path rule + rule_type (EscalationPolicyPathNotificationTypeRulesItemJSONPathRuleType): 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 (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) + operator (EscalationPolicyPathNotificationTypeRulesItemJSONPathOperator): 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) """ - rule_type: NewEscalationPolicyPathDataAttributesRulesItemType2RuleType + rule_type: EscalationPolicyPathNotificationTypeRulesItemJSONPathRuleType json_path: str - operator: NewEscalationPolicyPathDataAttributesRulesItemType2Operator - value: None | Unset | str = UNSET - values: Unset | list[str] = UNSET + operator: EscalationPolicyPathNotificationTypeRulesItemJSONPathOperator + value: None | str | Unset = UNSET + values: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,13 +44,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: None | Unset | str + value: None | str | Unset if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values @@ -71,24 +73,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) - rule_type = check_new_escalation_policy_path_data_attributes_rules_item_type_2_rule_type(d.pop("rule_type")) + rule_type = check_escalation_policy_path_notification_type_rules_item_json_path_rule_type(d.pop("rule_type")) json_path = d.pop("json_path") - operator = check_new_escalation_policy_path_data_attributes_rules_item_type_2_operator(d.pop("operator")) + operator = check_escalation_policy_path_notification_type_rules_item_json_path_operator(d.pop("operator")) - def _parse_value(data: object) -> None | Unset | str: + def _parse_value(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) value = _parse_value(d.pop("value", UNSET)) values = cast(list[str], d.pop("values", UNSET)) - new_escalation_policy_path_data_attributes_rules_item_type_2 = cls( + escalation_policy_path_notification_type_rules_item_json_path = cls( rule_type=rule_type, json_path=json_path, operator=operator, @@ -96,8 +98,8 @@ def _parse_value(data: object) -> None | Unset | str: values=values, ) - new_escalation_policy_path_data_attributes_rules_item_type_2.additional_properties = d - return new_escalation_policy_path_data_attributes_rules_item_type_2 + escalation_policy_path_notification_type_rules_item_json_path.additional_properties = d + return escalation_policy_path_notification_type_rules_item_json_path @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_2_operator.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_json_path_operator.py similarity index 54% rename from rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_2_operator.py rename to rootly_sdk/models/escalation_policy_path_notification_type_rules_item_json_path_operator.py index 5faeeb50..c6f559f2 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_2_operator.py +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_json_path_operator.py @@ -1,6 +1,6 @@ -from typing import Literal, cast +from typing import Literal -EscalationPolicyPathRulesItemType8Type2Operator = Literal[ +EscalationPolicyPathNotificationTypeRulesItemJSONPathOperator = Literal[ "contains", "contains_key", "does_not_contain", @@ -17,8 +17,8 @@ "starts_with", ] -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_2_OPERATOR_VALUES: set[ - EscalationPolicyPathRulesItemType8Type2Operator +ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_JSON_PATH_OPERATOR_VALUES: set[ + EscalationPolicyPathNotificationTypeRulesItemJSONPathOperator ] = { "contains", "contains_key", @@ -37,13 +37,13 @@ } -def check_escalation_policy_path_rules_item_type_8_type_2_operator( +def check_escalation_policy_path_notification_type_rules_item_json_path_operator( value: str | None, -) -> EscalationPolicyPathRulesItemType8Type2Operator | None: +) -> EscalationPolicyPathNotificationTypeRulesItemJSONPathOperator | None: if value is None: return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_2_OPERATOR_VALUES: - return cast(EscalationPolicyPathRulesItemType8Type2Operator, value) + if value in ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_JSON_PATH_OPERATOR_VALUES: + return value raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_2_OPERATOR_VALUES!r}" + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_JSON_PATH_OPERATOR_VALUES!r}" ) diff --git a/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_json_path_rule_type.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_json_path_rule_type.py new file mode 100644 index 00000000..f9d8e7cd --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_json_path_rule_type.py @@ -0,0 +1,21 @@ +from typing import Literal + +EscalationPolicyPathNotificationTypeRulesItemJSONPathRuleType = Literal["json_path"] + +ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_JSON_PATH_RULE_TYPE_VALUES: set[ + EscalationPolicyPathNotificationTypeRulesItemJSONPathRuleType +] = { + "json_path", +} + + +def check_escalation_policy_path_notification_type_rules_item_json_path_rule_type( + value: str | None, +) -> EscalationPolicyPathNotificationTypeRulesItemJSONPathRuleType | None: + if value is None: + return None + if value in ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_JSON_PATH_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_JSON_PATH_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_match_mode.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_match_mode.py new file mode 100644 index 00000000..f37962ff --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_match_mode.py @@ -0,0 +1,22 @@ +from typing import Literal + +EscalationPolicyPathNotificationTypeRulesItemMatchMode = Literal["match-all-rules", "match-any-rule"] + +ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_MATCH_MODE_VALUES: set[ + EscalationPolicyPathNotificationTypeRulesItemMatchMode +] = { + "match-all-rules", + "match-any-rule", +} + + +def check_escalation_policy_path_notification_type_rules_item_match_mode( + value: str | None, +) -> EscalationPolicyPathNotificationTypeRulesItemMatchMode | None: + if value is None: + return None + if value in ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_MATCH_MODE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_MATCH_MODE_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_notification_type.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_notification_type.py new file mode 100644 index 00000000..16eb4755 --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_notification_type.py @@ -0,0 +1,22 @@ +from typing import Literal + +EscalationPolicyPathNotificationTypeRulesItemNotificationType = Literal["audible", "quiet"] + +ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_NOTIFICATION_TYPE_VALUES: set[ + EscalationPolicyPathNotificationTypeRulesItemNotificationType +] = { + "audible", + "quiet", +} + + +def check_escalation_policy_path_notification_type_rules_item_notification_type( + value: str | None, +) -> EscalationPolicyPathNotificationTypeRulesItemNotificationType | None: + if value is None: + return None + if value in ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_NOTIFICATION_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_NOTIFICATION_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_related_incidents.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_related_incidents.py new file mode 100644 index 00000000..0e7d812c --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_related_incidents.py @@ -0,0 +1,84 @@ +from __future__ import annotations + +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.escalation_policy_path_notification_type_rules_item_related_incidents_operator import ( + EscalationPolicyPathNotificationTypeRulesItemRelatedIncidentsOperator, + check_escalation_policy_path_notification_type_rules_item_related_incidents_operator, +) +from ..models.escalation_policy_path_notification_type_rules_item_related_incidents_rule_type import ( + EscalationPolicyPathNotificationTypeRulesItemRelatedIncidentsRuleType, + check_escalation_policy_path_notification_type_rules_item_related_incidents_rule_type, +) + +T = TypeVar("T", bound="EscalationPolicyPathNotificationTypeRulesItemRelatedIncidents") + + +@_attrs_define +class EscalationPolicyPathNotificationTypeRulesItemRelatedIncidents: + """ + Attributes: + rule_type (EscalationPolicyPathNotificationTypeRulesItemRelatedIncidentsRuleType): The type of the escalation + path rule + operator (EscalationPolicyPathNotificationTypeRulesItemRelatedIncidentsOperator): Whether the alert must (or + must not) have related incidents + """ + + rule_type: EscalationPolicyPathNotificationTypeRulesItemRelatedIncidentsRuleType + operator: EscalationPolicyPathNotificationTypeRulesItemRelatedIncidentsOperator + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + rule_type: str = self.rule_type + + operator: str = self.operator + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "rule_type": rule_type, + "operator": operator, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + rule_type = check_escalation_policy_path_notification_type_rules_item_related_incidents_rule_type( + d.pop("rule_type") + ) + + operator = check_escalation_policy_path_notification_type_rules_item_related_incidents_operator( + d.pop("operator") + ) + + escalation_policy_path_notification_type_rules_item_related_incidents = cls( + rule_type=rule_type, + operator=operator, + ) + + escalation_policy_path_notification_type_rules_item_related_incidents.additional_properties = d + return escalation_policy_path_notification_type_rules_item_related_incidents + + @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/escalation_policy_path_notification_type_rules_item_related_incidents_operator.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_related_incidents_operator.py new file mode 100644 index 00000000..26ab2420 --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_related_incidents_operator.py @@ -0,0 +1,22 @@ +from typing import Literal + +EscalationPolicyPathNotificationTypeRulesItemRelatedIncidentsOperator = Literal["is_not_set", "is_set"] + +ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_RELATED_INCIDENTS_OPERATOR_VALUES: set[ + EscalationPolicyPathNotificationTypeRulesItemRelatedIncidentsOperator +] = { + "is_not_set", + "is_set", +} + + +def check_escalation_policy_path_notification_type_rules_item_related_incidents_operator( + value: str | None, +) -> EscalationPolicyPathNotificationTypeRulesItemRelatedIncidentsOperator | None: + if value is None: + return None + if value in ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_RELATED_INCIDENTS_OPERATOR_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_RELATED_INCIDENTS_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_related_incidents_rule_type.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_related_incidents_rule_type.py new file mode 100644 index 00000000..d0482022 --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_related_incidents_rule_type.py @@ -0,0 +1,21 @@ +from typing import Literal + +EscalationPolicyPathNotificationTypeRulesItemRelatedIncidentsRuleType = Literal["related_incidents"] + +ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_RELATED_INCIDENTS_RULE_TYPE_VALUES: set[ + EscalationPolicyPathNotificationTypeRulesItemRelatedIncidentsRuleType +] = { + "related_incidents", +} + + +def check_escalation_policy_path_notification_type_rules_item_related_incidents_rule_type( + value: str | None, +) -> EscalationPolicyPathNotificationTypeRulesItemRelatedIncidentsRuleType | None: + if value is None: + return None + if value in ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_RELATED_INCIDENTS_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_RELATED_INCIDENTS_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_service.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_service.py new file mode 100644 index 00000000..671c1125 --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_service.py @@ -0,0 +1,96 @@ +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.escalation_policy_path_notification_type_rules_item_service_operator import ( + EscalationPolicyPathNotificationTypeRulesItemServiceOperator, + check_escalation_policy_path_notification_type_rules_item_service_operator, +) +from ..models.escalation_policy_path_notification_type_rules_item_service_rule_type import ( + EscalationPolicyPathNotificationTypeRulesItemServiceRuleType, + check_escalation_policy_path_notification_type_rules_item_service_rule_type, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="EscalationPolicyPathNotificationTypeRulesItemService") + + +@_attrs_define +class EscalationPolicyPathNotificationTypeRulesItemService: + """ + Attributes: + rule_type (EscalationPolicyPathNotificationTypeRulesItemServiceRuleType): The type of the escalation path rule + service_ids (list[str]): Service ids for which this escalation path should be used + operator (EscalationPolicyPathNotificationTypeRulesItemServiceOperator | Unset): How the alert's services should + be matched. is and is_not take exactly one id Default: 'is_one_of'. + """ + + rule_type: EscalationPolicyPathNotificationTypeRulesItemServiceRuleType + service_ids: list[str] + operator: EscalationPolicyPathNotificationTypeRulesItemServiceOperator | Unset = "is_one_of" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + rule_type: str = self.rule_type + + service_ids = self.service_ids + + operator: str | Unset = UNSET + if not isinstance(self.operator, Unset): + operator = self.operator + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "rule_type": rule_type, + "service_ids": service_ids, + } + ) + if operator is not UNSET: + field_dict["operator"] = operator + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + rule_type = check_escalation_policy_path_notification_type_rules_item_service_rule_type(d.pop("rule_type")) + + service_ids = cast(list[str], d.pop("service_ids")) + + _operator = d.pop("operator", UNSET) + operator: EscalationPolicyPathNotificationTypeRulesItemServiceOperator | Unset + if isinstance(_operator, Unset): + operator = UNSET + else: + operator = check_escalation_policy_path_notification_type_rules_item_service_operator(_operator) + + escalation_policy_path_notification_type_rules_item_service = cls( + rule_type=rule_type, + service_ids=service_ids, + operator=operator, + ) + + escalation_policy_path_notification_type_rules_item_service.additional_properties = d + return escalation_policy_path_notification_type_rules_item_service + + @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/escalation_policy_path_notification_type_rules_item_service_operator.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_service_operator.py new file mode 100644 index 00000000..80cda3e2 --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_service_operator.py @@ -0,0 +1,24 @@ +from typing import Literal + +EscalationPolicyPathNotificationTypeRulesItemServiceOperator = Literal["is", "is_not", "is_not_one_of", "is_one_of"] + +ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_SERVICE_OPERATOR_VALUES: set[ + EscalationPolicyPathNotificationTypeRulesItemServiceOperator +] = { + "is", + "is_not", + "is_not_one_of", + "is_one_of", +} + + +def check_escalation_policy_path_notification_type_rules_item_service_operator( + value: str | None, +) -> EscalationPolicyPathNotificationTypeRulesItemServiceOperator | None: + if value is None: + return None + if value in ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_SERVICE_OPERATOR_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_SERVICE_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_service_rule_type.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_service_rule_type.py new file mode 100644 index 00000000..6097024b --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_service_rule_type.py @@ -0,0 +1,21 @@ +from typing import Literal + +EscalationPolicyPathNotificationTypeRulesItemServiceRuleType = Literal["service"] + +ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_SERVICE_RULE_TYPE_VALUES: set[ + EscalationPolicyPathNotificationTypeRulesItemServiceRuleType +] = { + "service", +} + + +def check_escalation_policy_path_notification_type_rules_item_service_rule_type( + value: str | None, +) -> EscalationPolicyPathNotificationTypeRulesItemServiceRuleType | None: + if value is None: + return None + if value in ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_SERVICE_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_SERVICE_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_1.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_working_hours.py similarity index 62% rename from rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_1.py rename to rootly_sdk/models/escalation_policy_path_notification_type_rules_item_working_hours.py index 67f10e0c..c684226f 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_1.py +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_working_hours.py @@ -1,27 +1,29 @@ +from __future__ import annotations + 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.update_escalation_policy_path_data_attributes_rules_item_type_8_type_1_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_1_rule_type, +from ..models.escalation_policy_path_notification_type_rules_item_working_hours_rule_type import ( + EscalationPolicyPathNotificationTypeRulesItemWorkingHoursRuleType, + check_escalation_policy_path_notification_type_rules_item_working_hours_rule_type, ) -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1") +T = TypeVar("T", bound="EscalationPolicyPathNotificationTypeRulesItemWorkingHours") @_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1: +class EscalationPolicyPathNotificationTypeRulesItemWorkingHours: """ Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1RuleType): The type of the escalation path + rule_type (EscalationPolicyPathNotificationTypeRulesItemWorkingHoursRuleType): The type of the escalation path rule within_working_hour (bool): Whether the escalation path should be used within working hours """ - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1RuleType + rule_type: EscalationPolicyPathNotificationTypeRulesItemWorkingHoursRuleType within_working_hour: bool additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -44,19 +46,19 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_1_rule_type( + rule_type = check_escalation_policy_path_notification_type_rules_item_working_hours_rule_type( d.pop("rule_type") ) within_working_hour = d.pop("within_working_hour") - update_escalation_policy_path_data_attributes_rules_item_type_8_type_1 = cls( + escalation_policy_path_notification_type_rules_item_working_hours = cls( rule_type=rule_type, within_working_hour=within_working_hour, ) - update_escalation_policy_path_data_attributes_rules_item_type_8_type_1.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_8_type_1 + escalation_policy_path_notification_type_rules_item_working_hours.additional_properties = d + return escalation_policy_path_notification_type_rules_item_working_hours @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_working_hours_rule_type.py b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_working_hours_rule_type.py new file mode 100644 index 00000000..c0c14564 --- /dev/null +++ b/rootly_sdk/models/escalation_policy_path_notification_type_rules_item_working_hours_rule_type.py @@ -0,0 +1,21 @@ +from typing import Literal + +EscalationPolicyPathNotificationTypeRulesItemWorkingHoursRuleType = Literal["working_hour"] + +ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_WORKING_HOURS_RULE_TYPE_VALUES: set[ + EscalationPolicyPathNotificationTypeRulesItemWorkingHoursRuleType +] = { + "working_hour", +} + + +def check_escalation_policy_path_notification_type_rules_item_working_hours_rule_type( + value: str | None, +) -> EscalationPolicyPathNotificationTypeRulesItemWorkingHoursRuleType | None: + if value is None: + return None + if value in ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_WORKING_HOURS_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_NOTIFICATION_TYPE_RULES_ITEM_WORKING_HOURS_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_path_path_type.py b/rootly_sdk/models/escalation_policy_path_path_type.py index 3f2dd888..a934cf72 100644 --- a/rootly_sdk/models/escalation_policy_path_path_type.py +++ b/rootly_sdk/models/escalation_policy_path_path_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalationPolicyPathPathType = Literal["deferral", "escalation"] @@ -12,5 +12,5 @@ def check_escalation_policy_path_path_type(value: str | None) -> EscalationPolic if value is None: return None if value in ESCALATION_POLICY_PATH_PATH_TYPE_VALUES: - return cast(EscalationPolicyPathPathType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_PATH_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/escalation_policy_path_response.py b/rootly_sdk/models/escalation_policy_path_response.py index 4715e25f..6f27688d 100644 --- a/rootly_sdk/models/escalation_policy_path_response.py +++ b/rootly_sdk/models/escalation_policy_path_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class EscalationPolicyPathResponse: """ Attributes: data (EscalationPolicyPathResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "EscalationPolicyPathResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: EscalationPolicyPathResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 18916f6d..a4d94aab 100644 --- a/rootly_sdk/models/escalation_policy_path_response_data.py +++ b/rootly_sdk/models/escalation_policy_path_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,12 +25,12 @@ class EscalationPolicyPathResponseData: Attributes: id (str): Unique ID of the escalation policy path attributes (EscalationPolicyPath): - type_ (Union[Unset, EscalationPolicyPathResponseDataType]): + type_ (EscalationPolicyPathResponseDataType | Unset): """ id: str - attributes: "EscalationPolicyPath" - type_: Unset | EscalationPolicyPathResponseDataType = UNSET + attributes: EscalationPolicyPath + type_: EscalationPolicyPathResponseDataType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +38,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -63,7 +65,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_: Unset | EscalationPolicyPathResponseDataType + type_: EscalationPolicyPathResponseDataType | Unset if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/escalation_policy_path_response_data_type.py b/rootly_sdk/models/escalation_policy_path_response_data_type.py index 23f1b33a..2c83856c 100644 --- a/rootly_sdk/models/escalation_policy_path_response_data_type.py +++ b/rootly_sdk/models/escalation_policy_path_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalationPolicyPathResponseDataType = Literal["escalation_paths"] @@ -11,5 +11,5 @@ def check_escalation_policy_path_response_data_type(value: str | None) -> Escala if value is None: return None if value in ESCALATION_POLICY_PATH_RESPONSE_DATA_TYPE_VALUES: - return cast(EscalationPolicyPathResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RESPONSE_DATA_TYPE_VALUES!r}") 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 deleted file mode 100644 index 7ed1d883..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_0.py +++ /dev/null @@ -1,72 +0,0 @@ -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.escalation_policy_path_rules_item_type_0_rule_type import ( - EscalationPolicyPathRulesItemType0RuleType, - check_escalation_policy_path_rules_item_type_0_rule_type, -) - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType0") - - -@_attrs_define -class EscalationPolicyPathRulesItemType0: - """ - Attributes: - rule_type (EscalationPolicyPathRulesItemType0RuleType): The type of the escalation path rule - urgency_ids (list[str]): Alert urgency ids for which this escalation path should be used - """ - - rule_type: EscalationPolicyPathRulesItemType0RuleType - urgency_ids: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - urgency_ids = self.urgency_ids - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "urgency_ids": urgency_ids, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_0_rule_type(d.pop("rule_type")) - - urgency_ids = cast(list[str], d.pop("urgency_ids")) - - escalation_policy_path_rules_item_type_0 = cls( - rule_type=rule_type, - urgency_ids=urgency_ids, - ) - - escalation_policy_path_rules_item_type_0.additional_properties = d - return escalation_policy_path_rules_item_type_0 - - @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/escalation_policy_path_rules_item_type_0_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_0_rule_type.py deleted file mode 100644 index ade096f4..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_0_rule_type.py +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType0RuleType = Literal["alert_urgency"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_0_RULE_TYPE_VALUES: set[EscalationPolicyPathRulesItemType0RuleType] = { - "alert_urgency", -} - - -def check_escalation_policy_path_rules_item_type_0_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType0RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_0_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType0RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_0_RULE_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_1_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_1_rule_type.py deleted file mode 100644 index 3ff4b383..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_1_rule_type.py +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType1RuleType = Literal["working_hour"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_1_RULE_TYPE_VALUES: set[EscalationPolicyPathRulesItemType1RuleType] = { - "working_hour", -} - - -def check_escalation_policy_path_rules_item_type_1_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType1RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_1_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType1RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_1_RULE_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_2_operator.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_2_operator.py deleted file mode 100644 index 5ba6f8b7..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_2_operator.py +++ /dev/null @@ -1,47 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType2Operator = Literal[ - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_not", - "is_not_one_of", - "is_not_set", - "is_one_of", - "is_set", - "matches", - "starts_with", -] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_2_OPERATOR_VALUES: set[EscalationPolicyPathRulesItemType2Operator] = { - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_not", - "is_not_one_of", - "is_not_set", - "is_one_of", - "is_set", - "matches", - "starts_with", -} - - -def check_escalation_policy_path_rules_item_type_2_operator( - value: str | None, -) -> EscalationPolicyPathRulesItemType2Operator | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_2_OPERATOR_VALUES: - return cast(EscalationPolicyPathRulesItemType2Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_2_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_2_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_2_rule_type.py deleted file mode 100644 index ed2c358b..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_2_rule_type.py +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType2RuleType = Literal["json_path"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_2_RULE_TYPE_VALUES: set[EscalationPolicyPathRulesItemType2RuleType] = { - "json_path", -} - - -def check_escalation_policy_path_rules_item_type_2_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType2RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_2_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType2RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_2_RULE_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_3_operator.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_3_operator.py deleted file mode 100644 index d036caca..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_3_operator.py +++ /dev/null @@ -1,47 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType3Operator = Literal[ - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_empty", - "is_not", - "is_not_empty", - "is_not_one_of", - "is_one_of", - "matches", - "starts_with", -] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_3_OPERATOR_VALUES: set[EscalationPolicyPathRulesItemType3Operator] = { - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_empty", - "is_not", - "is_not_empty", - "is_not_one_of", - "is_one_of", - "matches", - "starts_with", -} - - -def check_escalation_policy_path_rules_item_type_3_operator( - value: str | None, -) -> EscalationPolicyPathRulesItemType3Operator | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_3_OPERATOR_VALUES: - return cast(EscalationPolicyPathRulesItemType3Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_3_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_3_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_3_rule_type.py deleted file mode 100644 index 7e78400c..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_3_rule_type.py +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType3RuleType = Literal["field"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_3_RULE_TYPE_VALUES: set[EscalationPolicyPathRulesItemType3RuleType] = { - "field", -} - - -def check_escalation_policy_path_rules_item_type_3_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType3RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_3_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType3RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_3_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 823b3a31..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_4.py +++ /dev/null @@ -1,72 +0,0 @@ -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.escalation_policy_path_rules_item_type_4_rule_type import ( - EscalationPolicyPathRulesItemType4RuleType, - check_escalation_policy_path_rules_item_type_4_rule_type, -) - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType4") - - -@_attrs_define -class EscalationPolicyPathRulesItemType4: - """ - Attributes: - rule_type (EscalationPolicyPathRulesItemType4RuleType): The type of the escalation path rule - service_ids (list[str]): Service ids for which this escalation path should be used - """ - - rule_type: EscalationPolicyPathRulesItemType4RuleType - service_ids: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - service_ids = self.service_ids - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "service_ids": service_ids, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_4_rule_type(d.pop("rule_type")) - - service_ids = cast(list[str], d.pop("service_ids")) - - escalation_policy_path_rules_item_type_4 = cls( - rule_type=rule_type, - service_ids=service_ids, - ) - - escalation_policy_path_rules_item_type_4.additional_properties = d - return escalation_policy_path_rules_item_type_4 - - @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/escalation_policy_path_rules_item_type_4_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_4_rule_type.py deleted file mode 100644 index fe252ee5..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_4_rule_type.py +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType4RuleType = Literal["service"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_4_RULE_TYPE_VALUES: set[EscalationPolicyPathRulesItemType4RuleType] = { - "service", -} - - -def check_escalation_policy_path_rules_item_type_4_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType4RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_4_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType4RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_4_RULE_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_5_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_5_rule_type.py deleted file mode 100644 index 94cfaa55..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_5_rule_type.py +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType5RuleType = Literal["deferral_window"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_5_RULE_TYPE_VALUES: set[EscalationPolicyPathRulesItemType5RuleType] = { - "deferral_window", -} - - -def check_escalation_policy_path_rules_item_type_5_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType5RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_5_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType5RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_5_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 35414457..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_6.py +++ /dev/null @@ -1,84 +0,0 @@ -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.escalation_policy_path_rules_item_type_6_operator import ( - EscalationPolicyPathRulesItemType6Operator, - check_escalation_policy_path_rules_item_type_6_operator, -) -from ..models.escalation_policy_path_rules_item_type_6_rule_type import ( - EscalationPolicyPathRulesItemType6RuleType, - check_escalation_policy_path_rules_item_type_6_rule_type, -) - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType6") - - -@_attrs_define -class EscalationPolicyPathRulesItemType6: - """ - Attributes: - rule_type (EscalationPolicyPathRulesItemType6RuleType): The type of the escalation path rule - operator (EscalationPolicyPathRulesItemType6Operator): How the alert source should be matched - values (list[str]): Alert source values to match against (e.g., manual, datadog) - """ - - rule_type: EscalationPolicyPathRulesItemType6RuleType - operator: EscalationPolicyPathRulesItemType6Operator - values: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - operator: str = self.operator - - values = self.values - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "operator": operator, - "values": values, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_6_rule_type(d.pop("rule_type")) - - operator = check_escalation_policy_path_rules_item_type_6_operator(d.pop("operator")) - - values = cast(list[str], d.pop("values")) - - escalation_policy_path_rules_item_type_6 = cls( - rule_type=rule_type, - operator=operator, - values=values, - ) - - escalation_policy_path_rules_item_type_6.additional_properties = d - return escalation_policy_path_rules_item_type_6 - - @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/escalation_policy_path_rules_item_type_6_operator.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_6_operator.py deleted file mode 100644 index f841c2c3..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_6_operator.py +++ /dev/null @@ -1,22 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType6Operator = Literal["is", "is_not", "is_not_one_of", "is_one_of"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_6_OPERATOR_VALUES: set[EscalationPolicyPathRulesItemType6Operator] = { - "is", - "is_not", - "is_not_one_of", - "is_one_of", -} - - -def check_escalation_policy_path_rules_item_type_6_operator( - value: str | None, -) -> EscalationPolicyPathRulesItemType6Operator | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_6_OPERATOR_VALUES: - return cast(EscalationPolicyPathRulesItemType6Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_6_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_6_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_6_rule_type.py deleted file mode 100644 index 713ba08d..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_6_rule_type.py +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType6RuleType = Literal["source"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_6_RULE_TYPE_VALUES: set[EscalationPolicyPathRulesItemType6RuleType] = { - "source", -} - - -def check_escalation_policy_path_rules_item_type_6_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType6RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_6_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType6RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_6_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 6f9b7ce2..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_7.py +++ /dev/null @@ -1,77 +0,0 @@ -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.escalation_policy_path_rules_item_type_7_operator import ( - EscalationPolicyPathRulesItemType7Operator, - check_escalation_policy_path_rules_item_type_7_operator, -) -from ..models.escalation_policy_path_rules_item_type_7_rule_type import ( - EscalationPolicyPathRulesItemType7RuleType, - check_escalation_policy_path_rules_item_type_7_rule_type, -) - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType7") - - -@_attrs_define -class EscalationPolicyPathRulesItemType7: - """ - Attributes: - rule_type (EscalationPolicyPathRulesItemType7RuleType): The type of the escalation path rule - operator (EscalationPolicyPathRulesItemType7Operator): Whether the alert must (or must not) have related - incidents - """ - - rule_type: EscalationPolicyPathRulesItemType7RuleType - operator: EscalationPolicyPathRulesItemType7Operator - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - operator: str = self.operator - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "operator": operator, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_7_rule_type(d.pop("rule_type")) - - operator = check_escalation_policy_path_rules_item_type_7_operator(d.pop("operator")) - - escalation_policy_path_rules_item_type_7 = cls( - rule_type=rule_type, - operator=operator, - ) - - escalation_policy_path_rules_item_type_7.additional_properties = d - return escalation_policy_path_rules_item_type_7 - - @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/escalation_policy_path_rules_item_type_7_operator.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_7_operator.py deleted file mode 100644 index b31cb9a2..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_7_operator.py +++ /dev/null @@ -1,20 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType7Operator = Literal["is_not_set", "is_set"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_7_OPERATOR_VALUES: set[EscalationPolicyPathRulesItemType7Operator] = { - "is_not_set", - "is_set", -} - - -def check_escalation_policy_path_rules_item_type_7_operator( - value: str | None, -) -> EscalationPolicyPathRulesItemType7Operator | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_7_OPERATOR_VALUES: - return cast(EscalationPolicyPathRulesItemType7Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_7_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_7_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_7_rule_type.py deleted file mode 100644 index 1308f650..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_7_rule_type.py +++ /dev/null @@ -1,19 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType7RuleType = Literal["related_incidents"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_7_RULE_TYPE_VALUES: set[EscalationPolicyPathRulesItemType7RuleType] = { - "related_incidents", -} - - -def check_escalation_policy_path_rules_item_type_7_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType7RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_7_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType7RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_7_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 89172353..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_0.py +++ /dev/null @@ -1,72 +0,0 @@ -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.escalation_policy_path_rules_item_type_8_type_0_rule_type import ( - EscalationPolicyPathRulesItemType8Type0RuleType, - check_escalation_policy_path_rules_item_type_8_type_0_rule_type, -) - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType8Type0") - - -@_attrs_define -class EscalationPolicyPathRulesItemType8Type0: - """ - Attributes: - rule_type (EscalationPolicyPathRulesItemType8Type0RuleType): The type of the escalation path rule - urgency_ids (list[str]): Alert urgency ids for which this escalation path should be used - """ - - rule_type: EscalationPolicyPathRulesItemType8Type0RuleType - urgency_ids: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - urgency_ids = self.urgency_ids - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "urgency_ids": urgency_ids, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_8_type_0_rule_type(d.pop("rule_type")) - - urgency_ids = cast(list[str], d.pop("urgency_ids")) - - escalation_policy_path_rules_item_type_8_type_0 = cls( - rule_type=rule_type, - urgency_ids=urgency_ids, - ) - - escalation_policy_path_rules_item_type_8_type_0.additional_properties = d - return escalation_policy_path_rules_item_type_8_type_0 - - @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/escalation_policy_path_rules_item_type_8_type_0_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_0_rule_type.py deleted file mode 100644 index 264602f3..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_0_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType8Type0RuleType = Literal["alert_urgency"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_0_RULE_TYPE_VALUES: set[ - EscalationPolicyPathRulesItemType8Type0RuleType -] = { - "alert_urgency", -} - - -def check_escalation_policy_path_rules_item_type_8_type_0_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType8Type0RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_0_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType8Type0RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_0_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 74b34e0a..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_1.py +++ /dev/null @@ -1,72 +0,0 @@ -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.escalation_policy_path_rules_item_type_8_type_1_rule_type import ( - EscalationPolicyPathRulesItemType8Type1RuleType, - check_escalation_policy_path_rules_item_type_8_type_1_rule_type, -) - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType8Type1") - - -@_attrs_define -class EscalationPolicyPathRulesItemType8Type1: - """ - Attributes: - rule_type (EscalationPolicyPathRulesItemType8Type1RuleType): The type of the escalation path rule - within_working_hour (bool): Whether the escalation path should be used within working hours - """ - - rule_type: EscalationPolicyPathRulesItemType8Type1RuleType - within_working_hour: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - within_working_hour = self.within_working_hour - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "within_working_hour": within_working_hour, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_8_type_1_rule_type(d.pop("rule_type")) - - within_working_hour = d.pop("within_working_hour") - - escalation_policy_path_rules_item_type_8_type_1 = cls( - rule_type=rule_type, - within_working_hour=within_working_hour, - ) - - escalation_policy_path_rules_item_type_8_type_1.additional_properties = d - return escalation_policy_path_rules_item_type_8_type_1 - - @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/escalation_policy_path_rules_item_type_8_type_1_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_1_rule_type.py deleted file mode 100644 index 109e8ed2..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_1_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType8Type1RuleType = Literal["working_hour"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_1_RULE_TYPE_VALUES: set[ - EscalationPolicyPathRulesItemType8Type1RuleType -] = { - "working_hour", -} - - -def check_escalation_policy_path_rules_item_type_8_type_1_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType8Type1RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_1_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType8Type1RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_1_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index da128c49..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_2.py +++ /dev/null @@ -1,116 +0,0 @@ -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.escalation_policy_path_rules_item_type_8_type_2_operator import ( - EscalationPolicyPathRulesItemType8Type2Operator, - check_escalation_policy_path_rules_item_type_8_type_2_operator, -) -from ..models.escalation_policy_path_rules_item_type_8_type_2_rule_type import ( - EscalationPolicyPathRulesItemType8Type2RuleType, - check_escalation_policy_path_rules_item_type_8_type_2_rule_type, -) -from ..types import UNSET, Unset - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType8Type2") - - -@_attrs_define -class EscalationPolicyPathRulesItemType8Type2: - """ - Attributes: - 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 (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 | 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]: - rule_type: str = self.rule_type - - json_path = self.json_path - - operator: str = self.operator - - value: None | Unset | str - if isinstance(self.value, Unset): - value = UNSET - else: - value = self.value - - values: Unset | list[str] = UNSET - if not isinstance(self.values, Unset): - values = self.values - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "json_path": json_path, - "operator": operator, - } - ) - if value is not UNSET: - field_dict["value"] = value - if values is not UNSET: - field_dict["values"] = values - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_8_type_2_rule_type(d.pop("rule_type")) - - json_path = d.pop("json_path") - - operator = check_escalation_policy_path_rules_item_type_8_type_2_operator(d.pop("operator")) - - def _parse_value(data: object) -> None | Unset | str: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | Unset | str, data) - - value = _parse_value(d.pop("value", UNSET)) - - values = cast(list[str], d.pop("values", UNSET)) - - escalation_policy_path_rules_item_type_8_type_2 = cls( - rule_type=rule_type, - json_path=json_path, - operator=operator, - value=value, - values=values, - ) - - escalation_policy_path_rules_item_type_8_type_2.additional_properties = d - return escalation_policy_path_rules_item_type_8_type_2 - - @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/escalation_policy_path_rules_item_type_8_type_2_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_2_rule_type.py deleted file mode 100644 index 0e61520a..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_2_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType8Type2RuleType = Literal["json_path"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_2_RULE_TYPE_VALUES: set[ - EscalationPolicyPathRulesItemType8Type2RuleType -] = { - "json_path", -} - - -def check_escalation_policy_path_rules_item_type_8_type_2_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType8Type2RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_2_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType8Type2RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_2_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index a632ce68..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_3.py +++ /dev/null @@ -1,104 +0,0 @@ -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.escalation_policy_path_rules_item_type_8_type_3_operator import ( - EscalationPolicyPathRulesItemType8Type3Operator, - check_escalation_policy_path_rules_item_type_8_type_3_operator, -) -from ..models.escalation_policy_path_rules_item_type_8_type_3_rule_type import ( - EscalationPolicyPathRulesItemType8Type3RuleType, - check_escalation_policy_path_rules_item_type_8_type_3_rule_type, -) -from ..types import UNSET, Unset - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType8Type3") - - -@_attrs_define -class EscalationPolicyPathRulesItemType8Type3: - """ - Attributes: - rule_type (EscalationPolicyPathRulesItemType8Type3RuleType): The type of the escalation path rule - 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 (Union[Unset, list[str]]): Values to match against - """ - - rule_type: EscalationPolicyPathRulesItemType8Type3RuleType - fieldable_type: str - fieldable_id: str - operator: EscalationPolicyPathRulesItemType8Type3Operator - values: Unset | list[str] = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - fieldable_type = self.fieldable_type - - fieldable_id = self.fieldable_id - - operator: str = self.operator - - values: Unset | list[str] = UNSET - if not isinstance(self.values, Unset): - values = self.values - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "fieldable_type": fieldable_type, - "fieldable_id": fieldable_id, - "operator": operator, - } - ) - if values is not UNSET: - field_dict["values"] = values - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_8_type_3_rule_type(d.pop("rule_type")) - - fieldable_type = d.pop("fieldable_type") - - fieldable_id = d.pop("fieldable_id") - - operator = check_escalation_policy_path_rules_item_type_8_type_3_operator(d.pop("operator")) - - values = cast(list[str], d.pop("values", UNSET)) - - escalation_policy_path_rules_item_type_8_type_3 = cls( - rule_type=rule_type, - fieldable_type=fieldable_type, - fieldable_id=fieldable_id, - operator=operator, - values=values, - ) - - escalation_policy_path_rules_item_type_8_type_3.additional_properties = d - return escalation_policy_path_rules_item_type_8_type_3 - - @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/escalation_policy_path_rules_item_type_8_type_3_operator.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_3_operator.py deleted file mode 100644 index 2d4fbe9c..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_3_operator.py +++ /dev/null @@ -1,49 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType8Type3Operator = Literal[ - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_empty", - "is_not", - "is_not_empty", - "is_not_one_of", - "is_one_of", - "matches", - "starts_with", -] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_3_OPERATOR_VALUES: set[ - EscalationPolicyPathRulesItemType8Type3Operator -] = { - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_empty", - "is_not", - "is_not_empty", - "is_not_one_of", - "is_one_of", - "matches", - "starts_with", -} - - -def check_escalation_policy_path_rules_item_type_8_type_3_operator( - value: str | None, -) -> EscalationPolicyPathRulesItemType8Type3Operator | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_3_OPERATOR_VALUES: - return cast(EscalationPolicyPathRulesItemType8Type3Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_3_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_3_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_3_rule_type.py deleted file mode 100644 index 0a39312e..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_3_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType8Type3RuleType = Literal["field"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_3_RULE_TYPE_VALUES: set[ - EscalationPolicyPathRulesItemType8Type3RuleType -] = { - "field", -} - - -def check_escalation_policy_path_rules_item_type_8_type_3_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType8Type3RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_3_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType8Type3RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_3_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 8821029c..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_4.py +++ /dev/null @@ -1,72 +0,0 @@ -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.escalation_policy_path_rules_item_type_8_type_4_rule_type import ( - EscalationPolicyPathRulesItemType8Type4RuleType, - check_escalation_policy_path_rules_item_type_8_type_4_rule_type, -) - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType8Type4") - - -@_attrs_define -class EscalationPolicyPathRulesItemType8Type4: - """ - Attributes: - rule_type (EscalationPolicyPathRulesItemType8Type4RuleType): The type of the escalation path rule - service_ids (list[str]): Service ids for which this escalation path should be used - """ - - rule_type: EscalationPolicyPathRulesItemType8Type4RuleType - service_ids: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - service_ids = self.service_ids - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "service_ids": service_ids, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_8_type_4_rule_type(d.pop("rule_type")) - - service_ids = cast(list[str], d.pop("service_ids")) - - escalation_policy_path_rules_item_type_8_type_4 = cls( - rule_type=rule_type, - service_ids=service_ids, - ) - - escalation_policy_path_rules_item_type_8_type_4.additional_properties = d - return escalation_policy_path_rules_item_type_8_type_4 - - @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/escalation_policy_path_rules_item_type_8_type_4_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_4_rule_type.py deleted file mode 100644 index bdafcbd9..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_4_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType8Type4RuleType = Literal["service"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_4_RULE_TYPE_VALUES: set[ - EscalationPolicyPathRulesItemType8Type4RuleType -] = { - "service", -} - - -def check_escalation_policy_path_rules_item_type_8_type_4_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType8Type4RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_4_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType8Type4RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_4_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 01145569..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5.py +++ /dev/null @@ -1,103 +0,0 @@ -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.escalation_policy_path_rules_item_type_8_type_5_rule_type import ( - EscalationPolicyPathRulesItemType8Type5RuleType, - check_escalation_policy_path_rules_item_type_8_type_5_rule_type, -) -from ..models.escalation_policy_path_rules_item_type_8_type_5_time_zone import ( - EscalationPolicyPathRulesItemType8Type5TimeZone, - check_escalation_policy_path_rules_item_type_8_type_5_time_zone, -) - -if TYPE_CHECKING: - from ..models.escalation_policy_path_rules_item_type_8_type_5_time_blocks_item import ( - EscalationPolicyPathRulesItemType8Type5TimeBlocksItem, - ) - - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType8Type5") - - -@_attrs_define -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 - """ - - rule_type: EscalationPolicyPathRulesItemType8Type5RuleType - time_zone: EscalationPolicyPathRulesItemType8Type5TimeZone - 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 - - time_blocks = [] - for time_blocks_item_data in self.time_blocks: - time_blocks_item = time_blocks_item_data.to_dict() - time_blocks.append(time_blocks_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "time_zone": time_zone, - "time_blocks": time_blocks, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.escalation_policy_path_rules_item_type_8_type_5_time_blocks_item import ( - EscalationPolicyPathRulesItemType8Type5TimeBlocksItem, - ) - - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_8_type_5_rule_type(d.pop("rule_type")) - - time_zone = check_escalation_policy_path_rules_item_type_8_type_5_time_zone(d.pop("time_zone")) - - time_blocks = [] - _time_blocks = d.pop("time_blocks") - for time_blocks_item_data in _time_blocks: - time_blocks_item = EscalationPolicyPathRulesItemType8Type5TimeBlocksItem.from_dict(time_blocks_item_data) - - time_blocks.append(time_blocks_item) - - escalation_policy_path_rules_item_type_8_type_5 = cls( - rule_type=rule_type, - time_zone=time_zone, - time_blocks=time_blocks, - ) - - escalation_policy_path_rules_item_type_8_type_5.additional_properties = d - return escalation_policy_path_rules_item_type_8_type_5 - - @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/escalation_policy_path_rules_item_type_8_type_5_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_rule_type.py deleted file mode 100644 index b01151d2..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_5_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType8Type5RuleType = Literal["deferral_window"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_5_RULE_TYPE_VALUES: set[ - EscalationPolicyPathRulesItemType8Type5RuleType -] = { - "deferral_window", -} - - -def check_escalation_policy_path_rules_item_type_8_type_5_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType8Type5RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_5_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType8Type5RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_5_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 24acc55b..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_6.py +++ /dev/null @@ -1,84 +0,0 @@ -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.escalation_policy_path_rules_item_type_8_type_6_operator import ( - EscalationPolicyPathRulesItemType8Type6Operator, - check_escalation_policy_path_rules_item_type_8_type_6_operator, -) -from ..models.escalation_policy_path_rules_item_type_8_type_6_rule_type import ( - EscalationPolicyPathRulesItemType8Type6RuleType, - check_escalation_policy_path_rules_item_type_8_type_6_rule_type, -) - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType8Type6") - - -@_attrs_define -class EscalationPolicyPathRulesItemType8Type6: - """ - Attributes: - rule_type (EscalationPolicyPathRulesItemType8Type6RuleType): The type of the escalation path rule - operator (EscalationPolicyPathRulesItemType8Type6Operator): How the alert source should be matched - values (list[str]): Alert source values to match against (e.g., manual, datadog) - """ - - rule_type: EscalationPolicyPathRulesItemType8Type6RuleType - operator: EscalationPolicyPathRulesItemType8Type6Operator - values: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - operator: str = self.operator - - values = self.values - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "operator": operator, - "values": values, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_8_type_6_rule_type(d.pop("rule_type")) - - operator = check_escalation_policy_path_rules_item_type_8_type_6_operator(d.pop("operator")) - - values = cast(list[str], d.pop("values")) - - escalation_policy_path_rules_item_type_8_type_6 = cls( - rule_type=rule_type, - operator=operator, - values=values, - ) - - escalation_policy_path_rules_item_type_8_type_6.additional_properties = d - return escalation_policy_path_rules_item_type_8_type_6 - - @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/escalation_policy_path_rules_item_type_8_type_6_operator.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_6_operator.py deleted file mode 100644 index ac729347..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_6_operator.py +++ /dev/null @@ -1,24 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType8Type6Operator = Literal["is", "is_not", "is_not_one_of", "is_one_of"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_6_OPERATOR_VALUES: set[ - EscalationPolicyPathRulesItemType8Type6Operator -] = { - "is", - "is_not", - "is_not_one_of", - "is_one_of", -} - - -def check_escalation_policy_path_rules_item_type_8_type_6_operator( - value: str | None, -) -> EscalationPolicyPathRulesItemType8Type6Operator | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_6_OPERATOR_VALUES: - return cast(EscalationPolicyPathRulesItemType8Type6Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_6_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_6_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_6_rule_type.py deleted file mode 100644 index 3c5ff6b8..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_6_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType8Type6RuleType = Literal["source"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_6_RULE_TYPE_VALUES: set[ - EscalationPolicyPathRulesItemType8Type6RuleType -] = { - "source", -} - - -def check_escalation_policy_path_rules_item_type_8_type_6_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType8Type6RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_6_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType8Type6RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_6_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 757912d8..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_7.py +++ /dev/null @@ -1,77 +0,0 @@ -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.escalation_policy_path_rules_item_type_8_type_7_operator import ( - EscalationPolicyPathRulesItemType8Type7Operator, - check_escalation_policy_path_rules_item_type_8_type_7_operator, -) -from ..models.escalation_policy_path_rules_item_type_8_type_7_rule_type import ( - EscalationPolicyPathRulesItemType8Type7RuleType, - check_escalation_policy_path_rules_item_type_8_type_7_rule_type, -) - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType8Type7") - - -@_attrs_define -class EscalationPolicyPathRulesItemType8Type7: - """ - Attributes: - rule_type (EscalationPolicyPathRulesItemType8Type7RuleType): The type of the escalation path rule - operator (EscalationPolicyPathRulesItemType8Type7Operator): Whether the alert must (or must not) have related - incidents - """ - - rule_type: EscalationPolicyPathRulesItemType8Type7RuleType - operator: EscalationPolicyPathRulesItemType8Type7Operator - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - operator: str = self.operator - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "operator": operator, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_8_type_7_rule_type(d.pop("rule_type")) - - operator = check_escalation_policy_path_rules_item_type_8_type_7_operator(d.pop("operator")) - - escalation_policy_path_rules_item_type_8_type_7 = cls( - rule_type=rule_type, - operator=operator, - ) - - escalation_policy_path_rules_item_type_8_type_7.additional_properties = d - return escalation_policy_path_rules_item_type_8_type_7 - - @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/escalation_policy_path_rules_item_type_8_type_7_operator.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_7_operator.py deleted file mode 100644 index d5297005..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_7_operator.py +++ /dev/null @@ -1,22 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType8Type7Operator = Literal["is_not_set", "is_set"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_7_OPERATOR_VALUES: set[ - EscalationPolicyPathRulesItemType8Type7Operator -] = { - "is_not_set", - "is_set", -} - - -def check_escalation_policy_path_rules_item_type_8_type_7_operator( - value: str | None, -) -> EscalationPolicyPathRulesItemType8Type7Operator | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_7_OPERATOR_VALUES: - return cast(EscalationPolicyPathRulesItemType8Type7Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_7_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_7_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_7_rule_type.py deleted file mode 100644 index 1b37193d..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_8_type_7_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType8Type7RuleType = Literal["related_incidents"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_7_RULE_TYPE_VALUES: set[ - EscalationPolicyPathRulesItemType8Type7RuleType -] = { - "related_incidents", -} - - -def check_escalation_policy_path_rules_item_type_8_type_7_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType8Type7RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_7_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType8Type7RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_8_TYPE_7_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index aba4b2e1..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_0.py +++ /dev/null @@ -1,72 +0,0 @@ -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.escalation_policy_path_rules_item_type_9_type_0_rule_type import ( - EscalationPolicyPathRulesItemType9Type0RuleType, - check_escalation_policy_path_rules_item_type_9_type_0_rule_type, -) - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType9Type0") - - -@_attrs_define -class EscalationPolicyPathRulesItemType9Type0: - """ - Attributes: - rule_type (EscalationPolicyPathRulesItemType9Type0RuleType): The type of the escalation path rule - urgency_ids (list[str]): Alert urgency ids for which this escalation path should be used - """ - - rule_type: EscalationPolicyPathRulesItemType9Type0RuleType - urgency_ids: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - urgency_ids = self.urgency_ids - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "urgency_ids": urgency_ids, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_9_type_0_rule_type(d.pop("rule_type")) - - urgency_ids = cast(list[str], d.pop("urgency_ids")) - - escalation_policy_path_rules_item_type_9_type_0 = cls( - rule_type=rule_type, - urgency_ids=urgency_ids, - ) - - escalation_policy_path_rules_item_type_9_type_0.additional_properties = d - return escalation_policy_path_rules_item_type_9_type_0 - - @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/escalation_policy_path_rules_item_type_9_type_0_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_0_rule_type.py deleted file mode 100644 index 48322d7c..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_0_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType9Type0RuleType = Literal["alert_urgency"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_0_RULE_TYPE_VALUES: set[ - EscalationPolicyPathRulesItemType9Type0RuleType -] = { - "alert_urgency", -} - - -def check_escalation_policy_path_rules_item_type_9_type_0_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType9Type0RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_0_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType9Type0RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_0_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 90b2784d..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_1.py +++ /dev/null @@ -1,72 +0,0 @@ -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.escalation_policy_path_rules_item_type_9_type_1_rule_type import ( - EscalationPolicyPathRulesItemType9Type1RuleType, - check_escalation_policy_path_rules_item_type_9_type_1_rule_type, -) - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType9Type1") - - -@_attrs_define -class EscalationPolicyPathRulesItemType9Type1: - """ - Attributes: - rule_type (EscalationPolicyPathRulesItemType9Type1RuleType): The type of the escalation path rule - within_working_hour (bool): Whether the escalation path should be used within working hours - """ - - rule_type: EscalationPolicyPathRulesItemType9Type1RuleType - within_working_hour: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - within_working_hour = self.within_working_hour - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "within_working_hour": within_working_hour, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_9_type_1_rule_type(d.pop("rule_type")) - - within_working_hour = d.pop("within_working_hour") - - escalation_policy_path_rules_item_type_9_type_1 = cls( - rule_type=rule_type, - within_working_hour=within_working_hour, - ) - - escalation_policy_path_rules_item_type_9_type_1.additional_properties = d - return escalation_policy_path_rules_item_type_9_type_1 - - @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/escalation_policy_path_rules_item_type_9_type_1_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_1_rule_type.py deleted file mode 100644 index a87ebc23..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_1_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType9Type1RuleType = Literal["working_hour"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_1_RULE_TYPE_VALUES: set[ - EscalationPolicyPathRulesItemType9Type1RuleType -] = { - "working_hour", -} - - -def check_escalation_policy_path_rules_item_type_9_type_1_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType9Type1RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_1_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType9Type1RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_1_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 6e441992..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_2.py +++ /dev/null @@ -1,116 +0,0 @@ -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.escalation_policy_path_rules_item_type_9_type_2_operator import ( - EscalationPolicyPathRulesItemType9Type2Operator, - check_escalation_policy_path_rules_item_type_9_type_2_operator, -) -from ..models.escalation_policy_path_rules_item_type_9_type_2_rule_type import ( - EscalationPolicyPathRulesItemType9Type2RuleType, - check_escalation_policy_path_rules_item_type_9_type_2_rule_type, -) -from ..types import UNSET, Unset - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType9Type2") - - -@_attrs_define -class EscalationPolicyPathRulesItemType9Type2: - """ - Attributes: - 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 (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 | 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]: - rule_type: str = self.rule_type - - json_path = self.json_path - - operator: str = self.operator - - value: None | Unset | str - if isinstance(self.value, Unset): - value = UNSET - else: - value = self.value - - values: Unset | list[str] = UNSET - if not isinstance(self.values, Unset): - values = self.values - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "json_path": json_path, - "operator": operator, - } - ) - if value is not UNSET: - field_dict["value"] = value - if values is not UNSET: - field_dict["values"] = values - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_9_type_2_rule_type(d.pop("rule_type")) - - json_path = d.pop("json_path") - - operator = check_escalation_policy_path_rules_item_type_9_type_2_operator(d.pop("operator")) - - def _parse_value(data: object) -> None | Unset | str: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | Unset | str, data) - - value = _parse_value(d.pop("value", UNSET)) - - values = cast(list[str], d.pop("values", UNSET)) - - escalation_policy_path_rules_item_type_9_type_2 = cls( - rule_type=rule_type, - json_path=json_path, - operator=operator, - value=value, - values=values, - ) - - escalation_policy_path_rules_item_type_9_type_2.additional_properties = d - return escalation_policy_path_rules_item_type_9_type_2 - - @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/escalation_policy_path_rules_item_type_9_type_2_operator.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_2_operator.py deleted file mode 100644 index f28c4c22..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_2_operator.py +++ /dev/null @@ -1,49 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType9Type2Operator = Literal[ - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_not", - "is_not_one_of", - "is_not_set", - "is_one_of", - "is_set", - "matches", - "starts_with", -] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_2_OPERATOR_VALUES: set[ - EscalationPolicyPathRulesItemType9Type2Operator -] = { - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_not", - "is_not_one_of", - "is_not_set", - "is_one_of", - "is_set", - "matches", - "starts_with", -} - - -def check_escalation_policy_path_rules_item_type_9_type_2_operator( - value: str | None, -) -> EscalationPolicyPathRulesItemType9Type2Operator | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_2_OPERATOR_VALUES: - return cast(EscalationPolicyPathRulesItemType9Type2Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_2_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_2_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_2_rule_type.py deleted file mode 100644 index b5356280..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_2_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType9Type2RuleType = Literal["json_path"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_2_RULE_TYPE_VALUES: set[ - EscalationPolicyPathRulesItemType9Type2RuleType -] = { - "json_path", -} - - -def check_escalation_policy_path_rules_item_type_9_type_2_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType9Type2RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_2_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType9Type2RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_2_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 5f33ce05..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_3.py +++ /dev/null @@ -1,104 +0,0 @@ -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.escalation_policy_path_rules_item_type_9_type_3_operator import ( - EscalationPolicyPathRulesItemType9Type3Operator, - check_escalation_policy_path_rules_item_type_9_type_3_operator, -) -from ..models.escalation_policy_path_rules_item_type_9_type_3_rule_type import ( - EscalationPolicyPathRulesItemType9Type3RuleType, - check_escalation_policy_path_rules_item_type_9_type_3_rule_type, -) -from ..types import UNSET, Unset - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType9Type3") - - -@_attrs_define -class EscalationPolicyPathRulesItemType9Type3: - """ - Attributes: - rule_type (EscalationPolicyPathRulesItemType9Type3RuleType): The type of the escalation path rule - 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 (Union[Unset, list[str]]): Values to match against - """ - - rule_type: EscalationPolicyPathRulesItemType9Type3RuleType - fieldable_type: str - fieldable_id: str - operator: EscalationPolicyPathRulesItemType9Type3Operator - values: Unset | list[str] = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - fieldable_type = self.fieldable_type - - fieldable_id = self.fieldable_id - - operator: str = self.operator - - values: Unset | list[str] = UNSET - if not isinstance(self.values, Unset): - values = self.values - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "fieldable_type": fieldable_type, - "fieldable_id": fieldable_id, - "operator": operator, - } - ) - if values is not UNSET: - field_dict["values"] = values - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_9_type_3_rule_type(d.pop("rule_type")) - - fieldable_type = d.pop("fieldable_type") - - fieldable_id = d.pop("fieldable_id") - - operator = check_escalation_policy_path_rules_item_type_9_type_3_operator(d.pop("operator")) - - values = cast(list[str], d.pop("values", UNSET)) - - escalation_policy_path_rules_item_type_9_type_3 = cls( - rule_type=rule_type, - fieldable_type=fieldable_type, - fieldable_id=fieldable_id, - operator=operator, - values=values, - ) - - escalation_policy_path_rules_item_type_9_type_3.additional_properties = d - return escalation_policy_path_rules_item_type_9_type_3 - - @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/escalation_policy_path_rules_item_type_9_type_3_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_3_rule_type.py deleted file mode 100644 index 01336e99..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_3_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType9Type3RuleType = Literal["field"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_3_RULE_TYPE_VALUES: set[ - EscalationPolicyPathRulesItemType9Type3RuleType -] = { - "field", -} - - -def check_escalation_policy_path_rules_item_type_9_type_3_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType9Type3RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_3_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType9Type3RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_3_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 8b8719df..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_4.py +++ /dev/null @@ -1,72 +0,0 @@ -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.escalation_policy_path_rules_item_type_9_type_4_rule_type import ( - EscalationPolicyPathRulesItemType9Type4RuleType, - check_escalation_policy_path_rules_item_type_9_type_4_rule_type, -) - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType9Type4") - - -@_attrs_define -class EscalationPolicyPathRulesItemType9Type4: - """ - Attributes: - rule_type (EscalationPolicyPathRulesItemType9Type4RuleType): The type of the escalation path rule - service_ids (list[str]): Service ids for which this escalation path should be used - """ - - rule_type: EscalationPolicyPathRulesItemType9Type4RuleType - service_ids: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - service_ids = self.service_ids - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "service_ids": service_ids, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_9_type_4_rule_type(d.pop("rule_type")) - - service_ids = cast(list[str], d.pop("service_ids")) - - escalation_policy_path_rules_item_type_9_type_4 = cls( - rule_type=rule_type, - service_ids=service_ids, - ) - - escalation_policy_path_rules_item_type_9_type_4.additional_properties = d - return escalation_policy_path_rules_item_type_9_type_4 - - @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/escalation_policy_path_rules_item_type_9_type_4_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_4_rule_type.py deleted file mode 100644 index 4db178bf..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_4_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType9Type4RuleType = Literal["service"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_4_RULE_TYPE_VALUES: set[ - EscalationPolicyPathRulesItemType9Type4RuleType -] = { - "service", -} - - -def check_escalation_policy_path_rules_item_type_9_type_4_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType9Type4RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_4_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType9Type4RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_4_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 43f7ef47..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5.py +++ /dev/null @@ -1,103 +0,0 @@ -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.escalation_policy_path_rules_item_type_9_type_5_rule_type import ( - EscalationPolicyPathRulesItemType9Type5RuleType, - check_escalation_policy_path_rules_item_type_9_type_5_rule_type, -) -from ..models.escalation_policy_path_rules_item_type_9_type_5_time_zone import ( - EscalationPolicyPathRulesItemType9Type5TimeZone, - check_escalation_policy_path_rules_item_type_9_type_5_time_zone, -) - -if TYPE_CHECKING: - from ..models.escalation_policy_path_rules_item_type_9_type_5_time_blocks_item import ( - EscalationPolicyPathRulesItemType9Type5TimeBlocksItem, - ) - - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType9Type5") - - -@_attrs_define -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 - """ - - rule_type: EscalationPolicyPathRulesItemType9Type5RuleType - time_zone: EscalationPolicyPathRulesItemType9Type5TimeZone - 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 - - time_blocks = [] - for time_blocks_item_data in self.time_blocks: - time_blocks_item = time_blocks_item_data.to_dict() - time_blocks.append(time_blocks_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "time_zone": time_zone, - "time_blocks": time_blocks, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.escalation_policy_path_rules_item_type_9_type_5_time_blocks_item import ( - EscalationPolicyPathRulesItemType9Type5TimeBlocksItem, - ) - - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_9_type_5_rule_type(d.pop("rule_type")) - - time_zone = check_escalation_policy_path_rules_item_type_9_type_5_time_zone(d.pop("time_zone")) - - time_blocks = [] - _time_blocks = d.pop("time_blocks") - for time_blocks_item_data in _time_blocks: - time_blocks_item = EscalationPolicyPathRulesItemType9Type5TimeBlocksItem.from_dict(time_blocks_item_data) - - time_blocks.append(time_blocks_item) - - escalation_policy_path_rules_item_type_9_type_5 = cls( - rule_type=rule_type, - time_zone=time_zone, - time_blocks=time_blocks, - ) - - escalation_policy_path_rules_item_type_9_type_5.additional_properties = d - return escalation_policy_path_rules_item_type_9_type_5 - - @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/escalation_policy_path_rules_item_type_9_type_5_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5_rule_type.py deleted file mode 100644 index bc896cef..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType9Type5RuleType = Literal["deferral_window"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_5_RULE_TYPE_VALUES: set[ - EscalationPolicyPathRulesItemType9Type5RuleType -] = { - "deferral_window", -} - - -def check_escalation_policy_path_rules_item_type_9_type_5_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType9Type5RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_5_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType9Type5RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_5_RULE_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5_time_zone.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5_time_zone.py deleted file mode 100644 index 5d1ef449..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_5_time_zone.py +++ /dev/null @@ -1,631 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType9Type5TimeZone = Literal[ - "Abu Dhabi", - "Adelaide", - "Africa/Algiers", - "Africa/Cairo", - "Africa/Casablanca", - "Africa/Harare", - "Africa/Johannesburg", - "Africa/Monrovia", - "Africa/Nairobi", - "Alaska", - "Almaty", - "America/Adak", - "America/Argentina/Buenos_Aires", - "America/Asuncion", - "America/Atka", - "America/Bogota", - "America/Caracas", - "America/Chicago", - "America/Chihuahua", - "America/Denver", - "America/Guatemala", - "America/Guyana", - "America/Halifax", - "America/Indiana/Indianapolis", - "America/Juneau", - "America/La_Paz", - "America/Lima", - "America/Los_Angeles", - "America/Mazatlan", - "America/Mexico_City", - "America/Miquelon", - "America/Monterrey", - "America/Montevideo", - "America/New_York", - "America/Nuuk", - "America/Phoenix", - "America/Puerto_Rico", - "America/Regina", - "America/Santiago", - "America/Sao_Paulo", - "America/St_Johns", - "America/Tijuana", - "America/Vancouver", - "American Samoa", - "Amsterdam", - "Arizona", - "Asia/Almaty", - "Asia/Baghdad", - "Asia/Baku", - "Asia/Bangkok", - "Asia/Chongqing", - "Asia/Colombo", - "Asia/Dhaka", - "Asia/Hong_Kong", - "Asia/Irkutsk", - "Asia/Jakarta", - "Asia/Jerusalem", - "Asia/Kabul", - "Asia/Kamchatka", - "Asia/Karachi", - "Asia/Kathmandu", - "Asia/Kolkata", - "Asia/Krasnoyarsk", - "Asia/Kuala_Lumpur", - "Asia/Kuwait", - "Asia/Magadan", - "Asia/Muscat", - "Asia/Novosibirsk", - "Asia/Rangoon", - "Asia/Riyadh", - "Asia/Seoul", - "Asia/Shanghai", - "Asia/Singapore", - "Asia/Srednekolymsk", - "Asia/Taipei", - "Asia/Tashkent", - "Asia/Tbilisi", - "Asia/Tehran", - "Asia/Tokyo", - "Asia/Ulaanbaatar", - "Asia/Urumqi", - "Asia/Vladivostok", - "Asia/Yakutsk", - "Asia/Yekaterinburg", - "Asia/Yerevan", - "Astana", - "Asuncion", - "Athens", - "Atlantic Time (Canada)", - "Atlantic/Azores", - "Atlantic/Cape_Verde", - "Atlantic/South_Georgia", - "Auckland", - "Australia/Adelaide", - "Australia/Brisbane", - "Australia/Canberra", - "Australia/Darwin", - "Australia/Eucla", - "Australia/Hobart", - "Australia/LHI", - "Australia/Lord_Howe", - "Australia/Melbourne", - "Australia/Perth", - "Australia/Sydney", - "Azores", - "Baghdad", - "Baku", - "Bangkok", - "Beijing", - "Belgrade", - "Berlin", - "Bern", - "Bogota", - "Brasilia", - "Bratislava", - "Brisbane", - "Brussels", - "Bucharest", - "Budapest", - "Buenos Aires", - "Cairo", - "Canada/Pacific", - "Canberra", - "Cape Verde Is.", - "Caracas", - "Casablanca", - "Central America", - "Central Time (US & Canada)", - "Chatham Is.", - "Chennai", - "Chihuahua", - "Chile/EasterIsland", - "Chongqing", - "Copenhagen", - "Darwin", - "Dhaka", - "Dublin", - "Eastern Time (US & Canada)", - "Edinburgh", - "Ekaterinburg", - "Etc/GMT+12", - "Etc/UTC", - "Europe/Amsterdam", - "Europe/Athens", - "Europe/Belgrade", - "Europe/Berlin", - "Europe/Bratislava", - "Europe/Brussels", - "Europe/Bucharest", - "Europe/Budapest", - "Europe/Copenhagen", - "Europe/Dublin", - "Europe/Helsinki", - "Europe/Istanbul", - "Europe/Kaliningrad", - "Europe/Kiev", - "Europe/Lisbon", - "Europe/Ljubljana", - "Europe/London", - "Europe/Madrid", - "Europe/Minsk", - "Europe/Moscow", - "Europe/Paris", - "Europe/Prague", - "Europe/Riga", - "Europe/Rome", - "Europe/Samara", - "Europe/Sarajevo", - "Europe/Skopje", - "Europe/Sofia", - "Europe/Stockholm", - "Europe/Tallinn", - "Europe/Vienna", - "Europe/Vilnius", - "Europe/Volgograd", - "Europe/Warsaw", - "Europe/Zagreb", - "Europe/Zurich", - "Fiji", - "Georgetown", - "Greenland", - "Guadalajara", - "Guam", - "Hanoi", - "Harare", - "Hawaii", - "Helsinki", - "Hobart", - "Hong Kong", - "Indiana (East)", - "International Date Line West", - "Irkutsk", - "Islamabad", - "Istanbul", - "Jakarta", - "Jerusalem", - "Kabul", - "Kaliningrad", - "Kamchatka", - "Karachi", - "Kathmandu", - "Kolkata", - "Krasnoyarsk", - "Kuala Lumpur", - "Kuwait", - "Kyiv", - "La Paz", - "Lima", - "Lisbon", - "Ljubljana", - "London", - "Madrid", - "Magadan", - "Marshall Is.", - "Mazatlan", - "Melbourne", - "Mexico City", - "Mid-Atlantic", - "Midway Island", - "Minsk", - "Monrovia", - "Monterrey", - "Montevideo", - "Moscow", - "Mountain Time (US & Canada)", - "Mumbai", - "Muscat", - "Nairobi", - "New Caledonia", - "New Delhi", - "Newfoundland", - "Novosibirsk", - "Nuku'alofa", - "Osaka", - "Pacific Time (US & Canada)", - "Pacific/Apia", - "Pacific/Auckland", - "Pacific/Chatham", - "Pacific/Easter", - "Pacific/Fakaofo", - "Pacific/Fiji", - "Pacific/Gambier", - "Pacific/Guadalcanal", - "Pacific/Guam", - "Pacific/Honolulu", - "Pacific/Kiritimati", - "Pacific/Majuro", - "Pacific/Marquesas", - "Pacific/Midway", - "Pacific/Norfolk", - "Pacific/Noumea", - "Pacific/Pago_Pago", - "Pacific/Pitcairn", - "Pacific/Port_Moresby", - "Pacific/Tongatapu", - "Paris", - "Perth", - "Port Moresby", - "Prague", - "Pretoria", - "Puerto Rico", - "Quito", - "Rangoon", - "Riga", - "Riyadh", - "Rome", - "Samara", - "Samoa", - "Santiago", - "Sapporo", - "Sarajevo", - "Saskatchewan", - "Seoul", - "Singapore", - "Skopje", - "Sofia", - "Solomon Is.", - "Srednekolymsk", - "Sri Jayawardenepura", - "St. Petersburg", - "Stockholm", - "Sydney", - "Taipei", - "Tallinn", - "Tashkent", - "Tbilisi", - "Tehran", - "Tijuana", - "Tokelau Is.", - "Tokyo", - "Ulaanbaatar", - "Urumqi", - "US/Aleutian", - "UTC", - "Vienna", - "Vilnius", - "Vladivostok", - "Volgograd", - "Warsaw", - "Wellington", - "West Central Africa", - "Yakutsk", - "Yerevan", - "Zagreb", - "Zurich", -] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_5_TIME_ZONE_VALUES: set[ - EscalationPolicyPathRulesItemType9Type5TimeZone -] = { - "Abu Dhabi", - "Adelaide", - "Africa/Algiers", - "Africa/Cairo", - "Africa/Casablanca", - "Africa/Harare", - "Africa/Johannesburg", - "Africa/Monrovia", - "Africa/Nairobi", - "Alaska", - "Almaty", - "America/Adak", - "America/Argentina/Buenos_Aires", - "America/Asuncion", - "America/Atka", - "America/Bogota", - "America/Caracas", - "America/Chicago", - "America/Chihuahua", - "America/Denver", - "America/Guatemala", - "America/Guyana", - "America/Halifax", - "America/Indiana/Indianapolis", - "America/Juneau", - "America/La_Paz", - "America/Lima", - "America/Los_Angeles", - "America/Mazatlan", - "America/Mexico_City", - "America/Miquelon", - "America/Monterrey", - "America/Montevideo", - "America/New_York", - "America/Nuuk", - "America/Phoenix", - "America/Puerto_Rico", - "America/Regina", - "America/Santiago", - "America/Sao_Paulo", - "America/St_Johns", - "America/Tijuana", - "America/Vancouver", - "American Samoa", - "Amsterdam", - "Arizona", - "Asia/Almaty", - "Asia/Baghdad", - "Asia/Baku", - "Asia/Bangkok", - "Asia/Chongqing", - "Asia/Colombo", - "Asia/Dhaka", - "Asia/Hong_Kong", - "Asia/Irkutsk", - "Asia/Jakarta", - "Asia/Jerusalem", - "Asia/Kabul", - "Asia/Kamchatka", - "Asia/Karachi", - "Asia/Kathmandu", - "Asia/Kolkata", - "Asia/Krasnoyarsk", - "Asia/Kuala_Lumpur", - "Asia/Kuwait", - "Asia/Magadan", - "Asia/Muscat", - "Asia/Novosibirsk", - "Asia/Rangoon", - "Asia/Riyadh", - "Asia/Seoul", - "Asia/Shanghai", - "Asia/Singapore", - "Asia/Srednekolymsk", - "Asia/Taipei", - "Asia/Tashkent", - "Asia/Tbilisi", - "Asia/Tehran", - "Asia/Tokyo", - "Asia/Ulaanbaatar", - "Asia/Urumqi", - "Asia/Vladivostok", - "Asia/Yakutsk", - "Asia/Yekaterinburg", - "Asia/Yerevan", - "Astana", - "Asuncion", - "Athens", - "Atlantic Time (Canada)", - "Atlantic/Azores", - "Atlantic/Cape_Verde", - "Atlantic/South_Georgia", - "Auckland", - "Australia/Adelaide", - "Australia/Brisbane", - "Australia/Canberra", - "Australia/Darwin", - "Australia/Eucla", - "Australia/Hobart", - "Australia/LHI", - "Australia/Lord_Howe", - "Australia/Melbourne", - "Australia/Perth", - "Australia/Sydney", - "Azores", - "Baghdad", - "Baku", - "Bangkok", - "Beijing", - "Belgrade", - "Berlin", - "Bern", - "Bogota", - "Brasilia", - "Bratislava", - "Brisbane", - "Brussels", - "Bucharest", - "Budapest", - "Buenos Aires", - "Cairo", - "Canada/Pacific", - "Canberra", - "Cape Verde Is.", - "Caracas", - "Casablanca", - "Central America", - "Central Time (US & Canada)", - "Chatham Is.", - "Chennai", - "Chihuahua", - "Chile/EasterIsland", - "Chongqing", - "Copenhagen", - "Darwin", - "Dhaka", - "Dublin", - "Eastern Time (US & Canada)", - "Edinburgh", - "Ekaterinburg", - "Etc/GMT+12", - "Etc/UTC", - "Europe/Amsterdam", - "Europe/Athens", - "Europe/Belgrade", - "Europe/Berlin", - "Europe/Bratislava", - "Europe/Brussels", - "Europe/Bucharest", - "Europe/Budapest", - "Europe/Copenhagen", - "Europe/Dublin", - "Europe/Helsinki", - "Europe/Istanbul", - "Europe/Kaliningrad", - "Europe/Kiev", - "Europe/Lisbon", - "Europe/Ljubljana", - "Europe/London", - "Europe/Madrid", - "Europe/Minsk", - "Europe/Moscow", - "Europe/Paris", - "Europe/Prague", - "Europe/Riga", - "Europe/Rome", - "Europe/Samara", - "Europe/Sarajevo", - "Europe/Skopje", - "Europe/Sofia", - "Europe/Stockholm", - "Europe/Tallinn", - "Europe/Vienna", - "Europe/Vilnius", - "Europe/Volgograd", - "Europe/Warsaw", - "Europe/Zagreb", - "Europe/Zurich", - "Fiji", - "Georgetown", - "Greenland", - "Guadalajara", - "Guam", - "Hanoi", - "Harare", - "Hawaii", - "Helsinki", - "Hobart", - "Hong Kong", - "Indiana (East)", - "International Date Line West", - "Irkutsk", - "Islamabad", - "Istanbul", - "Jakarta", - "Jerusalem", - "Kabul", - "Kaliningrad", - "Kamchatka", - "Karachi", - "Kathmandu", - "Kolkata", - "Krasnoyarsk", - "Kuala Lumpur", - "Kuwait", - "Kyiv", - "La Paz", - "Lima", - "Lisbon", - "Ljubljana", - "London", - "Madrid", - "Magadan", - "Marshall Is.", - "Mazatlan", - "Melbourne", - "Mexico City", - "Mid-Atlantic", - "Midway Island", - "Minsk", - "Monrovia", - "Monterrey", - "Montevideo", - "Moscow", - "Mountain Time (US & Canada)", - "Mumbai", - "Muscat", - "Nairobi", - "New Caledonia", - "New Delhi", - "Newfoundland", - "Novosibirsk", - "Nuku'alofa", - "Osaka", - "Pacific Time (US & Canada)", - "Pacific/Apia", - "Pacific/Auckland", - "Pacific/Chatham", - "Pacific/Easter", - "Pacific/Fakaofo", - "Pacific/Fiji", - "Pacific/Gambier", - "Pacific/Guadalcanal", - "Pacific/Guam", - "Pacific/Honolulu", - "Pacific/Kiritimati", - "Pacific/Majuro", - "Pacific/Marquesas", - "Pacific/Midway", - "Pacific/Norfolk", - "Pacific/Noumea", - "Pacific/Pago_Pago", - "Pacific/Pitcairn", - "Pacific/Port_Moresby", - "Pacific/Tongatapu", - "Paris", - "Perth", - "Port Moresby", - "Prague", - "Pretoria", - "Puerto Rico", - "Quito", - "Rangoon", - "Riga", - "Riyadh", - "Rome", - "Samara", - "Samoa", - "Santiago", - "Sapporo", - "Sarajevo", - "Saskatchewan", - "Seoul", - "Singapore", - "Skopje", - "Sofia", - "Solomon Is.", - "Srednekolymsk", - "Sri Jayawardenepura", - "St. Petersburg", - "Stockholm", - "Sydney", - "Taipei", - "Tallinn", - "Tashkent", - "Tbilisi", - "Tehran", - "Tijuana", - "Tokelau Is.", - "Tokyo", - "Ulaanbaatar", - "Urumqi", - "US/Aleutian", - "UTC", - "Vienna", - "Vilnius", - "Vladivostok", - "Volgograd", - "Warsaw", - "Wellington", - "West Central Africa", - "Yakutsk", - "Yerevan", - "Zagreb", - "Zurich", -} - - -def check_escalation_policy_path_rules_item_type_9_type_5_time_zone( - value: str | None, -) -> EscalationPolicyPathRulesItemType9Type5TimeZone | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_5_TIME_ZONE_VALUES: - return cast(EscalationPolicyPathRulesItemType9Type5TimeZone, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_5_TIME_ZONE_VALUES!r}" - ) 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 deleted file mode 100644 index 0c836e8c..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_6.py +++ /dev/null @@ -1,84 +0,0 @@ -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.escalation_policy_path_rules_item_type_9_type_6_operator import ( - EscalationPolicyPathRulesItemType9Type6Operator, - check_escalation_policy_path_rules_item_type_9_type_6_operator, -) -from ..models.escalation_policy_path_rules_item_type_9_type_6_rule_type import ( - EscalationPolicyPathRulesItemType9Type6RuleType, - check_escalation_policy_path_rules_item_type_9_type_6_rule_type, -) - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType9Type6") - - -@_attrs_define -class EscalationPolicyPathRulesItemType9Type6: - """ - Attributes: - rule_type (EscalationPolicyPathRulesItemType9Type6RuleType): The type of the escalation path rule - operator (EscalationPolicyPathRulesItemType9Type6Operator): How the alert source should be matched - values (list[str]): Alert source values to match against (e.g., manual, datadog) - """ - - rule_type: EscalationPolicyPathRulesItemType9Type6RuleType - operator: EscalationPolicyPathRulesItemType9Type6Operator - values: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - operator: str = self.operator - - values = self.values - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "operator": operator, - "values": values, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_9_type_6_rule_type(d.pop("rule_type")) - - operator = check_escalation_policy_path_rules_item_type_9_type_6_operator(d.pop("operator")) - - values = cast(list[str], d.pop("values")) - - escalation_policy_path_rules_item_type_9_type_6 = cls( - rule_type=rule_type, - operator=operator, - values=values, - ) - - escalation_policy_path_rules_item_type_9_type_6.additional_properties = d - return escalation_policy_path_rules_item_type_9_type_6 - - @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/escalation_policy_path_rules_item_type_9_type_6_operator.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_6_operator.py deleted file mode 100644 index 4a71cad8..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_6_operator.py +++ /dev/null @@ -1,24 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType9Type6Operator = Literal["is", "is_not", "is_not_one_of", "is_one_of"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_6_OPERATOR_VALUES: set[ - EscalationPolicyPathRulesItemType9Type6Operator -] = { - "is", - "is_not", - "is_not_one_of", - "is_one_of", -} - - -def check_escalation_policy_path_rules_item_type_9_type_6_operator( - value: str | None, -) -> EscalationPolicyPathRulesItemType9Type6Operator | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_6_OPERATOR_VALUES: - return cast(EscalationPolicyPathRulesItemType9Type6Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_6_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_6_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_6_rule_type.py deleted file mode 100644 index 1b062e94..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_6_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType9Type6RuleType = Literal["source"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_6_RULE_TYPE_VALUES: set[ - EscalationPolicyPathRulesItemType9Type6RuleType -] = { - "source", -} - - -def check_escalation_policy_path_rules_item_type_9_type_6_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType9Type6RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_6_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType9Type6RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_6_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 6fe8e16b..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_7.py +++ /dev/null @@ -1,77 +0,0 @@ -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.escalation_policy_path_rules_item_type_9_type_7_operator import ( - EscalationPolicyPathRulesItemType9Type7Operator, - check_escalation_policy_path_rules_item_type_9_type_7_operator, -) -from ..models.escalation_policy_path_rules_item_type_9_type_7_rule_type import ( - EscalationPolicyPathRulesItemType9Type7RuleType, - check_escalation_policy_path_rules_item_type_9_type_7_rule_type, -) - -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType9Type7") - - -@_attrs_define -class EscalationPolicyPathRulesItemType9Type7: - """ - Attributes: - rule_type (EscalationPolicyPathRulesItemType9Type7RuleType): The type of the escalation path rule - operator (EscalationPolicyPathRulesItemType9Type7Operator): Whether the alert must (or must not) have related - incidents - """ - - rule_type: EscalationPolicyPathRulesItemType9Type7RuleType - operator: EscalationPolicyPathRulesItemType9Type7Operator - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - operator: str = self.operator - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "operator": operator, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_escalation_policy_path_rules_item_type_9_type_7_rule_type(d.pop("rule_type")) - - operator = check_escalation_policy_path_rules_item_type_9_type_7_operator(d.pop("operator")) - - escalation_policy_path_rules_item_type_9_type_7 = cls( - rule_type=rule_type, - operator=operator, - ) - - escalation_policy_path_rules_item_type_9_type_7.additional_properties = d - return escalation_policy_path_rules_item_type_9_type_7 - - @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/escalation_policy_path_rules_item_type_9_type_7_operator.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_7_operator.py deleted file mode 100644 index a3b93a2a..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_7_operator.py +++ /dev/null @@ -1,22 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType9Type7Operator = Literal["is_not_set", "is_set"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_7_OPERATOR_VALUES: set[ - EscalationPolicyPathRulesItemType9Type7Operator -] = { - "is_not_set", - "is_set", -} - - -def check_escalation_policy_path_rules_item_type_9_type_7_operator( - value: str | None, -) -> EscalationPolicyPathRulesItemType9Type7Operator | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_7_OPERATOR_VALUES: - return cast(EscalationPolicyPathRulesItemType9Type7Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_7_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_7_rule_type.py b/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_7_rule_type.py deleted file mode 100644 index 82299509..00000000 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_9_type_7_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -EscalationPolicyPathRulesItemType9Type7RuleType = Literal["related_incidents"] - -ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_7_RULE_TYPE_VALUES: set[ - EscalationPolicyPathRulesItemType9Type7RuleType -] = { - "related_incidents", -} - - -def check_escalation_policy_path_rules_item_type_9_type_7_rule_type( - value: str | None, -) -> EscalationPolicyPathRulesItemType9Type7RuleType | None: - if value is None: - return None - if value in ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_7_RULE_TYPE_VALUES: - return cast(EscalationPolicyPathRulesItemType9Type7RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_RULES_ITEM_TYPE_9_TYPE_7_RULE_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/escalation_policy_path_time_restriction_time_zone.py b/rootly_sdk/models/escalation_policy_path_time_restriction_time_zone.py index c5c8d0c2..99e7b358 100644 --- a/rootly_sdk/models/escalation_policy_path_time_restriction_time_zone.py +++ b/rootly_sdk/models/escalation_policy_path_time_restriction_time_zone.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalationPolicyPathTimeRestrictionTimeZone = Literal[ "Abu Dhabi", @@ -84,6 +84,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -157,6 +158,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -392,6 +394,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -465,6 +468,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -623,7 +627,7 @@ def check_escalation_policy_path_time_restriction_time_zone( if value is None: return None if value in ESCALATION_POLICY_PATH_TIME_RESTRICTION_TIME_ZONE_VALUES: - return cast(EscalationPolicyPathTimeRestrictionTimeZone, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_TIME_RESTRICTION_TIME_ZONE_VALUES!r}" ) 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 789ccb5f..b5f130f6 100644 --- a/rootly_sdk/models/escalation_policy_path_time_restrictions_item.py +++ b/rootly_sdk/models/escalation_policy_path_time_restrictions_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -21,26 +23,26 @@ class EscalationPolicyPathTimeRestrictionsItem: """ Attributes: - 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): + start_time (str | Unset): Formatted as HH:MM + end_day (EscalationPolicyPathTimeRestrictionsItemEndDay | Unset): + end_time (str | Unset): Formatted as HH:MM """ - start_day: Unset | EscalationPolicyPathTimeRestrictionsItemStartDay = UNSET - start_time: Unset | str = UNSET - end_day: Unset | EscalationPolicyPathTimeRestrictionsItemEndDay = UNSET - end_time: Unset | str = UNSET + start_day: EscalationPolicyPathTimeRestrictionsItemStartDay | Unset = UNSET + start_time: str | Unset = UNSET + end_day: EscalationPolicyPathTimeRestrictionsItemEndDay | Unset = UNSET + end_time: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - start_day: Unset | str = UNSET + start_day: str | Unset = UNSET if not isinstance(self.start_day, Unset): start_day = self.start_day start_time = self.start_time - end_day: Unset | str = UNSET + end_day: str | Unset = UNSET if not isinstance(self.end_day, Unset): end_day = self.end_day @@ -64,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) _start_day = d.pop("start_day", UNSET) - start_day: Unset | EscalationPolicyPathTimeRestrictionsItemStartDay + start_day: EscalationPolicyPathTimeRestrictionsItemStartDay | Unset if isinstance(_start_day, Unset): start_day = UNSET else: @@ -73,7 +75,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: Unset | EscalationPolicyPathTimeRestrictionsItemEndDay + end_day: EscalationPolicyPathTimeRestrictionsItemEndDay | Unset if isinstance(_end_day, Unset): end_day = UNSET else: diff --git a/rootly_sdk/models/escalation_policy_path_time_restrictions_item_end_day.py b/rootly_sdk/models/escalation_policy_path_time_restrictions_item_end_day.py index 693be3a0..d347acd2 100644 --- a/rootly_sdk/models/escalation_policy_path_time_restrictions_item_end_day.py +++ b/rootly_sdk/models/escalation_policy_path_time_restrictions_item_end_day.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalationPolicyPathTimeRestrictionsItemEndDay = Literal[ "friday", "monday", "saturday", "sunday", "thursday", "tuesday", "wednesday" @@ -21,7 +21,7 @@ def check_escalation_policy_path_time_restrictions_item_end_day( if value is None: return None if value in ESCALATION_POLICY_PATH_TIME_RESTRICTIONS_ITEM_END_DAY_VALUES: - return cast(EscalationPolicyPathTimeRestrictionsItemEndDay, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_TIME_RESTRICTIONS_ITEM_END_DAY_VALUES!r}" ) diff --git a/rootly_sdk/models/escalation_policy_path_time_restrictions_item_start_day.py b/rootly_sdk/models/escalation_policy_path_time_restrictions_item_start_day.py index 8583f458..dc91806f 100644 --- a/rootly_sdk/models/escalation_policy_path_time_restrictions_item_start_day.py +++ b/rootly_sdk/models/escalation_policy_path_time_restrictions_item_start_day.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalationPolicyPathTimeRestrictionsItemStartDay = Literal[ "friday", "monday", "saturday", "sunday", "thursday", "tuesday", "wednesday" @@ -23,7 +23,7 @@ def check_escalation_policy_path_time_restrictions_item_start_day( if value is None: return None if value in ESCALATION_POLICY_PATH_TIME_RESTRICTIONS_ITEM_START_DAY_VALUES: - return cast(EscalationPolicyPathTimeRestrictionsItemStartDay, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_PATH_TIME_RESTRICTIONS_ITEM_START_DAY_VALUES!r}" ) diff --git a/rootly_sdk/models/escalation_policy_response.py b/rootly_sdk/models/escalation_policy_response.py index a6804191..98941bef 100644 --- a/rootly_sdk/models/escalation_policy_response.py +++ b/rootly_sdk/models/escalation_policy_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class EscalationPolicyResponse: """ Attributes: data (EscalationPolicyResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "EscalationPolicyResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: EscalationPolicyResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 1155c119..24e804a5 100644 --- a/rootly_sdk/models/escalation_policy_response_data.py +++ b/rootly_sdk/models/escalation_policy_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/escalation_policy_response_data_type.py b/rootly_sdk/models/escalation_policy_response_data_type.py index a677ea40..9ce7f0b9 100644 --- a/rootly_sdk/models/escalation_policy_response_data_type.py +++ b/rootly_sdk/models/escalation_policy_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal EscalationPolicyResponseDataType = Literal["escalation_policies"] @@ -11,5 +11,5 @@ def check_escalation_policy_response_data_type(value: str | None) -> EscalationP if value is None: return None if value in ESCALATION_POLICY_RESPONSE_DATA_TYPE_VALUES: - return cast(EscalationPolicyResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ESCALATION_POLICY_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/form_field.py b/rootly_sdk/models/form_field.py index 61e4bb5e..7b6467fe 100644 --- a/rootly_sdk/models/form_field.py +++ b/rootly_sdk/models/form_field.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -26,13 +28,13 @@ class FormField: default_values (list[str]): created_at (str): Date of creation updated_at (str): Date of last update - 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 + 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 + resource_type (FormFieldResourceType | Unset): The resource type this field belongs to + 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 reference-kind catalog properties are supported. """ @@ -45,13 +47,13 @@ class FormField: default_values: list[str] created_at: str updated_at: str - 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 + value_kind_catalog_id: None | str | Unset = UNSET + slug: str | Unset = UNSET + resource_type: FormFieldResourceType | 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -73,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - value_kind_catalog_id: None | Unset | str + value_kind_catalog_id: None | str | Unset if isinstance(self.value_kind_catalog_id, Unset): value_kind_catalog_id = UNSET else: @@ -81,11 +83,11 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - resource_type: Unset | str = UNSET + resource_type: str | Unset = UNSET if not isinstance(self.resource_type, Unset): resource_type = self.resource_type - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -95,7 +97,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - auto_set_by_catalog_property_id: None | Unset | str + auto_set_by_catalog_property_id: None | str | Unset if isinstance(self.auto_set_by_catalog_property_id, Unset): auto_set_by_catalog_property_id = UNSET else: @@ -154,30 +156,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 | Unset | str: + def _parse_value_kind_catalog_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) value_kind_catalog_id = _parse_value_kind_catalog_id(d.pop("value_kind_catalog_id", UNSET)) slug = d.pop("slug", UNSET) _resource_type = d.pop("resource_type", UNSET) - resource_type: Unset | FormFieldResourceType + resource_type: FormFieldResourceType | Unset 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: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) @@ -185,12 +187,12 @@ def _parse_description(data: object) -> None | Unset | str: enabled = d.pop("enabled", UNSET) - def _parse_auto_set_by_catalog_property_id(data: object) -> None | Unset | str: + def _parse_auto_set_by_catalog_property_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) auto_set_by_catalog_property_id = _parse_auto_set_by_catalog_property_id( d.pop("auto_set_by_catalog_property_id", UNSET) diff --git a/rootly_sdk/models/form_field_input_kind.py b/rootly_sdk/models/form_field_input_kind.py index e682ac6b..8246f8ad 100644 --- a/rootly_sdk/models/form_field_input_kind.py +++ b/rootly_sdk/models/form_field_input_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormFieldInputKind = Literal[ "checkbox", "date", "datetime", "multi_select", "number", "rich_text", "select", "tags", "text", "textarea" @@ -22,5 +22,5 @@ def check_form_field_input_kind(value: str | None) -> FormFieldInputKind | None: if value is None: return None if value in FORM_FIELD_INPUT_KIND_VALUES: - return cast(FormFieldInputKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_INPUT_KIND_VALUES!r}") diff --git a/rootly_sdk/models/form_field_kind.py b/rootly_sdk/models/form_field_kind.py index a1252578..c87c0176 100644 --- a/rootly_sdk/models/form_field_kind.py +++ b/rootly_sdk/models/form_field_kind.py @@ -1,8 +1,9 @@ -from typing import Literal, cast +from typing import Literal FormFieldKind = Literal[ "acknowledged_at", "attach_alerts", + "cancellation_message", "causes", "closed_at", "custom", @@ -37,6 +38,7 @@ FORM_FIELD_KIND_VALUES: set[FormFieldKind] = { "acknowledged_at", "attach_alerts", + "cancellation_message", "causes", "closed_at", "custom", @@ -73,5 +75,5 @@ def check_form_field_kind(value: str | None) -> FormFieldKind | None: if value is None: return None if value in FORM_FIELD_KIND_VALUES: - return cast(FormFieldKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_KIND_VALUES!r}") diff --git a/rootly_sdk/models/form_field_list.py b/rootly_sdk/models/form_field_list.py index 62e11107..436c8248 100644 --- a/rootly_sdk/models/form_field_list.py +++ b/rootly_sdk/models/form_field_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class FormFieldList: """ Attributes: - data (list['FormFieldListDataItem']): + data (list[FormFieldListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["FormFieldListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[FormFieldListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 f29da629..190312ed 100644 --- a/rootly_sdk/models/form_field_list_data_item.py +++ b/rootly_sdk/models/form_field_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/form_field_list_data_item_type.py b/rootly_sdk/models/form_field_list_data_item_type.py index 8609ec7c..de7bfe4e 100644 --- a/rootly_sdk/models/form_field_list_data_item_type.py +++ b/rootly_sdk/models/form_field_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormFieldListDataItemType = Literal["form_fields"] @@ -11,5 +11,5 @@ def check_form_field_list_data_item_type(value: str | None) -> FormFieldListData if value is None: return None if value in FORM_FIELD_LIST_DATA_ITEM_TYPE_VALUES: - return cast(FormFieldListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/form_field_option.py b/rootly_sdk/models/form_field_option.py index c5a5b667..c26efcd3 100644 --- a/rootly_sdk/models/form_field_option.py +++ b/rootly_sdk/models/form_field_option.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -18,9 +20,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 (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]): + 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): """ value: str @@ -28,9 +30,9 @@ class FormFieldOption: position: int created_at: str updated_at: str - id: Unset | str = UNSET - form_field_id: Unset | str = UNSET - default: Unset | bool = UNSET + id: str | Unset = UNSET + form_field_id: str | Unset = UNSET + default: bool | Unset = UNSET 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 0df3186c..ef456b54 100644 --- a/rootly_sdk/models/form_field_option_list.py +++ b/rootly_sdk/models/form_field_option_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class FormFieldOptionList: """ Attributes: - data (list['FormFieldOptionListDataItem']): + data (list[FormFieldOptionListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["FormFieldOptionListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[FormFieldOptionListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 581c2720..b37a530e 100644 --- a/rootly_sdk/models/form_field_option_list_data_item.py +++ b/rootly_sdk/models/form_field_option_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/form_field_option_list_data_item_type.py b/rootly_sdk/models/form_field_option_list_data_item_type.py index dd22866a..3c3d20c5 100644 --- a/rootly_sdk/models/form_field_option_list_data_item_type.py +++ b/rootly_sdk/models/form_field_option_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormFieldOptionListDataItemType = Literal["form_field_options"] @@ -11,5 +11,5 @@ def check_form_field_option_list_data_item_type(value: str | None) -> FormFieldO if value is None: return None if value in FORM_FIELD_OPTION_LIST_DATA_ITEM_TYPE_VALUES: - return cast(FormFieldOptionListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_OPTION_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/form_field_option_response.py b/rootly_sdk/models/form_field_option_response.py index 7693a9f7..c5b7d2c8 100644 --- a/rootly_sdk/models/form_field_option_response.py +++ b/rootly_sdk/models/form_field_option_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class FormFieldOptionResponse: """ Attributes: data (FormFieldOptionResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "FormFieldOptionResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: FormFieldOptionResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 0711113b..ab893054 100644 --- a/rootly_sdk/models/form_field_option_response_data.py +++ b/rootly_sdk/models/form_field_option_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/form_field_option_response_data_type.py b/rootly_sdk/models/form_field_option_response_data_type.py index 67bb3687..cedee1b2 100644 --- a/rootly_sdk/models/form_field_option_response_data_type.py +++ b/rootly_sdk/models/form_field_option_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormFieldOptionResponseDataType = Literal["form_field_options"] @@ -11,5 +11,5 @@ def check_form_field_option_response_data_type(value: str | None) -> FormFieldOp if value is None: return None if value in FORM_FIELD_OPTION_RESPONSE_DATA_TYPE_VALUES: - return cast(FormFieldOptionResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_OPTION_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/form_field_placement.py b/rootly_sdk/models/form_field_placement.py index 56b64baf..1c2e110f 100644 --- a/rootly_sdk/models/form_field_placement.py +++ b/rootly_sdk/models/form_field_placement.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -27,11 +29,11 @@ class FormFieldPlacement: 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 (Union[Unset, FormFieldPlacementRequiredOperator]): Logical operator when evaluating multiple + required_operator (FormFieldPlacementRequiredOperator | Unset): Logical operator when evaluating multiple form_field_placement_conditions with conditioned=required - 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. + 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. """ form_field_id: str @@ -39,9 +41,9 @@ class FormFieldPlacement: form: str position: int required: bool - required_operator: Unset | FormFieldPlacementRequiredOperator = UNSET - placement_operator: Unset | FormFieldPlacementPlacementOperator = UNSET - non_editable: Unset | bool = UNSET + required_operator: FormFieldPlacementRequiredOperator | Unset = UNSET + placement_operator: FormFieldPlacementPlacementOperator | Unset = UNSET + non_editable: bool | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -55,11 +57,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - required_operator: Unset | str = UNSET + required_operator: str | Unset = UNSET if not isinstance(self.required_operator, Unset): required_operator = self.required_operator - placement_operator: Unset | str = UNSET + placement_operator: str | Unset = UNSET if not isinstance(self.placement_operator, Unset): placement_operator = self.placement_operator @@ -99,14 +101,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: Unset | FormFieldPlacementRequiredOperator + required_operator: FormFieldPlacementRequiredOperator | Unset 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: Unset | FormFieldPlacementPlacementOperator + placement_operator: FormFieldPlacementPlacementOperator | Unset 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 304d4790..727f0372 100644 --- a/rootly_sdk/models/form_field_placement_condition.py +++ b/rootly_sdk/models/form_field_placement_condition.py @@ -1,3 +1,5 @@ +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_comparison.py b/rootly_sdk/models/form_field_placement_condition_comparison.py index 2c32f6cb..f88d344b 100644 --- a/rootly_sdk/models/form_field_placement_condition_comparison.py +++ b/rootly_sdk/models/form_field_placement_condition_comparison.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormFieldPlacementConditionComparison = Literal["equal", "is_not_set", "is_set", "not_equal"] @@ -14,5 +14,5 @@ def check_form_field_placement_condition_comparison(value: str | None) -> FormFi if value is None: return None if value in FORM_FIELD_PLACEMENT_CONDITION_COMPARISON_VALUES: - return cast(FormFieldPlacementConditionComparison, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_PLACEMENT_CONDITION_COMPARISON_VALUES!r}") diff --git a/rootly_sdk/models/form_field_placement_condition_conditioned.py b/rootly_sdk/models/form_field_placement_condition_conditioned.py index 9dbb0dbf..105c4d7d 100644 --- a/rootly_sdk/models/form_field_placement_condition_conditioned.py +++ b/rootly_sdk/models/form_field_placement_condition_conditioned.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormFieldPlacementConditionConditioned = Literal["placement", "required"] @@ -14,7 +14,7 @@ def check_form_field_placement_condition_conditioned( if value is None: return None if value in FORM_FIELD_PLACEMENT_CONDITION_CONDITIONED_VALUES: - return cast(FormFieldPlacementConditionConditioned, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {FORM_FIELD_PLACEMENT_CONDITION_CONDITIONED_VALUES!r}" ) diff --git a/rootly_sdk/models/form_field_placement_condition_list.py b/rootly_sdk/models/form_field_placement_condition_list.py index fc68a3af..992454f0 100644 --- a/rootly_sdk/models/form_field_placement_condition_list.py +++ b/rootly_sdk/models/form_field_placement_condition_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class FormFieldPlacementConditionList: """ Attributes: - data (list['FormFieldPlacementConditionListDataItem']): + data (list[FormFieldPlacementConditionListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["FormFieldPlacementConditionListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[FormFieldPlacementConditionListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 ce1f7db9..f86cdeb6 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/form_field_placement_condition_list_data_item_type.py b/rootly_sdk/models/form_field_placement_condition_list_data_item_type.py index 10c28345..8927386c 100644 --- a/rootly_sdk/models/form_field_placement_condition_list_data_item_type.py +++ b/rootly_sdk/models/form_field_placement_condition_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormFieldPlacementConditionListDataItemType = Literal["form_field_placement_conditions"] @@ -13,7 +13,7 @@ def check_form_field_placement_condition_list_data_item_type( if value is None: return None if value in FORM_FIELD_PLACEMENT_CONDITION_LIST_DATA_ITEM_TYPE_VALUES: - return cast(FormFieldPlacementConditionListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {FORM_FIELD_PLACEMENT_CONDITION_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/form_field_placement_condition_response.py b/rootly_sdk/models/form_field_placement_condition_response.py index f781783b..f635b722 100644 --- a/rootly_sdk/models/form_field_placement_condition_response.py +++ b/rootly_sdk/models/form_field_placement_condition_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class FormFieldPlacementConditionResponse: """ Attributes: data (FormFieldPlacementConditionResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "FormFieldPlacementConditionResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: FormFieldPlacementConditionResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 1ffe68e9..72b5df8e 100644 --- a/rootly_sdk/models/form_field_placement_condition_response_data.py +++ b/rootly_sdk/models/form_field_placement_condition_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/form_field_placement_condition_response_data_type.py b/rootly_sdk/models/form_field_placement_condition_response_data_type.py index a263eaed..c5849c2f 100644 --- a/rootly_sdk/models/form_field_placement_condition_response_data_type.py +++ b/rootly_sdk/models/form_field_placement_condition_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormFieldPlacementConditionResponseDataType = Literal["form_field_placement_conditions"] @@ -13,7 +13,7 @@ def check_form_field_placement_condition_response_data_type( if value is None: return None if value in FORM_FIELD_PLACEMENT_CONDITION_RESPONSE_DATA_TYPE_VALUES: - return cast(FormFieldPlacementConditionResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {FORM_FIELD_PLACEMENT_CONDITION_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/form_field_placement_list.py b/rootly_sdk/models/form_field_placement_list.py index 4a2d176b..a4fa1749 100644 --- a/rootly_sdk/models/form_field_placement_list.py +++ b/rootly_sdk/models/form_field_placement_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class FormFieldPlacementList: """ Attributes: - data (list['FormFieldPlacementListDataItem']): + data (list[FormFieldPlacementListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["FormFieldPlacementListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[FormFieldPlacementListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 d9bb45af..ffb31c2b 100644 --- a/rootly_sdk/models/form_field_placement_list_data_item.py +++ b/rootly_sdk/models/form_field_placement_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/form_field_placement_list_data_item_type.py b/rootly_sdk/models/form_field_placement_list_data_item_type.py index 1fb84215..fec9c783 100644 --- a/rootly_sdk/models/form_field_placement_list_data_item_type.py +++ b/rootly_sdk/models/form_field_placement_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormFieldPlacementListDataItemType = Literal["form_field_placements"] @@ -11,5 +11,5 @@ def check_form_field_placement_list_data_item_type(value: str | None) -> FormFie if value is None: return None if value in FORM_FIELD_PLACEMENT_LIST_DATA_ITEM_TYPE_VALUES: - return cast(FormFieldPlacementListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_PLACEMENT_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/form_field_placement_placement_operator.py b/rootly_sdk/models/form_field_placement_placement_operator.py index 76f782b6..d24f5a51 100644 --- a/rootly_sdk/models/form_field_placement_placement_operator.py +++ b/rootly_sdk/models/form_field_placement_placement_operator.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormFieldPlacementPlacementOperator = Literal["and", "or"] @@ -12,5 +12,5 @@ def check_form_field_placement_placement_operator(value: str | None) -> FormFiel if value is None: return None if value in FORM_FIELD_PLACEMENT_PLACEMENT_OPERATOR_VALUES: - return cast(FormFieldPlacementPlacementOperator, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_PLACEMENT_PLACEMENT_OPERATOR_VALUES!r}") diff --git a/rootly_sdk/models/form_field_placement_required_operator.py b/rootly_sdk/models/form_field_placement_required_operator.py index 5c94cda1..a1a0e61d 100644 --- a/rootly_sdk/models/form_field_placement_required_operator.py +++ b/rootly_sdk/models/form_field_placement_required_operator.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormFieldPlacementRequiredOperator = Literal["and", "or"] @@ -12,5 +12,5 @@ def check_form_field_placement_required_operator(value: str | None) -> FormField if value is None: return None if value in FORM_FIELD_PLACEMENT_REQUIRED_OPERATOR_VALUES: - return cast(FormFieldPlacementRequiredOperator, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_PLACEMENT_REQUIRED_OPERATOR_VALUES!r}") diff --git a/rootly_sdk/models/form_field_placement_response.py b/rootly_sdk/models/form_field_placement_response.py index 8181d071..c8659b34 100644 --- a/rootly_sdk/models/form_field_placement_response.py +++ b/rootly_sdk/models/form_field_placement_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class FormFieldPlacementResponse: """ Attributes: data (FormFieldPlacementResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "FormFieldPlacementResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: FormFieldPlacementResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 8e7330b2..20c0d20f 100644 --- a/rootly_sdk/models/form_field_placement_response_data.py +++ b/rootly_sdk/models/form_field_placement_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/form_field_placement_response_data_type.py b/rootly_sdk/models/form_field_placement_response_data_type.py index 9d564cd3..fd06ab2d 100644 --- a/rootly_sdk/models/form_field_placement_response_data_type.py +++ b/rootly_sdk/models/form_field_placement_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormFieldPlacementResponseDataType = Literal["form_field_placements"] @@ -11,5 +11,5 @@ def check_form_field_placement_response_data_type(value: str | None) -> FormFiel if value is None: return None if value in FORM_FIELD_PLACEMENT_RESPONSE_DATA_TYPE_VALUES: - return cast(FormFieldPlacementResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_PLACEMENT_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/form_field_position.py b/rootly_sdk/models/form_field_position.py index 4531afd2..88003c9f 100644 --- a/rootly_sdk/models/form_field_position.py +++ b/rootly_sdk/models/form_field_position.py @@ -1,3 +1,5 @@ +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 8e148b0f..7221a175 100644 --- a/rootly_sdk/models/form_field_position_form.py +++ b/rootly_sdk/models/form_field_position_form.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormFieldPositionForm = Literal[ "incident_post_mortem", @@ -53,5 +53,5 @@ def check_form_field_position_form(value: str | None) -> FormFieldPositionForm | if value is None: return None if value in FORM_FIELD_POSITION_FORM_VALUES: - return cast(FormFieldPositionForm, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_POSITION_FORM_VALUES!r}") diff --git a/rootly_sdk/models/form_field_position_list.py b/rootly_sdk/models/form_field_position_list.py index 2b2b0ecf..552544f7 100644 --- a/rootly_sdk/models/form_field_position_list.py +++ b/rootly_sdk/models/form_field_position_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class FormFieldPositionList: """ Attributes: - data (list['FormFieldPositionListDataItem']): + data (list[FormFieldPositionListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["FormFieldPositionListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[FormFieldPositionListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 9678c8c9..c68a3ba1 100644 --- a/rootly_sdk/models/form_field_position_list_data_item.py +++ b/rootly_sdk/models/form_field_position_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/form_field_position_list_data_item_type.py b/rootly_sdk/models/form_field_position_list_data_item_type.py index fa512160..17223298 100644 --- a/rootly_sdk/models/form_field_position_list_data_item_type.py +++ b/rootly_sdk/models/form_field_position_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormFieldPositionListDataItemType = Literal["form_field_positions"] @@ -11,5 +11,5 @@ def check_form_field_position_list_data_item_type(value: str | None) -> FormFiel if value is None: return None if value in FORM_FIELD_POSITION_LIST_DATA_ITEM_TYPE_VALUES: - return cast(FormFieldPositionListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_POSITION_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/form_field_position_response.py b/rootly_sdk/models/form_field_position_response.py index ae3d2a61..48caaca2 100644 --- a/rootly_sdk/models/form_field_position_response.py +++ b/rootly_sdk/models/form_field_position_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class FormFieldPositionResponse: """ Attributes: data (FormFieldPositionResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "FormFieldPositionResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: FormFieldPositionResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 6bb51c2d..35e52e1a 100644 --- a/rootly_sdk/models/form_field_position_response_data.py +++ b/rootly_sdk/models/form_field_position_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/form_field_position_response_data_type.py b/rootly_sdk/models/form_field_position_response_data_type.py index 3b43bde8..418f9a42 100644 --- a/rootly_sdk/models/form_field_position_response_data_type.py +++ b/rootly_sdk/models/form_field_position_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormFieldPositionResponseDataType = Literal["form_field_positions"] @@ -11,5 +11,5 @@ def check_form_field_position_response_data_type(value: str | None) -> FormField if value is None: return None if value in FORM_FIELD_POSITION_RESPONSE_DATA_TYPE_VALUES: - return cast(FormFieldPositionResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_POSITION_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/form_field_resource_type.py b/rootly_sdk/models/form_field_resource_type.py index 241d6b76..82698b38 100644 --- a/rootly_sdk/models/form_field_resource_type.py +++ b/rootly_sdk/models/form_field_resource_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormFieldResourceType = Literal["incident", "problem"] @@ -12,5 +12,5 @@ def check_form_field_resource_type(value: str | None) -> FormFieldResourceType | if value is None: return None if value in FORM_FIELD_RESOURCE_TYPE_VALUES: - return cast(FormFieldResourceType, value) + return 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 3bdf968b..f21cdb0b 100644 --- a/rootly_sdk/models/form_field_response.py +++ b/rootly_sdk/models/form_field_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class FormFieldResponse: """ Attributes: data (FormFieldResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "FormFieldResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: FormFieldResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 78ddd119..10089c15 100644 --- a/rootly_sdk/models/form_field_response_data.py +++ b/rootly_sdk/models/form_field_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/form_field_response_data_type.py b/rootly_sdk/models/form_field_response_data_type.py index 2c4521f9..d0ffc3f2 100644 --- a/rootly_sdk/models/form_field_response_data_type.py +++ b/rootly_sdk/models/form_field_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormFieldResponseDataType = Literal["form_fields"] @@ -11,5 +11,5 @@ def check_form_field_response_data_type(value: str | None) -> FormFieldResponseD if value is None: return None if value in FORM_FIELD_RESPONSE_DATA_TYPE_VALUES: - return cast(FormFieldResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/form_field_value_kind.py b/rootly_sdk/models/form_field_value_kind.py index 9c3cdcf1..c2581de3 100644 --- a/rootly_sdk/models/form_field_value_kind.py +++ b/rootly_sdk/models/form_field_value_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormFieldValueKind = Literal[ "catalog_entity", "cause", "environment", "functionality", "group", "incident_type", "inherit", "service", "user" @@ -21,5 +21,5 @@ def check_form_field_value_kind(value: str | None) -> FormFieldValueKind | None: if value is None: return None if value in FORM_FIELD_VALUE_KIND_VALUES: - return cast(FormFieldValueKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_FIELD_VALUE_KIND_VALUES!r}") diff --git a/rootly_sdk/models/form_set.py b/rootly_sdk/models/form_set.py index bfa1ffaa..4f1eb1b9 100644 --- a/rootly_sdk/models/form_set.py +++ b/rootly_sdk/models/form_set.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -25,7 +27,7 @@ class FormSet: `microsoft_teams_new_incident_form` created_at (str): Date of creation updated_at (str): Date of last update - slug (Union[Unset, str]): The slug of the form set + slug (str | Unset): The slug of the form set """ name: str @@ -33,7 +35,7 @@ class FormSet: forms: list[str] created_at: str updated_at: str - slug: Unset | str = UNSET + slug: str | Unset = UNSET 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 e7bc4fd2..571f0ed8 100644 --- a/rootly_sdk/models/form_set_condition.py +++ b/rootly_sdk/models/form_set_condition.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/form_set_condition_comparison.py b/rootly_sdk/models/form_set_condition_comparison.py index cfd7dfde..2d4a57c9 100644 --- a/rootly_sdk/models/form_set_condition_comparison.py +++ b/rootly_sdk/models/form_set_condition_comparison.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormSetConditionComparison = Literal["equal"] @@ -11,5 +11,5 @@ def check_form_set_condition_comparison(value: str | None) -> FormSetConditionCo if value is None: return None if value in FORM_SET_CONDITION_COMPARISON_VALUES: - return cast(FormSetConditionComparison, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_SET_CONDITION_COMPARISON_VALUES!r}") diff --git a/rootly_sdk/models/form_set_condition_list.py b/rootly_sdk/models/form_set_condition_list.py index 8d87b92e..ed48bf0d 100644 --- a/rootly_sdk/models/form_set_condition_list.py +++ b/rootly_sdk/models/form_set_condition_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class FormSetConditionList: """ Attributes: - data (list['FormSetConditionListDataItem']): + data (list[FormSetConditionListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["FormSetConditionListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[FormSetConditionListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 01a1392e..0525b725 100644 --- a/rootly_sdk/models/form_set_condition_list_data_item.py +++ b/rootly_sdk/models/form_set_condition_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/form_set_condition_list_data_item_type.py b/rootly_sdk/models/form_set_condition_list_data_item_type.py index 875ced8e..6b9c42aa 100644 --- a/rootly_sdk/models/form_set_condition_list_data_item_type.py +++ b/rootly_sdk/models/form_set_condition_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormSetConditionListDataItemType = Literal["form_set_conditions"] @@ -11,5 +11,5 @@ def check_form_set_condition_list_data_item_type(value: str | None) -> FormSetCo if value is None: return None if value in FORM_SET_CONDITION_LIST_DATA_ITEM_TYPE_VALUES: - return cast(FormSetConditionListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_SET_CONDITION_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/form_set_condition_response.py b/rootly_sdk/models/form_set_condition_response.py index 2534ba03..92e4b81b 100644 --- a/rootly_sdk/models/form_set_condition_response.py +++ b/rootly_sdk/models/form_set_condition_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class FormSetConditionResponse: """ Attributes: data (FormSetConditionResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "FormSetConditionResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: FormSetConditionResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 6e721c80..6e6a3a67 100644 --- a/rootly_sdk/models/form_set_condition_response_data.py +++ b/rootly_sdk/models/form_set_condition_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/form_set_condition_response_data_type.py b/rootly_sdk/models/form_set_condition_response_data_type.py index 443233c0..7a2b5112 100644 --- a/rootly_sdk/models/form_set_condition_response_data_type.py +++ b/rootly_sdk/models/form_set_condition_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormSetConditionResponseDataType = Literal["form_set_conditions"] @@ -11,5 +11,5 @@ def check_form_set_condition_response_data_type(value: str | None) -> FormSetCon if value is None: return None if value in FORM_SET_CONDITION_RESPONSE_DATA_TYPE_VALUES: - return cast(FormSetConditionResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_SET_CONDITION_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/form_set_list.py b/rootly_sdk/models/form_set_list.py index cd9fdf90..36eda94a 100644 --- a/rootly_sdk/models/form_set_list.py +++ b/rootly_sdk/models/form_set_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class FormSetList: """ Attributes: - data (list['FormSetListDataItem']): + data (list[FormSetListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["FormSetListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[FormSetListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 783ebe8c..24f0718c 100644 --- a/rootly_sdk/models/form_set_list_data_item.py +++ b/rootly_sdk/models/form_set_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/form_set_list_data_item_type.py b/rootly_sdk/models/form_set_list_data_item_type.py index c186795c..5bd873ab 100644 --- a/rootly_sdk/models/form_set_list_data_item_type.py +++ b/rootly_sdk/models/form_set_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormSetListDataItemType = Literal["form_sets"] @@ -11,5 +11,5 @@ def check_form_set_list_data_item_type(value: str | None) -> FormSetListDataItem if value is None: return None if value in FORM_SET_LIST_DATA_ITEM_TYPE_VALUES: - return cast(FormSetListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_SET_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/form_set_response.py b/rootly_sdk/models/form_set_response.py index 318e9a40..1b78d16f 100644 --- a/rootly_sdk/models/form_set_response.py +++ b/rootly_sdk/models/form_set_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class FormSetResponse: """ Attributes: data (FormSetResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "FormSetResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: FormSetResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 3e6f4e46..96ccef28 100644 --- a/rootly_sdk/models/form_set_response_data.py +++ b/rootly_sdk/models/form_set_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/form_set_response_data_type.py b/rootly_sdk/models/form_set_response_data_type.py index c7ee5782..7da756ff 100644 --- a/rootly_sdk/models/form_set_response_data_type.py +++ b/rootly_sdk/models/form_set_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FormSetResponseDataType = Literal["form_sets"] @@ -11,5 +11,5 @@ def check_form_set_response_data_type(value: str | None) -> FormSetResponseDataT if value is None: return None if value in FORM_SET_RESPONSE_DATA_TYPE_VALUES: - return cast(FormSetResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FORM_SET_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/functionality.py b/rootly_sdk/models/functionality.py index 3bb6db57..d590c944 100644 --- a/rootly_sdk/models/functionality.py +++ b/rootly_sdk/models/functionality.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -23,60 +25,60 @@ class Functionality: name (str): The name of the functionality created_at (str): Date of creation updated_at (str): Date of last update - slug (Union[Unset, str]): The slug of the functionality - managed_by (Union[Unset, FunctionalityManagedBy]): How this functionality is managed (provenance): web, api, + slug (str | Unset): The slug of the functionality + managed_by (FunctionalityManagedBy | Unset): How this functionality is managed (provenance): web, api, terraform, etc. Read-only. - 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: + description (None | str | Unset): The description of the functionality + public_description (None | str | Unset): The status page 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: :namespace/:kind/:entity_name - 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 + 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 functionality. """ name: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -88,23 +90,23 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - managed_by: Unset | str = UNSET + managed_by: str | Unset = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -113,61 +115,61 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - backstage_id: None | Unset | str + backstage_id: None | str | Unset if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | Unset | str + pagerduty_id: None | str | Unset if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | Unset | str + opsgenie_id: None | str | Unset if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | Unset | str + opsgenie_team_id: None | str | Unset if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: None | Unset | str + cortex_id: None | str | Unset if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | Unset | str + service_now_ci_sys_id: None | str | Unset 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: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - environment_ids: None | Unset | list[str] + environment_ids: list[str] | None | Unset if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -176,7 +178,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -185,7 +187,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: None | Unset | list[str] + owner_group_ids: list[str] | None | Unset if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -194,7 +196,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: None | Unset | list[int] + owner_user_ids: list[int] | None | Unset if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -203,13 +205,13 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - escalation_policy_id: None | Unset | str + escalation_policy_id: None | str | Unset if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - slack_channels: None | Unset | list[dict[str, Any]] + slack_channels: list[dict[str, Any]] | None | Unset if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -221,7 +223,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: None | Unset | list[dict[str, Any]] + slack_aliases: list[dict[str, Any]] | None | Unset if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -233,7 +235,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: None | Unset | list[dict[str, Any]] + properties: list[dict[str, Any]] | None | Unset if isinstance(self.properties, Unset): properties = UNSET elif isinstance(self.properties, list): @@ -317,31 +319,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: Unset | FunctionalityManagedBy + managed_by: FunctionalityManagedBy | Unset if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_functionality_managed_by(_managed_by) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -352,94 +354,94 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_backstage_id(data: object) -> None | Unset | str: + def _parse_backstage_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | Unset | str: + def _parse_pagerduty_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | Unset | str: + def _parse_opsgenie_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | Unset | str: + def _parse_opsgenie_team_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> None | Unset | str: + def _parse_cortex_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: + def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_environment_ids(data: object) -> None | Unset | list[str]: + def _parse_environment_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -450,13 +452,13 @@ def _parse_environment_ids(data: object) -> None | Unset | list[str]: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -467,13 +469,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: + def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -484,13 +486,13 @@ def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: owner_group_ids_type_0 = cast(list[str], data) return owner_group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: + def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -501,22 +503,22 @@ def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: owner_user_ids_type_0 = cast(list[int], data) return owner_user_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[int], data) + return cast(list[int] | None | Unset, data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_escalation_policy_id(data: object) -> None | Unset | str: + def _parse_escalation_policy_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) - def _parse_slack_channels(data: object) -> None | Unset | list["FunctionalitySlackChannelsType0Item"]: + def _parse_slack_channels(data: object) -> list[FunctionalitySlackChannelsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -534,13 +536,13 @@ def _parse_slack_channels(data: object) -> None | Unset | list["FunctionalitySla slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["FunctionalitySlackChannelsType0Item"], data) + return cast(list[FunctionalitySlackChannelsType0Item] | None | Unset, data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> None | Unset | list["FunctionalitySlackAliasesType0Item"]: + def _parse_slack_aliases(data: object) -> list[FunctionalitySlackAliasesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -558,13 +560,13 @@ def _parse_slack_aliases(data: object) -> None | Unset | list["FunctionalitySlac slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["FunctionalitySlackAliasesType0Item"], data) + return cast(list[FunctionalitySlackAliasesType0Item] | None | Unset, data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_properties(data: object) -> None | Unset | list["FunctionalityPropertiesType0Item"]: + def _parse_properties(data: object) -> list[FunctionalityPropertiesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -580,9 +582,9 @@ def _parse_properties(data: object) -> None | Unset | list["FunctionalityPropert properties_type_0.append(properties_type_0_item) return properties_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["FunctionalityPropertiesType0Item"], data) + return cast(list[FunctionalityPropertiesType0Item] | None | Unset, 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 7f3dfca7..553a0732 100644 --- a/rootly_sdk/models/functionality_list.py +++ b/rootly_sdk/models/functionality_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class FunctionalityList: """ Attributes: - data (list['FunctionalityListDataItem']): + data (list[FunctionalityListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["FunctionalityListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[FunctionalityListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 891c5842..62e6eee4 100644 --- a/rootly_sdk/models/functionality_list_data_item.py +++ b/rootly_sdk/models/functionality_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/functionality_list_data_item_type.py b/rootly_sdk/models/functionality_list_data_item_type.py index 8f4647dd..3e0457de 100644 --- a/rootly_sdk/models/functionality_list_data_item_type.py +++ b/rootly_sdk/models/functionality_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FunctionalityListDataItemType = Literal["functionalities"] @@ -11,5 +11,5 @@ def check_functionality_list_data_item_type(value: str | None) -> FunctionalityL if value is None: return None if value in FUNCTIONALITY_LIST_DATA_ITEM_TYPE_VALUES: - return cast(FunctionalityListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FUNCTIONALITY_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/functionality_managed_by.py b/rootly_sdk/models/functionality_managed_by.py index 09f413b5..238a9733 100644 --- a/rootly_sdk/models/functionality_managed_by.py +++ b/rootly_sdk/models/functionality_managed_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FunctionalityManagedBy = Literal["admin_web", "api", "backstage", "catalog_sync", "pulumi", "terraform", "web"] @@ -17,5 +17,5 @@ def check_functionality_managed_by(value: str | None) -> FunctionalityManagedBy if value is None: return None if value in FUNCTIONALITY_MANAGED_BY_VALUES: - return cast(FunctionalityManagedBy, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FUNCTIONALITY_MANAGED_BY_VALUES!r}") diff --git a/rootly_sdk/models/functionality_properties_type_0_item.py b/rootly_sdk/models/functionality_properties_type_0_item.py index bb12ff07..6bcb6048 100644 --- a/rootly_sdk/models/functionality_properties_type_0_item.py +++ b/rootly_sdk/models/functionality_properties_type_0_item.py @@ -1,3 +1,5 @@ +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 6cbeba67..5ae91631 100644 --- a/rootly_sdk/models/functionality_response.py +++ b/rootly_sdk/models/functionality_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class FunctionalityResponse: """ Attributes: data (FunctionalityResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "FunctionalityResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: FunctionalityResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 1248604a..21af7809 100644 --- a/rootly_sdk/models/functionality_response_data.py +++ b/rootly_sdk/models/functionality_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/functionality_response_data_type.py b/rootly_sdk/models/functionality_response_data_type.py index 1228725b..1e3f7508 100644 --- a/rootly_sdk/models/functionality_response_data_type.py +++ b/rootly_sdk/models/functionality_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal FunctionalityResponseDataType = Literal["functionalities"] @@ -11,5 +11,5 @@ def check_functionality_response_data_type(value: str | None) -> FunctionalityRe if value is None: return None if value in FUNCTIONALITY_RESPONSE_DATA_TYPE_VALUES: - return cast(FunctionalityResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {FUNCTIONALITY_RESPONSE_DATA_TYPE_VALUES!r}") 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 63a4d598..d9afc31f 100644 --- a/rootly_sdk/models/functionality_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/functionality_slack_aliases_type_0_item.py @@ -1,3 +1,5 @@ +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 50b4ae69..f2ee6b04 100644 --- a/rootly_sdk/models/functionality_slack_channels_type_0_item.py +++ b/rootly_sdk/models/functionality_slack_channels_type_0_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/generate_phone_number_live_call_router_country_code.py b/rootly_sdk/models/generate_phone_number_live_call_router_country_code.py index bfa44e1e..db4639df 100644 --- a/rootly_sdk/models/generate_phone_number_live_call_router_country_code.py +++ b/rootly_sdk/models/generate_phone_number_live_call_router_country_code.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GeneratePhoneNumberLiveCallRouterCountryCode = Literal["AU", "CA", "CH", "DE", "GB", "NL", "NZ", "SE", "US"] @@ -21,7 +21,7 @@ def check_generate_phone_number_live_call_router_country_code( if value is None: return None if value in GENERATE_PHONE_NUMBER_LIVE_CALL_ROUTER_COUNTRY_CODE_VALUES: - return cast(GeneratePhoneNumberLiveCallRouterCountryCode, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {GENERATE_PHONE_NUMBER_LIVE_CALL_ROUTER_COUNTRY_CODE_VALUES!r}" ) diff --git a/rootly_sdk/models/generate_phone_number_live_call_router_phone_type.py b/rootly_sdk/models/generate_phone_number_live_call_router_phone_type.py index 9effeb49..238f0399 100644 --- a/rootly_sdk/models/generate_phone_number_live_call_router_phone_type.py +++ b/rootly_sdk/models/generate_phone_number_live_call_router_phone_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GeneratePhoneNumberLiveCallRouterPhoneType = Literal["local", "mobile", "toll_free"] @@ -15,7 +15,7 @@ def check_generate_phone_number_live_call_router_phone_type( if value is None: return None if value in GENERATE_PHONE_NUMBER_LIVE_CALL_ROUTER_PHONE_TYPE_VALUES: - return cast(GeneratePhoneNumberLiveCallRouterPhoneType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {GENERATE_PHONE_NUMBER_LIVE_CALL_ROUTER_PHONE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/get_alert_include.py b/rootly_sdk/models/get_alert_include.py index 5ac6ff9d..7da60e76 100644 --- a/rootly_sdk/models/get_alert_include.py +++ b/rootly_sdk/models/get_alert_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetAlertInclude = Literal[ "alert_call_recording", @@ -47,5 +47,5 @@ def check_get_alert_include(value: str | None) -> GetAlertInclude | None: if value is None: return None if value in GET_ALERT_INCLUDE_VALUES: - return cast(GetAlertInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_ALERT_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/get_alerts_task_params.py b/rootly_sdk/models/get_alerts_task_params.py index 22f9f5da..aa334970 100644 --- a/rootly_sdk/models/get_alerts_task_params.py +++ b/rootly_sdk/models/get_alerts_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,52 +26,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 (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 + 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 """ past_duration: str - 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 + 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 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - service_ids: Unset | list[str] = UNSET + service_ids: list[str] | Unset = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - environment_ids: Unset | list[str] = UNSET + environment_ids: list[str] | Unset = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - labels: Unset | list[str] = UNSET + labels: list[str] | Unset = UNSET if not isinstance(self.labels, Unset): labels = self.labels - sources: Unset | list[str] = UNSET + sources: list[str] | Unset = UNSET if not isinstance(self.sources, Unset): sources = self.sources @@ -79,14 +81,14 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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: Unset | dict[str, Any] = UNSET + parent_message_thread_task: dict[str, Any] | Unset = UNSET if not isinstance(self.parent_message_thread_task, Unset): parent_message_thread_task = self.parent_message_thread_task.to_dict() @@ -133,7 +135,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: Unset | GetAlertsTaskParamsTaskType + task_type: GetAlertsTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -153,17 +155,19 @@ 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) - 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: 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 + ) - 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: Unset | GetAlertsTaskParamsParentMessageThreadTask + parent_message_thread_task: GetAlertsTaskParamsParentMessageThreadTask | Unset 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 9b7c21dc..1f009e1e 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,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 (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 cf579af1..e4d3b93b 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class GetAlertsTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/get_alerts_task_params_task_type.py index 559693de..d7880cb7 100644 --- a/rootly_sdk/models/get_alerts_task_params_task_type.py +++ b/rootly_sdk/models/get_alerts_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetAlertsTaskParamsTaskType = Literal["get_alerts"] @@ -11,5 +11,5 @@ def check_get_alerts_task_params_task_type(value: str | None) -> GetAlertsTaskPa if value is None: return None if value in GET_ALERTS_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(GetAlertsTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_ALERTS_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/get_catalog_entity_include.py b/rootly_sdk/models/get_catalog_entity_include.py index fbb62724..6b19086a 100644 --- a/rootly_sdk/models/get_catalog_entity_include.py +++ b/rootly_sdk/models/get_catalog_entity_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetCatalogEntityInclude = Literal["catalog", "properties"] @@ -12,5 +12,5 @@ def check_get_catalog_entity_include(value: str | None) -> GetCatalogEntityInclu if value is None: return None if value in GET_CATALOG_ENTITY_INCLUDE_VALUES: - return cast(GetCatalogEntityInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_CATALOG_ENTITY_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/get_catalog_entity_property_include.py b/rootly_sdk/models/get_catalog_entity_property_include.py index a6ef3e78..eb828713 100644 --- a/rootly_sdk/models/get_catalog_entity_property_include.py +++ b/rootly_sdk/models/get_catalog_entity_property_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetCatalogEntityPropertyInclude = Literal["catalog_entity", "catalog_field"] @@ -12,5 +12,5 @@ def check_get_catalog_entity_property_include(value: str | None) -> GetCatalogEn if value is None: return None if value in GET_CATALOG_ENTITY_PROPERTY_INCLUDE_VALUES: - return cast(GetCatalogEntityPropertyInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_CATALOG_ENTITY_PROPERTY_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/get_custom_field_include.py b/rootly_sdk/models/get_custom_field_include.py index c0269664..4511e326 100644 --- a/rootly_sdk/models/get_custom_field_include.py +++ b/rootly_sdk/models/get_custom_field_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetCustomFieldInclude = Literal["options"] @@ -11,5 +11,5 @@ def check_get_custom_field_include(value: str | None) -> GetCustomFieldInclude | if value is None: return None if value in GET_CUSTOM_FIELD_INCLUDE_VALUES: - return cast(GetCustomFieldInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_CUSTOM_FIELD_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/get_dashboard_include.py b/rootly_sdk/models/get_dashboard_include.py index 9c657276..a34ed3dc 100644 --- a/rootly_sdk/models/get_dashboard_include.py +++ b/rootly_sdk/models/get_dashboard_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetDashboardInclude = Literal["panels"] @@ -11,5 +11,5 @@ def check_get_dashboard_include(value: str | None) -> GetDashboardInclude | None if value is None: return None if value in GET_DASHBOARD_INCLUDE_VALUES: - return cast(GetDashboardInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_DASHBOARD_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/get_escalation_path_include.py b/rootly_sdk/models/get_escalation_path_include.py index 620b2956..414b245b 100644 --- a/rootly_sdk/models/get_escalation_path_include.py +++ b/rootly_sdk/models/get_escalation_path_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetEscalationPathInclude = Literal["escalation_policy_levels"] @@ -11,5 +11,5 @@ def check_get_escalation_path_include(value: str | None) -> GetEscalationPathInc if value is None: return None if value in GET_ESCALATION_PATH_INCLUDE_VALUES: - return cast(GetEscalationPathInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_ESCALATION_PATH_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/get_escalation_policy_include.py b/rootly_sdk/models/get_escalation_policy_include.py index 34d8571b..27273681 100644 --- a/rootly_sdk/models/get_escalation_policy_include.py +++ b/rootly_sdk/models/get_escalation_policy_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetEscalationPolicyInclude = Literal["escalation_policy_levels", "escalation_policy_paths", "groups", "services"] @@ -14,5 +14,5 @@ def check_get_escalation_policy_include(value: str | None) -> GetEscalationPolic if value is None: return None if value in GET_ESCALATION_POLICY_INCLUDE_VALUES: - return cast(GetEscalationPolicyInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_ESCALATION_POLICY_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/get_form_field_include.py b/rootly_sdk/models/get_form_field_include.py index fe391082..03b83eaf 100644 --- a/rootly_sdk/models/get_form_field_include.py +++ b/rootly_sdk/models/get_form_field_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetFormFieldInclude = Literal["options", "positions"] @@ -12,5 +12,5 @@ def check_get_form_field_include(value: str | None) -> GetFormFieldInclude | Non if value is None: return None if value in GET_FORM_FIELD_INCLUDE_VALUES: - return cast(GetFormFieldInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_FORM_FIELD_INCLUDE_VALUES!r}") 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 30772304..06c5ef0e 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,3 +1,5 @@ +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 8d483d51..76dedc3e 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,3 +1,5 @@ +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 8063d061..b4ead582 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,3 +1,5 @@ +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 842037ca..dac35eb7 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast diff --git a/rootly_sdk/models/get_incident_include.py b/rootly_sdk/models/get_incident_include.py index a481a240..4b1d8e0e 100644 --- a/rootly_sdk/models/get_incident_include.py +++ b/rootly_sdk/models/get_incident_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetIncidentInclude = Literal[ "action_items", @@ -43,5 +43,5 @@ def check_get_incident_include(value: str | None) -> GetIncidentInclude | None: if value is None: return None if value in GET_INCIDENT_INCLUDE_VALUES: - return cast(GetIncidentInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_INCIDENT_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/get_incident_sub_status_include.py b/rootly_sdk/models/get_incident_sub_status_include.py index 3ae7b802..f184de87 100644 --- a/rootly_sdk/models/get_incident_sub_status_include.py +++ b/rootly_sdk/models/get_incident_sub_status_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetIncidentSubStatusInclude = Literal["assigned_by_user", "sub_status"] @@ -12,5 +12,5 @@ def check_get_incident_sub_status_include(value: str | None) -> GetIncidentSubSt if value is None: return None if value in GET_INCIDENT_SUB_STATUS_INCLUDE_VALUES: - return cast(GetIncidentSubStatusInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_INCIDENT_SUB_STATUS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/get_meeting_recording_include.py b/rootly_sdk/models/get_meeting_recording_include.py index 4f766051..06f86c00 100644 --- a/rootly_sdk/models/get_meeting_recording_include.py +++ b/rootly_sdk/models/get_meeting_recording_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetMeetingRecordingInclude = Literal["transcript"] @@ -11,5 +11,5 @@ def check_get_meeting_recording_include(value: str | None) -> GetMeetingRecordin if value is None: return None if value in GET_MEETING_RECORDING_INCLUDE_VALUES: - return cast(GetMeetingRecordingInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_MEETING_RECORDING_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/get_playbook_include.py b/rootly_sdk/models/get_playbook_include.py index 3a6cd00f..228e3a15 100644 --- a/rootly_sdk/models/get_playbook_include.py +++ b/rootly_sdk/models/get_playbook_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetPlaybookInclude = Literal[ "causes", "environments", "functionalities", "groups", "incident_types", "services", "severities" @@ -19,5 +19,5 @@ def check_get_playbook_include(value: str | None) -> GetPlaybookInclude | None: if value is None: return None if value in GET_PLAYBOOK_INCLUDE_VALUES: - return cast(GetPlaybookInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_PLAYBOOK_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/get_pulses_task_params.py b/rootly_sdk/models/get_pulses_task_params.py index 7db72bae..47ac664c 100644 --- a/rootly_sdk/models/get_pulses_task_params.py +++ b/rootly_sdk/models/get_pulses_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,58 +26,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 (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 + 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 """ past_duration: str - 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 + 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 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - service_ids: Unset | list[str] = UNSET + service_ids: list[str] | Unset = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - environment_ids: Unset | list[str] = UNSET + environment_ids: list[str] | Unset = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - labels: Unset | list[str] = UNSET + labels: list[str] | Unset = UNSET if not isinstance(self.labels, Unset): labels = self.labels - refs: Unset | list[str] = UNSET + refs: list[str] | Unset = UNSET if not isinstance(self.refs, Unset): refs = self.refs - sources: Unset | list[str] = UNSET + sources: list[str] | Unset = UNSET if not isinstance(self.sources, Unset): sources = self.sources @@ -85,14 +87,14 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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: Unset | dict[str, Any] = UNSET + parent_message_thread_task: dict[str, Any] | Unset = UNSET if not isinstance(self.parent_message_thread_task, Unset): parent_message_thread_task = self.parent_message_thread_task.to_dict() @@ -141,7 +143,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: Unset | GetPulsesTaskParamsTaskType + task_type: GetPulsesTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -163,17 +165,19 @@ 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) - 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: 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 + ) - 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: Unset | GetPulsesTaskParamsParentMessageThreadTask + parent_message_thread_task: GetPulsesTaskParamsParentMessageThreadTask | Unset 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 09881017..217e26b1 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,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 (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 17ab4fa8..022888dc 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class GetPulsesTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/get_pulses_task_params_task_type.py index e968d963..c8e08498 100644 --- a/rootly_sdk/models/get_pulses_task_params_task_type.py +++ b/rootly_sdk/models/get_pulses_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetPulsesTaskParamsTaskType = Literal["get_pulses"] @@ -11,5 +11,5 @@ def check_get_pulses_task_params_task_type(value: str | None) -> GetPulsesTaskPa if value is None: return None if value in GET_PULSES_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(GetPulsesTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_PULSES_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/get_retrospective_configuration_include.py b/rootly_sdk/models/get_retrospective_configuration_include.py index b5747909..632c2643 100644 --- a/rootly_sdk/models/get_retrospective_configuration_include.py +++ b/rootly_sdk/models/get_retrospective_configuration_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetRetrospectiveConfigurationInclude = Literal["groups", "incident_types", "severities"] @@ -13,5 +13,5 @@ def check_get_retrospective_configuration_include(value: str | None) -> GetRetro if value is None: return None if value in GET_RETROSPECTIVE_CONFIGURATION_INCLUDE_VALUES: - return cast(GetRetrospectiveConfigurationInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_RETROSPECTIVE_CONFIGURATION_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/get_retrospective_process_group_include.py b/rootly_sdk/models/get_retrospective_process_group_include.py index 10c03794..5ca5ffef 100644 --- a/rootly_sdk/models/get_retrospective_process_group_include.py +++ b/rootly_sdk/models/get_retrospective_process_group_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetRetrospectiveProcessGroupInclude = Literal["retrospective_process_group_steps"] @@ -11,5 +11,5 @@ def check_get_retrospective_process_group_include(value: str | None) -> GetRetro if value is None: return None if value in GET_RETROSPECTIVE_PROCESS_GROUP_INCLUDE_VALUES: - return cast(GetRetrospectiveProcessGroupInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_RETROSPECTIVE_PROCESS_GROUP_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/get_retrospective_process_include.py b/rootly_sdk/models/get_retrospective_process_include.py index 66a2f6cc..b6b10e49 100644 --- a/rootly_sdk/models/get_retrospective_process_include.py +++ b/rootly_sdk/models/get_retrospective_process_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetRetrospectiveProcessInclude = Literal["groups", "incident_types", "retrospective_steps", "severities"] @@ -14,5 +14,5 @@ def check_get_retrospective_process_include(value: str | None) -> GetRetrospecti if value is None: return None if value in GET_RETROSPECTIVE_PROCESS_INCLUDE_VALUES: - return cast(GetRetrospectiveProcessInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_RETROSPECTIVE_PROCESS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/get_team_include.py b/rootly_sdk/models/get_team_include.py index b59ae417..7781e7c6 100644 --- a/rootly_sdk/models/get_team_include.py +++ b/rootly_sdk/models/get_team_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetTeamInclude = Literal["escalation_policies", "schedules", "users"] @@ -13,5 +13,5 @@ def check_get_team_include(value: str | None) -> GetTeamInclude | None: if value is None: return None if value in GET_TEAM_INCLUDE_VALUES: - return cast(GetTeamInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_TEAM_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/get_user_include.py b/rootly_sdk/models/get_user_include.py index c2dc5173..f98eab5f 100644 --- a/rootly_sdk/models/get_user_include.py +++ b/rootly_sdk/models/get_user_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetUserInclude = Literal[ "devices", "email_addresses", "notification_rules", "on_call_role", "phone_numbers", "role", "schedules", "teams" @@ -20,5 +20,5 @@ def check_get_user_include(value: str | None) -> GetUserInclude | None: if value is None: return None if value in GET_USER_INCLUDE_VALUES: - return cast(GetUserInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_USER_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/get_workflow_include.py b/rootly_sdk/models/get_workflow_include.py index 5555ef7e..ec37d20d 100644 --- a/rootly_sdk/models/get_workflow_include.py +++ b/rootly_sdk/models/get_workflow_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal GetWorkflowInclude = Literal["alert_field_conditions", "form_field_conditions", "genius_tasks", "genius_workflow_runs"] @@ -14,5 +14,5 @@ def check_get_workflow_include(value: str | None) -> GetWorkflowInclude | None: if value is None: return None if value in GET_WORKFLOW_INCLUDE_VALUES: - return cast(GetWorkflowInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {GET_WORKFLOW_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/heartbeat.py b/rootly_sdk/models/heartbeat.py index 3a8716a8..80167725 100644 --- a/rootly_sdk/models/heartbeat.py +++ b/rootly_sdk/models/heartbeat.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -31,15 +33,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 (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. + 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): Last persisted heartbeat ping timestamp. Accepted pings may be coalesced + for up to 30 seconds. + expires_at (None | str | Unset): Persisted expiry deadline, including up to 30 seconds of coalescing grace. """ name: str @@ -53,14 +55,14 @@ class Heartbeat: email_address: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -86,47 +88,47 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - alert_description: None | Unset | str + alert_description: None | str | Unset if isinstance(self.alert_description, Unset): alert_description = UNSET else: alert_description = self.alert_description - alert_urgency_id: None | Unset | str + alert_urgency_id: None | str | Unset if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - owner_group_ids: Unset | list[str] = UNSET + owner_group_ids: list[str] | Unset = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - ping_url: None | Unset | str + ping_url: None | str | Unset if isinstance(self.ping_url, Unset): ping_url = UNSET else: ping_url = self.ping_url - secret: None | Unset | str + secret: None | str | Unset if isinstance(self.secret, Unset): secret = UNSET else: secret = self.secret - last_pinged_at: None | Unset | str + last_pinged_at: None | str | Unset if isinstance(self.last_pinged_at, Unset): last_pinged_at = UNSET else: last_pinged_at = self.last_pinged_at - expires_at: None | Unset | str + expires_at: None | str | Unset if isinstance(self.expires_at, Unset): expires_at = UNSET else: @@ -193,68 +195,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_alert_description(data: object) -> None | Unset | str: + def _parse_alert_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) alert_description = _parse_alert_description(d.pop("alert_description", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | Unset | str: + def _parse_alert_urgency_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_ping_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) ping_url = _parse_ping_url(d.pop("ping_url", UNSET)) - def _parse_secret(data: object) -> None | Unset | str: + def _parse_secret(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) secret = _parse_secret(d.pop("secret", UNSET)) - def _parse_last_pinged_at(data: object) -> None | Unset | str: + def _parse_last_pinged_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) last_pinged_at = _parse_last_pinged_at(d.pop("last_pinged_at", UNSET)) - def _parse_expires_at(data: object) -> None | Unset | str: + def _parse_expires_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) diff --git a/rootly_sdk/models/heartbeat_interval_unit.py b/rootly_sdk/models/heartbeat_interval_unit.py index 80237df4..3531c14b 100644 --- a/rootly_sdk/models/heartbeat_interval_unit.py +++ b/rootly_sdk/models/heartbeat_interval_unit.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal HeartbeatIntervalUnit = Literal["days", "hours", "minutes"] @@ -13,5 +13,5 @@ def check_heartbeat_interval_unit(value: str | None) -> HeartbeatIntervalUnit | if value is None: return None if value in HEARTBEAT_INTERVAL_UNIT_VALUES: - return cast(HeartbeatIntervalUnit, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {HEARTBEAT_INTERVAL_UNIT_VALUES!r}") diff --git a/rootly_sdk/models/heartbeat_list.py b/rootly_sdk/models/heartbeat_list.py index 85d81821..7574c7f7 100644 --- a/rootly_sdk/models/heartbeat_list.py +++ b/rootly_sdk/models/heartbeat_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class HeartbeatList: """ Attributes: - data (list['HeartbeatListDataItem']): + data (list[HeartbeatListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["HeartbeatListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[HeartbeatListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 dbcb529f..7de52115 100644 --- a/rootly_sdk/models/heartbeat_list_data_item.py +++ b/rootly_sdk/models/heartbeat_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/heartbeat_list_data_item_type.py b/rootly_sdk/models/heartbeat_list_data_item_type.py index 593f5f2d..f7cb58e4 100644 --- a/rootly_sdk/models/heartbeat_list_data_item_type.py +++ b/rootly_sdk/models/heartbeat_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal HeartbeatListDataItemType = Literal["heartbeats"] @@ -11,5 +11,5 @@ def check_heartbeat_list_data_item_type(value: str | None) -> HeartbeatListDataI if value is None: return None if value in HEARTBEAT_LIST_DATA_ITEM_TYPE_VALUES: - return cast(HeartbeatListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {HEARTBEAT_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/heartbeat_notification_target_type.py b/rootly_sdk/models/heartbeat_notification_target_type.py index 75ee0bca..2084e760 100644 --- a/rootly_sdk/models/heartbeat_notification_target_type.py +++ b/rootly_sdk/models/heartbeat_notification_target_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal HeartbeatNotificationTargetType = Literal["EscalationPolicy", "Functionality", "Group", "Service", "User"] @@ -15,5 +15,5 @@ def check_heartbeat_notification_target_type(value: str | None) -> HeartbeatNoti if value is None: return None if value in HEARTBEAT_NOTIFICATION_TARGET_TYPE_VALUES: - return cast(HeartbeatNotificationTargetType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {HEARTBEAT_NOTIFICATION_TARGET_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/heartbeat_response.py b/rootly_sdk/models/heartbeat_response.py index f914eac7..77d929aa 100644 --- a/rootly_sdk/models/heartbeat_response.py +++ b/rootly_sdk/models/heartbeat_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class HeartbeatResponse: """ Attributes: data (HeartbeatResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "HeartbeatResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: HeartbeatResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 a8cdd593..d680b42f 100644 --- a/rootly_sdk/models/heartbeat_response_data.py +++ b/rootly_sdk/models/heartbeat_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/heartbeat_response_data_type.py b/rootly_sdk/models/heartbeat_response_data_type.py index c1a4418a..db5a9c49 100644 --- a/rootly_sdk/models/heartbeat_response_data_type.py +++ b/rootly_sdk/models/heartbeat_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal HeartbeatResponseDataType = Literal["heartbeats"] @@ -11,5 +11,5 @@ def check_heartbeat_response_data_type(value: str | None) -> HeartbeatResponseDa if value is None: return None if value in HEARTBEAT_RESPONSE_DATA_TYPE_VALUES: - return cast(HeartbeatResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {HEARTBEAT_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/heartbeat_status.py b/rootly_sdk/models/heartbeat_status.py index 0581e2bd..3143392d 100644 --- a/rootly_sdk/models/heartbeat_status.py +++ b/rootly_sdk/models/heartbeat_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal HeartbeatStatus = Literal["active", "expired", "waiting"] @@ -13,5 +13,5 @@ def check_heartbeat_status(value: str | None) -> HeartbeatStatus | None: if value is None: return None if value in HEARTBEAT_STATUS_VALUES: - return cast(HeartbeatStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {HEARTBEAT_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/http_client_task_params.py b/rootly_sdk/models/http_client_task_params.py index 6ed518b8..805b80f9 100644 --- a/rootly_sdk/models/http_client_task_params.py +++ b/rootly_sdk/models/http_client_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -12,6 +14,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.http_client_task_params_expected_response_headers import HttpClientTaskParamsExpectedResponseHeaders from ..models.http_client_task_params_post_to_slack_channels_item import HttpClientTaskParamsPostToSlackChannelsItem @@ -25,34 +28,41 @@ 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 (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. + 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. + expected_response_headers (HttpClientTaskParamsExpectedResponseHeaders | Unset): Map of valid HTTP header names + to regexp patterns. Header names must use HTTP token characters. Task fails if any header value does not match + its pattern (case-insensitive). Leave empty to skip validation. + follow_redirects (bool | Unset): Whether to follow HTTP 3xx redirects. Defaults to true. Set to false to treat + redirect responses as-is. Default: True. """ url: str succeed_on_status: str - 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 + 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 + expected_response_headers: HttpClientTaskParamsExpectedResponseHeaders | Unset = UNSET + follow_redirects: bool | Unset = True additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -60,7 +70,7 @@ def to_dict(self) -> dict[str, Any]: succeed_on_status = self.succeed_on_status - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -74,13 +84,13 @@ def to_dict(self) -> dict[str, Any]: event_message = self.event_message - method: Unset | str = UNSET + method: str | Unset = UNSET if not isinstance(self.method, Unset): method = self.method post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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,6 +101,12 @@ def to_dict(self) -> dict[str, Any]: retry_wait_time = self.retry_wait_time + expected_response_headers: dict[str, Any] | Unset = UNSET + if not isinstance(self.expected_response_headers, Unset): + expected_response_headers = self.expected_response_headers.to_dict() + + follow_redirects = self.follow_redirects + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -121,11 +137,18 @@ def to_dict(self) -> dict[str, Any]: field_dict["retry_count"] = retry_count if retry_wait_time is not UNSET: field_dict["retry_wait_time"] = retry_wait_time + if expected_response_headers is not UNSET: + field_dict["expected_response_headers"] = expected_response_headers + if follow_redirects is not UNSET: + field_dict["follow_redirects"] = follow_redirects return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.http_client_task_params_expected_response_headers import ( + HttpClientTaskParamsExpectedResponseHeaders, + ) from ..models.http_client_task_params_post_to_slack_channels_item import ( HttpClientTaskParamsPostToSlackChannelsItem, ) @@ -136,7 +159,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: Unset | HttpClientTaskParamsTaskType + task_type: HttpClientTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -153,7 +176,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: Unset | HttpClientTaskParamsMethod + method: HttpClientTaskParamsMethod | Unset if isinstance(_method, Unset): method = UNSET else: @@ -161,19 +184,32 @@ 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) - 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: 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 + ) - 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) retry_wait_time = d.pop("retry_wait_time", UNSET) + _expected_response_headers = d.pop("expected_response_headers", UNSET) + expected_response_headers: HttpClientTaskParamsExpectedResponseHeaders | Unset + if isinstance(_expected_response_headers, Unset): + expected_response_headers = UNSET + else: + expected_response_headers = HttpClientTaskParamsExpectedResponseHeaders.from_dict( + _expected_response_headers + ) + + follow_redirects = d.pop("follow_redirects", UNSET) + http_client_task_params = cls( url=url, succeed_on_status=succeed_on_status, @@ -188,6 +224,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: post_to_slack_channels=post_to_slack_channels, retry_count=retry_count, retry_wait_time=retry_wait_time, + expected_response_headers=expected_response_headers, + follow_redirects=follow_redirects, ) http_client_task_params.additional_properties = d diff --git a/rootly_sdk/models/http_client_task_params_expected_response_headers.py b/rootly_sdk/models/http_client_task_params_expected_response_headers.py new file mode 100644 index 00000000..7291a56c --- /dev/null +++ b/rootly_sdk/models/http_client_task_params_expected_response_headers.py @@ -0,0 +1,50 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="HttpClientTaskParamsExpectedResponseHeaders") + + +@_attrs_define +class HttpClientTaskParamsExpectedResponseHeaders: + """Map of valid HTTP header names to regexp patterns. Header names must use HTTP token characters. Task fails if any + header value does not match its pattern (case-insensitive). Leave empty to skip validation. + + """ + + 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) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + http_client_task_params_expected_response_headers = cls() + + http_client_task_params_expected_response_headers.additional_properties = d + return http_client_task_params_expected_response_headers + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> str: + return self.additional_properties[key] + + def __setitem__(self, key: str, value: str) -> 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/http_client_task_params_method.py b/rootly_sdk/models/http_client_task_params_method.py index d3193567..ec6b9b73 100644 --- a/rootly_sdk/models/http_client_task_params_method.py +++ b/rootly_sdk/models/http_client_task_params_method.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal HttpClientTaskParamsMethod = Literal["DELETE", "GET", "OPTIONS", "PATCH", "POST", "PUT"] @@ -16,5 +16,5 @@ def check_http_client_task_params_method(value: str | None) -> HttpClientTaskPar if value is None: return None if value in HTTP_CLIENT_TASK_PARAMS_METHOD_VALUES: - return cast(HttpClientTaskParamsMethod, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {HTTP_CLIENT_TASK_PARAMS_METHOD_VALUES!r}") 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 619d65ed..642bc030 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class HttpClientTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/http_client_task_params_task_type.py b/rootly_sdk/models/http_client_task_params_task_type.py index 867892e9..e9ad7c28 100644 --- a/rootly_sdk/models/http_client_task_params_task_type.py +++ b/rootly_sdk/models/http_client_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal HttpClientTaskParamsTaskType = Literal["http_client"] @@ -11,5 +11,5 @@ def check_http_client_task_params_task_type(value: str | None) -> HttpClientTask if value is None: return None if value in HTTP_CLIENT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(HttpClientTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {HTTP_CLIENT_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/import_meeting_recording.py b/rootly_sdk/models/import_meeting_recording.py index 9b3c6214..accbf2b5 100644 --- a/rootly_sdk/models/import_meeting_recording.py +++ b/rootly_sdk/models/import_meeting_recording.py @@ -1,3 +1,5 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -5,7 +7,6 @@ from attrs import define as _attrs_define from attrs import field as _attrs_field -from dateutil.parser import isoparse from ..models.import_meeting_recording_platform import ( ImportMeetingRecordingPlatform, @@ -24,17 +25,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 (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 + 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 """ source: ImportMeetingRecordingSource recall_recording_id: UUID platform: ImportMeetingRecordingPlatform - started_at: None | Unset | datetime.datetime = UNSET - ended_at: None | Unset | datetime.datetime = UNSET - meeting_url: None | Unset | str = UNSET + started_at: datetime.datetime | None | Unset = UNSET + ended_at: datetime.datetime | None | Unset = UNSET + meeting_url: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +45,7 @@ def to_dict(self) -> dict[str, Any]: platform: str = self.platform - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -52,7 +53,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | Unset | str + ended_at: None | str | Unset if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -60,7 +61,7 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - meeting_url: None | Unset | str + meeting_url: None | str | Unset if isinstance(self.meeting_url, Unset): meeting_url = UNSET else: @@ -93,7 +94,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) -> None | Unset | datetime.datetime: + def _parse_started_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -101,16 +102,16 @@ def _parse_started_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - started_at_type_0 = isoparse(data) + started_at_type_0 = datetime.datetime.fromisoformat(data) return started_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: + def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -118,21 +119,21 @@ def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - ended_at_type_0 = isoparse(data) + ended_at_type_0 = datetime.datetime.fromisoformat(data) return ended_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_meeting_url(data: object) -> None | Unset | str: + def _parse_meeting_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) meeting_url = _parse_meeting_url(d.pop("meeting_url", UNSET)) diff --git a/rootly_sdk/models/import_meeting_recording_platform.py b/rootly_sdk/models/import_meeting_recording_platform.py index 384fa62c..d7335656 100644 --- a/rootly_sdk/models/import_meeting_recording_platform.py +++ b/rootly_sdk/models/import_meeting_recording_platform.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ImportMeetingRecordingPlatform = Literal["google_meet", "microsoft_teams", "webex", "zoom"] @@ -14,5 +14,5 @@ def check_import_meeting_recording_platform(value: str | None) -> ImportMeetingR if value is None: return None if value in IMPORT_MEETING_RECORDING_PLATFORM_VALUES: - return cast(ImportMeetingRecordingPlatform, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {IMPORT_MEETING_RECORDING_PLATFORM_VALUES!r}") diff --git a/rootly_sdk/models/import_meeting_recording_source.py b/rootly_sdk/models/import_meeting_recording_source.py index 809dea7a..07e5fcd7 100644 --- a/rootly_sdk/models/import_meeting_recording_source.py +++ b/rootly_sdk/models/import_meeting_recording_source.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ImportMeetingRecordingSource = Literal["recall_desktop_sdk"] @@ -11,5 +11,5 @@ def check_import_meeting_recording_source(value: str | None) -> ImportMeetingRec if value is None: return None if value in IMPORT_MEETING_RECORDING_SOURCE_VALUES: - return cast(ImportMeetingRecordingSource, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {IMPORT_MEETING_RECORDING_SOURCE_VALUES!r}") diff --git a/rootly_sdk/models/in_triage_incident.py b/rootly_sdk/models/in_triage_incident.py index e6689084..7ff9287a 100644 --- a/rootly_sdk/models/in_triage_incident.py +++ b/rootly_sdk/models/in_triage_incident.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.in_triage_incident_data import InTriageIncidentData @@ -18,14 +19,13 @@ class InTriageIncident: data (InTriageIncidentData): """ - data: "InTriageIncidentData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: InTriageIncidentData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - in_triage_incident.additional_properties = d return in_triage_incident - - @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/in_triage_incident_data.py b/rootly_sdk/models/in_triage_incident_data.py index 3ff763ca..fd38e84d 100644 --- a/rootly_sdk/models/in_triage_incident_data.py +++ b/rootly_sdk/models/in_triage_incident_data.py @@ -1,10 +1,12 @@ +from __future__ import annotations + 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.in_triage_incident_data_type import InTriageIncidentDataType, check_in_triage_incident_data_type +from ..types import UNSET, Unset T = TypeVar("T", bound="InTriageIncidentData") @@ -14,21 +16,27 @@ class InTriageIncidentData: """ Attributes: type_ (InTriageIncidentDataType): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: InTriageIncidentDataType - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + id: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: type_: str = self.type_ + id = self.id + field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, } ) + if id is not UNSET: + field_dict["id"] = id return field_dict @@ -37,25 +45,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) type_ = check_in_triage_incident_data_type(d.pop("type")) + id = d.pop("id", UNSET) + in_triage_incident_data = cls( type_=type_, + id=id, ) - in_triage_incident_data.additional_properties = d return in_triage_incident_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/in_triage_incident_data_type.py b/rootly_sdk/models/in_triage_incident_data_type.py index 3af3ca2f..deba4434 100644 --- a/rootly_sdk/models/in_triage_incident_data_type.py +++ b/rootly_sdk/models/in_triage_incident_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal InTriageIncidentDataType = Literal["incidents"] @@ -11,5 +11,5 @@ def check_in_triage_incident_data_type(value: str | None) -> InTriageIncidentDat if value is None: return None if value in IN_TRIAGE_INCIDENT_DATA_TYPE_VALUES: - return cast(InTriageIncidentDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {IN_TRIAGE_INCIDENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident.py b/rootly_sdk/models/incident.py index aaac3646..0c412407 100644 --- a/rootly_sdk/models/incident.py +++ b/rootly_sdk/models/incident.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,8 +27,8 @@ from ..models.incident_zoom_meeting_global_dial_in_numbers_type_0_item import ( IncidentZoomMeetingGlobalDialInNumbersType0Item, ) + from ..models.nullable_severity_response_type_0 import NullableSeverityResponseType0 from ..models.service_response import ServiceResponse - from ..models.severity_response import SeverityResponse from ..models.team_response import TeamResponse @@ -40,279 +42,282 @@ class Incident: title (str): The title of the incident created_at (str): Date of creation updated_at (str): Date of last update - 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[None, 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", + 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 (None | NullableSeverityResponseType0 | Unset): The severity assigned to an incident, or null when no + severity is assigned + 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", "version": "1.29"} - 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 + 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_key (None | str | Unset): Linear issue key + 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 """ title: str created_at: str updated_at: str - 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[None, 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 + 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: None | NullableSeverityResponseType0 | 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_key: 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -324,7 +329,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.incident_resolved_by_type_0 import IncidentResolvedByType0 from ..models.incident_started_by_type_0 import IncidentStartedByType0 from ..models.incident_user_type_0 import IncidentUserType0 - from ..models.severity_response import SeverityResponse + from ..models.nullable_severity_response_type_0 import NullableSeverityResponseType0 title = self.title @@ -340,19 +345,19 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - parent_incident_id: None | Unset | str + parent_incident_id: None | str | Unset if isinstance(self.parent_incident_id, Unset): parent_incident_id = UNSET else: parent_incident_id = self.parent_incident_id - duplicate_incident_id: None | Unset | str + duplicate_incident_id: None | str | Unset if isinstance(self.duplicate_incident_id, Unset): duplicate_incident_id = UNSET else: duplicate_incident_id = self.duplicate_incident_id - summary: None | Unset | str + summary: None | str | Unset if isinstance(self.summary, Unset): summary = UNSET else: @@ -360,37 +365,37 @@ def to_dict(self) -> dict[str, Any]: private = self.private - source: None | Unset | str + source: None | str | Unset if isinstance(self.source, Unset): source = UNSET else: source = self.source - status: None | Unset | str + status: None | str | Unset if isinstance(self.status, Unset): status = UNSET else: status = self.status - url: None | Unset | str + url: None | str | Unset if isinstance(self.url, Unset): url = UNSET else: url = self.url - short_url: None | Unset | str + short_url: None | str | Unset if isinstance(self.short_url, Unset): short_url = UNSET else: short_url = self.short_url - public_title: None | Unset | str + public_title: None | str | Unset if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - user: None | Unset | dict[str, Any] + user: dict[str, Any] | None | Unset if isinstance(self.user, Unset): user = UNSET elif isinstance(self.user, IncidentUserType0): @@ -398,15 +403,15 @@ def to_dict(self) -> dict[str, Any]: else: user = self.user - severity: None | Unset | dict[str, Any] + severity: dict[str, Any] | None | Unset if isinstance(self.severity, Unset): severity = UNSET - elif isinstance(self.severity, SeverityResponse): + elif isinstance(self.severity, NullableSeverityResponseType0): severity = self.severity.to_dict() else: severity = self.severity - environments: None | Unset | list[dict[str, Any]] + environments: list[dict[str, Any]] | None | Unset if isinstance(self.environments, Unset): environments = UNSET elif isinstance(self.environments, list): @@ -418,7 +423,7 @@ def to_dict(self) -> dict[str, Any]: else: environments = self.environments - incident_types: None | Unset | list[dict[str, Any]] + incident_types: list[dict[str, Any]] | None | Unset if isinstance(self.incident_types, Unset): incident_types = UNSET elif isinstance(self.incident_types, list): @@ -430,7 +435,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_types = self.incident_types - services: None | Unset | list[dict[str, Any]] + services: list[dict[str, Any]] | None | Unset if isinstance(self.services, Unset): services = UNSET elif isinstance(self.services, list): @@ -442,7 +447,7 @@ def to_dict(self) -> dict[str, Any]: else: services = self.services - functionalities: None | Unset | list[dict[str, Any]] + functionalities: list[dict[str, Any]] | None | Unset if isinstance(self.functionalities, Unset): functionalities = UNSET elif isinstance(self.functionalities, list): @@ -454,7 +459,7 @@ def to_dict(self) -> dict[str, Any]: else: functionalities = self.functionalities - groups: None | Unset | list[dict[str, Any]] + groups: list[dict[str, Any]] | None | Unset if isinstance(self.groups, Unset): groups = UNSET elif isinstance(self.groups, list): @@ -466,7 +471,7 @@ def to_dict(self) -> dict[str, Any]: else: groups = self.groups - labels: None | Unset | dict[str, Any] + labels: dict[str, Any] | None | Unset if isinstance(self.labels, Unset): labels = UNSET elif isinstance(self.labels, IncidentLabelsType0): @@ -474,85 +479,85 @@ def to_dict(self) -> dict[str, Any]: else: labels = self.labels - slack_channel_id: None | Unset | str + slack_channel_id: None | str | Unset if isinstance(self.slack_channel_id, Unset): slack_channel_id = UNSET else: slack_channel_id = self.slack_channel_id - slack_channel_name: None | Unset | str + slack_channel_name: None | str | Unset if isinstance(self.slack_channel_name, Unset): slack_channel_name = UNSET else: slack_channel_name = self.slack_channel_name - slack_channel_url: None | Unset | str + slack_channel_url: None | str | Unset if isinstance(self.slack_channel_url, Unset): slack_channel_url = UNSET else: slack_channel_url = self.slack_channel_url - slack_channel_short_url: None | Unset | str + slack_channel_short_url: None | str | Unset 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 | Unset | str + slack_channel_deep_link: None | str | Unset 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: None | Unset | bool + slack_channel_archived: bool | None | Unset if isinstance(self.slack_channel_archived, Unset): slack_channel_archived = UNSET else: slack_channel_archived = self.slack_channel_archived - slack_last_message_ts: None | Unset | str + slack_last_message_ts: None | str | Unset 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 | Unset | str + zoom_meeting_id: None | str | Unset if isinstance(self.zoom_meeting_id, Unset): zoom_meeting_id = UNSET else: zoom_meeting_id = self.zoom_meeting_id - zoom_meeting_start_url: None | Unset | str + zoom_meeting_start_url: None | str | Unset 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 | Unset | str + zoom_meeting_join_url: None | str | Unset 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 | Unset | str + zoom_meeting_password: None | str | Unset if isinstance(self.zoom_meeting_password, Unset): zoom_meeting_password = UNSET else: zoom_meeting_password = self.zoom_meeting_password - zoom_meeting_pstn_password: None | Unset | str + zoom_meeting_pstn_password: None | str | Unset 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 | Unset | str + zoom_meeting_h323_password: None | str | Unset 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: None | Unset | list[dict[str, Any]] + zoom_meeting_global_dial_in_numbers: list[dict[str, Any]] | None | Unset 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): @@ -566,493 +571,499 @@ 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 | Unset | str + google_drive_id: None | str | Unset if isinstance(self.google_drive_id, Unset): google_drive_id = UNSET else: google_drive_id = self.google_drive_id - google_drive_parent_id: None | Unset | str + google_drive_parent_id: None | str | Unset 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 | Unset | str + google_drive_url: None | str | Unset if isinstance(self.google_drive_url, Unset): google_drive_url = UNSET else: google_drive_url = self.google_drive_url - google_meeting_id: None | Unset | str + google_meeting_id: None | str | Unset if isinstance(self.google_meeting_id, Unset): google_meeting_id = UNSET else: google_meeting_id = self.google_meeting_id - google_meeting_url: None | Unset | str + google_meeting_url: None | str | Unset if isinstance(self.google_meeting_url, Unset): google_meeting_url = UNSET else: google_meeting_url = self.google_meeting_url - microsoft_teams_meeting_id: None | Unset | str + microsoft_teams_meeting_id: None | str | Unset 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 | Unset | str + microsoft_teams_meeting_url: None | str | Unset 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 | Unset | str + microsoft_teams_channel_id: None | str | Unset 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 | Unset | str + microsoft_teams_channel_name: None | str | Unset 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 | Unset | str + microsoft_teams_channel_url: None | str | Unset 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 | Unset | str + microsoft_teams_channel_short_url: None | str | Unset 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 | Unset | str + microsoft_teams_chat_id: None | str | Unset 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 | Unset | str + microsoft_teams_chat_url: None | str | Unset 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 | Unset | str + microsoft_teams_team_id: None | str | Unset 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 | Unset | str + google_chat_space_id: None | str | Unset 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 | Unset | str + google_chat_space_name: None | str | Unset 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 | Unset | str + google_chat_space_url: None | str | Unset 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 | Unset | str + google_chat_space_short_url: None | str | Unset 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: None | Unset | bool + google_chat_space_archived: bool | None | Unset 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 | Unset | str + google_chat_space_domain_id: None | str | Unset 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 | Unset | str + webex_meeting_id: None | str | Unset if isinstance(self.webex_meeting_id, Unset): webex_meeting_id = UNSET else: webex_meeting_id = self.webex_meeting_id - webex_meeting_url: None | Unset | str + webex_meeting_url: None | str | Unset if isinstance(self.webex_meeting_url, Unset): webex_meeting_url = UNSET else: webex_meeting_url = self.webex_meeting_url - jira_issue_key: None | Unset | str + jira_issue_key: None | str | Unset if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_id: None | Unset | str + jira_issue_id: None | str | Unset if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_url: None | Unset | str + jira_issue_url: None | str | Unset if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - github_issue_id: None | Unset | str + github_issue_id: None | str | Unset if isinstance(self.github_issue_id, Unset): github_issue_id = UNSET else: github_issue_id = self.github_issue_id - github_issue_url: None | Unset | str + github_issue_url: None | str | Unset if isinstance(self.github_issue_url, Unset): github_issue_url = UNSET else: github_issue_url = self.github_issue_url - gitlab_issue_id: None | Unset | str + gitlab_issue_id: None | str | Unset if isinstance(self.gitlab_issue_id, Unset): gitlab_issue_id = UNSET else: gitlab_issue_id = self.gitlab_issue_id - gitlab_issue_url: None | Unset | str + gitlab_issue_url: None | str | Unset if isinstance(self.gitlab_issue_url, Unset): gitlab_issue_url = UNSET else: gitlab_issue_url = self.gitlab_issue_url - asana_task_id: None | Unset | str + asana_task_id: None | str | Unset if isinstance(self.asana_task_id, Unset): asana_task_id = UNSET else: asana_task_id = self.asana_task_id - asana_task_url: None | Unset | str + asana_task_url: None | str | Unset if isinstance(self.asana_task_url, Unset): asana_task_url = UNSET else: asana_task_url = self.asana_task_url - linear_issue_id: None | Unset | str + linear_issue_key: None | str | Unset + if isinstance(self.linear_issue_key, Unset): + linear_issue_key = UNSET + else: + linear_issue_key = self.linear_issue_key + + linear_issue_id: None | str | Unset if isinstance(self.linear_issue_id, Unset): linear_issue_id = UNSET else: linear_issue_id = self.linear_issue_id - linear_issue_url: None | Unset | str + linear_issue_url: None | str | Unset if isinstance(self.linear_issue_url, Unset): linear_issue_url = UNSET else: linear_issue_url = self.linear_issue_url - trello_card_id: None | Unset | str + trello_card_id: None | str | Unset if isinstance(self.trello_card_id, Unset): trello_card_id = UNSET else: trello_card_id = self.trello_card_id - trello_card_url: None | Unset | str + trello_card_url: None | str | Unset if isinstance(self.trello_card_url, Unset): trello_card_url = UNSET else: trello_card_url = self.trello_card_url - zendesk_ticket_id: None | Unset | str + zendesk_ticket_id: None | str | Unset if isinstance(self.zendesk_ticket_id, Unset): zendesk_ticket_id = UNSET else: zendesk_ticket_id = self.zendesk_ticket_id - zendesk_ticket_url: None | Unset | str + zendesk_ticket_url: None | str | Unset if isinstance(self.zendesk_ticket_url, Unset): zendesk_ticket_url = UNSET else: zendesk_ticket_url = self.zendesk_ticket_url - pagerduty_incident_id: None | Unset | str + pagerduty_incident_id: None | str | Unset if isinstance(self.pagerduty_incident_id, Unset): pagerduty_incident_id = UNSET else: pagerduty_incident_id = self.pagerduty_incident_id - pagerduty_incident_number: None | Unset | str + pagerduty_incident_number: None | str | Unset if isinstance(self.pagerduty_incident_number, Unset): pagerduty_incident_number = UNSET else: pagerduty_incident_number = self.pagerduty_incident_number - pagerduty_incident_url: None | Unset | str + pagerduty_incident_url: None | str | Unset if isinstance(self.pagerduty_incident_url, Unset): pagerduty_incident_url = UNSET else: pagerduty_incident_url = self.pagerduty_incident_url - opsgenie_incident_id: None | Unset | str + opsgenie_incident_id: None | str | Unset if isinstance(self.opsgenie_incident_id, Unset): opsgenie_incident_id = UNSET else: opsgenie_incident_id = self.opsgenie_incident_id - opsgenie_incident_url: None | Unset | str + opsgenie_incident_url: None | str | Unset if isinstance(self.opsgenie_incident_url, Unset): opsgenie_incident_url = UNSET else: opsgenie_incident_url = self.opsgenie_incident_url - opsgenie_alert_id: None | Unset | str + opsgenie_alert_id: None | str | Unset if isinstance(self.opsgenie_alert_id, Unset): opsgenie_alert_id = UNSET else: opsgenie_alert_id = self.opsgenie_alert_id - opsgenie_alert_url: None | Unset | str + opsgenie_alert_url: None | str | Unset if isinstance(self.opsgenie_alert_url, Unset): opsgenie_alert_url = UNSET else: opsgenie_alert_url = self.opsgenie_alert_url - service_now_incident_id: None | Unset | str + service_now_incident_id: None | str | Unset 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 | Unset | str + service_now_incident_key: None | str | Unset 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 | Unset | str + service_now_incident_url: None | str | Unset 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 | Unset | str + mattermost_channel_id: None | str | Unset if isinstance(self.mattermost_channel_id, Unset): mattermost_channel_id = UNSET else: mattermost_channel_id = self.mattermost_channel_id - mattermost_channel_name: None | Unset | str + mattermost_channel_name: None | str | Unset if isinstance(self.mattermost_channel_name, Unset): mattermost_channel_name = UNSET else: mattermost_channel_name = self.mattermost_channel_name - mattermost_channel_url: None | Unset | str + mattermost_channel_url: None | str | Unset if isinstance(self.mattermost_channel_url, Unset): mattermost_channel_url = UNSET else: mattermost_channel_url = self.mattermost_channel_url - confluence_page_id: None | Unset | str + confluence_page_id: None | str | Unset if isinstance(self.confluence_page_id, Unset): confluence_page_id = UNSET else: confluence_page_id = self.confluence_page_id - confluence_page_url: None | Unset | str + confluence_page_url: None | str | Unset if isinstance(self.confluence_page_url, Unset): confluence_page_url = UNSET else: confluence_page_url = self.confluence_page_url - datadog_notebook_id: None | Unset | str + datadog_notebook_id: None | str | Unset if isinstance(self.datadog_notebook_id, Unset): datadog_notebook_id = UNSET else: datadog_notebook_id = self.datadog_notebook_id - datadog_notebook_url: None | Unset | str + datadog_notebook_url: None | str | Unset if isinstance(self.datadog_notebook_url, Unset): datadog_notebook_url = UNSET else: datadog_notebook_url = self.datadog_notebook_url - shortcut_story_id: None | Unset | str + shortcut_story_id: None | str | Unset if isinstance(self.shortcut_story_id, Unset): shortcut_story_id = UNSET else: shortcut_story_id = self.shortcut_story_id - shortcut_story_url: None | Unset | str + shortcut_story_url: None | str | Unset if isinstance(self.shortcut_story_url, Unset): shortcut_story_url = UNSET else: shortcut_story_url = self.shortcut_story_url - shortcut_task_id: None | Unset | str + shortcut_task_id: None | str | Unset if isinstance(self.shortcut_task_id, Unset): shortcut_task_id = UNSET else: shortcut_task_id = self.shortcut_task_id - shortcut_task_url: None | Unset | str + shortcut_task_url: None | str | Unset if isinstance(self.shortcut_task_url, Unset): shortcut_task_url = UNSET else: shortcut_task_url = self.shortcut_task_url - motion_task_id: None | Unset | str + motion_task_id: None | str | Unset if isinstance(self.motion_task_id, Unset): motion_task_id = UNSET else: motion_task_id = self.motion_task_id - motion_task_url: None | Unset | str + motion_task_url: None | str | Unset if isinstance(self.motion_task_url, Unset): motion_task_url = UNSET else: motion_task_url = self.motion_task_url - clickup_task_id: None | Unset | str + clickup_task_id: None | str | Unset if isinstance(self.clickup_task_id, Unset): clickup_task_id = UNSET else: clickup_task_id = self.clickup_task_id - clickup_task_url: None | Unset | str + clickup_task_url: None | str | Unset if isinstance(self.clickup_task_url, Unset): clickup_task_url = UNSET else: clickup_task_url = self.clickup_task_url - victor_ops_incident_id: None | Unset | str + victor_ops_incident_id: None | str | Unset 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 | Unset | str + victor_ops_incident_url: None | str | Unset 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 | Unset | str + quip_page_id: None | str | Unset if isinstance(self.quip_page_id, Unset): quip_page_id = UNSET else: quip_page_id = self.quip_page_id - quip_page_url: None | Unset | str + quip_page_url: None | str | Unset if isinstance(self.quip_page_url, Unset): quip_page_url = UNSET else: quip_page_url = self.quip_page_url - sharepoint_page_id: None | Unset | str + sharepoint_page_id: None | str | Unset if isinstance(self.sharepoint_page_id, Unset): sharepoint_page_id = UNSET else: sharepoint_page_id = self.sharepoint_page_id - sharepoint_page_url: None | Unset | str + sharepoint_page_url: None | str | Unset if isinstance(self.sharepoint_page_url, Unset): sharepoint_page_url = UNSET else: sharepoint_page_url = self.sharepoint_page_url - airtable_base_key: None | Unset | str + airtable_base_key: None | str | Unset if isinstance(self.airtable_base_key, Unset): airtable_base_key = UNSET else: airtable_base_key = self.airtable_base_key - airtable_table_name: None | Unset | str + airtable_table_name: None | str | Unset if isinstance(self.airtable_table_name, Unset): airtable_table_name = UNSET else: airtable_table_name = self.airtable_table_name - airtable_record_id: None | Unset | str + airtable_record_id: None | str | Unset if isinstance(self.airtable_record_id, Unset): airtable_record_id = UNSET else: airtable_record_id = self.airtable_record_id - airtable_record_url: None | Unset | str + airtable_record_url: None | str | Unset if isinstance(self.airtable_record_url, Unset): airtable_record_url = UNSET else: airtable_record_url = self.airtable_record_url - freshservice_ticket_id: None | Unset | str + freshservice_ticket_id: None | str | Unset if isinstance(self.freshservice_ticket_id, Unset): freshservice_ticket_id = UNSET else: freshservice_ticket_id = self.freshservice_ticket_id - freshservice_ticket_url: None | Unset | str + freshservice_ticket_url: None | str | Unset if isinstance(self.freshservice_ticket_url, Unset): freshservice_ticket_url = UNSET else: freshservice_ticket_url = self.freshservice_ticket_url - freshservice_task_id: None | Unset | str + freshservice_task_id: None | str | Unset if isinstance(self.freshservice_task_id, Unset): freshservice_task_id = UNSET else: freshservice_task_id = self.freshservice_task_id - freshservice_task_url: None | Unset | str + freshservice_task_url: None | str | Unset if isinstance(self.freshservice_task_url, Unset): freshservice_task_url = UNSET else: freshservice_task_url = self.freshservice_task_url - mitigation_message: None | Unset | str + mitigation_message: None | str | Unset if isinstance(self.mitigation_message, Unset): mitigation_message = UNSET else: mitigation_message = self.mitigation_message - resolution_message: None | Unset | str + resolution_message: None | str | Unset if isinstance(self.resolution_message, Unset): resolution_message = UNSET else: resolution_message = self.resolution_message - cancellation_message: None | Unset | str + cancellation_message: None | str | Unset if isinstance(self.cancellation_message, Unset): cancellation_message = UNSET else: cancellation_message = self.cancellation_message - scheduled_for: None | Unset | str + scheduled_for: None | str | Unset if isinstance(self.scheduled_for, Unset): scheduled_for = UNSET else: scheduled_for = self.scheduled_for - scheduled_until: None | Unset | str + scheduled_until: None | str | Unset if isinstance(self.scheduled_until, Unset): scheduled_until = UNSET else: scheduled_until = self.scheduled_until - muted_service_ids: None | Unset | list[str] + muted_service_ids: list[str] | None | Unset if isinstance(self.muted_service_ids, Unset): muted_service_ids = UNSET elif isinstance(self.muted_service_ids, list): @@ -1061,11 +1072,11 @@ def to_dict(self) -> dict[str, Any]: else: muted_service_ids = self.muted_service_ids - retrospective_progress_status: Unset | str = UNSET + retrospective_progress_status: str | Unset = UNSET if not isinstance(self.retrospective_progress_status, Unset): retrospective_progress_status = self.retrospective_progress_status - in_triage_by: None | Unset | dict[str, Any] + in_triage_by: dict[str, Any] | None | Unset if isinstance(self.in_triage_by, Unset): in_triage_by = UNSET elif isinstance(self.in_triage_by, IncidentInTriageByType0): @@ -1073,7 +1084,7 @@ def to_dict(self) -> dict[str, Any]: else: in_triage_by = self.in_triage_by - started_by: None | Unset | dict[str, Any] + started_by: dict[str, Any] | None | Unset if isinstance(self.started_by, Unset): started_by = UNSET elif isinstance(self.started_by, IncidentStartedByType0): @@ -1081,7 +1092,7 @@ def to_dict(self) -> dict[str, Any]: else: started_by = self.started_by - mitigated_by: None | Unset | dict[str, Any] + mitigated_by: dict[str, Any] | None | Unset if isinstance(self.mitigated_by, Unset): mitigated_by = UNSET elif isinstance(self.mitigated_by, IncidentMitigatedByType0): @@ -1089,7 +1100,7 @@ def to_dict(self) -> dict[str, Any]: else: mitigated_by = self.mitigated_by - resolved_by: None | Unset | dict[str, Any] + resolved_by: dict[str, Any] | None | Unset if isinstance(self.resolved_by, Unset): resolved_by = UNSET elif isinstance(self.resolved_by, IncidentResolvedByType0): @@ -1097,7 +1108,7 @@ def to_dict(self) -> dict[str, Any]: else: resolved_by = self.resolved_by - closed_by: None | Unset | dict[str, Any] + closed_by: dict[str, Any] | None | Unset if isinstance(self.closed_by, Unset): closed_by = UNSET elif isinstance(self.closed_by, IncidentClosedByType0): @@ -1105,7 +1116,7 @@ def to_dict(self) -> dict[str, Any]: else: closed_by = self.closed_by - cancelled_by: None | Unset | dict[str, Any] + cancelled_by: dict[str, Any] | None | Unset if isinstance(self.cancelled_by, Unset): cancelled_by = UNSET elif isinstance(self.cancelled_by, IncidentCancelledByType0): @@ -1113,49 +1124,49 @@ def to_dict(self) -> dict[str, Any]: else: cancelled_by = self.cancelled_by - in_triage_at: None | Unset | str + in_triage_at: None | str | Unset if isinstance(self.in_triage_at, Unset): in_triage_at = UNSET else: in_triage_at = self.in_triage_at - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - detected_at: None | Unset | str + detected_at: None | str | Unset if isinstance(self.detected_at, Unset): detected_at = UNSET else: detected_at = self.detected_at - acknowledged_at: None | Unset | str + acknowledged_at: None | str | Unset if isinstance(self.acknowledged_at, Unset): acknowledged_at = UNSET else: acknowledged_at = self.acknowledged_at - mitigated_at: None | Unset | str + mitigated_at: None | str | Unset if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: None | Unset | str + resolved_at: None | str | Unset if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: resolved_at = self.resolved_at - closed_at: None | Unset | str + closed_at: None | str | Unset if isinstance(self.closed_at, Unset): closed_at = UNSET else: closed_at = self.closed_at - cancelled_at: None | Unset | str + cancelled_at: None | str | Unset if isinstance(self.cancelled_at, Unset): cancelled_at = UNSET else: @@ -1302,6 +1313,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["asana_task_id"] = asana_task_id if asana_task_url is not UNSET: field_dict["asana_task_url"] = asana_task_url + if linear_issue_key is not UNSET: + field_dict["linear_issue_key"] = linear_issue_key if linear_issue_id is not UNSET: field_dict["linear_issue_id"] = linear_issue_id if linear_issue_url is not UNSET: @@ -1453,8 +1466,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.incident_zoom_meeting_global_dial_in_numbers_type_0_item import ( IncidentZoomMeetingGlobalDialInNumbersType0Item, ) + from ..models.nullable_severity_response_type_0 import NullableSeverityResponseType0 from ..models.service_response import ServiceResponse - from ..models.severity_response import SeverityResponse from ..models.team_response import TeamResponse d = dict(src_dict) @@ -1472,81 +1485,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 | Unset | str: + def _parse_parent_incident_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) parent_incident_id = _parse_parent_incident_id(d.pop("parent_incident_id", UNSET)) - def _parse_duplicate_incident_id(data: object) -> None | Unset | str: + def _parse_duplicate_incident_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) duplicate_incident_id = _parse_duplicate_incident_id(d.pop("duplicate_incident_id", UNSET)) - def _parse_summary(data: object) -> None | Unset | str: + def _parse_summary(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) summary = _parse_summary(d.pop("summary", UNSET)) private = d.pop("private", UNSET) - def _parse_source(data: object) -> None | Unset | str: + def _parse_source(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) source = _parse_source(d.pop("source", UNSET)) - def _parse_status(data: object) -> None | Unset | str: + def _parse_status(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) status = _parse_status(d.pop("status", UNSET)) - def _parse_url(data: object) -> None | Unset | str: + def _parse_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) url = _parse_url(d.pop("url", UNSET)) - def _parse_short_url(data: object) -> None | Unset | str: + def _parse_short_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) short_url = _parse_short_url(d.pop("short_url", UNSET)) - def _parse_public_title(data: object) -> None | Unset | str: + def _parse_public_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_user(data: object) -> Union["IncidentUserType0", None, Unset]: + def _parse_user(data: object) -> IncidentUserType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -1557,24 +1570,30 @@ def _parse_user(data: object) -> Union["IncidentUserType0", None, Unset]: user_type_0 = IncidentUserType0.from_dict(data) return user_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["IncidentUserType0", None, Unset], data) + return cast(IncidentUserType0 | None | Unset, data) user = _parse_user(d.pop("user", UNSET)) - def _parse_severity(data: object) -> None | Unset | SeverityResponse: + def _parse_severity(data: object) -> None | NullableSeverityResponseType0 | Unset: if data is None: return data if isinstance(data, Unset): return data - if not isinstance(data, dict): - raise TypeError() - return SeverityResponse.from_dict(data) + try: + if not isinstance(data, dict): + raise TypeError() + componentsschemasnullable_severity_response_type_0 = NullableSeverityResponseType0.from_dict(data) + + return componentsschemasnullable_severity_response_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | NullableSeverityResponseType0 | Unset, data) severity = _parse_severity(d.pop("severity", UNSET)) - def _parse_environments(data: object) -> None | Unset | list["EnvironmentResponse"]: + def _parse_environments(data: object) -> list[EnvironmentResponse] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -1590,13 +1609,13 @@ def _parse_environments(data: object) -> None | Unset | list["EnvironmentRespons environments_type_0.append(environments_type_0_item) return environments_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["EnvironmentResponse"], data) + return cast(list[EnvironmentResponse] | None | Unset, data) environments = _parse_environments(d.pop("environments", UNSET)) - def _parse_incident_types(data: object) -> None | Unset | list["IncidentTypeResponse"]: + def _parse_incident_types(data: object) -> list[IncidentTypeResponse] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -1612,13 +1631,13 @@ def _parse_incident_types(data: object) -> None | Unset | list["IncidentTypeResp incident_types_type_0.append(incident_types_type_0_item) return incident_types_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["IncidentTypeResponse"], data) + return cast(list[IncidentTypeResponse] | None | Unset, data) incident_types = _parse_incident_types(d.pop("incident_types", UNSET)) - def _parse_services(data: object) -> None | Unset | list["ServiceResponse"]: + def _parse_services(data: object) -> list[ServiceResponse] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -1634,13 +1653,13 @@ def _parse_services(data: object) -> None | Unset | list["ServiceResponse"]: services_type_0.append(services_type_0_item) return services_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["ServiceResponse"], data) + return cast(list[ServiceResponse] | None | Unset, data) services = _parse_services(d.pop("services", UNSET)) - def _parse_functionalities(data: object) -> None | Unset | list["FunctionalityResponse"]: + def _parse_functionalities(data: object) -> list[FunctionalityResponse] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -1656,13 +1675,13 @@ def _parse_functionalities(data: object) -> None | Unset | list["FunctionalityRe functionalities_type_0.append(functionalities_type_0_item) return functionalities_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["FunctionalityResponse"], data) + return cast(list[FunctionalityResponse] | None | Unset, data) functionalities = _parse_functionalities(d.pop("functionalities", UNSET)) - def _parse_groups(data: object) -> None | Unset | list["TeamResponse"]: + def _parse_groups(data: object) -> list[TeamResponse] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -1678,13 +1697,13 @@ def _parse_groups(data: object) -> None | Unset | list["TeamResponse"]: groups_type_0.append(groups_type_0_item) return groups_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["TeamResponse"], data) + return cast(list[TeamResponse] | None | Unset, data) groups = _parse_groups(d.pop("groups", UNSET)) - def _parse_labels(data: object) -> Union["IncidentLabelsType0", None, Unset]: + def _parse_labels(data: object) -> IncidentLabelsType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -1695,132 +1714,132 @@ def _parse_labels(data: object) -> Union["IncidentLabelsType0", None, Unset]: labels_type_0 = IncidentLabelsType0.from_dict(data) return labels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["IncidentLabelsType0", None, Unset], data) + return cast(IncidentLabelsType0 | None | Unset, data) labels = _parse_labels(d.pop("labels", UNSET)) - def _parse_slack_channel_id(data: object) -> None | Unset | str: + def _parse_slack_channel_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slack_channel_id = _parse_slack_channel_id(d.pop("slack_channel_id", UNSET)) - def _parse_slack_channel_name(data: object) -> None | Unset | str: + def _parse_slack_channel_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slack_channel_name = _parse_slack_channel_name(d.pop("slack_channel_name", UNSET)) - def _parse_slack_channel_url(data: object) -> None | Unset | str: + def _parse_slack_channel_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slack_channel_url = _parse_slack_channel_url(d.pop("slack_channel_url", UNSET)) - def _parse_slack_channel_short_url(data: object) -> None | Unset | str: + def _parse_slack_channel_short_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_slack_channel_deep_link(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slack_channel_deep_link = _parse_slack_channel_deep_link(d.pop("slack_channel_deep_link", UNSET)) - def _parse_slack_channel_archived(data: object) -> None | Unset | bool: + def _parse_slack_channel_archived(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) slack_channel_archived = _parse_slack_channel_archived(d.pop("slack_channel_archived", UNSET)) - def _parse_slack_last_message_ts(data: object) -> None | Unset | str: + def _parse_slack_last_message_ts(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_zoom_meeting_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) zoom_meeting_id = _parse_zoom_meeting_id(d.pop("zoom_meeting_id", UNSET)) - def _parse_zoom_meeting_start_url(data: object) -> None | Unset | str: + def _parse_zoom_meeting_start_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_zoom_meeting_join_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_zoom_meeting_password(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) zoom_meeting_password = _parse_zoom_meeting_password(d.pop("zoom_meeting_password", UNSET)) - def _parse_zoom_meeting_pstn_password(data: object) -> None | Unset | str: + def _parse_zoom_meeting_pstn_password(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_zoom_meeting_h323_password(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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, - ) -> None | Unset | list["IncidentZoomMeetingGlobalDialInNumbersType0Item"]: + ) -> list[IncidentZoomMeetingGlobalDialInNumbersType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -1840,746 +1859,755 @@ 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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["IncidentZoomMeetingGlobalDialInNumbersType0Item"], data) + return cast(list[IncidentZoomMeetingGlobalDialInNumbersType0Item] | None | Unset, 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 | Unset | str: + def _parse_google_drive_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) google_drive_id = _parse_google_drive_id(d.pop("google_drive_id", UNSET)) - def _parse_google_drive_parent_id(data: object) -> None | Unset | str: + def _parse_google_drive_parent_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_google_drive_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) google_drive_url = _parse_google_drive_url(d.pop("google_drive_url", UNSET)) - def _parse_google_meeting_id(data: object) -> None | Unset | str: + def _parse_google_meeting_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) google_meeting_id = _parse_google_meeting_id(d.pop("google_meeting_id", UNSET)) - def _parse_google_meeting_url(data: object) -> None | Unset | str: + def _parse_google_meeting_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) google_meeting_url = _parse_google_meeting_url(d.pop("google_meeting_url", UNSET)) - def _parse_microsoft_teams_meeting_id(data: object) -> None | Unset | str: + def _parse_microsoft_teams_meeting_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_microsoft_teams_meeting_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_microsoft_teams_channel_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_microsoft_teams_channel_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_microsoft_teams_channel_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_microsoft_teams_channel_short_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_microsoft_teams_chat_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_microsoft_teams_chat_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_microsoft_teams_team_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_google_chat_space_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_google_chat_space_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_google_chat_space_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_google_chat_space_short_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) -> None | Unset | bool: + def _parse_google_chat_space_archived(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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 | Unset | str: + def _parse_google_chat_space_domain_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_webex_meeting_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) webex_meeting_id = _parse_webex_meeting_id(d.pop("webex_meeting_id", UNSET)) - def _parse_webex_meeting_url(data: object) -> None | Unset | str: + def _parse_webex_meeting_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) webex_meeting_url = _parse_webex_meeting_url(d.pop("webex_meeting_url", UNSET)) - def _parse_jira_issue_key(data: object) -> None | Unset | str: + def _parse_jira_issue_key(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_id(data: object) -> None | Unset | str: + def _parse_jira_issue_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_url(data: object) -> None | Unset | str: + def _parse_jira_issue_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) - def _parse_github_issue_id(data: object) -> None | Unset | str: + def _parse_github_issue_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) github_issue_id = _parse_github_issue_id(d.pop("github_issue_id", UNSET)) - def _parse_github_issue_url(data: object) -> None | Unset | str: + def _parse_github_issue_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) github_issue_url = _parse_github_issue_url(d.pop("github_issue_url", UNSET)) - def _parse_gitlab_issue_id(data: object) -> None | Unset | str: + def _parse_gitlab_issue_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) gitlab_issue_id = _parse_gitlab_issue_id(d.pop("gitlab_issue_id", UNSET)) - def _parse_gitlab_issue_url(data: object) -> None | Unset | str: + def _parse_gitlab_issue_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) gitlab_issue_url = _parse_gitlab_issue_url(d.pop("gitlab_issue_url", UNSET)) - def _parse_asana_task_id(data: object) -> None | Unset | str: + def _parse_asana_task_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) asana_task_id = _parse_asana_task_id(d.pop("asana_task_id", UNSET)) - def _parse_asana_task_url(data: object) -> None | Unset | str: + def _parse_asana_task_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) asana_task_url = _parse_asana_task_url(d.pop("asana_task_url", UNSET)) - def _parse_linear_issue_id(data: object) -> None | Unset | str: + def _parse_linear_issue_key(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + linear_issue_key = _parse_linear_issue_key(d.pop("linear_issue_key", UNSET)) + + def _parse_linear_issue_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) linear_issue_id = _parse_linear_issue_id(d.pop("linear_issue_id", UNSET)) - def _parse_linear_issue_url(data: object) -> None | Unset | str: + def _parse_linear_issue_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) linear_issue_url = _parse_linear_issue_url(d.pop("linear_issue_url", UNSET)) - def _parse_trello_card_id(data: object) -> None | Unset | str: + def _parse_trello_card_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) trello_card_id = _parse_trello_card_id(d.pop("trello_card_id", UNSET)) - def _parse_trello_card_url(data: object) -> None | Unset | str: + def _parse_trello_card_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) trello_card_url = _parse_trello_card_url(d.pop("trello_card_url", UNSET)) - def _parse_zendesk_ticket_id(data: object) -> None | Unset | str: + def _parse_zendesk_ticket_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) zendesk_ticket_id = _parse_zendesk_ticket_id(d.pop("zendesk_ticket_id", UNSET)) - def _parse_zendesk_ticket_url(data: object) -> None | Unset | str: + def _parse_zendesk_ticket_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) zendesk_ticket_url = _parse_zendesk_ticket_url(d.pop("zendesk_ticket_url", UNSET)) - def _parse_pagerduty_incident_id(data: object) -> None | Unset | str: + def _parse_pagerduty_incident_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_incident_id = _parse_pagerduty_incident_id(d.pop("pagerduty_incident_id", UNSET)) - def _parse_pagerduty_incident_number(data: object) -> None | Unset | str: + def _parse_pagerduty_incident_number(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_incident_number = _parse_pagerduty_incident_number(d.pop("pagerduty_incident_number", UNSET)) - def _parse_pagerduty_incident_url(data: object) -> None | Unset | str: + def _parse_pagerduty_incident_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_incident_url = _parse_pagerduty_incident_url(d.pop("pagerduty_incident_url", UNSET)) - def _parse_opsgenie_incident_id(data: object) -> None | Unset | str: + def _parse_opsgenie_incident_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_incident_id = _parse_opsgenie_incident_id(d.pop("opsgenie_incident_id", UNSET)) - def _parse_opsgenie_incident_url(data: object) -> None | Unset | str: + def _parse_opsgenie_incident_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_incident_url = _parse_opsgenie_incident_url(d.pop("opsgenie_incident_url", UNSET)) - def _parse_opsgenie_alert_id(data: object) -> None | Unset | str: + def _parse_opsgenie_alert_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_alert_id = _parse_opsgenie_alert_id(d.pop("opsgenie_alert_id", UNSET)) - def _parse_opsgenie_alert_url(data: object) -> None | Unset | str: + def _parse_opsgenie_alert_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_alert_url = _parse_opsgenie_alert_url(d.pop("opsgenie_alert_url", UNSET)) - def _parse_service_now_incident_id(data: object) -> None | Unset | str: + def _parse_service_now_incident_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_service_now_incident_key(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_service_now_incident_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_mattermost_channel_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) mattermost_channel_id = _parse_mattermost_channel_id(d.pop("mattermost_channel_id", UNSET)) - def _parse_mattermost_channel_name(data: object) -> None | Unset | str: + def _parse_mattermost_channel_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) mattermost_channel_name = _parse_mattermost_channel_name(d.pop("mattermost_channel_name", UNSET)) - def _parse_mattermost_channel_url(data: object) -> None | Unset | str: + def _parse_mattermost_channel_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) mattermost_channel_url = _parse_mattermost_channel_url(d.pop("mattermost_channel_url", UNSET)) - def _parse_confluence_page_id(data: object) -> None | Unset | str: + def _parse_confluence_page_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) confluence_page_id = _parse_confluence_page_id(d.pop("confluence_page_id", UNSET)) - def _parse_confluence_page_url(data: object) -> None | Unset | str: + def _parse_confluence_page_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) confluence_page_url = _parse_confluence_page_url(d.pop("confluence_page_url", UNSET)) - def _parse_datadog_notebook_id(data: object) -> None | Unset | str: + def _parse_datadog_notebook_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) datadog_notebook_id = _parse_datadog_notebook_id(d.pop("datadog_notebook_id", UNSET)) - def _parse_datadog_notebook_url(data: object) -> None | Unset | str: + def _parse_datadog_notebook_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) datadog_notebook_url = _parse_datadog_notebook_url(d.pop("datadog_notebook_url", UNSET)) - def _parse_shortcut_story_id(data: object) -> None | Unset | str: + def _parse_shortcut_story_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) shortcut_story_id = _parse_shortcut_story_id(d.pop("shortcut_story_id", UNSET)) - def _parse_shortcut_story_url(data: object) -> None | Unset | str: + def _parse_shortcut_story_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) shortcut_story_url = _parse_shortcut_story_url(d.pop("shortcut_story_url", UNSET)) - def _parse_shortcut_task_id(data: object) -> None | Unset | str: + def _parse_shortcut_task_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) shortcut_task_id = _parse_shortcut_task_id(d.pop("shortcut_task_id", UNSET)) - def _parse_shortcut_task_url(data: object) -> None | Unset | str: + def _parse_shortcut_task_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) shortcut_task_url = _parse_shortcut_task_url(d.pop("shortcut_task_url", UNSET)) - def _parse_motion_task_id(data: object) -> None | Unset | str: + def _parse_motion_task_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) motion_task_id = _parse_motion_task_id(d.pop("motion_task_id", UNSET)) - def _parse_motion_task_url(data: object) -> None | Unset | str: + def _parse_motion_task_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) motion_task_url = _parse_motion_task_url(d.pop("motion_task_url", UNSET)) - def _parse_clickup_task_id(data: object) -> None | Unset | str: + def _parse_clickup_task_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) clickup_task_id = _parse_clickup_task_id(d.pop("clickup_task_id", UNSET)) - def _parse_clickup_task_url(data: object) -> None | Unset | str: + def _parse_clickup_task_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) clickup_task_url = _parse_clickup_task_url(d.pop("clickup_task_url", UNSET)) - def _parse_victor_ops_incident_id(data: object) -> None | Unset | str: + def _parse_victor_ops_incident_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_victor_ops_incident_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_quip_page_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) quip_page_id = _parse_quip_page_id(d.pop("quip_page_id", UNSET)) - def _parse_quip_page_url(data: object) -> None | Unset | str: + def _parse_quip_page_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) quip_page_url = _parse_quip_page_url(d.pop("quip_page_url", UNSET)) - def _parse_sharepoint_page_id(data: object) -> None | Unset | str: + def _parse_sharepoint_page_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) sharepoint_page_id = _parse_sharepoint_page_id(d.pop("sharepoint_page_id", UNSET)) - def _parse_sharepoint_page_url(data: object) -> None | Unset | str: + def _parse_sharepoint_page_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) sharepoint_page_url = _parse_sharepoint_page_url(d.pop("sharepoint_page_url", UNSET)) - def _parse_airtable_base_key(data: object) -> None | Unset | str: + def _parse_airtable_base_key(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) airtable_base_key = _parse_airtable_base_key(d.pop("airtable_base_key", UNSET)) - def _parse_airtable_table_name(data: object) -> None | Unset | str: + def _parse_airtable_table_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) airtable_table_name = _parse_airtable_table_name(d.pop("airtable_table_name", UNSET)) - def _parse_airtable_record_id(data: object) -> None | Unset | str: + def _parse_airtable_record_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) airtable_record_id = _parse_airtable_record_id(d.pop("airtable_record_id", UNSET)) - def _parse_airtable_record_url(data: object) -> None | Unset | str: + def _parse_airtable_record_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) airtable_record_url = _parse_airtable_record_url(d.pop("airtable_record_url", UNSET)) - def _parse_freshservice_ticket_id(data: object) -> None | Unset | str: + def _parse_freshservice_ticket_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) freshservice_ticket_id = _parse_freshservice_ticket_id(d.pop("freshservice_ticket_id", UNSET)) - def _parse_freshservice_ticket_url(data: object) -> None | Unset | str: + def _parse_freshservice_ticket_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) freshservice_ticket_url = _parse_freshservice_ticket_url(d.pop("freshservice_ticket_url", UNSET)) - def _parse_freshservice_task_id(data: object) -> None | Unset | str: + def _parse_freshservice_task_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) freshservice_task_id = _parse_freshservice_task_id(d.pop("freshservice_task_id", UNSET)) - def _parse_freshservice_task_url(data: object) -> None | Unset | str: + def _parse_freshservice_task_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) freshservice_task_url = _parse_freshservice_task_url(d.pop("freshservice_task_url", UNSET)) - def _parse_mitigation_message(data: object) -> None | Unset | str: + def _parse_mitigation_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) mitigation_message = _parse_mitigation_message(d.pop("mitigation_message", UNSET)) - def _parse_resolution_message(data: object) -> None | Unset | str: + def _parse_resolution_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) resolution_message = _parse_resolution_message(d.pop("resolution_message", UNSET)) - def _parse_cancellation_message(data: object) -> None | Unset | str: + def _parse_cancellation_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) cancellation_message = _parse_cancellation_message(d.pop("cancellation_message", UNSET)) - def _parse_scheduled_for(data: object) -> None | Unset | str: + def _parse_scheduled_for(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) scheduled_for = _parse_scheduled_for(d.pop("scheduled_for", UNSET)) - def _parse_scheduled_until(data: object) -> None | Unset | str: + def _parse_scheduled_until(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) scheduled_until = _parse_scheduled_until(d.pop("scheduled_until", UNSET)) - def _parse_muted_service_ids(data: object) -> None | Unset | list[str]: + def _parse_muted_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -2590,20 +2618,20 @@ def _parse_muted_service_ids(data: object) -> None | Unset | list[str]: muted_service_ids_type_0 = cast(list[str], data) return muted_service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, 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: Unset | IncidentRetrospectiveProgressStatus + retrospective_progress_status: IncidentRetrospectiveProgressStatus | Unset 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) -> Union["IncidentInTriageByType0", None, Unset]: + def _parse_in_triage_by(data: object) -> IncidentInTriageByType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -2614,13 +2642,13 @@ def _parse_in_triage_by(data: object) -> Union["IncidentInTriageByType0", None, in_triage_by_type_0 = IncidentInTriageByType0.from_dict(data) return in_triage_by_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["IncidentInTriageByType0", None, Unset], data) + return cast(IncidentInTriageByType0 | None | Unset, data) in_triage_by = _parse_in_triage_by(d.pop("in_triage_by", UNSET)) - def _parse_started_by(data: object) -> Union["IncidentStartedByType0", None, Unset]: + def _parse_started_by(data: object) -> IncidentStartedByType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -2631,13 +2659,13 @@ def _parse_started_by(data: object) -> Union["IncidentStartedByType0", None, Uns started_by_type_0 = IncidentStartedByType0.from_dict(data) return started_by_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["IncidentStartedByType0", None, Unset], data) + return cast(IncidentStartedByType0 | None | Unset, data) started_by = _parse_started_by(d.pop("started_by", UNSET)) - def _parse_mitigated_by(data: object) -> Union["IncidentMitigatedByType0", None, Unset]: + def _parse_mitigated_by(data: object) -> IncidentMitigatedByType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -2648,13 +2676,13 @@ def _parse_mitigated_by(data: object) -> Union["IncidentMitigatedByType0", None, mitigated_by_type_0 = IncidentMitigatedByType0.from_dict(data) return mitigated_by_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["IncidentMitigatedByType0", None, Unset], data) + return cast(IncidentMitigatedByType0 | None | Unset, data) mitigated_by = _parse_mitigated_by(d.pop("mitigated_by", UNSET)) - def _parse_resolved_by(data: object) -> Union["IncidentResolvedByType0", None, Unset]: + def _parse_resolved_by(data: object) -> IncidentResolvedByType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -2665,13 +2693,13 @@ def _parse_resolved_by(data: object) -> Union["IncidentResolvedByType0", None, U resolved_by_type_0 = IncidentResolvedByType0.from_dict(data) return resolved_by_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["IncidentResolvedByType0", None, Unset], data) + return cast(IncidentResolvedByType0 | None | Unset, data) resolved_by = _parse_resolved_by(d.pop("resolved_by", UNSET)) - def _parse_closed_by(data: object) -> Union["IncidentClosedByType0", None, Unset]: + def _parse_closed_by(data: object) -> IncidentClosedByType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -2682,13 +2710,13 @@ def _parse_closed_by(data: object) -> Union["IncidentClosedByType0", None, Unset closed_by_type_0 = IncidentClosedByType0.from_dict(data) return closed_by_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["IncidentClosedByType0", None, Unset], data) + return cast(IncidentClosedByType0 | None | Unset, data) closed_by = _parse_closed_by(d.pop("closed_by", UNSET)) - def _parse_cancelled_by(data: object) -> Union["IncidentCancelledByType0", None, Unset]: + def _parse_cancelled_by(data: object) -> IncidentCancelledByType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -2699,81 +2727,81 @@ def _parse_cancelled_by(data: object) -> Union["IncidentCancelledByType0", None, cancelled_by_type_0 = IncidentCancelledByType0.from_dict(data) return cancelled_by_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["IncidentCancelledByType0", None, Unset], data) + return cast(IncidentCancelledByType0 | None | Unset, data) cancelled_by = _parse_cancelled_by(d.pop("cancelled_by", UNSET)) - def _parse_in_triage_at(data: object) -> None | Unset | str: + def _parse_in_triage_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) in_triage_at = _parse_in_triage_at(d.pop("in_triage_at", UNSET)) - def _parse_started_at(data: object) -> None | Unset | str: + def _parse_started_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_detected_at(data: object) -> None | Unset | str: + def _parse_detected_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) detected_at = _parse_detected_at(d.pop("detected_at", UNSET)) - def _parse_acknowledged_at(data: object) -> None | Unset | str: + def _parse_acknowledged_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) acknowledged_at = _parse_acknowledged_at(d.pop("acknowledged_at", UNSET)) - def _parse_mitigated_at(data: object) -> None | Unset | str: + def _parse_mitigated_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> None | Unset | str: + def _parse_resolved_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) - def _parse_closed_at(data: object) -> None | Unset | str: + def _parse_closed_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) closed_at = _parse_closed_at(d.pop("closed_at", UNSET)) - def _parse_cancelled_at(data: object) -> None | Unset | str: + def _parse_cancelled_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) cancelled_at = _parse_cancelled_at(d.pop("cancelled_at", UNSET)) @@ -2847,6 +2875,7 @@ def _parse_cancelled_at(data: object) -> None | Unset | str: gitlab_issue_url=gitlab_issue_url, asana_task_id=asana_task_id, asana_task_url=asana_task_url, + linear_issue_key=linear_issue_key, linear_issue_id=linear_issue_id, linear_issue_url=linear_issue_url, trello_card_id=trello_card_id, diff --git a/rootly_sdk/models/incident_action_item.py b/rootly_sdk/models/incident_action_item.py index cdb4826d..1620963a 100644 --- a/rootly_sdk/models/incident_action_item.py +++ b/rootly_sdk/models/incident_action_item.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,35 +25,35 @@ class IncidentActionItem: summary (str): The summary of the action item created_at (str): Date of creation updated_at (str): Date of last update - 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 + 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 associations) - 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 + 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 associations) """ summary: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -61,21 +63,21 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind - assigned_to: Unset | dict[str, Any] = UNSET + assigned_to: dict[str, Any] | Unset = UNSET if not isinstance(self.assigned_to, Unset): assigned_to = self.assigned_to.to_dict() - assigned_to_group_ids: None | Unset | list[str] + assigned_to_group_ids: list[str] | None | Unset if isinstance(self.assigned_to_group_ids, Unset): assigned_to_group_ids = UNSET elif isinstance(self.assigned_to_group_ids, list): @@ -84,39 +86,39 @@ def to_dict(self) -> dict[str, Any]: else: assigned_to_group_ids = self.assigned_to_group_ids - priority: Unset | str = UNSET + priority: str | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status - due_date: None | Unset | str + due_date: None | str | Unset if isinstance(self.due_date, Unset): due_date = UNSET else: due_date = self.due_date - jira_issue_id: None | Unset | str + jira_issue_id: None | str | Unset if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_key: None | Unset | str + jira_issue_key: None | str | Unset if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_url: None | Unset | str + jira_issue_url: None | str | Unset if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - created_by: Unset | dict[str, Any] = UNSET + created_by: dict[str, Any] | Unset = UNSET if not isinstance(self.created_by, Unset): created_by = self.created_by.to_dict() @@ -165,30 +167,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) _kind = d.pop("kind", UNSET) - kind: Unset | IncidentActionItemKind + kind: IncidentActionItemKind | Unset if isinstance(_kind, Unset): kind = UNSET else: kind = check_incident_action_item_kind(_kind) _assigned_to = d.pop("assigned_to", UNSET) - assigned_to: Unset | UserFlatResponse + assigned_to: UserFlatResponse | Unset if isinstance(_assigned_to, Unset): assigned_to = UNSET else: assigned_to = UserFlatResponse.from_dict(_assigned_to) - def _parse_assigned_to_group_ids(data: object) -> None | Unset | list[str]: + def _parse_assigned_to_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -199,64 +201,64 @@ def _parse_assigned_to_group_ids(data: object) -> None | Unset | list[str]: assigned_to_group_ids_type_0 = cast(list[str], data) return assigned_to_group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) assigned_to_group_ids = _parse_assigned_to_group_ids(d.pop("assigned_to_group_ids", UNSET)) _priority = d.pop("priority", UNSET) - priority: Unset | IncidentActionItemPriority + priority: IncidentActionItemPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: priority = check_incident_action_item_priority(_priority) _status = d.pop("status", UNSET) - status: Unset | IncidentActionItemStatus + status: IncidentActionItemStatus | Unset if isinstance(_status, Unset): status = UNSET else: status = check_incident_action_item_status(_status) - def _parse_due_date(data: object) -> None | Unset | str: + def _parse_due_date(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) due_date = _parse_due_date(d.pop("due_date", UNSET)) - def _parse_jira_issue_id(data: object) -> None | Unset | str: + def _parse_jira_issue_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_key(data: object) -> None | Unset | str: + def _parse_jira_issue_key(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_url(data: object) -> None | Unset | str: + def _parse_jira_issue_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) _created_by = d.pop("created_by", UNSET) - created_by: Unset | UserFlatResponse + created_by: UserFlatResponse | Unset if isinstance(_created_by, Unset): created_by = UNSET else: diff --git a/rootly_sdk/models/incident_action_item_kind.py b/rootly_sdk/models/incident_action_item_kind.py index 4ccd1179..92ba0332 100644 --- a/rootly_sdk/models/incident_action_item_kind.py +++ b/rootly_sdk/models/incident_action_item_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentActionItemKind = Literal["follow_up", "task"] @@ -12,5 +12,5 @@ def check_incident_action_item_kind(value: str | None) -> IncidentActionItemKind if value is None: return None if value in INCIDENT_ACTION_ITEM_KIND_VALUES: - return cast(IncidentActionItemKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_ACTION_ITEM_KIND_VALUES!r}") diff --git a/rootly_sdk/models/incident_action_item_list.py b/rootly_sdk/models/incident_action_item_list.py index 4644a6d0..70b1c1b9 100644 --- a/rootly_sdk/models/incident_action_item_list.py +++ b/rootly_sdk/models/incident_action_item_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class IncidentActionItemList: """ Attributes: - data (list['IncidentActionItemListDataItem']): + data (list[IncidentActionItemListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["IncidentActionItemListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[IncidentActionItemListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 99e97c67..46910964 100644 --- a/rootly_sdk/models/incident_action_item_list_data_item.py +++ b/rootly_sdk/models/incident_action_item_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_action_item_list_data_item_type.py b/rootly_sdk/models/incident_action_item_list_data_item_type.py index c7496496..8960ce7a 100644 --- a/rootly_sdk/models/incident_action_item_list_data_item_type.py +++ b/rootly_sdk/models/incident_action_item_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentActionItemListDataItemType = Literal["incident_action_items"] @@ -11,5 +11,5 @@ def check_incident_action_item_list_data_item_type(value: str | None) -> Inciden if value is None: return None if value in INCIDENT_ACTION_ITEM_LIST_DATA_ITEM_TYPE_VALUES: - return cast(IncidentActionItemListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_ACTION_ITEM_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_action_item_priority.py b/rootly_sdk/models/incident_action_item_priority.py index 3f253a5a..8cc195d3 100644 --- a/rootly_sdk/models/incident_action_item_priority.py +++ b/rootly_sdk/models/incident_action_item_priority.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentActionItemPriority = Literal["high", "low", "medium"] @@ -13,5 +13,5 @@ def check_incident_action_item_priority(value: str | None) -> IncidentActionItem if value is None: return None if value in INCIDENT_ACTION_ITEM_PRIORITY_VALUES: - return cast(IncidentActionItemPriority, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_ACTION_ITEM_PRIORITY_VALUES!r}") diff --git a/rootly_sdk/models/incident_action_item_response.py b/rootly_sdk/models/incident_action_item_response.py index a6bfaa1a..3bac877a 100644 --- a/rootly_sdk/models/incident_action_item_response.py +++ b/rootly_sdk/models/incident_action_item_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class IncidentActionItemResponse: """ Attributes: data (IncidentActionItemResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "IncidentActionItemResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: IncidentActionItemResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 c21de0b4..162efaa1 100644 --- a/rootly_sdk/models/incident_action_item_response_data.py +++ b/rootly_sdk/models/incident_action_item_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_action_item_response_data_type.py b/rootly_sdk/models/incident_action_item_response_data_type.py index 9621785f..0d294c62 100644 --- a/rootly_sdk/models/incident_action_item_response_data_type.py +++ b/rootly_sdk/models/incident_action_item_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentActionItemResponseDataType = Literal["incident_action_items"] @@ -11,5 +11,5 @@ def check_incident_action_item_response_data_type(value: str | None) -> Incident if value is None: return None if value in INCIDENT_ACTION_ITEM_RESPONSE_DATA_TYPE_VALUES: - return cast(IncidentActionItemResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_ACTION_ITEM_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_action_item_status.py b/rootly_sdk/models/incident_action_item_status.py index d0447a7e..8b423ec8 100644 --- a/rootly_sdk/models/incident_action_item_status.py +++ b/rootly_sdk/models/incident_action_item_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentActionItemStatus = Literal["cancelled", "done", "in_progress", "open"] @@ -14,5 +14,5 @@ def check_incident_action_item_status(value: str | None) -> IncidentActionItemSt if value is None: return None if value in INCIDENT_ACTION_ITEM_STATUS_VALUES: - return cast(IncidentActionItemStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_ACTION_ITEM_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/incident_cancelled_by_type_0.py b/rootly_sdk/models/incident_cancelled_by_type_0.py index 12d1b454..0e7a89aa 100644 --- a/rootly_sdk/models/incident_cancelled_by_type_0.py +++ b/rootly_sdk/models/incident_cancelled_by_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 71d3c34a..27fb3bfc 100644 --- a/rootly_sdk/models/incident_closed_by_type_0.py +++ b/rootly_sdk/models/incident_closed_by_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 d1a07a29..8fb65665 100644 --- a/rootly_sdk/models/incident_custom_field_selection.py +++ b/rootly_sdk/models/incident_custom_field_selection.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,16 +15,16 @@ class IncidentCustomFieldSelection: """ Attributes: - value (Union[None, str]): The value of the incident_custom_field_selection + value (None | str): The value of the incident_custom_field_selection selected_option_ids (list[int]): - incident_id (Union[Unset, str]): - custom_field_id (Union[Unset, int]): + incident_id (str | Unset): + custom_field_id (int | Unset): """ value: None | str selected_option_ids: list[int] - incident_id: Unset | str = UNSET - custom_field_id: Unset | int = UNSET + incident_id: str | Unset = UNSET + custom_field_id: int | Unset = UNSET 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 e43b5ed7..fc3febde 100644 --- a/rootly_sdk/models/incident_custom_field_selection_list.py +++ b/rootly_sdk/models/incident_custom_field_selection_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class IncidentCustomFieldSelectionList: """ Attributes: - data (list['IncidentCustomFieldSelectionListDataItem']): + data (list[IncidentCustomFieldSelectionListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["IncidentCustomFieldSelectionListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[IncidentCustomFieldSelectionListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 33a38024..8cc9c216 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_custom_field_selection_list_data_item_type.py b/rootly_sdk/models/incident_custom_field_selection_list_data_item_type.py index 3338507e..0b110225 100644 --- a/rootly_sdk/models/incident_custom_field_selection_list_data_item_type.py +++ b/rootly_sdk/models/incident_custom_field_selection_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentCustomFieldSelectionListDataItemType = Literal["incident_custom_field_selections"] @@ -13,7 +13,7 @@ def check_incident_custom_field_selection_list_data_item_type( if value is None: return None if value in INCIDENT_CUSTOM_FIELD_SELECTION_LIST_DATA_ITEM_TYPE_VALUES: - return cast(IncidentCustomFieldSelectionListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_CUSTOM_FIELD_SELECTION_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_custom_field_selection_response.py b/rootly_sdk/models/incident_custom_field_selection_response.py index a9b02f9c..97593eb5 100644 --- a/rootly_sdk/models/incident_custom_field_selection_response.py +++ b/rootly_sdk/models/incident_custom_field_selection_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class IncidentCustomFieldSelectionResponse: """ Attributes: data (IncidentCustomFieldSelectionResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "IncidentCustomFieldSelectionResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: IncidentCustomFieldSelectionResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 9ef29384..40bee22e 100644 --- a/rootly_sdk/models/incident_custom_field_selection_response_data.py +++ b/rootly_sdk/models/incident_custom_field_selection_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_custom_field_selection_response_data_type.py b/rootly_sdk/models/incident_custom_field_selection_response_data_type.py index c69547d5..416fb9fc 100644 --- a/rootly_sdk/models/incident_custom_field_selection_response_data_type.py +++ b/rootly_sdk/models/incident_custom_field_selection_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentCustomFieldSelectionResponseDataType = Literal["incident_custom_field_selections"] @@ -13,7 +13,7 @@ def check_incident_custom_field_selection_response_data_type( if value is None: return None if value in INCIDENT_CUSTOM_FIELD_SELECTION_RESPONSE_DATA_TYPE_VALUES: - return cast(IncidentCustomFieldSelectionResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_CUSTOM_FIELD_SELECTION_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_event.py b/rootly_sdk/models/incident_event.py index 0b4a0f1a..0f1d3de6 100644 --- a/rootly_sdk/models/incident_event.py +++ b/rootly_sdk/models/incident_event.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -18,14 +20,14 @@ class IncidentEvent: occurred_at (str): Date of occurence created_at (str): Date of creation updated_at (str): Date of last update - visibility (Union[Unset, IncidentEventVisibility]): The visibility of the incident action item + visibility (IncidentEventVisibility | Unset): The visibility of the incident action item """ event: str occurred_at: str created_at: str updated_at: str - visibility: Unset | IncidentEventVisibility = UNSET + visibility: IncidentEventVisibility | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -37,7 +39,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - visibility: Unset | str = UNSET + visibility: str | Unset = UNSET if not isinstance(self.visibility, Unset): visibility = self.visibility @@ -68,7 +70,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: Unset | IncidentEventVisibility + visibility: IncidentEventVisibility | Unset 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 9bbee28a..2283fbd7 100644 --- a/rootly_sdk/models/incident_event_functionality.py +++ b/rootly_sdk/models/incident_event_functionality.py @@ -1,3 +1,5 @@ +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 54d1a8ed..5c41c9c2 100644 --- a/rootly_sdk/models/incident_event_functionality_list.py +++ b/rootly_sdk/models/incident_event_functionality_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class IncidentEventFunctionalityList: """ Attributes: - data (list['IncidentEventFunctionalityListDataItem']): + data (list[IncidentEventFunctionalityListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["IncidentEventFunctionalityListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[IncidentEventFunctionalityListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 aaa8b50f..187d9f5d 100644 --- a/rootly_sdk/models/incident_event_functionality_list_data_item.py +++ b/rootly_sdk/models/incident_event_functionality_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_event_functionality_list_data_item_type.py b/rootly_sdk/models/incident_event_functionality_list_data_item_type.py index 66688397..121f4de6 100644 --- a/rootly_sdk/models/incident_event_functionality_list_data_item_type.py +++ b/rootly_sdk/models/incident_event_functionality_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentEventFunctionalityListDataItemType = Literal["incident_event_functionalities"] @@ -13,7 +13,7 @@ def check_incident_event_functionality_list_data_item_type( if value is None: return None if value in INCIDENT_EVENT_FUNCTIONALITY_LIST_DATA_ITEM_TYPE_VALUES: - return cast(IncidentEventFunctionalityListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_EVENT_FUNCTIONALITY_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_event_functionality_response.py b/rootly_sdk/models/incident_event_functionality_response.py index df64b5a3..0cc0ac58 100644 --- a/rootly_sdk/models/incident_event_functionality_response.py +++ b/rootly_sdk/models/incident_event_functionality_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class IncidentEventFunctionalityResponse: """ Attributes: data (IncidentEventFunctionalityResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "IncidentEventFunctionalityResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: IncidentEventFunctionalityResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 41215a06..a7efe600 100644 --- a/rootly_sdk/models/incident_event_functionality_response_data.py +++ b/rootly_sdk/models/incident_event_functionality_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_event_functionality_response_data_type.py b/rootly_sdk/models/incident_event_functionality_response_data_type.py index 51c584fd..86b3c3b9 100644 --- a/rootly_sdk/models/incident_event_functionality_response_data_type.py +++ b/rootly_sdk/models/incident_event_functionality_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentEventFunctionalityResponseDataType = Literal["incident_event_functionalities"] @@ -13,7 +13,7 @@ def check_incident_event_functionality_response_data_type( if value is None: return None if value in INCIDENT_EVENT_FUNCTIONALITY_RESPONSE_DATA_TYPE_VALUES: - return cast(IncidentEventFunctionalityResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_EVENT_FUNCTIONALITY_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_event_functionality_status.py b/rootly_sdk/models/incident_event_functionality_status.py index 4aa984a5..da0da349 100644 --- a/rootly_sdk/models/incident_event_functionality_status.py +++ b/rootly_sdk/models/incident_event_functionality_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentEventFunctionalityStatus = Literal["major_outage", "operational", "partial_outage"] @@ -13,5 +13,5 @@ def check_incident_event_functionality_status(value: str | None) -> IncidentEven if value is None: return None if value in INCIDENT_EVENT_FUNCTIONALITY_STATUS_VALUES: - return cast(IncidentEventFunctionalityStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_EVENT_FUNCTIONALITY_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/incident_event_list.py b/rootly_sdk/models/incident_event_list.py index de72b0b5..7868272e 100644 --- a/rootly_sdk/models/incident_event_list.py +++ b/rootly_sdk/models/incident_event_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class IncidentEventList: """ Attributes: - data (list['IncidentEventListDataItem']): + data (list[IncidentEventListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["IncidentEventListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[IncidentEventListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 c895c45b..ec5e4556 100644 --- a/rootly_sdk/models/incident_event_list_data_item.py +++ b/rootly_sdk/models/incident_event_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_event_list_data_item_type.py b/rootly_sdk/models/incident_event_list_data_item_type.py index 2dcf2756..2c8454e5 100644 --- a/rootly_sdk/models/incident_event_list_data_item_type.py +++ b/rootly_sdk/models/incident_event_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentEventListDataItemType = Literal["incident_events"] @@ -11,5 +11,5 @@ def check_incident_event_list_data_item_type(value: str | None) -> IncidentEvent if value is None: return None if value in INCIDENT_EVENT_LIST_DATA_ITEM_TYPE_VALUES: - return cast(IncidentEventListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_EVENT_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_event_response.py b/rootly_sdk/models/incident_event_response.py index 32ea9040..27d05797 100644 --- a/rootly_sdk/models/incident_event_response.py +++ b/rootly_sdk/models/incident_event_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class IncidentEventResponse: """ Attributes: data (IncidentEventResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "IncidentEventResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: IncidentEventResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 0f415f3f..420a0bb2 100644 --- a/rootly_sdk/models/incident_event_response_data.py +++ b/rootly_sdk/models/incident_event_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_event_response_data_type.py b/rootly_sdk/models/incident_event_response_data_type.py index 93d390e4..71435e42 100644 --- a/rootly_sdk/models/incident_event_response_data_type.py +++ b/rootly_sdk/models/incident_event_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentEventResponseDataType = Literal["incident_events"] @@ -11,5 +11,5 @@ def check_incident_event_response_data_type(value: str | None) -> IncidentEventR if value is None: return None if value in INCIDENT_EVENT_RESPONSE_DATA_TYPE_VALUES: - return cast(IncidentEventResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_EVENT_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_event_service.py b/rootly_sdk/models/incident_event_service.py index 163037e9..1353bf73 100644 --- a/rootly_sdk/models/incident_event_service.py +++ b/rootly_sdk/models/incident_event_service.py @@ -1,3 +1,5 @@ +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 4b620aab..3a2dbb4a 100644 --- a/rootly_sdk/models/incident_event_service_list.py +++ b/rootly_sdk/models/incident_event_service_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class IncidentEventServiceList: """ Attributes: - data (list['IncidentEventServiceListDataItem']): + data (list[IncidentEventServiceListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["IncidentEventServiceListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[IncidentEventServiceListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 64783455..092f03d4 100644 --- a/rootly_sdk/models/incident_event_service_list_data_item.py +++ b/rootly_sdk/models/incident_event_service_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_event_service_list_data_item_type.py b/rootly_sdk/models/incident_event_service_list_data_item_type.py index 3d89feb2..867eb21d 100644 --- a/rootly_sdk/models/incident_event_service_list_data_item_type.py +++ b/rootly_sdk/models/incident_event_service_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentEventServiceListDataItemType = Literal["incident_event_services"] @@ -11,7 +11,7 @@ def check_incident_event_service_list_data_item_type(value: str | None) -> Incid if value is None: return None if value in INCIDENT_EVENT_SERVICE_LIST_DATA_ITEM_TYPE_VALUES: - return cast(IncidentEventServiceListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_EVENT_SERVICE_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_event_service_response.py b/rootly_sdk/models/incident_event_service_response.py index a0abbb81..41567cc0 100644 --- a/rootly_sdk/models/incident_event_service_response.py +++ b/rootly_sdk/models/incident_event_service_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class IncidentEventServiceResponse: """ Attributes: data (IncidentEventServiceResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "IncidentEventServiceResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: IncidentEventServiceResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 c684683c..01413cba 100644 --- a/rootly_sdk/models/incident_event_service_response_data.py +++ b/rootly_sdk/models/incident_event_service_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_event_service_response_data_type.py b/rootly_sdk/models/incident_event_service_response_data_type.py index 044da9e7..4a42b35f 100644 --- a/rootly_sdk/models/incident_event_service_response_data_type.py +++ b/rootly_sdk/models/incident_event_service_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentEventServiceResponseDataType = Literal["incident_event_services"] @@ -11,5 +11,5 @@ def check_incident_event_service_response_data_type(value: str | None) -> Incide if value is None: return None if value in INCIDENT_EVENT_SERVICE_RESPONSE_DATA_TYPE_VALUES: - return cast(IncidentEventServiceResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_EVENT_SERVICE_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_event_service_status.py b/rootly_sdk/models/incident_event_service_status.py index 8e0674a1..0f8d0d41 100644 --- a/rootly_sdk/models/incident_event_service_status.py +++ b/rootly_sdk/models/incident_event_service_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentEventServiceStatus = Literal["major_outage", "operational", "partial_outage"] @@ -13,5 +13,5 @@ def check_incident_event_service_status(value: str | None) -> IncidentEventServi if value is None: return None if value in INCIDENT_EVENT_SERVICE_STATUS_VALUES: - return cast(IncidentEventServiceStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_EVENT_SERVICE_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/incident_event_visibility.py b/rootly_sdk/models/incident_event_visibility.py index 9f0f27b9..914a8999 100644 --- a/rootly_sdk/models/incident_event_visibility.py +++ b/rootly_sdk/models/incident_event_visibility.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentEventVisibility = Literal["external", "internal"] @@ -12,5 +12,5 @@ def check_incident_event_visibility(value: str | None) -> IncidentEventVisibilit if value is None: return None if value in INCIDENT_EVENT_VISIBILITY_VALUES: - return cast(IncidentEventVisibility, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_EVENT_VISIBILITY_VALUES!r}") diff --git a/rootly_sdk/models/incident_feedback.py b/rootly_sdk/models/incident_feedback.py index f047ab5e..4ea237d8 100644 --- a/rootly_sdk/models/incident_feedback.py +++ b/rootly_sdk/models/incident_feedback.py @@ -1,3 +1,5 @@ +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 43c7dfb8..42bfce5f 100644 --- a/rootly_sdk/models/incident_feedback_list.py +++ b/rootly_sdk/models/incident_feedback_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class IncidentFeedbackList: """ Attributes: - data (list['IncidentFeedbackListDataItem']): + data (list[IncidentFeedbackListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["IncidentFeedbackListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[IncidentFeedbackListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 f1be8b2d..a71bc453 100644 --- a/rootly_sdk/models/incident_feedback_list_data_item.py +++ b/rootly_sdk/models/incident_feedback_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_feedback_list_data_item_type.py b/rootly_sdk/models/incident_feedback_list_data_item_type.py index f34ddd26..1f66d00c 100644 --- a/rootly_sdk/models/incident_feedback_list_data_item_type.py +++ b/rootly_sdk/models/incident_feedback_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentFeedbackListDataItemType = Literal["incident_feedbacks"] @@ -11,5 +11,5 @@ def check_incident_feedback_list_data_item_type(value: str | None) -> IncidentFe if value is None: return None if value in INCIDENT_FEEDBACK_LIST_DATA_ITEM_TYPE_VALUES: - return cast(IncidentFeedbackListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_FEEDBACK_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_feedback_rating.py b/rootly_sdk/models/incident_feedback_rating.py index 8518844d..4dc0fd84 100644 --- a/rootly_sdk/models/incident_feedback_rating.py +++ b/rootly_sdk/models/incident_feedback_rating.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentFeedbackRating = Literal[0, 1, 2, 3, 4] @@ -13,5 +13,5 @@ def check_incident_feedback_rating(value: int) -> IncidentFeedbackRating: if value in INCIDENT_FEEDBACK_RATING_VALUES: - return cast(IncidentFeedbackRating, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_FEEDBACK_RATING_VALUES!r}") diff --git a/rootly_sdk/models/incident_feedback_response.py b/rootly_sdk/models/incident_feedback_response.py index 62f27c11..18347296 100644 --- a/rootly_sdk/models/incident_feedback_response.py +++ b/rootly_sdk/models/incident_feedback_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class IncidentFeedbackResponse: """ Attributes: data (IncidentFeedbackResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "IncidentFeedbackResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: IncidentFeedbackResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 59b31f61..e87ec38d 100644 --- a/rootly_sdk/models/incident_feedback_response_data.py +++ b/rootly_sdk/models/incident_feedback_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_feedback_response_data_type.py b/rootly_sdk/models/incident_feedback_response_data_type.py index b72d4b61..f04eda14 100644 --- a/rootly_sdk/models/incident_feedback_response_data_type.py +++ b/rootly_sdk/models/incident_feedback_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentFeedbackResponseDataType = Literal["incident_feedbacks"] @@ -11,5 +11,5 @@ def check_incident_feedback_response_data_type(value: str | None) -> IncidentFee if value is None: return None if value in INCIDENT_FEEDBACK_RESPONSE_DATA_TYPE_VALUES: - return cast(IncidentFeedbackResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_FEEDBACK_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_form_field_selection.py b/rootly_sdk/models/incident_form_field_selection.py index 97ee3216..546b0afb 100644 --- a/rootly_sdk/models/incident_form_field_selection.py +++ b/rootly_sdk/models/incident_form_field_selection.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,30 +17,30 @@ class IncidentFormFieldSelection: Attributes: incident_id (str): form_field_id (str): The custom field for this selection - 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): 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): """ incident_id: str form_field_id: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,45 +48,45 @@ def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id - value: None | Unset | str + value: None | str | Unset if isinstance(self.value, Unset): value = UNSET else: value = self.value - selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_catalog_entity_ids: list[str] | Unset = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_group_ids: Unset | list[str] = UNSET + selected_group_ids: list[str] | Unset = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: Unset | list[str] = UNSET + selected_option_ids: list[str] | Unset = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: Unset | list[str] = UNSET + selected_service_ids: list[str] | Unset = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: Unset | list[str] = UNSET + selected_functionality_ids: list[str] | Unset = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_user_ids: Unset | list[int] = UNSET + selected_user_ids: list[int] | Unset = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_environment_ids: Unset | list[str] = UNSET + selected_environment_ids: list[str] | Unset = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: Unset | list[str] = UNSET + selected_cause_ids: list[str] | Unset = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: Unset | list[str] = UNSET + selected_incident_type_ids: list[str] | Unset = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -126,12 +128,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 | Unset | str: + def _parse_value(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 f16f722a..5308dab5 100644 --- a/rootly_sdk/models/incident_form_field_selection_list.py +++ b/rootly_sdk/models/incident_form_field_selection_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class IncidentFormFieldSelectionList: """ Attributes: - data (list['IncidentFormFieldSelectionListDataItem']): + data (list[IncidentFormFieldSelectionListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["IncidentFormFieldSelectionListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[IncidentFormFieldSelectionListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 2de7ef35..4b57072f 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_form_field_selection_list_data_item_type.py b/rootly_sdk/models/incident_form_field_selection_list_data_item_type.py index e5bd7afb..82e5f805 100644 --- a/rootly_sdk/models/incident_form_field_selection_list_data_item_type.py +++ b/rootly_sdk/models/incident_form_field_selection_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentFormFieldSelectionListDataItemType = Literal["incident_form_field_selections"] @@ -13,7 +13,7 @@ def check_incident_form_field_selection_list_data_item_type( if value is None: return None if value in INCIDENT_FORM_FIELD_SELECTION_LIST_DATA_ITEM_TYPE_VALUES: - return cast(IncidentFormFieldSelectionListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_FORM_FIELD_SELECTION_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_form_field_selection_response.py b/rootly_sdk/models/incident_form_field_selection_response.py index b7e4c36f..403adc0f 100644 --- a/rootly_sdk/models/incident_form_field_selection_response.py +++ b/rootly_sdk/models/incident_form_field_selection_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class IncidentFormFieldSelectionResponse: """ Attributes: data (IncidentFormFieldSelectionResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "IncidentFormFieldSelectionResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: IncidentFormFieldSelectionResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 b10a39c7..8143f17b 100644 --- a/rootly_sdk/models/incident_form_field_selection_response_data.py +++ b/rootly_sdk/models/incident_form_field_selection_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_form_field_selection_response_data_type.py b/rootly_sdk/models/incident_form_field_selection_response_data_type.py index c842c4f6..646b4406 100644 --- a/rootly_sdk/models/incident_form_field_selection_response_data_type.py +++ b/rootly_sdk/models/incident_form_field_selection_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentFormFieldSelectionResponseDataType = Literal["incident_form_field_selections"] @@ -13,7 +13,7 @@ def check_incident_form_field_selection_response_data_type( if value is None: return None if value in INCIDENT_FORM_FIELD_SELECTION_RESPONSE_DATA_TYPE_VALUES: - return cast(IncidentFormFieldSelectionResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_FORM_FIELD_SELECTION_RESPONSE_DATA_TYPE_VALUES!r}" ) 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 5882e668..d9e70a76 100644 --- a/rootly_sdk/models/incident_in_triage_by_type_0.py +++ b/rootly_sdk/models/incident_in_triage_by_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 8d2f88e9..44337a9d 100644 --- a/rootly_sdk/models/incident_labels_type_0.py +++ b/rootly_sdk/models/incident_labels_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 da1fff97..aee7aa58 100644 --- a/rootly_sdk/models/incident_list.py +++ b/rootly_sdk/models/incident_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class IncidentList: """ Attributes: - data (list['IncidentListDataItem']): + data (list[IncidentListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["IncidentListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[IncidentListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 babda31a..0087518b 100644 --- a/rootly_sdk/models/incident_list_data_item.py +++ b/rootly_sdk/models/incident_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/incident_list_data_item_type.py b/rootly_sdk/models/incident_list_data_item_type.py index f9fb8e8a..ac518d03 100644 --- a/rootly_sdk/models/incident_list_data_item_type.py +++ b/rootly_sdk/models/incident_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentListDataItemType = Literal["incidents"] @@ -11,5 +11,5 @@ def check_incident_list_data_item_type(value: str | None) -> IncidentListDataIte if value is None: return None if value in INCIDENT_LIST_DATA_ITEM_TYPE_VALUES: - return cast(IncidentListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_mitigated_by_type_0.py b/rootly_sdk/models/incident_mitigated_by_type_0.py index 78045edb..cb9cdf55 100644 --- a/rootly_sdk/models/incident_mitigated_by_type_0.py +++ b/rootly_sdk/models/incident_mitigated_by_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 ca9eaaf7..ea4d766a 100644 --- a/rootly_sdk/models/incident_permission_set.py +++ b/rootly_sdk/models/incident_permission_set.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -24,19 +26,19 @@ class IncidentPermissionSet: name (str): The incident permission set name. created_at (str): updated_at (str): - 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]]): + 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): """ name: str created_at: str updated_at: str - slug: Unset | str = UNSET - description: None | Unset | str = UNSET - private_incident_permissions: Unset | list[IncidentPermissionSetPrivateIncidentPermissionsItem] = UNSET - public_incident_permissions: Unset | list[IncidentPermissionSetPublicIncidentPermissionsItem] = UNSET + slug: str | Unset = UNSET + description: None | str | Unset = UNSET + private_incident_permissions: list[IncidentPermissionSetPrivateIncidentPermissionsItem] | Unset = UNSET + public_incident_permissions: list[IncidentPermissionSetPublicIncidentPermissionsItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -48,20 +50,20 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - private_incident_permissions: Unset | list[str] = UNSET + private_incident_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + public_incident_permissions: list[str] | Unset = UNSET if not isinstance(self.public_incident_permissions, Unset): public_incident_permissions = [] for public_incident_permissions_item_data in self.public_incident_permissions: @@ -99,32 +101,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - private_incident_permissions = [] _private_incident_permissions = d.pop("private_incident_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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 + ) - 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 a61795ab..681230c8 100644 --- a/rootly_sdk/models/incident_permission_set_boolean.py +++ b/rootly_sdk/models/incident_permission_set_boolean.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -20,17 +22,17 @@ class IncidentPermissionSetBoolean: kind (IncidentPermissionSetBooleanKind): created_at (str): updated_at (str): - incident_permission_set_id (Union[Unset, str]): - private (Union[Unset, bool]): - enabled (Union[Unset, bool]): + incident_permission_set_id (str | Unset): + private (bool | Unset): + enabled (bool | Unset): """ kind: IncidentPermissionSetBooleanKind created_at: str updated_at: str - incident_permission_set_id: Unset | str = UNSET - private: Unset | bool = UNSET - enabled: Unset | bool = UNSET + incident_permission_set_id: str | Unset = UNSET + private: bool | Unset = UNSET + enabled: bool | Unset = UNSET 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_kind.py b/rootly_sdk/models/incident_permission_set_boolean_kind.py index 80da8070..6abe5127 100644 --- a/rootly_sdk/models/incident_permission_set_boolean_kind.py +++ b/rootly_sdk/models/incident_permission_set_boolean_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentPermissionSetBooleanKind = Literal[ "assign_incident_roles", @@ -35,5 +35,5 @@ def check_incident_permission_set_boolean_kind(value: str | None) -> IncidentPer if value is None: return None if value in INCIDENT_PERMISSION_SET_BOOLEAN_KIND_VALUES: - return cast(IncidentPermissionSetBooleanKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_PERMISSION_SET_BOOLEAN_KIND_VALUES!r}") diff --git a/rootly_sdk/models/incident_permission_set_boolean_list.py b/rootly_sdk/models/incident_permission_set_boolean_list.py index aaf3a5d4..9de80e26 100644 --- a/rootly_sdk/models/incident_permission_set_boolean_list.py +++ b/rootly_sdk/models/incident_permission_set_boolean_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class IncidentPermissionSetBooleanList: """ Attributes: - data (list['IncidentPermissionSetBooleanListDataItem']): + data (list[IncidentPermissionSetBooleanListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["IncidentPermissionSetBooleanListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[IncidentPermissionSetBooleanListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 89085db4..e356914c 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_permission_set_boolean_list_data_item_type.py b/rootly_sdk/models/incident_permission_set_boolean_list_data_item_type.py index 177f1de9..4ca928f9 100644 --- a/rootly_sdk/models/incident_permission_set_boolean_list_data_item_type.py +++ b/rootly_sdk/models/incident_permission_set_boolean_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentPermissionSetBooleanListDataItemType = Literal["incident_permission_set_booleans"] @@ -13,7 +13,7 @@ def check_incident_permission_set_boolean_list_data_item_type( if value is None: return None if value in INCIDENT_PERMISSION_SET_BOOLEAN_LIST_DATA_ITEM_TYPE_VALUES: - return cast(IncidentPermissionSetBooleanListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_PERMISSION_SET_BOOLEAN_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_permission_set_boolean_response.py b/rootly_sdk/models/incident_permission_set_boolean_response.py index 4400150a..3ba37831 100644 --- a/rootly_sdk/models/incident_permission_set_boolean_response.py +++ b/rootly_sdk/models/incident_permission_set_boolean_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class IncidentPermissionSetBooleanResponse: """ Attributes: data (IncidentPermissionSetBooleanResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "IncidentPermissionSetBooleanResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: IncidentPermissionSetBooleanResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 a1e629fc..5c85b779 100644 --- a/rootly_sdk/models/incident_permission_set_boolean_response_data.py +++ b/rootly_sdk/models/incident_permission_set_boolean_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_permission_set_boolean_response_data_type.py b/rootly_sdk/models/incident_permission_set_boolean_response_data_type.py index 4f619ea0..27ba9e3c 100644 --- a/rootly_sdk/models/incident_permission_set_boolean_response_data_type.py +++ b/rootly_sdk/models/incident_permission_set_boolean_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentPermissionSetBooleanResponseDataType = Literal["incident_permission_set_booleans"] @@ -13,7 +13,7 @@ def check_incident_permission_set_boolean_response_data_type( if value is None: return None if value in INCIDENT_PERMISSION_SET_BOOLEAN_RESPONSE_DATA_TYPE_VALUES: - return cast(IncidentPermissionSetBooleanResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_PERMISSION_SET_BOOLEAN_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_permission_set_list.py b/rootly_sdk/models/incident_permission_set_list.py index d847ecac..babdfd06 100644 --- a/rootly_sdk/models/incident_permission_set_list.py +++ b/rootly_sdk/models/incident_permission_set_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class IncidentPermissionSetList: """ Attributes: - data (list['IncidentPermissionSetListDataItem']): + data (list[IncidentPermissionSetListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["IncidentPermissionSetListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[IncidentPermissionSetListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 f6498f4d..119ee59f 100644 --- a/rootly_sdk/models/incident_permission_set_list_data_item.py +++ b/rootly_sdk/models/incident_permission_set_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_permission_set_list_data_item_type.py b/rootly_sdk/models/incident_permission_set_list_data_item_type.py index 03b293d4..e3ddc75b 100644 --- a/rootly_sdk/models/incident_permission_set_list_data_item_type.py +++ b/rootly_sdk/models/incident_permission_set_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentPermissionSetListDataItemType = Literal["incident_permission_sets"] @@ -13,7 +13,7 @@ def check_incident_permission_set_list_data_item_type( if value is None: return None if value in INCIDENT_PERMISSION_SET_LIST_DATA_ITEM_TYPE_VALUES: - return cast(IncidentPermissionSetListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_PERMISSION_SET_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_permission_set_private_incident_permissions_item.py b/rootly_sdk/models/incident_permission_set_private_incident_permissions_item.py index 3560cac7..db58a807 100644 --- a/rootly_sdk/models/incident_permission_set_private_incident_permissions_item.py +++ b/rootly_sdk/models/incident_permission_set_private_incident_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentPermissionSetPrivateIncidentPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_incident_permission_set_private_incident_permissions_item( if value is None: return None if value in INCIDENT_PERMISSION_SET_PRIVATE_INCIDENT_PERMISSIONS_ITEM_VALUES: - return cast(IncidentPermissionSetPrivateIncidentPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_PERMISSION_SET_PRIVATE_INCIDENT_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_permission_set_public_incident_permissions_item.py b/rootly_sdk/models/incident_permission_set_public_incident_permissions_item.py index df37158c..844099c8 100644 --- a/rootly_sdk/models/incident_permission_set_public_incident_permissions_item.py +++ b/rootly_sdk/models/incident_permission_set_public_incident_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentPermissionSetPublicIncidentPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_incident_permission_set_public_incident_permissions_item( if value is None: return None if value in INCIDENT_PERMISSION_SET_PUBLIC_INCIDENT_PERMISSIONS_ITEM_VALUES: - return cast(IncidentPermissionSetPublicIncidentPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_PERMISSION_SET_PUBLIC_INCIDENT_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_permission_set_resource.py b/rootly_sdk/models/incident_permission_set_resource.py index 9a6e6ccd..301cd270 100644 --- a/rootly_sdk/models/incident_permission_set_resource.py +++ b/rootly_sdk/models/incident_permission_set_resource.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -21,18 +23,18 @@ class IncidentPermissionSetResource: kind (IncidentPermissionSetResourceKind): created_at (str): updated_at (str): - private (Union[Unset, bool]): - resource_id (Union[Unset, str]): - resource_type (Union[Unset, str]): + private (bool | Unset): + resource_id (str | Unset): + resource_type (str | Unset): """ incident_permission_set_id: str kind: IncidentPermissionSetResourceKind created_at: str updated_at: str - private: Unset | bool = UNSET - resource_id: Unset | str = UNSET - resource_type: Unset | str = UNSET + private: bool | Unset = UNSET + resource_id: str | Unset = UNSET + resource_type: str | Unset = UNSET 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_kind.py b/rootly_sdk/models/incident_permission_set_resource_kind.py index 8b8a95d3..0f4534f6 100644 --- a/rootly_sdk/models/incident_permission_set_resource_kind.py +++ b/rootly_sdk/models/incident_permission_set_resource_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentPermissionSetResourceKind = Literal["incident_types", "severities", "statuses", "sub_statuses"] @@ -14,5 +14,5 @@ def check_incident_permission_set_resource_kind(value: str | None) -> IncidentPe if value is None: return None if value in INCIDENT_PERMISSION_SET_RESOURCE_KIND_VALUES: - return cast(IncidentPermissionSetResourceKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_PERMISSION_SET_RESOURCE_KIND_VALUES!r}") diff --git a/rootly_sdk/models/incident_permission_set_resource_list.py b/rootly_sdk/models/incident_permission_set_resource_list.py index 4ea3383e..37c12f1e 100644 --- a/rootly_sdk/models/incident_permission_set_resource_list.py +++ b/rootly_sdk/models/incident_permission_set_resource_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class IncidentPermissionSetResourceList: """ Attributes: - data (list['IncidentPermissionSetResourceListDataItem']): + data (list[IncidentPermissionSetResourceListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["IncidentPermissionSetResourceListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[IncidentPermissionSetResourceListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 118d6aa1..7d14eee6 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_permission_set_resource_list_data_item_type.py b/rootly_sdk/models/incident_permission_set_resource_list_data_item_type.py index 3d1c26c5..bf36cf79 100644 --- a/rootly_sdk/models/incident_permission_set_resource_list_data_item_type.py +++ b/rootly_sdk/models/incident_permission_set_resource_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentPermissionSetResourceListDataItemType = Literal["incident_permission_set_resources"] @@ -13,7 +13,7 @@ def check_incident_permission_set_resource_list_data_item_type( if value is None: return None if value in INCIDENT_PERMISSION_SET_RESOURCE_LIST_DATA_ITEM_TYPE_VALUES: - return cast(IncidentPermissionSetResourceListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_PERMISSION_SET_RESOURCE_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_permission_set_resource_response.py b/rootly_sdk/models/incident_permission_set_resource_response.py index fc0bb33c..6c0e7fa5 100644 --- a/rootly_sdk/models/incident_permission_set_resource_response.py +++ b/rootly_sdk/models/incident_permission_set_resource_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class IncidentPermissionSetResourceResponse: """ Attributes: data (IncidentPermissionSetResourceResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "IncidentPermissionSetResourceResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: IncidentPermissionSetResourceResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 4120859c..7d77c245 100644 --- a/rootly_sdk/models/incident_permission_set_resource_response_data.py +++ b/rootly_sdk/models/incident_permission_set_resource_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_permission_set_resource_response_data_type.py b/rootly_sdk/models/incident_permission_set_resource_response_data_type.py index ccb52fb3..a0c230ce 100644 --- a/rootly_sdk/models/incident_permission_set_resource_response_data_type.py +++ b/rootly_sdk/models/incident_permission_set_resource_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentPermissionSetResourceResponseDataType = Literal["incident_permission_set_resources"] @@ -13,7 +13,7 @@ def check_incident_permission_set_resource_response_data_type( if value is None: return None if value in INCIDENT_PERMISSION_SET_RESOURCE_RESPONSE_DATA_TYPE_VALUES: - return cast(IncidentPermissionSetResourceResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_PERMISSION_SET_RESOURCE_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_permission_set_response.py b/rootly_sdk/models/incident_permission_set_response.py index f777d861..29c452e4 100644 --- a/rootly_sdk/models/incident_permission_set_response.py +++ b/rootly_sdk/models/incident_permission_set_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class IncidentPermissionSetResponse: """ Attributes: data (IncidentPermissionSetResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "IncidentPermissionSetResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: IncidentPermissionSetResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 239d598f..086da0db 100644 --- a/rootly_sdk/models/incident_permission_set_response_data.py +++ b/rootly_sdk/models/incident_permission_set_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_permission_set_response_data_type.py b/rootly_sdk/models/incident_permission_set_response_data_type.py index 9be1c033..8f30f8e4 100644 --- a/rootly_sdk/models/incident_permission_set_response_data_type.py +++ b/rootly_sdk/models/incident_permission_set_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentPermissionSetResponseDataType = Literal["incident_permission_sets"] @@ -11,7 +11,7 @@ def check_incident_permission_set_response_data_type(value: str | None) -> Incid if value is None: return None if value in INCIDENT_PERMISSION_SET_RESPONSE_DATA_TYPE_VALUES: - return cast(IncidentPermissionSetResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_PERMISSION_SET_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_post_mortem.py b/rootly_sdk/models/incident_post_mortem.py index 73b656dc..b3798e39 100644 --- a/rootly_sdk/models/incident_post_mortem.py +++ b/rootly_sdk/models/incident_post_mortem.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -21,44 +23,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 (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 + 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 timeline Default: 'desc'. - 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 + 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 """ title: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -68,29 +70,29 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - content: None | Unset | str + content: None | str | Unset if isinstance(self.content, Unset): content = UNSET else: content = self.content - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - mitigated_at: None | Unset | str + mitigated_at: None | str | Unset if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: None | Unset | str + resolved_at: None | str | Unset if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: @@ -106,7 +108,7 @@ def to_dict(self) -> dict[str, Any]: show_timeline_action_items = self.show_timeline_action_items - show_timeline_order: Unset | str = UNSET + show_timeline_order: str | Unset = UNSET if not isinstance(self.show_timeline_order, Unset): show_timeline_order = self.show_timeline_order @@ -173,46 +175,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 | Unset | str: + def _parse_content(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) content = _parse_content(d.pop("content", UNSET)) _status = d.pop("status", UNSET) - status: Unset | IncidentPostMortemStatus + status: IncidentPostMortemStatus | Unset if isinstance(_status, Unset): status = UNSET else: status = check_incident_post_mortem_status(_status) - def _parse_started_at(data: object) -> None | Unset | str: + def _parse_started_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_mitigated_at(data: object) -> None | Unset | str: + def _parse_mitigated_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> None | Unset | str: + def _parse_resolved_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) @@ -227,7 +229,7 @@ def _parse_resolved_at(data: object) -> None | Unset | str: show_timeline_action_items = d.pop("show_timeline_action_items", UNSET) _show_timeline_order = d.pop("show_timeline_order", UNSET) - show_timeline_order: Unset | IncidentPostMortemShowTimelineOrder + show_timeline_order: IncidentPostMortemShowTimelineOrder | Unset 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 f7efcaa0..e7b97004 100644 --- a/rootly_sdk/models/incident_post_mortem_list.py +++ b/rootly_sdk/models/incident_post_mortem_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class IncidentPostMortemList: """ Attributes: - data (list['IncidentPostMortemListDataItem']): + data (list[IncidentPostMortemListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["IncidentPostMortemListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[IncidentPostMortemListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 83ac4c56..956c4ed2 100644 --- a/rootly_sdk/models/incident_post_mortem_list_data_item.py +++ b/rootly_sdk/models/incident_post_mortem_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_post_mortem_list_data_item_type.py b/rootly_sdk/models/incident_post_mortem_list_data_item_type.py index f8521394..7aa06925 100644 --- a/rootly_sdk/models/incident_post_mortem_list_data_item_type.py +++ b/rootly_sdk/models/incident_post_mortem_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentPostMortemListDataItemType = Literal["incident_post_mortems"] @@ -11,5 +11,5 @@ def check_incident_post_mortem_list_data_item_type(value: str | None) -> Inciden if value is None: return None if value in INCIDENT_POST_MORTEM_LIST_DATA_ITEM_TYPE_VALUES: - return cast(IncidentPostMortemListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_POST_MORTEM_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_post_mortem_response.py b/rootly_sdk/models/incident_post_mortem_response.py index 1a0c29ab..7eadc19c 100644 --- a/rootly_sdk/models/incident_post_mortem_response.py +++ b/rootly_sdk/models/incident_post_mortem_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class IncidentPostMortemResponse: """ Attributes: data (IncidentPostMortemResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "IncidentPostMortemResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: IncidentPostMortemResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 c32b822e..c5f49a4e 100644 --- a/rootly_sdk/models/incident_post_mortem_response_data.py +++ b/rootly_sdk/models/incident_post_mortem_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_post_mortem_response_data_type.py b/rootly_sdk/models/incident_post_mortem_response_data_type.py index d0b662fc..399ddf22 100644 --- a/rootly_sdk/models/incident_post_mortem_response_data_type.py +++ b/rootly_sdk/models/incident_post_mortem_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentPostMortemResponseDataType = Literal["incident_post_mortems"] @@ -11,5 +11,5 @@ def check_incident_post_mortem_response_data_type(value: str | None) -> Incident if value is None: return None if value in INCIDENT_POST_MORTEM_RESPONSE_DATA_TYPE_VALUES: - return cast(IncidentPostMortemResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_POST_MORTEM_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_post_mortem_show_timeline_order.py b/rootly_sdk/models/incident_post_mortem_show_timeline_order.py index 4d1f1089..635fd3c5 100644 --- a/rootly_sdk/models/incident_post_mortem_show_timeline_order.py +++ b/rootly_sdk/models/incident_post_mortem_show_timeline_order.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentPostMortemShowTimelineOrder = Literal["asc", "desc"] @@ -12,5 +12,5 @@ def check_incident_post_mortem_show_timeline_order(value: str | None) -> Inciden if value is None: return None if value in INCIDENT_POST_MORTEM_SHOW_TIMELINE_ORDER_VALUES: - return cast(IncidentPostMortemShowTimelineOrder, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_POST_MORTEM_SHOW_TIMELINE_ORDER_VALUES!r}") diff --git a/rootly_sdk/models/incident_post_mortem_status.py b/rootly_sdk/models/incident_post_mortem_status.py index 368b3bc0..c02e953e 100644 --- a/rootly_sdk/models/incident_post_mortem_status.py +++ b/rootly_sdk/models/incident_post_mortem_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentPostMortemStatus = Literal["draft", "published"] @@ -12,5 +12,5 @@ def check_incident_post_mortem_status(value: str | None) -> IncidentPostMortemSt if value is None: return None if value in INCIDENT_POST_MORTEM_STATUS_VALUES: - return cast(IncidentPostMortemStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_POST_MORTEM_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/incident_resolved_by_type_0.py b/rootly_sdk/models/incident_resolved_by_type_0.py index 6b8abbc3..053c1026 100644 --- a/rootly_sdk/models/incident_resolved_by_type_0.py +++ b/rootly_sdk/models/incident_resolved_by_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 e77f749c..6ec28ab0 100644 --- a/rootly_sdk/models/incident_response.py +++ b/rootly_sdk/models/incident_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class IncidentResponse: """ Attributes: data (IncidentResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "IncidentResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: IncidentResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 e36fbd3f..0bbe83f7 100644 --- a/rootly_sdk/models/incident_response_data.py +++ b/rootly_sdk/models/incident_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/incident_response_data_type.py b/rootly_sdk/models/incident_response_data_type.py index 9d53cff0..f834cf0c 100644 --- a/rootly_sdk/models/incident_response_data_type.py +++ b/rootly_sdk/models/incident_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentResponseDataType = Literal["incidents"] @@ -11,5 +11,5 @@ def check_incident_response_data_type(value: str | None) -> IncidentResponseData if value is None: return None if value in INCIDENT_RESPONSE_DATA_TYPE_VALUES: - return cast(IncidentResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_retrospective_progress_status.py b/rootly_sdk/models/incident_retrospective_progress_status.py index 9a7458fa..bdd1e190 100644 --- a/rootly_sdk/models/incident_retrospective_progress_status.py +++ b/rootly_sdk/models/incident_retrospective_progress_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentRetrospectiveProgressStatus = Literal["active", "completed", "not_started", "skipped"] @@ -14,5 +14,5 @@ def check_incident_retrospective_progress_status(value: str | None) -> IncidentR if value is None: return None if value in INCIDENT_RETROSPECTIVE_PROGRESS_STATUS_VALUES: - return cast(IncidentRetrospectiveProgressStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_RETROSPECTIVE_PROGRESS_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/incident_retrospective_step.py b/rootly_sdk/models/incident_retrospective_step.py index bdd48caa..96dca873 100644 --- a/rootly_sdk/models/incident_retrospective_step.py +++ b/rootly_sdk/models/incident_retrospective_step.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -22,12 +24,12 @@ class IncidentRetrospectiveStep: title (str): The name of the step created_at (str): Date of creation updated_at (str): Date of last update - 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? + 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? """ retrospective_step_id: str @@ -35,12 +37,12 @@ class IncidentRetrospectiveStep: title: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,23 +56,23 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status - kind: None | Unset | str + kind: None | str | Unset if isinstance(self.kind, Unset): kind = UNSET else: kind = self.kind - due_date: None | Unset | str + due_date: None | str | Unset if isinstance(self.due_date, Unset): due_date = UNSET else: @@ -119,37 +121,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) _status = d.pop("status", UNSET) - status: Unset | IncidentRetrospectiveStepStatus + status: IncidentRetrospectiveStepStatus | Unset if isinstance(_status, Unset): status = UNSET else: status = check_incident_retrospective_step_status(_status) - def _parse_kind(data: object) -> None | Unset | str: + def _parse_kind(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) kind = _parse_kind(d.pop("kind", UNSET)) - def _parse_due_date(data: object) -> None | Unset | str: + def _parse_due_date(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 a30d5e05..442bbed3 100644 --- a/rootly_sdk/models/incident_retrospective_step_response.py +++ b/rootly_sdk/models/incident_retrospective_step_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class IncidentRetrospectiveStepResponse: """ Attributes: data (IncidentRetrospectiveStepResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "IncidentRetrospectiveStepResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: IncidentRetrospectiveStepResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 c231054b..d5e1b578 100644 --- a/rootly_sdk/models/incident_retrospective_step_response_data.py +++ b/rootly_sdk/models/incident_retrospective_step_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_retrospective_step_response_data_type.py b/rootly_sdk/models/incident_retrospective_step_response_data_type.py index ea518832..0e1f955d 100644 --- a/rootly_sdk/models/incident_retrospective_step_response_data_type.py +++ b/rootly_sdk/models/incident_retrospective_step_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentRetrospectiveStepResponseDataType = Literal["incident_retrospective_steps"] @@ -13,7 +13,7 @@ def check_incident_retrospective_step_response_data_type( if value is None: return None if value in INCIDENT_RETROSPECTIVE_STEP_RESPONSE_DATA_TYPE_VALUES: - return cast(IncidentRetrospectiveStepResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_RETROSPECTIVE_STEP_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_retrospective_step_status.py b/rootly_sdk/models/incident_retrospective_step_status.py index 6c867683..e4fb3d53 100644 --- a/rootly_sdk/models/incident_retrospective_step_status.py +++ b/rootly_sdk/models/incident_retrospective_step_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentRetrospectiveStepStatus = Literal["completed", "in_progress", "skipped", "todo"] @@ -14,5 +14,5 @@ def check_incident_retrospective_step_status(value: str | None) -> IncidentRetro if value is None: return None if value in INCIDENT_RETROSPECTIVE_STEP_STATUS_VALUES: - return cast(IncidentRetrospectiveStepStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_RETROSPECTIVE_STEP_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/incident_role.py b/rootly_sdk/models/incident_role.py index c5216257..9aa66312 100644 --- a/rootly_sdk/models/incident_role.py +++ b/rootly_sdk/models/incident_role.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,25 +18,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 (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]): + 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): """ name: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,19 +48,19 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - summary: None | Unset | str + summary: None | str | Unset if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -107,30 +109,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_summary(data: object) -> None | Unset | str: + def _parse_summary(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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 1f71ce7f..52eaae48 100644 --- a/rootly_sdk/models/incident_role_list.py +++ b/rootly_sdk/models/incident_role_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class IncidentRoleList: """ Attributes: - data (list['IncidentRoleListDataItem']): + data (list[IncidentRoleListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["IncidentRoleListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[IncidentRoleListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 c736b804..3a519dc9 100644 --- a/rootly_sdk/models/incident_role_list_data_item.py +++ b/rootly_sdk/models/incident_role_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_role_list_data_item_type.py b/rootly_sdk/models/incident_role_list_data_item_type.py index 3c14480a..0d4028b4 100644 --- a/rootly_sdk/models/incident_role_list_data_item_type.py +++ b/rootly_sdk/models/incident_role_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentRoleListDataItemType = Literal["incident_roles"] @@ -11,5 +11,5 @@ def check_incident_role_list_data_item_type(value: str | None) -> IncidentRoleLi if value is None: return None if value in INCIDENT_ROLE_LIST_DATA_ITEM_TYPE_VALUES: - return cast(IncidentRoleListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_ROLE_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_role_response.py b/rootly_sdk/models/incident_role_response.py index 6a7cd413..66785284 100644 --- a/rootly_sdk/models/incident_role_response.py +++ b/rootly_sdk/models/incident_role_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class IncidentRoleResponse: """ Attributes: data (IncidentRoleResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "IncidentRoleResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: IncidentRoleResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 9b1a5e16..b6a7a41d 100644 --- a/rootly_sdk/models/incident_role_response_data.py +++ b/rootly_sdk/models/incident_role_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_role_response_data_type.py b/rootly_sdk/models/incident_role_response_data_type.py index 6e00cd8c..b2e2fd76 100644 --- a/rootly_sdk/models/incident_role_response_data_type.py +++ b/rootly_sdk/models/incident_role_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentRoleResponseDataType = Literal["incident_roles"] @@ -11,5 +11,5 @@ def check_incident_role_response_data_type(value: str | None) -> IncidentRoleRes if value is None: return None if value in INCIDENT_ROLE_RESPONSE_DATA_TYPE_VALUES: - return cast(IncidentRoleResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_ROLE_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_role_task.py b/rootly_sdk/models/incident_role_task.py index 16646549..5d7c3c97 100644 --- a/rootly_sdk/models/incident_role_task.py +++ b/rootly_sdk/models/incident_role_task.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,17 +19,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 (Union[Unset, str]): - description (Union[None, Unset, str]): The description of incident task - priority (Union[Unset, IncidentRoleTaskPriority]): The priority of the incident task + incident_role_id (str | Unset): + description (None | str | Unset): The description of incident task + priority (IncidentRoleTaskPriority | Unset): The priority of the incident task """ task: str created_at: str updated_at: str - incident_role_id: Unset | str = UNSET - description: None | Unset | str = UNSET - priority: Unset | IncidentRoleTaskPriority = UNSET + incident_role_id: str | Unset = UNSET + description: None | str | Unset = UNSET + priority: IncidentRoleTaskPriority | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -39,13 +41,13 @@ def to_dict(self) -> dict[str, Any]: incident_role_id = self.incident_role_id - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - priority: Unset | str = UNSET + priority: str | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -78,17 +80,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) _priority = d.pop("priority", UNSET) - priority: Unset | IncidentRoleTaskPriority + priority: IncidentRoleTaskPriority | Unset 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 481d26cb..83677305 100644 --- a/rootly_sdk/models/incident_role_task_list.py +++ b/rootly_sdk/models/incident_role_task_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class IncidentRoleTaskList: """ Attributes: - data (list['IncidentRoleTaskListDataItem']): + data (list[IncidentRoleTaskListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["IncidentRoleTaskListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[IncidentRoleTaskListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 708c5a06..f9a55f68 100644 --- a/rootly_sdk/models/incident_role_task_list_data_item.py +++ b/rootly_sdk/models/incident_role_task_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_role_task_list_data_item_type.py b/rootly_sdk/models/incident_role_task_list_data_item_type.py index 18b2196f..8113a5df 100644 --- a/rootly_sdk/models/incident_role_task_list_data_item_type.py +++ b/rootly_sdk/models/incident_role_task_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentRoleTaskListDataItemType = Literal["incident_role_tasks"] @@ -11,5 +11,5 @@ def check_incident_role_task_list_data_item_type(value: str | None) -> IncidentR if value is None: return None if value in INCIDENT_ROLE_TASK_LIST_DATA_ITEM_TYPE_VALUES: - return cast(IncidentRoleTaskListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_ROLE_TASK_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_role_task_priority.py b/rootly_sdk/models/incident_role_task_priority.py index 72dbd981..e1a28606 100644 --- a/rootly_sdk/models/incident_role_task_priority.py +++ b/rootly_sdk/models/incident_role_task_priority.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentRoleTaskPriority = Literal["high", "low", "medium"] @@ -13,5 +13,5 @@ def check_incident_role_task_priority(value: str | None) -> IncidentRoleTaskPrio if value is None: return None if value in INCIDENT_ROLE_TASK_PRIORITY_VALUES: - return cast(IncidentRoleTaskPriority, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_ROLE_TASK_PRIORITY_VALUES!r}") diff --git a/rootly_sdk/models/incident_role_task_response.py b/rootly_sdk/models/incident_role_task_response.py index 7716f2b0..0c5d62ca 100644 --- a/rootly_sdk/models/incident_role_task_response.py +++ b/rootly_sdk/models/incident_role_task_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class IncidentRoleTaskResponse: """ Attributes: data (IncidentRoleTaskResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "IncidentRoleTaskResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: IncidentRoleTaskResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 7fd228aa..04f49ff4 100644 --- a/rootly_sdk/models/incident_role_task_response_data.py +++ b/rootly_sdk/models/incident_role_task_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_role_task_response_data_type.py b/rootly_sdk/models/incident_role_task_response_data_type.py index 39ed0a2f..06409686 100644 --- a/rootly_sdk/models/incident_role_task_response_data_type.py +++ b/rootly_sdk/models/incident_role_task_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentRoleTaskResponseDataType = Literal["incident_role_tasks"] @@ -11,5 +11,5 @@ def check_incident_role_task_response_data_type(value: str | None) -> IncidentRo if value is None: return None if value in INCIDENT_ROLE_TASK_RESPONSE_DATA_TYPE_VALUES: - return cast(IncidentRoleTaskResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_ROLE_TASK_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_started_by_type_0.py b/rootly_sdk/models/incident_started_by_type_0.py index 5189979b..241e922c 100644 --- a/rootly_sdk/models/incident_started_by_type_0.py +++ b/rootly_sdk/models/incident_started_by_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 048ce5a7..2d3a33b2 100644 --- a/rootly_sdk/models/incident_status_page_event.py +++ b/rootly_sdk/models/incident_status_page_event.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,23 +29,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 (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 + 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_components (list[IncidentStatusPageEventStatusPageComponentsItem] | Unset): 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: Unset | str = UNSET - status: Unset | IncidentStatusPageEventStatus = UNSET - notify_subscribers: Unset | bool = UNSET - should_tweet: Unset | bool = UNSET - status_page_components: Unset | list["IncidentStatusPageEventStatusPageComponentsItem"] = UNSET + status_page_id: str | Unset = UNSET + status: IncidentStatusPageEventStatus | Unset = UNSET + notify_subscribers: bool | Unset = UNSET + should_tweet: bool | Unset = UNSET + status_page_components: list[IncidentStatusPageEventStatusPageComponentsItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -57,7 +59,7 @@ def to_dict(self) -> dict[str, Any]: status_page_id = self.status_page_id - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status @@ -65,7 +67,7 @@ def to_dict(self) -> dict[str, Any]: should_tweet = self.should_tweet - status_page_components: Unset | list[dict[str, Any]] = UNSET + status_page_components: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.status_page_components, Unset): status_page_components = [] for status_page_components_item_data in self.status_page_components: @@ -113,7 +115,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: Unset | IncidentStatusPageEventStatus + status: IncidentStatusPageEventStatus | Unset if isinstance(_status, Unset): status = UNSET else: @@ -123,14 +125,16 @@ 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: list[IncidentStatusPageEventStatusPageComponentsItem] | Unset = UNSET + if _status_page_components is not UNSET: + status_page_components = [] + for status_page_components_item_data in _status_page_components: + status_page_components_item = IncidentStatusPageEventStatusPageComponentsItem.from_dict( + status_page_components_item_data + ) - status_page_components.append(status_page_components_item) + status_page_components.append(status_page_components_item) incident_status_page_event = cls( event=event, diff --git a/rootly_sdk/models/incident_status_page_event_list.py b/rootly_sdk/models/incident_status_page_event_list.py index 73ece2a3..4c4d3640 100644 --- a/rootly_sdk/models/incident_status_page_event_list.py +++ b/rootly_sdk/models/incident_status_page_event_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class IncidentStatusPageEventList: """ Attributes: - data (list['IncidentStatusPageEventListDataItem']): + data (list[IncidentStatusPageEventListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["IncidentStatusPageEventListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[IncidentStatusPageEventListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 6187375a..18ef50a2 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_status_page_event_list_data_item_type.py b/rootly_sdk/models/incident_status_page_event_list_data_item_type.py index 283c2160..48c78bad 100644 --- a/rootly_sdk/models/incident_status_page_event_list_data_item_type.py +++ b/rootly_sdk/models/incident_status_page_event_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentStatusPageEventListDataItemType = Literal["incident_status_page_events"] @@ -13,7 +13,7 @@ def check_incident_status_page_event_list_data_item_type( if value is None: return None if value in INCIDENT_STATUS_PAGE_EVENT_LIST_DATA_ITEM_TYPE_VALUES: - return cast(IncidentStatusPageEventListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_STATUS_PAGE_EVENT_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_status_page_event_response.py b/rootly_sdk/models/incident_status_page_event_response.py index 53860c68..f15db200 100644 --- a/rootly_sdk/models/incident_status_page_event_response.py +++ b/rootly_sdk/models/incident_status_page_event_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class IncidentStatusPageEventResponse: """ Attributes: data (IncidentStatusPageEventResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "IncidentStatusPageEventResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: IncidentStatusPageEventResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 2a860a98..7310f9cb 100644 --- a/rootly_sdk/models/incident_status_page_event_response_data.py +++ b/rootly_sdk/models/incident_status_page_event_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_status_page_event_response_data_type.py b/rootly_sdk/models/incident_status_page_event_response_data_type.py index de5057ac..1bacf74c 100644 --- a/rootly_sdk/models/incident_status_page_event_response_data_type.py +++ b/rootly_sdk/models/incident_status_page_event_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentStatusPageEventResponseDataType = Literal["incident_status_page_events"] @@ -13,7 +13,7 @@ def check_incident_status_page_event_response_data_type( if value is None: return None if value in INCIDENT_STATUS_PAGE_EVENT_RESPONSE_DATA_TYPE_VALUES: - return cast(IncidentStatusPageEventResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_STATUS_PAGE_EVENT_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_status_page_event_status.py b/rootly_sdk/models/incident_status_page_event_status.py index 5c489042..1ccc8f38 100644 --- a/rootly_sdk/models/incident_status_page_event_status.py +++ b/rootly_sdk/models/incident_status_page_event_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentStatusPageEventStatus = Literal[ "completed", "identified", "in_progress", "investigating", "monitoring", "resolved", "scheduled" @@ -19,5 +19,5 @@ def check_incident_status_page_event_status(value: str | None) -> IncidentStatus if value is None: return None if value in INCIDENT_STATUS_PAGE_EVENT_STATUS_VALUES: - return cast(IncidentStatusPageEventStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_STATUS_PAGE_EVENT_STATUS_VALUES!r}") 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 index 930468ea..59a9d39d 100644 --- 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 @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -18,18 +20,17 @@ 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 (IncidentStatusPageEventStatusPageComponentsItemStatus | Unset): The status recorded for the component """ status_page_component_id: str - status: Unset | IncidentStatusPageEventStatusPageComponentsItemStatus = UNSET + status: IncidentStatusPageEventStatusPageComponentsItemStatus | Unset = 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 + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status @@ -51,7 +52,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_component_id = d.pop("status_page_component_id") _status = d.pop("status", UNSET) - status: Unset | IncidentStatusPageEventStatusPageComponentsItemStatus + status: IncidentStatusPageEventStatusPageComponentsItemStatus | Unset if isinstance(_status, Unset): status = UNSET else: 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 index 7013b60f..39543d06 100644 --- 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 @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentStatusPageEventStatusPageComponentsItemStatus = Literal[ "degraded_performance", "major_outage", "operational", "partial_outage" @@ -20,7 +20,7 @@ def check_incident_status_page_event_status_page_components_item_status( if value is None: return None if value in INCIDENT_STATUS_PAGE_EVENT_STATUS_PAGE_COMPONENTS_ITEM_STATUS_VALUES: - return cast(IncidentStatusPageEventStatusPageComponentsItemStatus, value) + return 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 62537e7e..5fa71a29 100644 --- a/rootly_sdk/models/incident_sub_status.py +++ b/rootly_sdk/models/incident_sub_status.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,13 +20,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 (Union[None, Unset, int]): + assigned_by_user_id (int | None | Unset): """ incident_id: str sub_status_id: str assigned_at: str - assigned_by_user_id: None | Unset | int = UNSET + assigned_by_user_id: int | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: assigned_at = self.assigned_at - assigned_by_user_id: None | Unset | int + assigned_by_user_id: int | None | Unset if isinstance(self.assigned_by_user_id, Unset): assigned_by_user_id = UNSET else: @@ -63,12 +65,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) -> None | Unset | int: + def _parse_assigned_by_user_id(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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 2ce4f83f..4e1f1b86 100644 --- a/rootly_sdk/models/incident_sub_status_list.py +++ b/rootly_sdk/models/incident_sub_status_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class IncidentSubStatusList: """ Attributes: - data (list['IncidentSubStatusListDataItem']): + data (list[IncidentSubStatusListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["IncidentSubStatusListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[IncidentSubStatusListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 bfb54b09..d008330e 100644 --- a/rootly_sdk/models/incident_sub_status_list_data_item.py +++ b/rootly_sdk/models/incident_sub_status_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_sub_status_list_data_item_type.py b/rootly_sdk/models/incident_sub_status_list_data_item_type.py index dd1c1c67..8bbf5148 100644 --- a/rootly_sdk/models/incident_sub_status_list_data_item_type.py +++ b/rootly_sdk/models/incident_sub_status_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentSubStatusListDataItemType = Literal["incident_sub_statuses"] @@ -11,5 +11,5 @@ def check_incident_sub_status_list_data_item_type(value: str | None) -> Incident if value is None: return None if value in INCIDENT_SUB_STATUS_LIST_DATA_ITEM_TYPE_VALUES: - return cast(IncidentSubStatusListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_SUB_STATUS_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_sub_status_response.py b/rootly_sdk/models/incident_sub_status_response.py index 0a92311a..41928049 100644 --- a/rootly_sdk/models/incident_sub_status_response.py +++ b/rootly_sdk/models/incident_sub_status_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class IncidentSubStatusResponse: """ Attributes: data (IncidentSubStatusResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "IncidentSubStatusResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: IncidentSubStatusResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 c6afd0ca..2ed85e51 100644 --- a/rootly_sdk/models/incident_sub_status_response_data.py +++ b/rootly_sdk/models/incident_sub_status_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_sub_status_response_data_type.py b/rootly_sdk/models/incident_sub_status_response_data_type.py index bb7139a2..c9680517 100644 --- a/rootly_sdk/models/incident_sub_status_response_data_type.py +++ b/rootly_sdk/models/incident_sub_status_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentSubStatusResponseDataType = Literal["incident_sub_statuses"] @@ -11,5 +11,5 @@ def check_incident_sub_status_response_data_type(value: str | None) -> IncidentS if value is None: return None if value in INCIDENT_SUB_STATUS_RESPONSE_DATA_TYPE_VALUES: - return cast(IncidentSubStatusResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_SUB_STATUS_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_trigger_params.py b/rootly_sdk/models/incident_trigger_params.py index 317b8c86..12914e71 100644 --- a/rootly_sdk/models/incident_trigger_params.py +++ b/rootly_sdk/models/incident_trigger_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -56,6 +58,14 @@ IncidentTriggerParamsIncidentConditionResolvedAt, check_incident_trigger_params_incident_condition_resolved_at, ) +from ..models.incident_trigger_params_incident_condition_scheduled_for import ( + IncidentTriggerParamsIncidentConditionScheduledFor, + check_incident_trigger_params_incident_condition_scheduled_for, +) +from ..models.incident_trigger_params_incident_condition_scheduled_until import ( + IncidentTriggerParamsIncidentConditionScheduledUntil, + check_incident_trigger_params_incident_condition_scheduled_until, +) from ..models.incident_trigger_params_incident_condition_service import ( IncidentTriggerParamsIncidentConditionService, check_incident_trigger_params_incident_condition_service, @@ -114,196 +124,205 @@ class IncidentTriggerParams: """ Attributes: trigger_type (IncidentTriggerParamsTriggerType): - 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: + 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: 'ANY'. - incident_condition_service (Union[Unset, IncidentTriggerParamsIncidentConditionService]): Default: 'ANY'. - incident_condition_functionality (Union[Unset, IncidentTriggerParamsIncidentConditionFunctionality]): Default: - 'ANY'. - 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]): + 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): [DEPRECATED] Use incident_condition_cause instead Default: 'ANY'. - 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]): + 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_condition_scheduled_for (IncidentTriggerParamsIncidentConditionScheduledFor | Unset): + incident_condition_scheduled_until (IncidentTriggerParamsIncidentConditionScheduledUntil | Unset): + incident_conditional_inactivity (IncidentTriggerParamsIncidentConditionalInactivity | Unset): """ trigger_type: IncidentTriggerParamsTriggerType - 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 + 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_condition_scheduled_for: IncidentTriggerParamsIncidentConditionScheduledFor | Unset = UNSET + incident_condition_scheduled_until: IncidentTriggerParamsIncidentConditionScheduledUntil | Unset = UNSET + incident_conditional_inactivity: IncidentTriggerParamsIncidentConditionalInactivity | Unset = 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: Unset | list[str] = UNSET + triggers: list[str] | Unset = UNSET if not isinstance(self.triggers, Unset): triggers = self.triggers - incident_visibilities: Unset | list[bool] = UNSET + incident_visibilities: list[bool] | Unset = UNSET if not isinstance(self.incident_visibilities, Unset): incident_visibilities = self.incident_visibilities - incident_kinds: Unset | list[str] = UNSET + incident_kinds: list[str] | Unset = 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: Unset | list[str] = UNSET + incident_statuses: list[str] | Unset = 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 | Unset | str + incident_inactivity_duration: None | str | Unset if isinstance(self.incident_inactivity_duration, Unset): incident_inactivity_duration = UNSET else: incident_inactivity_duration = self.incident_inactivity_duration - incident_condition: Unset | str = UNSET + incident_condition: str | Unset = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - incident_condition_visibility: Unset | str = UNSET + incident_condition_visibility: str | Unset = UNSET if not isinstance(self.incident_condition_visibility, Unset): incident_condition_visibility = self.incident_condition_visibility - incident_condition_kind: Unset | str = UNSET + incident_condition_kind: str | Unset = UNSET if not isinstance(self.incident_condition_kind, Unset): incident_condition_kind = self.incident_condition_kind - incident_condition_status: Unset | str = UNSET + incident_condition_status: str | Unset = UNSET if not isinstance(self.incident_condition_status, Unset): incident_condition_status = self.incident_condition_status - incident_condition_sub_status: Unset | str = UNSET + incident_condition_sub_status: str | Unset = UNSET if not isinstance(self.incident_condition_sub_status, Unset): incident_condition_sub_status = self.incident_condition_sub_status - incident_condition_environment: Unset | str = UNSET + incident_condition_environment: str | Unset = UNSET if not isinstance(self.incident_condition_environment, Unset): incident_condition_environment = self.incident_condition_environment - incident_condition_severity: Unset | str = UNSET + incident_condition_severity: str | Unset = UNSET if not isinstance(self.incident_condition_severity, Unset): incident_condition_severity = self.incident_condition_severity - incident_condition_incident_type: Unset | str = UNSET + incident_condition_incident_type: str | Unset = UNSET if not isinstance(self.incident_condition_incident_type, Unset): incident_condition_incident_type = self.incident_condition_incident_type - incident_condition_incident_roles: Unset | str = UNSET + incident_condition_incident_roles: str | Unset = UNSET if not isinstance(self.incident_condition_incident_roles, Unset): incident_condition_incident_roles = self.incident_condition_incident_roles - incident_condition_service: Unset | str = UNSET + incident_condition_service: str | Unset = UNSET if not isinstance(self.incident_condition_service, Unset): incident_condition_service = self.incident_condition_service - incident_condition_functionality: Unset | str = UNSET + incident_condition_functionality: str | Unset = UNSET if not isinstance(self.incident_condition_functionality, Unset): incident_condition_functionality = self.incident_condition_functionality - incident_condition_group: Unset | str = UNSET + incident_condition_group: str | Unset = UNSET if not isinstance(self.incident_condition_group, Unset): incident_condition_group = self.incident_condition_group - incident_condition_cause: Unset | str = UNSET + incident_condition_cause: str | Unset = UNSET if not isinstance(self.incident_condition_cause, Unset): incident_condition_cause = self.incident_condition_cause - incident_condition_label: Unset | str = UNSET + incident_condition_label: str | Unset = 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: Unset | list[str] = UNSET + incident_labels: list[str] | Unset = UNSET if not isinstance(self.incident_labels, Unset): incident_labels = self.incident_labels - incident_post_mortem_condition_cause: Unset | str = UNSET + incident_post_mortem_condition_cause: str | Unset = 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: Unset | str = UNSET + incident_condition_summary: str | Unset = UNSET if not isinstance(self.incident_condition_summary, Unset): incident_condition_summary = self.incident_condition_summary - incident_condition_started_at: Unset | str = UNSET + incident_condition_started_at: str | Unset = UNSET if not isinstance(self.incident_condition_started_at, Unset): incident_condition_started_at = self.incident_condition_started_at - incident_condition_detected_at: Unset | str = UNSET + incident_condition_detected_at: str | Unset = UNSET if not isinstance(self.incident_condition_detected_at, Unset): incident_condition_detected_at = self.incident_condition_detected_at - incident_condition_acknowledged_at: Unset | str = UNSET + incident_condition_acknowledged_at: str | Unset = UNSET if not isinstance(self.incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = self.incident_condition_acknowledged_at - incident_condition_mitigated_at: Unset | str = UNSET + incident_condition_mitigated_at: str | Unset = UNSET if not isinstance(self.incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = self.incident_condition_mitigated_at - incident_condition_resolved_at: Unset | str = UNSET + incident_condition_resolved_at: str | Unset = UNSET if not isinstance(self.incident_condition_resolved_at, Unset): incident_condition_resolved_at = self.incident_condition_resolved_at - incident_conditional_inactivity: Unset | str = UNSET + incident_condition_scheduled_for: str | Unset = UNSET + if not isinstance(self.incident_condition_scheduled_for, Unset): + incident_condition_scheduled_for = self.incident_condition_scheduled_for + + incident_condition_scheduled_until: str | Unset = UNSET + if not isinstance(self.incident_condition_scheduled_until, Unset): + incident_condition_scheduled_until = self.incident_condition_scheduled_until + + incident_conditional_inactivity: str | Unset = UNSET if not isinstance(self.incident_conditional_inactivity, Unset): incident_conditional_inactivity = self.incident_conditional_inactivity @@ -370,6 +389,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["incident_condition_mitigated_at"] = incident_condition_mitigated_at if incident_condition_resolved_at is not UNSET: field_dict["incident_condition_resolved_at"] = incident_condition_resolved_at + if incident_condition_scheduled_for is not UNSET: + field_dict["incident_condition_scheduled_for"] = incident_condition_scheduled_for + if incident_condition_scheduled_until is not UNSET: + field_dict["incident_condition_scheduled_until"] = incident_condition_scheduled_until if incident_conditional_inactivity is not UNSET: field_dict["incident_conditional_inactivity"] = incident_conditional_inactivity @@ -384,38 +407,44 @@ 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) - 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: 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) - incident_kinds.append(incident_kinds_item) + incident_kinds.append(incident_kinds_item) - incident_statuses = [] _incident_statuses = d.pop("incident_statuses", UNSET) - 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: 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 + ) - incident_statuses.append(incident_statuses_item) + incident_statuses.append(incident_statuses_item) - def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: + def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) incident_inactivity_duration = _parse_incident_inactivity_duration(d.pop("incident_inactivity_duration", UNSET)) _incident_condition = d.pop("incident_condition", UNSET) - incident_condition: Unset | IncidentTriggerParamsIncidentCondition + incident_condition: IncidentTriggerParamsIncidentCondition | Unset 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: Unset | IncidentTriggerParamsIncidentConditionVisibility + incident_condition_visibility: IncidentTriggerParamsIncidentConditionVisibility | Unset if isinstance(_incident_condition_visibility, Unset): incident_condition_visibility = UNSET else: @@ -424,14 +453,14 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_kind = d.pop("incident_condition_kind", UNSET) - incident_condition_kind: Unset | IncidentTriggerParamsIncidentConditionKind + incident_condition_kind: IncidentTriggerParamsIncidentConditionKind | Unset 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: Unset | IncidentTriggerParamsIncidentConditionStatus + incident_condition_status: IncidentTriggerParamsIncidentConditionStatus | Unset if isinstance(_incident_condition_status, Unset): incident_condition_status = UNSET else: @@ -440,7 +469,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_sub_status = d.pop("incident_condition_sub_status", UNSET) - incident_condition_sub_status: Unset | IncidentTriggerParamsIncidentConditionSubStatus + incident_condition_sub_status: IncidentTriggerParamsIncidentConditionSubStatus | Unset if isinstance(_incident_condition_sub_status, Unset): incident_condition_sub_status = UNSET else: @@ -449,7 +478,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_environment = d.pop("incident_condition_environment", UNSET) - incident_condition_environment: Unset | IncidentTriggerParamsIncidentConditionEnvironment + incident_condition_environment: IncidentTriggerParamsIncidentConditionEnvironment | Unset if isinstance(_incident_condition_environment, Unset): incident_condition_environment = UNSET else: @@ -458,7 +487,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_severity = d.pop("incident_condition_severity", UNSET) - incident_condition_severity: Unset | IncidentTriggerParamsIncidentConditionSeverity + incident_condition_severity: IncidentTriggerParamsIncidentConditionSeverity | Unset if isinstance(_incident_condition_severity, Unset): incident_condition_severity = UNSET else: @@ -467,7 +496,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_incident_type = d.pop("incident_condition_incident_type", UNSET) - incident_condition_incident_type: Unset | IncidentTriggerParamsIncidentConditionIncidentType + incident_condition_incident_type: IncidentTriggerParamsIncidentConditionIncidentType | Unset if isinstance(_incident_condition_incident_type, Unset): incident_condition_incident_type = UNSET else: @@ -476,7 +505,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_incident_roles = d.pop("incident_condition_incident_roles", UNSET) - incident_condition_incident_roles: Unset | IncidentTriggerParamsIncidentConditionIncidentRoles + incident_condition_incident_roles: IncidentTriggerParamsIncidentConditionIncidentRoles | Unset if isinstance(_incident_condition_incident_roles, Unset): incident_condition_incident_roles = UNSET else: @@ -485,7 +514,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_service = d.pop("incident_condition_service", UNSET) - incident_condition_service: Unset | IncidentTriggerParamsIncidentConditionService + incident_condition_service: IncidentTriggerParamsIncidentConditionService | Unset if isinstance(_incident_condition_service, Unset): incident_condition_service = UNSET else: @@ -494,7 +523,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_functionality = d.pop("incident_condition_functionality", UNSET) - incident_condition_functionality: Unset | IncidentTriggerParamsIncidentConditionFunctionality + incident_condition_functionality: IncidentTriggerParamsIncidentConditionFunctionality | Unset if isinstance(_incident_condition_functionality, Unset): incident_condition_functionality = UNSET else: @@ -503,21 +532,21 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_group = d.pop("incident_condition_group", UNSET) - incident_condition_group: Unset | IncidentTriggerParamsIncidentConditionGroup + incident_condition_group: IncidentTriggerParamsIncidentConditionGroup | Unset 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: Unset | IncidentTriggerParamsIncidentConditionCause + incident_condition_cause: IncidentTriggerParamsIncidentConditionCause | Unset 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: Unset | IncidentTriggerParamsIncidentConditionLabel + incident_condition_label: IncidentTriggerParamsIncidentConditionLabel | Unset if isinstance(_incident_condition_label, Unset): incident_condition_label = UNSET else: @@ -528,7 +557,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: 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: Unset | IncidentTriggerParamsIncidentPostMortemConditionCause + incident_post_mortem_condition_cause: IncidentTriggerParamsIncidentPostMortemConditionCause | Unset if isinstance(_incident_post_mortem_condition_cause, Unset): incident_post_mortem_condition_cause = UNSET else: @@ -537,7 +566,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_summary = d.pop("incident_condition_summary", UNSET) - incident_condition_summary: Unset | IncidentTriggerParamsIncidentConditionSummary + incident_condition_summary: IncidentTriggerParamsIncidentConditionSummary | Unset if isinstance(_incident_condition_summary, Unset): incident_condition_summary = UNSET else: @@ -546,7 +575,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_started_at = d.pop("incident_condition_started_at", UNSET) - incident_condition_started_at: Unset | IncidentTriggerParamsIncidentConditionStartedAt + incident_condition_started_at: IncidentTriggerParamsIncidentConditionStartedAt | Unset if isinstance(_incident_condition_started_at, Unset): incident_condition_started_at = UNSET else: @@ -555,7 +584,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_detected_at = d.pop("incident_condition_detected_at", UNSET) - incident_condition_detected_at: Unset | IncidentTriggerParamsIncidentConditionDetectedAt + incident_condition_detected_at: IncidentTriggerParamsIncidentConditionDetectedAt | Unset if isinstance(_incident_condition_detected_at, Unset): incident_condition_detected_at = UNSET else: @@ -564,7 +593,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_acknowledged_at = d.pop("incident_condition_acknowledged_at", UNSET) - incident_condition_acknowledged_at: Unset | IncidentTriggerParamsIncidentConditionAcknowledgedAt + incident_condition_acknowledged_at: IncidentTriggerParamsIncidentConditionAcknowledgedAt | Unset if isinstance(_incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = UNSET else: @@ -573,7 +602,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_mitigated_at = d.pop("incident_condition_mitigated_at", UNSET) - incident_condition_mitigated_at: Unset | IncidentTriggerParamsIncidentConditionMitigatedAt + incident_condition_mitigated_at: IncidentTriggerParamsIncidentConditionMitigatedAt | Unset if isinstance(_incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = UNSET else: @@ -582,7 +611,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_resolved_at = d.pop("incident_condition_resolved_at", UNSET) - incident_condition_resolved_at: Unset | IncidentTriggerParamsIncidentConditionResolvedAt + incident_condition_resolved_at: IncidentTriggerParamsIncidentConditionResolvedAt | Unset if isinstance(_incident_condition_resolved_at, Unset): incident_condition_resolved_at = UNSET else: @@ -590,8 +619,26 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: _incident_condition_resolved_at ) + _incident_condition_scheduled_for = d.pop("incident_condition_scheduled_for", UNSET) + incident_condition_scheduled_for: IncidentTriggerParamsIncidentConditionScheduledFor | Unset + if isinstance(_incident_condition_scheduled_for, Unset): + incident_condition_scheduled_for = UNSET + else: + incident_condition_scheduled_for = check_incident_trigger_params_incident_condition_scheduled_for( + _incident_condition_scheduled_for + ) + + _incident_condition_scheduled_until = d.pop("incident_condition_scheduled_until", UNSET) + incident_condition_scheduled_until: IncidentTriggerParamsIncidentConditionScheduledUntil | Unset + if isinstance(_incident_condition_scheduled_until, Unset): + incident_condition_scheduled_until = UNSET + else: + incident_condition_scheduled_until = check_incident_trigger_params_incident_condition_scheduled_until( + _incident_condition_scheduled_until + ) + _incident_conditional_inactivity = d.pop("incident_conditional_inactivity", UNSET) - incident_conditional_inactivity: Unset | IncidentTriggerParamsIncidentConditionalInactivity + incident_conditional_inactivity: IncidentTriggerParamsIncidentConditionalInactivity | Unset if isinstance(_incident_conditional_inactivity, Unset): incident_conditional_inactivity = UNSET else: @@ -629,6 +676,8 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: incident_condition_acknowledged_at=incident_condition_acknowledged_at, incident_condition_mitigated_at=incident_condition_mitigated_at, incident_condition_resolved_at=incident_condition_resolved_at, + incident_condition_scheduled_for=incident_condition_scheduled_for, + incident_condition_scheduled_until=incident_condition_scheduled_until, incident_conditional_inactivity=incident_conditional_inactivity, ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition.py b/rootly_sdk/models/incident_trigger_params_incident_condition.py index b866f9e9..87a14888 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentCondition = Literal["ALL", "ANY", "NONE"] @@ -15,7 +15,7 @@ def check_incident_trigger_params_incident_condition( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_VALUES: - return cast(IncidentTriggerParamsIncidentCondition, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_acknowledged_at.py b/rootly_sdk/models/incident_trigger_params_incident_condition_acknowledged_at.py index 68d83d81..607282b8 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_acknowledged_at.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_acknowledged_at.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionAcknowledgedAt = Literal["SET", "UNSET"] @@ -16,7 +16,7 @@ def check_incident_trigger_params_incident_condition_acknowledged_at( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_ACKNOWLEDGED_AT_VALUES: - return cast(IncidentTriggerParamsIncidentConditionAcknowledgedAt, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_ACKNOWLEDGED_AT_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_cause.py b/rootly_sdk/models/incident_trigger_params_incident_condition_cause.py index 494930e9..48437ed5 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_cause.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_cause.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionCause = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_incident_trigger_params_incident_condition_cause( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_CAUSE_VALUES: - return cast(IncidentTriggerParamsIncidentConditionCause, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_CAUSE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_detected_at.py b/rootly_sdk/models/incident_trigger_params_incident_condition_detected_at.py index 69645f09..c4bd900b 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_detected_at.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_detected_at.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionDetectedAt = Literal["SET", "UNSET"] @@ -14,7 +14,7 @@ def check_incident_trigger_params_incident_condition_detected_at( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_DETECTED_AT_VALUES: - return cast(IncidentTriggerParamsIncidentConditionDetectedAt, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_DETECTED_AT_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_environment.py b/rootly_sdk/models/incident_trigger_params_incident_condition_environment.py index bc8d1e91..fcb65dd8 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_environment.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_environment.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionEnvironment = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_incident_trigger_params_incident_condition_environment( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_ENVIRONMENT_VALUES: - return cast(IncidentTriggerParamsIncidentConditionEnvironment, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_ENVIRONMENT_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_functionality.py b/rootly_sdk/models/incident_trigger_params_incident_condition_functionality.py index 706dff0c..c6de0724 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_functionality.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_functionality.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionFunctionality = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_incident_trigger_params_incident_condition_functionality( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_FUNCTIONALITY_VALUES: - return cast(IncidentTriggerParamsIncidentConditionFunctionality, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_FUNCTIONALITY_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_group.py b/rootly_sdk/models/incident_trigger_params_incident_condition_group.py index 4cf5b297..0eed6b05 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_group.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_group.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionGroup = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_incident_trigger_params_incident_condition_group( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_GROUP_VALUES: - return cast(IncidentTriggerParamsIncidentConditionGroup, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_GROUP_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_incident_roles.py b/rootly_sdk/models/incident_trigger_params_incident_condition_incident_roles.py index 524a99c5..009cab02 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_incident_roles.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_incident_roles.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionIncidentRoles = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_incident_trigger_params_incident_condition_incident_roles( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_INCIDENT_ROLES_VALUES: - return cast(IncidentTriggerParamsIncidentConditionIncidentRoles, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_INCIDENT_ROLES_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_incident_type.py b/rootly_sdk/models/incident_trigger_params_incident_condition_incident_type.py index fb8cb5e2..1ece5469 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_incident_type.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_incident_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionIncidentType = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_incident_trigger_params_incident_condition_incident_type( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_INCIDENT_TYPE_VALUES: - return cast(IncidentTriggerParamsIncidentConditionIncidentType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_INCIDENT_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_kind.py b/rootly_sdk/models/incident_trigger_params_incident_condition_kind.py index 35b91d0b..5f4e5a28 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_kind.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionKind = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_incident_trigger_params_incident_condition_kind( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_KIND_VALUES: - return cast(IncidentTriggerParamsIncidentConditionKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_label.py b/rootly_sdk/models/incident_trigger_params_incident_condition_label.py index 7f2f1c13..42e7a35b 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_label.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_label.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionLabel = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_incident_trigger_params_incident_condition_label( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_LABEL_VALUES: - return cast(IncidentTriggerParamsIncidentConditionLabel, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_LABEL_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_mitigated_at.py b/rootly_sdk/models/incident_trigger_params_incident_condition_mitigated_at.py index bd798922..8b84cff8 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_mitigated_at.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_mitigated_at.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionMitigatedAt = Literal["SET", "UNSET"] @@ -16,7 +16,7 @@ def check_incident_trigger_params_incident_condition_mitigated_at( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_MITIGATED_AT_VALUES: - return cast(IncidentTriggerParamsIncidentConditionMitigatedAt, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_MITIGATED_AT_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_resolved_at.py b/rootly_sdk/models/incident_trigger_params_incident_condition_resolved_at.py index a53536db..c857fb7d 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_resolved_at.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_resolved_at.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionResolvedAt = Literal["SET", "UNSET"] @@ -14,7 +14,7 @@ def check_incident_trigger_params_incident_condition_resolved_at( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_RESOLVED_AT_VALUES: - return cast(IncidentTriggerParamsIncidentConditionResolvedAt, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_RESOLVED_AT_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_scheduled_for.py b/rootly_sdk/models/incident_trigger_params_incident_condition_scheduled_for.py new file mode 100644 index 00000000..074c0a6c --- /dev/null +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_scheduled_for.py @@ -0,0 +1,22 @@ +from typing import Literal + +IncidentTriggerParamsIncidentConditionScheduledFor = Literal["SET", "UNSET"] + +INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_SCHEDULED_FOR_VALUES: set[ + IncidentTriggerParamsIncidentConditionScheduledFor +] = { + "SET", + "UNSET", +} + + +def check_incident_trigger_params_incident_condition_scheduled_for( + value: str | None, +) -> IncidentTriggerParamsIncidentConditionScheduledFor | None: + if value is None: + return None + if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_SCHEDULED_FOR_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_SCHEDULED_FOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_scheduled_until.py b/rootly_sdk/models/incident_trigger_params_incident_condition_scheduled_until.py new file mode 100644 index 00000000..ec727dbe --- /dev/null +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_scheduled_until.py @@ -0,0 +1,22 @@ +from typing import Literal + +IncidentTriggerParamsIncidentConditionScheduledUntil = Literal["SET", "UNSET"] + +INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_SCHEDULED_UNTIL_VALUES: set[ + IncidentTriggerParamsIncidentConditionScheduledUntil +] = { + "SET", + "UNSET", +} + + +def check_incident_trigger_params_incident_condition_scheduled_until( + value: str | None, +) -> IncidentTriggerParamsIncidentConditionScheduledUntil | None: + if value is None: + return None + if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_SCHEDULED_UNTIL_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_SCHEDULED_UNTIL_VALUES!r}" + ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_service.py b/rootly_sdk/models/incident_trigger_params_incident_condition_service.py index 02dd7074..47507605 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_service.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_service.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionService = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_incident_trigger_params_incident_condition_service( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_SERVICE_VALUES: - return cast(IncidentTriggerParamsIncidentConditionService, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_SERVICE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_severity.py b/rootly_sdk/models/incident_trigger_params_incident_condition_severity.py index 6cb213b4..23e402ee 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_severity.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_severity.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionSeverity = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_incident_trigger_params_incident_condition_severity( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_SEVERITY_VALUES: - return cast(IncidentTriggerParamsIncidentConditionSeverity, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_SEVERITY_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_started_at.py b/rootly_sdk/models/incident_trigger_params_incident_condition_started_at.py index b54da9c5..43ca7d0f 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_started_at.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_started_at.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionStartedAt = Literal["SET", "UNSET"] @@ -14,7 +14,7 @@ def check_incident_trigger_params_incident_condition_started_at( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_STARTED_AT_VALUES: - return cast(IncidentTriggerParamsIncidentConditionStartedAt, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_STARTED_AT_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_status.py b/rootly_sdk/models/incident_trigger_params_incident_condition_status.py index 5c1db486..04ca45a8 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_status.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionStatus = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_incident_trigger_params_incident_condition_status( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_STATUS_VALUES: - return cast(IncidentTriggerParamsIncidentConditionStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_sub_status.py b/rootly_sdk/models/incident_trigger_params_incident_condition_sub_status.py index 09f3df68..ceee8afb 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_sub_status.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_sub_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionSubStatus = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_incident_trigger_params_incident_condition_sub_status( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_SUB_STATUS_VALUES: - return cast(IncidentTriggerParamsIncidentConditionSubStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_SUB_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_summary.py b/rootly_sdk/models/incident_trigger_params_incident_condition_summary.py index 59059de1..c76ae98c 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_summary.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_summary.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionSummary = Literal["SET", "UNSET"] @@ -14,7 +14,7 @@ def check_incident_trigger_params_incident_condition_summary( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_SUMMARY_VALUES: - return cast(IncidentTriggerParamsIncidentConditionSummary, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_SUMMARY_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_condition_visibility.py b/rootly_sdk/models/incident_trigger_params_incident_condition_visibility.py index 83dda22d..38b53aeb 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_condition_visibility.py +++ b/rootly_sdk/models/incident_trigger_params_incident_condition_visibility.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionVisibility = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_incident_trigger_params_incident_condition_visibility( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_VISIBILITY_VALUES: - return cast(IncidentTriggerParamsIncidentConditionVisibility, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITION_VISIBILITY_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_conditional_inactivity.py b/rootly_sdk/models/incident_trigger_params_incident_conditional_inactivity.py index 561aff65..c0ece7d3 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_conditional_inactivity.py +++ b/rootly_sdk/models/incident_trigger_params_incident_conditional_inactivity.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentConditionalInactivity = Literal["IS"] @@ -15,7 +15,7 @@ def check_incident_trigger_params_incident_conditional_inactivity( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITIONAL_INACTIVITY_VALUES: - return cast(IncidentTriggerParamsIncidentConditionalInactivity, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_CONDITIONAL_INACTIVITY_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_kinds_item.py b/rootly_sdk/models/incident_trigger_params_incident_kinds_item.py index 20dbab3f..9671fe27 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_kinds_item.py +++ b/rootly_sdk/models/incident_trigger_params_incident_kinds_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentKindsItem = Literal[ "backfilled", "example", "example_sub", "normal", "normal_sub", "scheduled", "scheduled_sub", "test", "test_sub" @@ -23,7 +23,7 @@ def check_incident_trigger_params_incident_kinds_item( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_KINDS_ITEM_VALUES: - return cast(IncidentTriggerParamsIncidentKindsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_KINDS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_post_mortem_condition_cause.py b/rootly_sdk/models/incident_trigger_params_incident_post_mortem_condition_cause.py index 323afe3c..9f7d3077 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_post_mortem_condition_cause.py +++ b/rootly_sdk/models/incident_trigger_params_incident_post_mortem_condition_cause.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentPostMortemConditionCause = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_incident_trigger_params_incident_post_mortem_condition_cause( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_POST_MORTEM_CONDITION_CAUSE_VALUES: - return cast(IncidentTriggerParamsIncidentPostMortemConditionCause, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_POST_MORTEM_CONDITION_CAUSE_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_incident_statuses_item.py b/rootly_sdk/models/incident_trigger_params_incident_statuses_item.py index acf6661f..70d0697f 100644 --- a/rootly_sdk/models/incident_trigger_params_incident_statuses_item.py +++ b/rootly_sdk/models/incident_trigger_params_incident_statuses_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsIncidentStatusesItem = Literal[ "acknowledged", @@ -35,7 +35,7 @@ def check_incident_trigger_params_incident_statuses_item( if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_INCIDENT_STATUSES_ITEM_VALUES: - return cast(IncidentTriggerParamsIncidentStatusesItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_INCIDENT_STATUSES_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/incident_trigger_params_trigger_type.py b/rootly_sdk/models/incident_trigger_params_trigger_type.py index fdf7fe77..b2b6d7c1 100644 --- a/rootly_sdk/models/incident_trigger_params_trigger_type.py +++ b/rootly_sdk/models/incident_trigger_params_trigger_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTriggerParamsTriggerType = Literal["incident"] @@ -11,5 +11,5 @@ def check_incident_trigger_params_trigger_type(value: str | None) -> IncidentTri if value is None: return None if value in INCIDENT_TRIGGER_PARAMS_TRIGGER_TYPE_VALUES: - return cast(IncidentTriggerParamsTriggerType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_TRIGGER_PARAMS_TRIGGER_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_type.py b/rootly_sdk/models/incident_type.py index 3ebd7402..c9b1e572 100644 --- a/rootly_sdk/models/incident_type.py +++ b/rootly_sdk/models/incident_type.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -22,31 +24,31 @@ class IncidentType: name (str): The name of the incident type created_at (str): Date of creation updated_at (str): Date of last update - 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. + slug (str | Unset): The slug of the incident type + description (None | str | Unset): The description of the incident type + public_description (None | str | Unset): The status page 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. """ name: str created_at: str updated_at: str - 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 + slug: str | Unset = UNSET + description: None | str | Unset = UNSET + public_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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -58,31 +60,31 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -91,7 +93,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: None | Unset | list[dict[str, Any]] + slack_channels: list[dict[str, Any]] | None | Unset if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -103,7 +105,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: None | Unset | list[dict[str, Any]] + slack_aliases: list[dict[str, Any]] | None | Unset if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -115,7 +117,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: Unset | list[dict[str, Any]] = UNSET + properties: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -167,43 +169,43 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -214,13 +216,13 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_slack_channels(data: object) -> None | Unset | list["IncidentTypeSlackChannelsType0Item"]: + def _parse_slack_channels(data: object) -> list[IncidentTypeSlackChannelsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -238,13 +240,13 @@ def _parse_slack_channels(data: object) -> None | Unset | list["IncidentTypeSlac slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["IncidentTypeSlackChannelsType0Item"], data) + return cast(list[IncidentTypeSlackChannelsType0Item] | None | Unset, data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> None | Unset | list["IncidentTypeSlackAliasesType0Item"]: + def _parse_slack_aliases(data: object) -> list[IncidentTypeSlackAliasesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -262,18 +264,20 @@ def _parse_slack_aliases(data: object) -> None | Unset | list["IncidentTypeSlack slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["IncidentTypeSlackAliasesType0Item"], data) + return cast(list[IncidentTypeSlackAliasesType0Item] | None | Unset, data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - properties = [] _properties = d.pop("properties", UNSET) - for properties_item_data in _properties or []: - properties_item = IncidentTypePropertiesItem.from_dict(properties_item_data) + 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) - properties.append(properties_item) + properties.append(properties_item) incident_type = cls( name=name, diff --git a/rootly_sdk/models/incident_type_list.py b/rootly_sdk/models/incident_type_list.py index e33a72b9..621b8170 100644 --- a/rootly_sdk/models/incident_type_list.py +++ b/rootly_sdk/models/incident_type_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class IncidentTypeList: """ Attributes: - data (list['IncidentTypeListDataItem']): + data (list[IncidentTypeListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["IncidentTypeListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[IncidentTypeListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 ed31943b..3f11a9a3 100644 --- a/rootly_sdk/models/incident_type_list_data_item.py +++ b/rootly_sdk/models/incident_type_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_type_list_data_item_type.py b/rootly_sdk/models/incident_type_list_data_item_type.py index 68977f33..7901a45e 100644 --- a/rootly_sdk/models/incident_type_list_data_item_type.py +++ b/rootly_sdk/models/incident_type_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTypeListDataItemType = Literal["incident_types"] @@ -11,5 +11,5 @@ def check_incident_type_list_data_item_type(value: str | None) -> IncidentTypeLi if value is None: return None if value in INCIDENT_TYPE_LIST_DATA_ITEM_TYPE_VALUES: - return cast(IncidentTypeListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_TYPE_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/incident_type_properties_item.py b/rootly_sdk/models/incident_type_properties_item.py index 6c91d662..5bcab317 100644 --- a/rootly_sdk/models/incident_type_properties_item.py +++ b/rootly_sdk/models/incident_type_properties_item.py @@ -1,3 +1,5 @@ +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 dd8fc4e3..4ab162ed 100644 --- a/rootly_sdk/models/incident_type_response.py +++ b/rootly_sdk/models/incident_type_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class IncidentTypeResponse: """ Attributes: data (IncidentTypeResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "IncidentTypeResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: IncidentTypeResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 7b9f0ecb..022302b0 100644 --- a/rootly_sdk/models/incident_type_response_data.py +++ b/rootly_sdk/models/incident_type_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/incident_type_response_data_type.py b/rootly_sdk/models/incident_type_response_data_type.py index 8b63d4ef..58ed3afe 100644 --- a/rootly_sdk/models/incident_type_response_data_type.py +++ b/rootly_sdk/models/incident_type_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IncidentTypeResponseDataType = Literal["incident_types"] @@ -11,5 +11,5 @@ def check_incident_type_response_data_type(value: str | None) -> IncidentTypeRes if value is None: return None if value in INCIDENT_TYPE_RESPONSE_DATA_TYPE_VALUES: - return cast(IncidentTypeResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {INCIDENT_TYPE_RESPONSE_DATA_TYPE_VALUES!r}") 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 5aadf52e..e60d5ce2 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,3 +1,5 @@ +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 4db8b7e4..b579c633 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,3 +1,5 @@ +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 efbc92a9..dce50314 100644 --- a/rootly_sdk/models/incident_user_type_0.py +++ b/rootly_sdk/models/incident_user_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 06ca093e..3bfaac57 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,18 +15,18 @@ class IncidentZoomMeetingGlobalDialInNumbersType0Item: """ Attributes: - country (Union[Unset, str]): - country_name (Union[Unset, str]): - city (Union[Unset, str]): - number (Union[Unset, str]): - type_ (Union[Unset, str]): + country (str | Unset): + country_name (str | Unset): + city (str | Unset): + number (str | Unset): + type_ (str | Unset): """ - country: Unset | str = UNSET - country_name: Unset | str = UNSET - city: Unset | str = UNSET - number: Unset | str = UNSET - type_: Unset | str = UNSET + country: str | Unset = UNSET + country_name: str | Unset = UNSET + city: str | Unset = UNSET + number: str | Unset = UNSET + type_: str | Unset = UNSET 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 becff146..1feb556c 100644 --- a/rootly_sdk/models/incidents_chart_response.py +++ b/rootly_sdk/models/incidents_chart_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,7 +20,7 @@ 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]: diff --git a/rootly_sdk/models/incidents_chart_response_data.py b/rootly_sdk/models/incidents_chart_response_data.py index 35782e51..544d592e 100644 --- a/rootly_sdk/models/incidents_chart_response_data.py +++ b/rootly_sdk/models/incidents_chart_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 6a099867..445de231 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,12 +25,12 @@ class InviteToGoogleChatSpaceTaskParams: Attributes: space (InviteToGoogleChatSpaceTaskParamsSpace): emails (str): Comma separated list of emails to invite - task_type (Union[Unset, InviteToGoogleChatSpaceTaskParamsTaskType]): + task_type (InviteToGoogleChatSpaceTaskParamsTaskType | Unset): """ - space: "InviteToGoogleChatSpaceTaskParamsSpace" + space: InviteToGoogleChatSpaceTaskParamsSpace emails: str - task_type: Unset | InviteToGoogleChatSpaceTaskParamsTaskType = UNSET + task_type: InviteToGoogleChatSpaceTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +38,7 @@ def to_dict(self) -> dict[str, Any]: emails = self.emails - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,7 +65,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: Unset | InviteToGoogleChatSpaceTaskParamsTaskType + task_type: InviteToGoogleChatSpaceTaskParamsTaskType | Unset 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 0b0940eb..90770cb9 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToGoogleChatSpaceTaskParamsSpace: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_google_chat_space_task_params_task_type.py b/rootly_sdk/models/invite_to_google_chat_space_task_params_task_type.py index 8c0ddf59..8722507e 100644 --- a/rootly_sdk/models/invite_to_google_chat_space_task_params_task_type.py +++ b/rootly_sdk/models/invite_to_google_chat_space_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal InviteToGoogleChatSpaceTaskParamsTaskType = Literal["invite_to_google_chat_space"] @@ -13,7 +13,7 @@ def check_invite_to_google_chat_space_task_params_task_type( if value is None: return None if value in INVITE_TO_GOOGLE_CHAT_SPACE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(InviteToGoogleChatSpaceTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INVITE_TO_GOOGLE_CHAT_SPACE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 ac0cac25..4b6561a8 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -43,24 +45,22 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParams: Attributes: team (InviteToMicrosoftTeamsChannelRootlyTaskParamsTeam): channel (InviteToMicrosoftTeamsChannelRootlyTaskParamsChannel): - 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]): + 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): """ - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -68,27 +68,27 @@ def to_dict(self) -> dict[str, Any]: channel = self.channel.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - escalation_policy_target: Unset | dict[str, Any] = UNSET + 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: Unset | dict[str, Any] = UNSET + service_target: dict[str, Any] | Unset = UNSET if not isinstance(self.service_target, Unset): service_target = self.service_target.to_dict() - user_target: Unset | dict[str, Any] = UNSET + user_target: dict[str, Any] | Unset = UNSET if not isinstance(self.user_target, Unset): user_target = self.user_target.to_dict() - group_target: Unset | dict[str, Any] = UNSET + group_target: dict[str, Any] | Unset = UNSET if not isinstance(self.group_target, Unset): group_target = self.group_target.to_dict() - schedule_target: Unset | dict[str, Any] = UNSET + schedule_target: dict[str, Any] | Unset = UNSET if not isinstance(self.schedule_target, Unset): schedule_target = self.schedule_target.to_dict() @@ -145,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: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType + task_type: InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType | Unset 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: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget + escalation_policy_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget | Unset if isinstance(_escalation_policy_target, Unset): escalation_policy_target = UNSET else: @@ -161,28 +161,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _service_target = d.pop("service_target", UNSET) - service_target: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget + service_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget | Unset 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: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget + user_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget | Unset 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: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget + group_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget | Unset 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: Unset | InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget + schedule_target: InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget | Unset 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 4c24a4ac..865e2e95 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsChannel: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 4d3d9bd8..4ef5fc51 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsEscalationPolicyTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 0434c72b..3c2a90e4 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsGroupTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 1e28a267..0616c5e2 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsScheduleTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 6a401033..167fa3e6 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsServiceTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_task_type.py index b84a5230..376213b4 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_task_type.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_rootly_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType = Literal["invite_to_microsoft_teams_channel_rootly"] @@ -15,7 +15,7 @@ def check_invite_to_microsoft_teams_channel_rootly_task_params_task_type( if value is None: return None if value in INVITE_TO_MICROSOFT_TEAMS_CHANNEL_ROOTLY_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(InviteToMicrosoftTeamsChannelRootlyTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INVITE_TO_MICROSOFT_TEAMS_CHANNEL_ROOTLY_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 f8579431..f828e8a0 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsTeam: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 0c1ffc90..ed58e7af 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToMicrosoftTeamsChannelRootlyTaskParamsUserTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 00939f9c..c9e9c3fa 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,14 +28,14 @@ class InviteToMicrosoftTeamsChannelTaskParams: Attributes: channel (InviteToMicrosoftTeamsChannelTaskParamsChannel): emails (str): Comma separated list of emails to invite - task_type (Union[Unset, InviteToMicrosoftTeamsChannelTaskParamsTaskType]): - team (Union[Unset, InviteToMicrosoftTeamsChannelTaskParamsTeam]): + task_type (InviteToMicrosoftTeamsChannelTaskParamsTaskType | Unset): + team (InviteToMicrosoftTeamsChannelTaskParamsTeam | Unset): """ - channel: "InviteToMicrosoftTeamsChannelTaskParamsChannel" + channel: InviteToMicrosoftTeamsChannelTaskParamsChannel emails: str - task_type: Unset | InviteToMicrosoftTeamsChannelTaskParamsTaskType = UNSET - team: Union[Unset, "InviteToMicrosoftTeamsChannelTaskParamsTeam"] = UNSET + task_type: InviteToMicrosoftTeamsChannelTaskParamsTaskType | Unset = UNSET + team: InviteToMicrosoftTeamsChannelTaskParamsTeam | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,11 +43,11 @@ def to_dict(self) -> dict[str, Any]: emails = self.emails - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - team: Unset | dict[str, Any] = UNSET + team: dict[str, Any] | Unset = UNSET if not isinstance(self.team, Unset): team = self.team.to_dict() @@ -79,14 +81,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: Unset | InviteToMicrosoftTeamsChannelTaskParamsTaskType + task_type: InviteToMicrosoftTeamsChannelTaskParamsTaskType | Unset 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: Unset | InviteToMicrosoftTeamsChannelTaskParamsTeam + team: InviteToMicrosoftTeamsChannelTaskParamsTeam | Unset 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 5c59110f..08fe1c78 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToMicrosoftTeamsChannelTaskParamsChannel: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_task_type.py index f2c12d7a..ac1cde99 100644 --- a/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_task_type.py +++ b/rootly_sdk/models/invite_to_microsoft_teams_channel_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal InviteToMicrosoftTeamsChannelTaskParamsTaskType = Literal["invite_to_microsoft_teams_channel"] @@ -13,7 +13,7 @@ def check_invite_to_microsoft_teams_channel_task_params_task_type( if value is None: return None if value in INVITE_TO_MICROSOFT_TEAMS_CHANNEL_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(InviteToMicrosoftTeamsChannelTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INVITE_TO_MICROSOFT_TEAMS_CHANNEL_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 00f2cd5d..8e6139f7 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToMicrosoftTeamsChannelTaskParamsTeam: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 b26c113a..7e1b9b24 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,14 +28,14 @@ class InviteToSlackChannelOpsgenieTaskParams: """ Attributes: - channels (list['InviteToSlackChannelOpsgenieTaskParamsChannelsItem']): + channels (list[InviteToSlackChannelOpsgenieTaskParamsChannelsItem]): schedule (InviteToSlackChannelOpsgenieTaskParamsSchedule): - task_type (Union[Unset, InviteToSlackChannelOpsgenieTaskParamsTaskType]): + task_type (InviteToSlackChannelOpsgenieTaskParamsTaskType | Unset): """ - channels: list["InviteToSlackChannelOpsgenieTaskParamsChannelsItem"] - schedule: "InviteToSlackChannelOpsgenieTaskParamsSchedule" - task_type: Unset | InviteToSlackChannelOpsgenieTaskParamsTaskType = UNSET + channels: list[InviteToSlackChannelOpsgenieTaskParamsChannelsItem] + schedule: InviteToSlackChannelOpsgenieTaskParamsSchedule + task_type: InviteToSlackChannelOpsgenieTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: schedule = self.schedule.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -81,7 +83,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: Unset | InviteToSlackChannelOpsgenieTaskParamsTaskType + task_type: InviteToSlackChannelOpsgenieTaskParamsTaskType | Unset 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 45a6009d..203b4beb 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToSlackChannelOpsgenieTaskParamsChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 496748be..395e06bf 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToSlackChannelOpsgenieTaskParamsSchedule: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_task_type.py index 078a5897..e041f0e7 100644 --- a/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_task_type.py +++ b/rootly_sdk/models/invite_to_slack_channel_opsgenie_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal InviteToSlackChannelOpsgenieTaskParamsTaskType = Literal["invite_to_slack_channel_opsgenie"] @@ -13,7 +13,7 @@ def check_invite_to_slack_channel_opsgenie_task_params_task_type( if value is None: return None if value in INVITE_TO_SLACK_CHANNEL_OPSGENIE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(InviteToSlackChannelOpsgenieTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INVITE_TO_SLACK_CHANNEL_OPSGENIE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 009cd231..3351841d 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToSlackChannelPagerdutyTaskParamsType0EscalationPolicy: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 7e1c28ab..41e59cc3 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToSlackChannelPagerdutyTaskParamsType1Schedule: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 070af339..591cb3c9 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -38,22 +40,22 @@ class InviteToSlackChannelRootlyTaskParams: """ Attributes: - 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): + 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: 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,27 +64,27 @@ def to_dict(self) -> dict[str, Any]: channels_item = channels_item_data.to_dict() channels.append(channels_item) - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - escalation_policy_target: Unset | dict[str, Any] = UNSET + 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: Unset | dict[str, Any] = UNSET + service_target: dict[str, Any] | Unset = UNSET if not isinstance(self.service_target, Unset): service_target = self.service_target.to_dict() - user_target: Unset | dict[str, Any] = UNSET + user_target: dict[str, Any] | Unset = UNSET if not isinstance(self.user_target, Unset): user_target = self.user_target.to_dict() - group_target: Unset | dict[str, Any] = UNSET + group_target: dict[str, Any] | Unset = UNSET if not isinstance(self.group_target, Unset): group_target = self.group_target.to_dict() - schedule_target: Unset | dict[str, Any] = UNSET + schedule_target: dict[str, Any] | Unset = UNSET if not isinstance(self.schedule_target, Unset): schedule_target = self.schedule_target.to_dict() @@ -138,14 +140,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: Unset | InviteToSlackChannelRootlyTaskParamsTaskType + task_type: InviteToSlackChannelRootlyTaskParamsTaskType | Unset 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: Unset | InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget + escalation_policy_target: InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget | Unset if isinstance(_escalation_policy_target, Unset): escalation_policy_target = UNSET else: @@ -154,28 +156,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _service_target = d.pop("service_target", UNSET) - service_target: Unset | InviteToSlackChannelRootlyTaskParamsServiceTarget + service_target: InviteToSlackChannelRootlyTaskParamsServiceTarget | Unset 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: Unset | InviteToSlackChannelRootlyTaskParamsUserTarget + user_target: InviteToSlackChannelRootlyTaskParamsUserTarget | Unset 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: Unset | InviteToSlackChannelRootlyTaskParamsGroupTarget + group_target: InviteToSlackChannelRootlyTaskParamsGroupTarget | Unset 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: Unset | InviteToSlackChannelRootlyTaskParamsScheduleTarget + schedule_target: InviteToSlackChannelRootlyTaskParamsScheduleTarget | Unset 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 40e8480b..dc0a4aeb 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToSlackChannelRootlyTaskParamsChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 b7f8aae0..c1ec962e 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToSlackChannelRootlyTaskParamsEscalationPolicyTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 e22e4a4c..ddd9bad8 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToSlackChannelRootlyTaskParamsGroupTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 68ad559b..66307c41 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToSlackChannelRootlyTaskParamsScheduleTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 b9f9bd54..93a0ddb1 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToSlackChannelRootlyTaskParamsServiceTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_task_type.py index f80d775c..a58a93c1 100644 --- a/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_task_type.py +++ b/rootly_sdk/models/invite_to_slack_channel_rootly_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal InviteToSlackChannelRootlyTaskParamsTaskType = Literal["invite_to_slack_channel_rootly"] @@ -13,7 +13,7 @@ def check_invite_to_slack_channel_rootly_task_params_task_type( if value is None: return None if value in INVITE_TO_SLACK_CHANNEL_ROOTLY_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(InviteToSlackChannelRootlyTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INVITE_TO_SLACK_CHANNEL_ROOTLY_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 ac6987fd..6ba36eae 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToSlackChannelRootlyTaskParamsUserTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 1d7557f8..c0d9d99d 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToSlackChannelTaskParamsType0SlackUsersItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 f262daae..97ba21b9 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToSlackChannelTaskParamsType1SlackUserGroupsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 01eb52a0..ce51bda3 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,3 +1,5 @@ +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 fe9170b0..53822b1d 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,14 +26,14 @@ class InviteToSlackChannelVictorOpsTaskParams: """ Attributes: - channels (list['InviteToSlackChannelVictorOpsTaskParamsChannelsItem']): + channels (list[InviteToSlackChannelVictorOpsTaskParamsChannelsItem]): team (InviteToSlackChannelVictorOpsTaskParamsTeam): - task_type (Union[Unset, InviteToSlackChannelVictorOpsTaskParamsTaskType]): + task_type (InviteToSlackChannelVictorOpsTaskParamsTaskType | Unset): """ - channels: list["InviteToSlackChannelVictorOpsTaskParamsChannelsItem"] - team: "InviteToSlackChannelVictorOpsTaskParamsTeam" - task_type: Unset | InviteToSlackChannelVictorOpsTaskParamsTaskType = UNSET + channels: list[InviteToSlackChannelVictorOpsTaskParamsChannelsItem] + team: InviteToSlackChannelVictorOpsTaskParamsTeam + task_type: InviteToSlackChannelVictorOpsTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: team = self.team.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -79,7 +81,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: Unset | InviteToSlackChannelVictorOpsTaskParamsTaskType + task_type: InviteToSlackChannelVictorOpsTaskParamsTaskType | Unset 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 65599a9a..bb0cad1b 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToSlackChannelVictorOpsTaskParamsChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_task_type.py index a73d00a2..a1a7cb74 100644 --- a/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_task_type.py +++ b/rootly_sdk/models/invite_to_slack_channel_victor_ops_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal InviteToSlackChannelVictorOpsTaskParamsTaskType = Literal["invite_to_slack_channel_victor_ops"] @@ -15,7 +15,7 @@ def check_invite_to_slack_channel_victor_ops_task_params_task_type( if value is None: return None if value in INVITE_TO_SLACK_CHANNEL_VICTOR_OPS_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(InviteToSlackChannelVictorOpsTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {INVITE_TO_SLACK_CHANNEL_VICTOR_OPS_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 fda1a9f0..b00e5aa4 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class InviteToSlackChannelVictorOpsTaskParamsTeam: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 64c416d1..f959ae26 100644 --- a/rootly_sdk/models/ip_ranges.py +++ b/rootly_sdk/models/ip_ranges.py @@ -1,3 +1,5 @@ +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 23b3ad46..b38ca535 100644 --- a/rootly_sdk/models/ip_ranges_response.py +++ b/rootly_sdk/models/ip_ranges_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,7 +20,7 @@ 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]: diff --git a/rootly_sdk/models/ip_ranges_response_data.py b/rootly_sdk/models/ip_ranges_response_data.py index 815ecd72..3c0ea6ff 100644 --- a/rootly_sdk/models/ip_ranges_response_data.py +++ b/rootly_sdk/models/ip_ranges_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/ip_ranges_response_data_type.py b/rootly_sdk/models/ip_ranges_response_data_type.py index fceedcf3..d9f38365 100644 --- a/rootly_sdk/models/ip_ranges_response_data_type.py +++ b/rootly_sdk/models/ip_ranges_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal IpRangesResponseDataType = Literal["ip_ranges"] @@ -11,5 +11,5 @@ def check_ip_ranges_response_data_type(value: str | None) -> IpRangesResponseDat if value is None: return None if value in IP_RANGES_RESPONSE_DATA_TYPE_VALUES: - return cast(IpRangesResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {IP_RANGES_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/jsonapi_included_resource.py b/rootly_sdk/models/jsonapi_included_resource.py index cf6c95bf..6b0577e8 100644 --- a/rootly_sdk/models/jsonapi_included_resource.py +++ b/rootly_sdk/models/jsonapi_included_resource.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,14 +22,14 @@ class JsonapiIncludedResource: Attributes: id (str): type_ (str): - attributes (Union[Unset, JsonapiIncludedResourceAttributes]): - relationships (Union[Unset, JsonapiIncludedResourceRelationships]): + attributes (JsonapiIncludedResourceAttributes | Unset): + relationships (JsonapiIncludedResourceRelationships | Unset): """ id: str type_: str - attributes: Union[Unset, "JsonapiIncludedResourceAttributes"] = UNSET - relationships: Union[Unset, "JsonapiIncludedResourceRelationships"] = UNSET + attributes: JsonapiIncludedResourceAttributes | Unset = UNSET + relationships: JsonapiIncludedResourceRelationships | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -35,11 +37,11 @@ def to_dict(self) -> dict[str, Any]: type_ = self.type_ - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() - relationships: Unset | dict[str, Any] = UNSET + relationships: dict[str, Any] | Unset = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -69,14 +71,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_ = d.pop("type") _attributes = d.pop("attributes", UNSET) - attributes: Unset | JsonapiIncludedResourceAttributes + attributes: JsonapiIncludedResourceAttributes | Unset if isinstance(_attributes, Unset): attributes = UNSET else: attributes = JsonapiIncludedResourceAttributes.from_dict(_attributes) _relationships = d.pop("relationships", UNSET) - relationships: Unset | JsonapiIncludedResourceRelationships + relationships: JsonapiIncludedResourceRelationships | Unset 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 b80d55bd..4941c7af 100644 --- a/rootly_sdk/models/jsonapi_included_resource_attributes.py +++ b/rootly_sdk/models/jsonapi_included_resource_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 5d006566..2ed1ed48 100644 --- a/rootly_sdk/models/jsonapi_included_resource_relationships.py +++ b/rootly_sdk/models/jsonapi_included_resource_relationships.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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/link_incidents.py b/rootly_sdk/models/link_incidents.py new file mode 100644 index 00000000..3c03126f --- /dev/null +++ b/rootly_sdk/models/link_incidents.py @@ -0,0 +1,48 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.link_incidents_data import LinkIncidentsData + + +T = TypeVar("T", bound="LinkIncidents") + + +@_attrs_define +class LinkIncidents: + """ + Attributes: + data (LinkIncidentsData): + """ + + data: LinkIncidentsData + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.link_incidents_data import LinkIncidentsData + + d = dict(src_dict) + data = LinkIncidentsData.from_dict(d.pop("data")) + + link_incidents = cls( + data=data, + ) + + return link_incidents diff --git a/rootly_sdk/models/link_incidents_data.py b/rootly_sdk/models/link_incidents_data.py new file mode 100644 index 00000000..e2878dc3 --- /dev/null +++ b/rootly_sdk/models/link_incidents_data.py @@ -0,0 +1,58 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.link_incidents_data_type import LinkIncidentsDataType, check_link_incidents_data_type + +if TYPE_CHECKING: + from ..models.link_incidents_data_attributes import LinkIncidentsDataAttributes + + +T = TypeVar("T", bound="LinkIncidentsData") + + +@_attrs_define +class LinkIncidentsData: + """ + Attributes: + type_ (LinkIncidentsDataType): + attributes (LinkIncidentsDataAttributes): + """ + + type_: LinkIncidentsDataType + attributes: LinkIncidentsDataAttributes + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + + 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.link_incidents_data_attributes import LinkIncidentsDataAttributes + + d = dict(src_dict) + type_ = check_link_incidents_data_type(d.pop("type")) + + attributes = LinkIncidentsDataAttributes.from_dict(d.pop("attributes")) + + link_incidents_data = cls( + type_=type_, + attributes=attributes, + ) + + return link_incidents_data diff --git a/rootly_sdk/models/link_incidents_data_attributes.py b/rootly_sdk/models/link_incidents_data_attributes.py new file mode 100644 index 00000000..822cfe98 --- /dev/null +++ b/rootly_sdk/models/link_incidents_data_attributes.py @@ -0,0 +1,53 @@ +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="LinkIncidentsDataAttributes") + + +@_attrs_define +class LinkIncidentsDataAttributes: + """ + Attributes: + incident_id (str | Unset): ID of a single incident to link + incident_ids (list[str] | Unset): IDs of incidents to link + """ + + incident_id: str | Unset = UNSET + incident_ids: list[str] | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + incident_id = self.incident_id + + incident_ids: list[str] | Unset = UNSET + if not isinstance(self.incident_ids, Unset): + incident_ids = self.incident_ids + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if incident_id is not UNSET: + field_dict["incident_id"] = incident_id + if incident_ids is not UNSET: + field_dict["incident_ids"] = incident_ids + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + incident_id = d.pop("incident_id", UNSET) + + incident_ids = cast(list[str], d.pop("incident_ids", UNSET)) + + link_incidents_data_attributes = cls( + incident_id=incident_id, + incident_ids=incident_ids, + ) + + return link_incidents_data_attributes diff --git a/rootly_sdk/models/link_incidents_data_type.py b/rootly_sdk/models/link_incidents_data_type.py new file mode 100644 index 00000000..b48c6c49 --- /dev/null +++ b/rootly_sdk/models/link_incidents_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +LinkIncidentsDataType = Literal["problems"] + +LINK_INCIDENTS_DATA_TYPE_VALUES: set[LinkIncidentsDataType] = { + "problems", +} + + +def check_link_incidents_data_type(value: str | None) -> LinkIncidentsDataType | None: + if value is None: + return None + if value in LINK_INCIDENTS_DATA_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {LINK_INCIDENTS_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/links.py b/rootly_sdk/models/links.py index 0aba5061..48bcff63 100644 --- a/rootly_sdk/models/links.py +++ b/rootly_sdk/models/links.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,9 +15,9 @@ class Links: Attributes: self_ (str): first (str): - prev (Union[None, str]): - next_ (Union[None, str]): - last (Union[None, str]): + prev (None | str): + next_ (None | str): + last (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 229f0c20..1fd7a60b 100644 --- a/rootly_sdk/models/list_alert_events_feed_filteraction.py +++ b/rootly_sdk/models/list_alert_events_feed_filteraction.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListAlertEventsFeedFilteraction = Literal[ "ack_timeout_retriggered", @@ -27,14 +27,17 @@ "paged", "removed", "resolved", + "retrigger_cancelled", "retrigger_suppressed", "retriggered", "skipped", "slacked", "snoozed", + "team_attached_from_payload", "texted", "triggered", "updated", + "user_paged", ] LIST_ALERT_EVENTS_FEED_FILTERACTION_VALUES: set[ListAlertEventsFeedFilteraction] = { @@ -64,14 +67,17 @@ "paged", "removed", "resolved", + "retrigger_cancelled", "retrigger_suppressed", "retriggered", "skipped", "slacked", "snoozed", + "team_attached_from_payload", "texted", "triggered", "updated", + "user_paged", } @@ -79,5 +85,5 @@ def check_list_alert_events_feed_filteraction(value: str | None) -> ListAlertEve if value is None: return None if value in LIST_ALERT_EVENTS_FEED_FILTERACTION_VALUES: - return cast(ListAlertEventsFeedFilteraction, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_ALERT_EVENTS_FEED_FILTERACTION_VALUES!r}") diff --git a/rootly_sdk/models/list_alert_events_feed_filterkind.py b/rootly_sdk/models/list_alert_events_feed_filterkind.py index 511c5438..3d9dea70 100644 --- a/rootly_sdk/models/list_alert_events_feed_filterkind.py +++ b/rootly_sdk/models/list_alert_events_feed_filterkind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListAlertEventsFeedFilterkind = Literal[ "action", @@ -35,5 +35,5 @@ def check_list_alert_events_feed_filterkind(value: str | None) -> ListAlertEvent if value is None: return None if value in LIST_ALERT_EVENTS_FEED_FILTERKIND_VALUES: - return cast(ListAlertEventsFeedFilterkind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_ALERT_EVENTS_FEED_FILTERKIND_VALUES!r}") diff --git a/rootly_sdk/models/list_alert_events_feed_sort.py b/rootly_sdk/models/list_alert_events_feed_sort.py index f154e60c..46c66b60 100644 --- a/rootly_sdk/models/list_alert_events_feed_sort.py +++ b/rootly_sdk/models/list_alert_events_feed_sort.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListAlertEventsFeedSort = Literal["-created_at", "created_at"] @@ -12,5 +12,5 @@ def check_list_alert_events_feed_sort(value: str | None) -> ListAlertEventsFeedS if value is None: return None if value in LIST_ALERT_EVENTS_FEED_SORT_VALUES: - return cast(ListAlertEventsFeedSort, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_ALERT_EVENTS_FEED_SORT_VALUES!r}") diff --git a/rootly_sdk/models/list_alerts_include.py b/rootly_sdk/models/list_alerts_include.py index 239b223d..3d246bdc 100644 --- a/rootly_sdk/models/list_alerts_include.py +++ b/rootly_sdk/models/list_alerts_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListAlertsInclude = Literal[ "alert_call_recording", @@ -47,5 +47,5 @@ def check_list_alerts_include(value: str | None) -> ListAlertsInclude | None: if value is None: return None if value in LIST_ALERTS_INCLUDE_VALUES: - return cast(ListAlertsInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_ALERTS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_catalog_checklist_templates_include.py b/rootly_sdk/models/list_catalog_checklist_templates_include.py index a43f01a6..650d8e94 100644 --- a/rootly_sdk/models/list_catalog_checklist_templates_include.py +++ b/rootly_sdk/models/list_catalog_checklist_templates_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListCatalogChecklistTemplatesInclude = Literal["template_fields", "template_owners"] @@ -12,5 +12,5 @@ def check_list_catalog_checklist_templates_include(value: str | None) -> ListCat if value is None: return None if value in LIST_CATALOG_CHECKLIST_TEMPLATES_INCLUDE_VALUES: - return cast(ListCatalogChecklistTemplatesInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_CATALOG_CHECKLIST_TEMPLATES_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_catalog_checklist_templates_sort.py b/rootly_sdk/models/list_catalog_checklist_templates_sort.py index e8eb966a..3c7f3665 100644 --- a/rootly_sdk/models/list_catalog_checklist_templates_sort.py +++ b/rootly_sdk/models/list_catalog_checklist_templates_sort.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListCatalogChecklistTemplatesSort = Literal["-created_at", "-name", "-updated_at", "created_at", "name", "updated_at"] @@ -16,5 +16,5 @@ def check_list_catalog_checklist_templates_sort(value: str | None) -> ListCatalo if value is None: return None if value in LIST_CATALOG_CHECKLIST_TEMPLATES_SORT_VALUES: - return cast(ListCatalogChecklistTemplatesSort, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_CATALOG_CHECKLIST_TEMPLATES_SORT_VALUES!r}") diff --git a/rootly_sdk/models/list_catalog_entities_include.py b/rootly_sdk/models/list_catalog_entities_include.py index c800a372..62a8210c 100644 --- a/rootly_sdk/models/list_catalog_entities_include.py +++ b/rootly_sdk/models/list_catalog_entities_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListCatalogEntitiesInclude = Literal["catalog", "properties"] @@ -12,5 +12,5 @@ def check_list_catalog_entities_include(value: str | None) -> ListCatalogEntitie if value is None: return None if value in LIST_CATALOG_ENTITIES_INCLUDE_VALUES: - return cast(ListCatalogEntitiesInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_CATALOG_ENTITIES_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_catalog_entities_sort.py b/rootly_sdk/models/list_catalog_entities_sort.py index 6a899ba1..ee54d06d 100644 --- a/rootly_sdk/models/list_catalog_entities_sort.py +++ b/rootly_sdk/models/list_catalog_entities_sort.py @@ -1,12 +1,16 @@ -from typing import Literal, cast +from typing import Literal -ListCatalogEntitiesSort = Literal["-created_at", "-position", "-updated_at", "created_at", "position", "updated_at"] +ListCatalogEntitiesSort = Literal[ + "-created_at", "-name", "-position", "-updated_at", "created_at", "name", "position", "updated_at" +] LIST_CATALOG_ENTITIES_SORT_VALUES: set[ListCatalogEntitiesSort] = { "-created_at", + "-name", "-position", "-updated_at", "created_at", + "name", "position", "updated_at", } @@ -16,5 +20,5 @@ def check_list_catalog_entities_sort(value: str | None) -> ListCatalogEntitiesSo if value is None: return None if value in LIST_CATALOG_ENTITIES_SORT_VALUES: - return cast(ListCatalogEntitiesSort, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_CATALOG_ENTITIES_SORT_VALUES!r}") diff --git a/rootly_sdk/models/list_catalog_entity_properties_include.py b/rootly_sdk/models/list_catalog_entity_properties_include.py index 1bda3f46..932b5905 100644 --- a/rootly_sdk/models/list_catalog_entity_properties_include.py +++ b/rootly_sdk/models/list_catalog_entity_properties_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListCatalogEntityPropertiesInclude = Literal["catalog_entity", "catalog_field"] @@ -12,5 +12,5 @@ def check_list_catalog_entity_properties_include(value: str | None) -> ListCatal if value is None: return None if value in LIST_CATALOG_ENTITY_PROPERTIES_INCLUDE_VALUES: - return cast(ListCatalogEntityPropertiesInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_CATALOG_ENTITY_PROPERTIES_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_catalog_entity_properties_sort.py b/rootly_sdk/models/list_catalog_entity_properties_sort.py index 3dda51a1..e704d4f8 100644 --- a/rootly_sdk/models/list_catalog_entity_properties_sort.py +++ b/rootly_sdk/models/list_catalog_entity_properties_sort.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListCatalogEntityPropertiesSort = Literal["-created_at", "-updated_at", "created_at", "updated_at"] @@ -14,5 +14,5 @@ def check_list_catalog_entity_properties_sort(value: str | None) -> ListCatalogE if value is None: return None if value in LIST_CATALOG_ENTITY_PROPERTIES_SORT_VALUES: - return cast(ListCatalogEntityPropertiesSort, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_CATALOG_ENTITY_PROPERTIES_SORT_VALUES!r}") diff --git a/rootly_sdk/models/list_catalogs_include.py b/rootly_sdk/models/list_catalogs_include.py index 362f0b2e..fa1bb366 100644 --- a/rootly_sdk/models/list_catalogs_include.py +++ b/rootly_sdk/models/list_catalogs_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListCatalogsInclude = Literal["entities", "fields"] @@ -12,5 +12,5 @@ def check_list_catalogs_include(value: str | None) -> ListCatalogsInclude | None if value is None: return None if value in LIST_CATALOGS_INCLUDE_VALUES: - return cast(ListCatalogsInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_CATALOGS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_catalogs_sort.py b/rootly_sdk/models/list_catalogs_sort.py index a46cc25c..a7263056 100644 --- a/rootly_sdk/models/list_catalogs_sort.py +++ b/rootly_sdk/models/list_catalogs_sort.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListCatalogsSort = Literal["-created_at", "-position", "-updated_at", "created_at", "position", "updated_at"] @@ -16,5 +16,5 @@ def check_list_catalogs_sort(value: str | None) -> ListCatalogsSort | None: if value is None: return None if value in LIST_CATALOGS_SORT_VALUES: - return cast(ListCatalogsSort, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_CATALOGS_SORT_VALUES!r}") diff --git a/rootly_sdk/models/list_cause_catalog_properties_include.py b/rootly_sdk/models/list_cause_catalog_properties_include.py index 5565b8dd..5328121c 100644 --- a/rootly_sdk/models/list_cause_catalog_properties_include.py +++ b/rootly_sdk/models/list_cause_catalog_properties_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListCauseCatalogPropertiesInclude = Literal["catalog"] @@ -11,5 +11,5 @@ def check_list_cause_catalog_properties_include(value: str | None) -> ListCauseC if value is None: return None if value in LIST_CAUSE_CATALOG_PROPERTIES_INCLUDE_VALUES: - return cast(ListCauseCatalogPropertiesInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_CAUSE_CATALOG_PROPERTIES_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_cause_catalog_properties_sort.py b/rootly_sdk/models/list_cause_catalog_properties_sort.py index 89fc6156..7e2baeaf 100644 --- a/rootly_sdk/models/list_cause_catalog_properties_sort.py +++ b/rootly_sdk/models/list_cause_catalog_properties_sort.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListCauseCatalogPropertiesSort = Literal[ "-created_at", "-position", "-updated_at", "created_at", "position", "updated_at" @@ -18,5 +18,5 @@ def check_list_cause_catalog_properties_sort(value: str | None) -> ListCauseCata if value is None: return None if value in LIST_CAUSE_CATALOG_PROPERTIES_SORT_VALUES: - return cast(ListCauseCatalogPropertiesSort, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_CAUSE_CATALOG_PROPERTIES_SORT_VALUES!r}") diff --git a/rootly_sdk/models/list_custom_fields_include.py b/rootly_sdk/models/list_custom_fields_include.py index 71b0f772..181ba247 100644 --- a/rootly_sdk/models/list_custom_fields_include.py +++ b/rootly_sdk/models/list_custom_fields_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListCustomFieldsInclude = Literal["options"] @@ -11,5 +11,5 @@ def check_list_custom_fields_include(value: str | None) -> ListCustomFieldsInclu if value is None: return None if value in LIST_CUSTOM_FIELDS_INCLUDE_VALUES: - return cast(ListCustomFieldsInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_CUSTOM_FIELDS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_custom_fields_sort.py b/rootly_sdk/models/list_custom_fields_sort.py index baa2dfbe..9c32e3dd 100644 --- a/rootly_sdk/models/list_custom_fields_sort.py +++ b/rootly_sdk/models/list_custom_fields_sort.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListCustomFieldsSort = Literal["-created_at", "-position", "-updated_at", "created_at", "position", "updated_at"] @@ -16,5 +16,5 @@ def check_list_custom_fields_sort(value: str | None) -> ListCustomFieldsSort | N if value is None: return None if value in LIST_CUSTOM_FIELDS_SORT_VALUES: - return cast(ListCustomFieldsSort, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_CUSTOM_FIELDS_SORT_VALUES!r}") diff --git a/rootly_sdk/models/list_dashboards_include.py b/rootly_sdk/models/list_dashboards_include.py index 9db5d514..2ca2ebb2 100644 --- a/rootly_sdk/models/list_dashboards_include.py +++ b/rootly_sdk/models/list_dashboards_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListDashboardsInclude = Literal["panels"] @@ -11,5 +11,5 @@ def check_list_dashboards_include(value: str | None) -> ListDashboardsInclude | if value is None: return None if value in LIST_DASHBOARDS_INCLUDE_VALUES: - return cast(ListDashboardsInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_DASHBOARDS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_environment_catalog_properties_include.py b/rootly_sdk/models/list_environment_catalog_properties_include.py index 02b002b0..29c376b0 100644 --- a/rootly_sdk/models/list_environment_catalog_properties_include.py +++ b/rootly_sdk/models/list_environment_catalog_properties_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListEnvironmentCatalogPropertiesInclude = Literal["catalog"] @@ -13,7 +13,7 @@ def check_list_environment_catalog_properties_include( if value is None: return None if value in LIST_ENVIRONMENT_CATALOG_PROPERTIES_INCLUDE_VALUES: - return cast(ListEnvironmentCatalogPropertiesInclude, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {LIST_ENVIRONMENT_CATALOG_PROPERTIES_INCLUDE_VALUES!r}" ) diff --git a/rootly_sdk/models/list_environment_catalog_properties_sort.py b/rootly_sdk/models/list_environment_catalog_properties_sort.py index 52360d89..3a7e1f9b 100644 --- a/rootly_sdk/models/list_environment_catalog_properties_sort.py +++ b/rootly_sdk/models/list_environment_catalog_properties_sort.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListEnvironmentCatalogPropertiesSort = Literal[ "-created_at", "-position", "-updated_at", "created_at", "position", "updated_at" @@ -18,5 +18,5 @@ def check_list_environment_catalog_properties_sort(value: str | None) -> ListEnv if value is None: return None if value in LIST_ENVIRONMENT_CATALOG_PROPERTIES_SORT_VALUES: - return cast(ListEnvironmentCatalogPropertiesSort, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_ENVIRONMENT_CATALOG_PROPERTIES_SORT_VALUES!r}") diff --git a/rootly_sdk/models/list_escalation_paths_filterpath_type.py b/rootly_sdk/models/list_escalation_paths_filterpath_type.py index ecde9f6a..31392034 100644 --- a/rootly_sdk/models/list_escalation_paths_filterpath_type.py +++ b/rootly_sdk/models/list_escalation_paths_filterpath_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListEscalationPathsFilterpathType = Literal["deferral", "escalation"] @@ -12,5 +12,5 @@ def check_list_escalation_paths_filterpath_type(value: str | None) -> ListEscala if value is None: return None if value in LIST_ESCALATION_PATHS_FILTERPATH_TYPE_VALUES: - return cast(ListEscalationPathsFilterpathType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_ESCALATION_PATHS_FILTERPATH_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/list_escalation_paths_include.py b/rootly_sdk/models/list_escalation_paths_include.py index 315f76f1..863c09f2 100644 --- a/rootly_sdk/models/list_escalation_paths_include.py +++ b/rootly_sdk/models/list_escalation_paths_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListEscalationPathsInclude = Literal["escalation_policy_levels"] @@ -11,5 +11,5 @@ def check_list_escalation_paths_include(value: str | None) -> ListEscalationPath if value is None: return None if value in LIST_ESCALATION_PATHS_INCLUDE_VALUES: - return cast(ListEscalationPathsInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_ESCALATION_PATHS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_escalation_policies_include.py b/rootly_sdk/models/list_escalation_policies_include.py index 2896b93d..0311c271 100644 --- a/rootly_sdk/models/list_escalation_policies_include.py +++ b/rootly_sdk/models/list_escalation_policies_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListEscalationPoliciesInclude = Literal["escalation_policy_levels", "escalation_policy_paths", "groups", "services"] @@ -14,5 +14,5 @@ def check_list_escalation_policies_include(value: str | None) -> ListEscalationP if value is None: return None if value in LIST_ESCALATION_POLICIES_INCLUDE_VALUES: - return cast(ListEscalationPoliciesInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_ESCALATION_POLICIES_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_form_fields_include.py b/rootly_sdk/models/list_form_fields_include.py index 39b5f704..f593dedf 100644 --- a/rootly_sdk/models/list_form_fields_include.py +++ b/rootly_sdk/models/list_form_fields_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListFormFieldsInclude = Literal["options", "positions"] @@ -12,5 +12,5 @@ def check_list_form_fields_include(value: str | None) -> ListFormFieldsInclude | if value is None: return None if value in LIST_FORM_FIELDS_INCLUDE_VALUES: - return cast(ListFormFieldsInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_FORM_FIELDS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_functionality_catalog_properties_include.py b/rootly_sdk/models/list_functionality_catalog_properties_include.py index 5503a2c1..dd4416ca 100644 --- a/rootly_sdk/models/list_functionality_catalog_properties_include.py +++ b/rootly_sdk/models/list_functionality_catalog_properties_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListFunctionalityCatalogPropertiesInclude = Literal["catalog"] @@ -13,7 +13,7 @@ def check_list_functionality_catalog_properties_include( if value is None: return None if value in LIST_FUNCTIONALITY_CATALOG_PROPERTIES_INCLUDE_VALUES: - return cast(ListFunctionalityCatalogPropertiesInclude, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {LIST_FUNCTIONALITY_CATALOG_PROPERTIES_INCLUDE_VALUES!r}" ) diff --git a/rootly_sdk/models/list_functionality_catalog_properties_sort.py b/rootly_sdk/models/list_functionality_catalog_properties_sort.py index a29e521d..ba6100a1 100644 --- a/rootly_sdk/models/list_functionality_catalog_properties_sort.py +++ b/rootly_sdk/models/list_functionality_catalog_properties_sort.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListFunctionalityCatalogPropertiesSort = Literal[ "-created_at", "-position", "-updated_at", "created_at", "position", "updated_at" @@ -20,7 +20,7 @@ def check_list_functionality_catalog_properties_sort( if value is None: return None if value in LIST_FUNCTIONALITY_CATALOG_PROPERTIES_SORT_VALUES: - return cast(ListFunctionalityCatalogPropertiesSort, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {LIST_FUNCTIONALITY_CATALOG_PROPERTIES_SORT_VALUES!r}" ) diff --git a/rootly_sdk/models/list_group_catalog_properties_include.py b/rootly_sdk/models/list_group_catalog_properties_include.py index 0cb0a85f..5fa58b39 100644 --- a/rootly_sdk/models/list_group_catalog_properties_include.py +++ b/rootly_sdk/models/list_group_catalog_properties_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListGroupCatalogPropertiesInclude = Literal["catalog"] @@ -11,5 +11,5 @@ def check_list_group_catalog_properties_include(value: str | None) -> ListGroupC if value is None: return None if value in LIST_GROUP_CATALOG_PROPERTIES_INCLUDE_VALUES: - return cast(ListGroupCatalogPropertiesInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_GROUP_CATALOG_PROPERTIES_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_group_catalog_properties_sort.py b/rootly_sdk/models/list_group_catalog_properties_sort.py index 78eec151..6fb24757 100644 --- a/rootly_sdk/models/list_group_catalog_properties_sort.py +++ b/rootly_sdk/models/list_group_catalog_properties_sort.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListGroupCatalogPropertiesSort = Literal[ "-created_at", "-position", "-updated_at", "created_at", "position", "updated_at" @@ -18,5 +18,5 @@ def check_list_group_catalog_properties_sort(value: str | None) -> ListGroupCata if value is None: return None if value in LIST_GROUP_CATALOG_PROPERTIES_SORT_VALUES: - return cast(ListGroupCatalogPropertiesSort, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_GROUP_CATALOG_PROPERTIES_SORT_VALUES!r}") diff --git a/rootly_sdk/models/list_incident_alerts_include.py b/rootly_sdk/models/list_incident_alerts_include.py index bc706824..ebb85568 100644 --- a/rootly_sdk/models/list_incident_alerts_include.py +++ b/rootly_sdk/models/list_incident_alerts_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListIncidentAlertsInclude = Literal[ "alert_call_recording", @@ -47,5 +47,5 @@ def check_list_incident_alerts_include(value: str | None) -> ListIncidentAlertsI if value is None: return None if value in LIST_INCIDENT_ALERTS_INCLUDE_VALUES: - return cast(ListIncidentAlertsInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_INCIDENT_ALERTS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_incident_sub_statuses_include.py b/rootly_sdk/models/list_incident_sub_statuses_include.py index 9eb0d47e..f7707f0e 100644 --- a/rootly_sdk/models/list_incident_sub_statuses_include.py +++ b/rootly_sdk/models/list_incident_sub_statuses_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListIncidentSubStatusesInclude = Literal["assigned_by_user", "sub_status"] @@ -12,5 +12,5 @@ def check_list_incident_sub_statuses_include(value: str | None) -> ListIncidentS if value is None: return None if value in LIST_INCIDENT_SUB_STATUSES_INCLUDE_VALUES: - return cast(ListIncidentSubStatusesInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_INCIDENT_SUB_STATUSES_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_incident_sub_statuses_sort.py b/rootly_sdk/models/list_incident_sub_statuses_sort.py index e093a860..352f209a 100644 --- a/rootly_sdk/models/list_incident_sub_statuses_sort.py +++ b/rootly_sdk/models/list_incident_sub_statuses_sort.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListIncidentSubStatusesSort = Literal[ "-assigned_at", "-created_at", "-updated_at", "assigned_at", "created_at", "updated_at" @@ -18,5 +18,5 @@ def check_list_incident_sub_statuses_sort(value: str | None) -> ListIncidentSubS if value is None: return None if value in LIST_INCIDENT_SUB_STATUSES_SORT_VALUES: - return cast(ListIncidentSubStatusesSort, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_INCIDENT_SUB_STATUSES_SORT_VALUES!r}") diff --git a/rootly_sdk/models/list_incident_type_catalog_properties_include.py b/rootly_sdk/models/list_incident_type_catalog_properties_include.py index 7595b487..475cfd3a 100644 --- a/rootly_sdk/models/list_incident_type_catalog_properties_include.py +++ b/rootly_sdk/models/list_incident_type_catalog_properties_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListIncidentTypeCatalogPropertiesInclude = Literal["catalog"] @@ -13,7 +13,7 @@ def check_list_incident_type_catalog_properties_include( if value is None: return None if value in LIST_INCIDENT_TYPE_CATALOG_PROPERTIES_INCLUDE_VALUES: - return cast(ListIncidentTypeCatalogPropertiesInclude, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {LIST_INCIDENT_TYPE_CATALOG_PROPERTIES_INCLUDE_VALUES!r}" ) diff --git a/rootly_sdk/models/list_incident_type_catalog_properties_sort.py b/rootly_sdk/models/list_incident_type_catalog_properties_sort.py index d1edf47a..b484f7d3 100644 --- a/rootly_sdk/models/list_incident_type_catalog_properties_sort.py +++ b/rootly_sdk/models/list_incident_type_catalog_properties_sort.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListIncidentTypeCatalogPropertiesSort = Literal[ "-created_at", "-position", "-updated_at", "created_at", "position", "updated_at" @@ -18,7 +18,7 @@ def check_list_incident_type_catalog_properties_sort(value: str | None) -> ListI if value is None: return None if value in LIST_INCIDENT_TYPE_CATALOG_PROPERTIES_SORT_VALUES: - return cast(ListIncidentTypeCatalogPropertiesSort, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {LIST_INCIDENT_TYPE_CATALOG_PROPERTIES_SORT_VALUES!r}" ) diff --git a/rootly_sdk/models/list_incidents_include.py b/rootly_sdk/models/list_incidents_include.py index 7586484a..1c7f06ff 100644 --- a/rootly_sdk/models/list_incidents_include.py +++ b/rootly_sdk/models/list_incidents_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListIncidentsInclude = Literal[ "action_items", @@ -43,5 +43,5 @@ def check_list_incidents_include(value: str | None) -> ListIncidentsInclude | No if value is None: return None if value in LIST_INCIDENTS_INCLUDE_VALUES: - return cast(ListIncidentsInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_INCIDENTS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_incidents_sort.py b/rootly_sdk/models/list_incidents_sort.py index c2eb5a73..62cf843d 100644 --- a/rootly_sdk/models/list_incidents_sort.py +++ b/rootly_sdk/models/list_incidents_sort.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListIncidentsSort = Literal[ "-created_at", @@ -35,5 +35,5 @@ def check_list_incidents_sort(value: str | None) -> ListIncidentsSort | None: if value is None: return None if value in LIST_INCIDENTS_SORT_VALUES: - return cast(ListIncidentsSort, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_INCIDENTS_SORT_VALUES!r}") diff --git a/rootly_sdk/models/list_oncalls_include.py b/rootly_sdk/models/list_oncalls_include.py index b3a77042..e5085e60 100644 --- a/rootly_sdk/models/list_oncalls_include.py +++ b/rootly_sdk/models/list_oncalls_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListOncallsInclude = Literal["escalation_policy", "schedule", "user"] @@ -13,5 +13,5 @@ def check_list_oncalls_include(value: str | None) -> ListOncallsInclude | None: if value is None: return None if value in LIST_ONCALLS_INCLUDE_VALUES: - return cast(ListOncallsInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_ONCALLS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_playbooks_include.py b/rootly_sdk/models/list_playbooks_include.py index 2084838a..83077c39 100644 --- a/rootly_sdk/models/list_playbooks_include.py +++ b/rootly_sdk/models/list_playbooks_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListPlaybooksInclude = Literal[ "causes", "environments", "functionalities", "groups", "incident_types", "services", "severities" @@ -19,5 +19,5 @@ def check_list_playbooks_include(value: str | None) -> ListPlaybooksInclude | No if value is None: return None if value in LIST_PLAYBOOKS_INCLUDE_VALUES: - return cast(ListPlaybooksInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_PLAYBOOKS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_retrospective_configurations_include.py b/rootly_sdk/models/list_retrospective_configurations_include.py index 0f3da64b..6ee9caab 100644 --- a/rootly_sdk/models/list_retrospective_configurations_include.py +++ b/rootly_sdk/models/list_retrospective_configurations_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListRetrospectiveConfigurationsInclude = Literal["groups", "incident_types", "severities"] @@ -13,5 +13,5 @@ def check_list_retrospective_configurations_include(value: str | None) -> ListRe if value is None: return None if value in LIST_RETROSPECTIVE_CONFIGURATIONS_INCLUDE_VALUES: - return cast(ListRetrospectiveConfigurationsInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_RETROSPECTIVE_CONFIGURATIONS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_retrospective_process_groups_include.py b/rootly_sdk/models/list_retrospective_process_groups_include.py index 50ff7a38..f1175621 100644 --- a/rootly_sdk/models/list_retrospective_process_groups_include.py +++ b/rootly_sdk/models/list_retrospective_process_groups_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListRetrospectiveProcessGroupsInclude = Literal["retrospective_process_group_steps"] @@ -11,5 +11,5 @@ def check_list_retrospective_process_groups_include(value: str | None) -> ListRe if value is None: return None if value in LIST_RETROSPECTIVE_PROCESS_GROUPS_INCLUDE_VALUES: - return cast(ListRetrospectiveProcessGroupsInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_RETROSPECTIVE_PROCESS_GROUPS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_retrospective_process_groups_sort.py b/rootly_sdk/models/list_retrospective_process_groups_sort.py index 809046c9..13bd1b0d 100644 --- a/rootly_sdk/models/list_retrospective_process_groups_sort.py +++ b/rootly_sdk/models/list_retrospective_process_groups_sort.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListRetrospectiveProcessGroupsSort = Literal[ "-created_at", "-position", "-updated_at", "created_at", "position", "updated_at" @@ -18,5 +18,5 @@ def check_list_retrospective_process_groups_sort(value: str | None) -> ListRetro if value is None: return None if value in LIST_RETROSPECTIVE_PROCESS_GROUPS_SORT_VALUES: - return cast(ListRetrospectiveProcessGroupsSort, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_RETROSPECTIVE_PROCESS_GROUPS_SORT_VALUES!r}") diff --git a/rootly_sdk/models/list_retrospective_processes_include.py b/rootly_sdk/models/list_retrospective_processes_include.py index 13aba6c6..838904c1 100644 --- a/rootly_sdk/models/list_retrospective_processes_include.py +++ b/rootly_sdk/models/list_retrospective_processes_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListRetrospectiveProcessesInclude = Literal["groups", "incident_types", "retrospective_steps", "severities"] @@ -14,5 +14,5 @@ def check_list_retrospective_processes_include(value: str | None) -> ListRetrosp if value is None: return None if value in LIST_RETROSPECTIVE_PROCESSES_INCLUDE_VALUES: - return cast(ListRetrospectiveProcessesInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_RETROSPECTIVE_PROCESSES_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_service_catalog_properties_include.py b/rootly_sdk/models/list_service_catalog_properties_include.py index 76347599..c34c0a91 100644 --- a/rootly_sdk/models/list_service_catalog_properties_include.py +++ b/rootly_sdk/models/list_service_catalog_properties_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListServiceCatalogPropertiesInclude = Literal["catalog"] @@ -11,5 +11,5 @@ def check_list_service_catalog_properties_include(value: str | None) -> ListServ if value is None: return None if value in LIST_SERVICE_CATALOG_PROPERTIES_INCLUDE_VALUES: - return cast(ListServiceCatalogPropertiesInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_SERVICE_CATALOG_PROPERTIES_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_service_catalog_properties_sort.py b/rootly_sdk/models/list_service_catalog_properties_sort.py index 95dbf20f..13512e37 100644 --- a/rootly_sdk/models/list_service_catalog_properties_sort.py +++ b/rootly_sdk/models/list_service_catalog_properties_sort.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListServiceCatalogPropertiesSort = Literal[ "-created_at", "-position", "-updated_at", "created_at", "position", "updated_at" @@ -18,5 +18,5 @@ def check_list_service_catalog_properties_sort(value: str | None) -> ListService if value is None: return None if value in LIST_SERVICE_CATALOG_PROPERTIES_SORT_VALUES: - return cast(ListServiceCatalogPropertiesSort, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_SERVICE_CATALOG_PROPERTIES_SORT_VALUES!r}") diff --git a/rootly_sdk/models/list_shifts_include.py b/rootly_sdk/models/list_shifts_include.py index 32f63223..37ff18f9 100644 --- a/rootly_sdk/models/list_shifts_include.py +++ b/rootly_sdk/models/list_shifts_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListShiftsInclude = Literal["assignee", "shift_override", "shift_shadow", "user"] @@ -14,5 +14,5 @@ def check_list_shifts_include(value: str | None) -> ListShiftsInclude | None: if value is None: return None if value in LIST_SHIFTS_INCLUDE_VALUES: - return cast(ListShiftsInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_SHIFTS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_teams_include.py b/rootly_sdk/models/list_teams_include.py index dd467bfa..b79c5d85 100644 --- a/rootly_sdk/models/list_teams_include.py +++ b/rootly_sdk/models/list_teams_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListTeamsInclude = Literal["escalation_policies", "schedules", "users"] @@ -13,5 +13,5 @@ def check_list_teams_include(value: str | None) -> ListTeamsInclude | None: if value is None: return None if value in LIST_TEAMS_INCLUDE_VALUES: - return cast(ListTeamsInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_TEAMS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_users_include.py b/rootly_sdk/models/list_users_include.py index 535458bb..ef942d44 100644 --- a/rootly_sdk/models/list_users_include.py +++ b/rootly_sdk/models/list_users_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListUsersInclude = Literal[ "devices", "email_addresses", "notification_rules", "on_call_role", "phone_numbers", "role", "schedules", "teams" @@ -20,5 +20,5 @@ def check_list_users_include(value: str | None) -> ListUsersInclude | None: if value is None: return None if value in LIST_USERS_INCLUDE_VALUES: - return cast(ListUsersInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_USERS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_users_sort.py b/rootly_sdk/models/list_users_sort.py index 7435b384..b1b50b17 100644 --- a/rootly_sdk/models/list_users_sort.py +++ b/rootly_sdk/models/list_users_sort.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListUsersSort = Literal["-created_at", "-updated_at", "created_at", "updated_at"] @@ -14,5 +14,5 @@ def check_list_users_sort(value: str | None) -> ListUsersSort | None: if value is None: return None if value in LIST_USERS_SORT_VALUES: - return cast(ListUsersSort, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_USERS_SORT_VALUES!r}") diff --git a/rootly_sdk/models/list_workflow_runs_include.py b/rootly_sdk/models/list_workflow_runs_include.py index 2df6e0cb..d061d80e 100644 --- a/rootly_sdk/models/list_workflow_runs_include.py +++ b/rootly_sdk/models/list_workflow_runs_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListWorkflowRunsInclude = Literal["genius_task_runs"] @@ -11,5 +11,5 @@ def check_list_workflow_runs_include(value: str | None) -> ListWorkflowRunsInclu if value is None: return None if value in LIST_WORKFLOW_RUNS_INCLUDE_VALUES: - return cast(ListWorkflowRunsInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_WORKFLOW_RUNS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_workflows_include.py b/rootly_sdk/models/list_workflows_include.py index c3881dc9..96c96869 100644 --- a/rootly_sdk/models/list_workflows_include.py +++ b/rootly_sdk/models/list_workflows_include.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListWorkflowsInclude = Literal[ "alert_field_conditions", "form_field_conditions", "genius_tasks", "genius_workflow_runs" @@ -16,5 +16,5 @@ def check_list_workflows_include(value: str | None) -> ListWorkflowsInclude | No if value is None: return None if value in LIST_WORKFLOWS_INCLUDE_VALUES: - return cast(ListWorkflowsInclude, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_WORKFLOWS_INCLUDE_VALUES!r}") diff --git a/rootly_sdk/models/list_workflows_sort.py b/rootly_sdk/models/list_workflows_sort.py index 842a178e..b08d70dc 100644 --- a/rootly_sdk/models/list_workflows_sort.py +++ b/rootly_sdk/models/list_workflows_sort.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ListWorkflowsSort = Literal["-created_at", "-position", "-updated_at", "created_at", "position", "updated_at"] @@ -16,5 +16,5 @@ def check_list_workflows_sort(value: str | None) -> ListWorkflowsSort | None: if value is None: return None if value in LIST_WORKFLOWS_SORT_VALUES: - return cast(ListWorkflowsSort, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIST_WORKFLOWS_SORT_VALUES!r}") diff --git a/rootly_sdk/models/live_call_router.py b/rootly_sdk/models/live_call_router.py index ba86dbf4..5232b51d 100644 --- a/rootly_sdk/models/live_call_router.py +++ b/rootly_sdk/models/live_call_router.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -28,63 +30,59 @@ 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 (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 + 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 [generate_phone_number](#//api/v1/live_call_routers/generate_phone_number) API and pass that phone number here to register - 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, + 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, prompting them to select from available options to route their call - 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]): + 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): """ name: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -94,17 +92,17 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind enabled = self.enabled - country_code: Unset | str = UNSET + country_code: str | Unset = UNSET if not isinstance(self.country_code, Unset): country_code = self.country_code - phone_type: Unset | str = UNSET + phone_type: str | Unset = UNSET if not isinstance(self.phone_type, Unset): phone_type = self.phone_type @@ -114,13 +112,13 @@ def to_dict(self) -> dict[str, Any]: caller_greeting = self.caller_greeting - unavailable_responder_message: None | Unset | str + unavailable_responder_message: None | str | Unset if isinstance(self.unavailable_responder_message, Unset): unavailable_responder_message = UNSET else: unavailable_responder_message = self.unavailable_responder_message - waiting_music_url: Unset | str = UNSET + waiting_music_url: str | Unset = UNSET if not isinstance(self.waiting_music_url, Unset): waiting_music_url = self.waiting_music_url @@ -136,7 +134,7 @@ def to_dict(self) -> dict[str, Any]: notify_via_push_notification = self.notify_via_push_notification - informational_notification_message: None | Unset | str + informational_notification_message: None | str | Unset if isinstance(self.informational_notification_message, Unset): informational_notification_message = UNSET else: @@ -146,14 +144,14 @@ def to_dict(self) -> dict[str, Any]: calling_tree_prompt = self.calling_tree_prompt - paging_targets: Unset | list[dict[str, Any]] = UNSET + paging_targets: list[dict[str, Any]] | Unset = 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: Unset | dict[str, Any] = UNSET + escalation_policy_trigger_params: dict[str, Any] | Unset = UNSET if not isinstance(self.escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = self.escalation_policy_trigger_params.to_dict() @@ -224,7 +222,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: Unset | LiveCallRouterKind + kind: LiveCallRouterKind | Unset if isinstance(_kind, Unset): kind = UNSET else: @@ -233,14 +231,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: Unset | LiveCallRouterCountryCode + country_code: LiveCallRouterCountryCode | Unset 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: Unset | LiveCallRouterPhoneType + phone_type: LiveCallRouterPhoneType | Unset if isinstance(_phone_type, Unset): phone_type = UNSET else: @@ -252,19 +250,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 | Unset | str: + def _parse_unavailable_responder_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: Unset | LiveCallRouterWaitingMusicUrl + waiting_music_url: LiveCallRouterWaitingMusicUrl | Unset if isinstance(_waiting_music_url, Unset): waiting_music_url = UNSET else: @@ -282,12 +280,12 @@ def _parse_unavailable_responder_message(data: object) -> None | Unset | str: notify_via_push_notification = d.pop("notify_via_push_notification", UNSET) - def _parse_informational_notification_message(data: object) -> None | Unset | str: + def _parse_informational_notification_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) informational_notification_message = _parse_informational_notification_message( d.pop("informational_notification_message", UNSET) @@ -297,15 +295,17 @@ def _parse_informational_notification_message(data: object) -> None | Unset | st calling_tree_prompt = d.pop("calling_tree_prompt", UNSET) - paging_targets = [] _paging_targets = d.pop("paging_targets", UNSET) - for paging_targets_item_data in _paging_targets or []: - paging_targets_item = LiveCallRouterPagingTargetsItem.from_dict(paging_targets_item_data) + 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) - 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: Unset | LiveCallRouterEscalationPolicyTriggerParams + escalation_policy_trigger_params: LiveCallRouterEscalationPolicyTriggerParams | Unset if isinstance(_escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = UNSET else: diff --git a/rootly_sdk/models/live_call_router_country_code.py b/rootly_sdk/models/live_call_router_country_code.py index 3085b226..406f42f2 100644 --- a/rootly_sdk/models/live_call_router_country_code.py +++ b/rootly_sdk/models/live_call_router_country_code.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal LiveCallRouterCountryCode = Literal["AU", "CA", "CH", "DE", "GB", "NL", "NZ", "SE", "US"] @@ -19,5 +19,5 @@ def check_live_call_router_country_code(value: str | None) -> LiveCallRouterCoun if value is None: return None if value in LIVE_CALL_ROUTER_COUNTRY_CODE_VALUES: - return cast(LiveCallRouterCountryCode, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIVE_CALL_ROUTER_COUNTRY_CODE_VALUES!r}") 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 7f74f656..4963b65f 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/live_call_router_escalation_policy_trigger_params_type.py b/rootly_sdk/models/live_call_router_escalation_policy_trigger_params_type.py index bada1658..fdaeb746 100644 --- a/rootly_sdk/models/live_call_router_escalation_policy_trigger_params_type.py +++ b/rootly_sdk/models/live_call_router_escalation_policy_trigger_params_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal LiveCallRouterEscalationPolicyTriggerParamsType = Literal["EscalationPolicy", "Functionality", "Group", "Service"] @@ -16,7 +16,7 @@ def check_live_call_router_escalation_policy_trigger_params_type( if value is None: return None if value in LIVE_CALL_ROUTER_ESCALATION_POLICY_TRIGGER_PARAMS_TYPE_VALUES: - return cast(LiveCallRouterEscalationPolicyTriggerParamsType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {LIVE_CALL_ROUTER_ESCALATION_POLICY_TRIGGER_PARAMS_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/live_call_router_kind.py b/rootly_sdk/models/live_call_router_kind.py index 1df0e1b2..bbab67af 100644 --- a/rootly_sdk/models/live_call_router_kind.py +++ b/rootly_sdk/models/live_call_router_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal LiveCallRouterKind = Literal["live", "voicemail"] @@ -12,5 +12,5 @@ def check_live_call_router_kind(value: str | None) -> LiveCallRouterKind | None: if value is None: return None if value in LIVE_CALL_ROUTER_KIND_VALUES: - return cast(LiveCallRouterKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIVE_CALL_ROUTER_KIND_VALUES!r}") diff --git a/rootly_sdk/models/live_call_router_list.py b/rootly_sdk/models/live_call_router_list.py index 77f66edd..1c0f0759 100644 --- a/rootly_sdk/models/live_call_router_list.py +++ b/rootly_sdk/models/live_call_router_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class LiveCallRouterList: """ Attributes: - data (list['LiveCallRouterListDataItem']): + data (list[LiveCallRouterListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["LiveCallRouterListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[LiveCallRouterListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 cc64df7e..622c19a8 100644 --- a/rootly_sdk/models/live_call_router_list_data_item.py +++ b/rootly_sdk/models/live_call_router_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/live_call_router_list_data_item_type.py b/rootly_sdk/models/live_call_router_list_data_item_type.py index cbe6cb1f..33a82131 100644 --- a/rootly_sdk/models/live_call_router_list_data_item_type.py +++ b/rootly_sdk/models/live_call_router_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal LiveCallRouterListDataItemType = Literal["live_call_routers"] @@ -11,5 +11,5 @@ def check_live_call_router_list_data_item_type(value: str | None) -> LiveCallRou if value is None: return None if value in LIVE_CALL_ROUTER_LIST_DATA_ITEM_TYPE_VALUES: - return cast(LiveCallRouterListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIVE_CALL_ROUTER_LIST_DATA_ITEM_TYPE_VALUES!r}") 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 9fdc04a4..33e6941c 100644 --- a/rootly_sdk/models/live_call_router_paging_targets_item.py +++ b/rootly_sdk/models/live_call_router_paging_targets_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/live_call_router_paging_targets_item_type.py b/rootly_sdk/models/live_call_router_paging_targets_item_type.py index 72403c9d..bb2ff1f6 100644 --- a/rootly_sdk/models/live_call_router_paging_targets_item_type.py +++ b/rootly_sdk/models/live_call_router_paging_targets_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal LiveCallRouterPagingTargetsItemType = Literal["escalation_policy", "functionality", "service", "team"] @@ -14,5 +14,5 @@ def check_live_call_router_paging_targets_item_type(value: str | None) -> LiveCa if value is None: return None if value in LIVE_CALL_ROUTER_PAGING_TARGETS_ITEM_TYPE_VALUES: - return cast(LiveCallRouterPagingTargetsItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIVE_CALL_ROUTER_PAGING_TARGETS_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/live_call_router_phone_type.py b/rootly_sdk/models/live_call_router_phone_type.py index e6060d9c..cf0b0647 100644 --- a/rootly_sdk/models/live_call_router_phone_type.py +++ b/rootly_sdk/models/live_call_router_phone_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal LiveCallRouterPhoneType = Literal["local", "mobile", "toll_free"] @@ -13,5 +13,5 @@ def check_live_call_router_phone_type(value: str | None) -> LiveCallRouterPhoneT if value is None: return None if value in LIVE_CALL_ROUTER_PHONE_TYPE_VALUES: - return cast(LiveCallRouterPhoneType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIVE_CALL_ROUTER_PHONE_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/live_call_router_response.py b/rootly_sdk/models/live_call_router_response.py index 4feab05c..276ceb05 100644 --- a/rootly_sdk/models/live_call_router_response.py +++ b/rootly_sdk/models/live_call_router_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class LiveCallRouterResponse: """ Attributes: data (LiveCallRouterResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "LiveCallRouterResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: LiveCallRouterResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 6f15f45b..3618b0d6 100644 --- a/rootly_sdk/models/live_call_router_response_data.py +++ b/rootly_sdk/models/live_call_router_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/live_call_router_response_data_type.py b/rootly_sdk/models/live_call_router_response_data_type.py index dd772817..5cd41a89 100644 --- a/rootly_sdk/models/live_call_router_response_data_type.py +++ b/rootly_sdk/models/live_call_router_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal LiveCallRouterResponseDataType = Literal["live_call_routers"] @@ -11,5 +11,5 @@ def check_live_call_router_response_data_type(value: str | None) -> LiveCallRout if value is None: return None if value in LIVE_CALL_ROUTER_RESPONSE_DATA_TYPE_VALUES: - return cast(LiveCallRouterResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIVE_CALL_ROUTER_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/live_call_router_waiting_music_url.py b/rootly_sdk/models/live_call_router_waiting_music_url.py index 912aafc8..6eb923ff 100644 --- a/rootly_sdk/models/live_call_router_waiting_music_url.py +++ b/rootly_sdk/models/live_call_router_waiting_music_url.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal LiveCallRouterWaitingMusicUrl = Literal[ "https://storage.rootly.com/twilio/voicemail/BusyStrings.mp3", @@ -25,5 +25,5 @@ def check_live_call_router_waiting_music_url(value: str | None) -> LiveCallRoute if value is None: return None if value in LIVE_CALL_ROUTER_WAITING_MUSIC_URL_VALUES: - return cast(LiveCallRouterWaitingMusicUrl, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {LIVE_CALL_ROUTER_WAITING_MUSIC_URL_VALUES!r}") diff --git a/rootly_sdk/models/meeting_recording.py b/rootly_sdk/models/meeting_recording.py index e32e79c8..ece675ea 100644 --- a/rootly_sdk/models/meeting_recording.py +++ b/rootly_sdk/models/meeting_recording.py @@ -1,10 +1,11 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field -from dateutil.parser import isoparse from ..models.meeting_recording_platform import MeetingRecordingPlatform, check_meeting_recording_platform from ..models.meeting_recording_status import MeetingRecordingStatus, check_meeting_recording_status @@ -23,17 +24,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 (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) + 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) """ platform: MeetingRecordingPlatform @@ -41,16 +42,16 @@ class MeetingRecording: status: MeetingRecordingStatus created_at: datetime.datetime updated_at: datetime.datetime - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -64,7 +65,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at.isoformat() - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -72,7 +73,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | Unset | str + ended_at: None | str | Unset if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -80,7 +81,7 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - duration_minutes: None | Unset | float + duration_minutes: float | None | Unset if isinstance(self.duration_minutes, Unset): duration_minutes = UNSET else: @@ -90,31 +91,31 @@ def to_dict(self) -> dict[str, Any]: word_count = self.word_count - transcript_summary: None | Unset | str + transcript_summary: None | str | Unset if isinstance(self.transcript_summary, Unset): transcript_summary = UNSET else: transcript_summary = self.transcript_summary - title: None | Unset | str + title: None | str | Unset if isinstance(self.title, Unset): title = UNSET else: title = self.title - meeting_url: None | Unset | str + meeting_url: None | str | Unset if isinstance(self.meeting_url, Unset): meeting_url = UNSET else: meeting_url = self.meeting_url - video_url: None | Unset | str + video_url: None | str | Unset if isinstance(self.video_url, Unset): video_url = UNSET else: video_url = self.video_url - created_by: None | Unset | str + created_by: None | str | Unset if isinstance(self.created_by, Unset): created_by = UNSET else: @@ -163,11 +164,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_meeting_recording_status(d.pop("status")) - created_at = isoparse(d.pop("created_at")) + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) - updated_at = isoparse(d.pop("updated_at")) + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) - def _parse_started_at(data: object) -> None | Unset | datetime.datetime: + def _parse_started_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -175,16 +176,16 @@ def _parse_started_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - started_at_type_0 = isoparse(data) + started_at_type_0 = datetime.datetime.fromisoformat(data) return started_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: + def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -192,21 +193,21 @@ def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - ended_at_type_0 = isoparse(data) + ended_at_type_0 = datetime.datetime.fromisoformat(data) return ended_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_duration_minutes(data: object) -> None | Unset | float: + def _parse_duration_minutes(data: object) -> float | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | float, data) + return cast(float | None | Unset, data) duration_minutes = _parse_duration_minutes(d.pop("duration_minutes", UNSET)) @@ -214,48 +215,48 @@ def _parse_duration_minutes(data: object) -> None | Unset | float: word_count = d.pop("word_count", UNSET) - def _parse_transcript_summary(data: object) -> None | Unset | str: + def _parse_transcript_summary(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) transcript_summary = _parse_transcript_summary(d.pop("transcript_summary", UNSET)) - def _parse_title(data: object) -> None | Unset | str: + def _parse_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_meeting_url(data: object) -> None | Unset | str: + def _parse_meeting_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) meeting_url = _parse_meeting_url(d.pop("meeting_url", UNSET)) - def _parse_video_url(data: object) -> None | Unset | str: + def _parse_video_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) video_url = _parse_video_url(d.pop("video_url", UNSET)) - def _parse_created_by(data: object) -> None | Unset | str: + def _parse_created_by(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 7be0306d..a0bd1e48 100644 --- a/rootly_sdk/models/meeting_recording_detail.py +++ b/rootly_sdk/models/meeting_recording_detail.py @@ -1,10 +1,11 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field -from dateutil.parser import isoparse from ..models.meeting_recording_platform import MeetingRecordingPlatform, check_meeting_recording_platform from ..models.meeting_recording_status import MeetingRecordingStatus, check_meeting_recording_status @@ -28,22 +29,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 (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) + 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) """ platform: MeetingRecordingPlatform @@ -51,20 +52,20 @@ class MeetingRecordingDetail: status: MeetingRecordingStatus created_at: datetime.datetime updated_at: datetime.datetime - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -78,7 +79,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at.isoformat() - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -86,7 +87,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | Unset | str + ended_at: None | str | Unset if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -94,7 +95,7 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - duration_minutes: None | Unset | float + duration_minutes: float | None | Unset if isinstance(self.duration_minutes, Unset): duration_minutes = UNSET else: @@ -104,37 +105,37 @@ def to_dict(self) -> dict[str, Any]: word_count = self.word_count - transcript_summary: None | Unset | str + transcript_summary: None | str | Unset if isinstance(self.transcript_summary, Unset): transcript_summary = UNSET else: transcript_summary = self.transcript_summary - title: None | Unset | str + title: None | str | Unset if isinstance(self.title, Unset): title = UNSET else: title = self.title - meeting_url: None | Unset | str + meeting_url: None | str | Unset if isinstance(self.meeting_url, Unset): meeting_url = UNSET else: meeting_url = self.meeting_url - video_url: None | Unset | str + video_url: None | str | Unset if isinstance(self.video_url, Unset): video_url = UNSET else: video_url = self.video_url - created_by: None | Unset | str + created_by: None | str | Unset if isinstance(self.created_by, Unset): created_by = UNSET else: created_by = self.created_by - transcript: Unset | dict[str, Any] | list[dict[str, Any]] + transcript: dict[str, Any] | list[dict[str, Any]] | Unset if isinstance(self.transcript, Unset): transcript = UNSET elif isinstance(self.transcript, list): @@ -146,19 +147,19 @@ def to_dict(self) -> dict[str, Any]: else: transcript = self.transcript.to_dict() - recall_upload_id: None | Unset | str + recall_upload_id: None | str | Unset if isinstance(self.recall_upload_id, Unset): recall_upload_id = UNSET else: recall_upload_id = self.recall_upload_id - recordable_id: None | Unset | str + recordable_id: None | str | Unset if isinstance(self.recordable_id, Unset): recordable_id = UNSET else: recordable_id = self.recordable_id - recordable_type: None | Unset | str + recordable_type: None | str | Unset if isinstance(self.recordable_type, Unset): recordable_type = UNSET else: @@ -218,11 +219,11 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_meeting_recording_status(d.pop("status")) - created_at = isoparse(d.pop("created_at")) + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) - updated_at = isoparse(d.pop("updated_at")) + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) - def _parse_started_at(data: object) -> None | Unset | datetime.datetime: + def _parse_started_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -230,16 +231,16 @@ def _parse_started_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - started_at_type_0 = isoparse(data) + started_at_type_0 = datetime.datetime.fromisoformat(data) return started_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: + def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -247,21 +248,21 @@ def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - ended_at_type_0 = isoparse(data) + ended_at_type_0 = datetime.datetime.fromisoformat(data) return ended_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_duration_minutes(data: object) -> None | Unset | float: + def _parse_duration_minutes(data: object) -> float | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | float, data) + return cast(float | None | Unset, data) duration_minutes = _parse_duration_minutes(d.pop("duration_minutes", UNSET)) @@ -269,54 +270,54 @@ def _parse_duration_minutes(data: object) -> None | Unset | float: word_count = d.pop("word_count", UNSET) - def _parse_transcript_summary(data: object) -> None | Unset | str: + def _parse_transcript_summary(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) transcript_summary = _parse_transcript_summary(d.pop("transcript_summary", UNSET)) - def _parse_title(data: object) -> None | Unset | str: + def _parse_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_meeting_url(data: object) -> None | Unset | str: + def _parse_meeting_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) meeting_url = _parse_meeting_url(d.pop("meeting_url", UNSET)) - def _parse_video_url(data: object) -> None | Unset | str: + def _parse_video_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) video_url = _parse_video_url(d.pop("video_url", UNSET)) - def _parse_created_by(data: object) -> None | Unset | str: + def _parse_created_by(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) created_by = _parse_created_by(d.pop("created_by", UNSET)) def _parse_transcript( data: object, - ) -> Union["MeetingRecordingDetailTranscriptType1", Unset, list["MeetingRecordingTranscriptSegment"]]: + ) -> list[MeetingRecordingTranscriptSegment] | MeetingRecordingDetailTranscriptType1 | Unset: if isinstance(data, Unset): return data try: @@ -330,7 +331,7 @@ def _parse_transcript( transcript_type_0.append(transcript_type_0_item) return transcript_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -340,30 +341,30 @@ def _parse_transcript( transcript = _parse_transcript(d.pop("transcript", UNSET)) - def _parse_recall_upload_id(data: object) -> None | Unset | str: + def _parse_recall_upload_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) recall_upload_id = _parse_recall_upload_id(d.pop("recall_upload_id", UNSET)) - def _parse_recordable_id(data: object) -> None | Unset | str: + def _parse_recordable_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) recordable_id = _parse_recordable_id(d.pop("recordable_id", UNSET)) - def _parse_recordable_type(data: object) -> None | Unset | str: + def _parse_recordable_type(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 8a11371b..f82deaeb 100644 --- a/rootly_sdk/models/meeting_recording_detail_response.py +++ b/rootly_sdk/models/meeting_recording_detail_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,7 +20,7 @@ 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]: diff --git a/rootly_sdk/models/meeting_recording_detail_response_data.py b/rootly_sdk/models/meeting_recording_detail_response_data.py index 6b46c0ed..1646d0f3 100644 --- a/rootly_sdk/models/meeting_recording_detail_response_data.py +++ b/rootly_sdk/models/meeting_recording_detail_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/meeting_recording_detail_response_data_type.py b/rootly_sdk/models/meeting_recording_detail_response_data_type.py index ba51d718..f3e3e921 100644 --- a/rootly_sdk/models/meeting_recording_detail_response_data_type.py +++ b/rootly_sdk/models/meeting_recording_detail_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal MeetingRecordingDetailResponseDataType = Literal["meeting_recordings"] @@ -13,7 +13,7 @@ def check_meeting_recording_detail_response_data_type( if value is None: return None if value in MEETING_RECORDING_DETAIL_RESPONSE_DATA_TYPE_VALUES: - return cast(MeetingRecordingDetailResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {MEETING_RECORDING_DETAIL_RESPONSE_DATA_TYPE_VALUES!r}" ) 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 b2cff2e2..6faa6679 100644 --- a/rootly_sdk/models/meeting_recording_detail_transcript_type_1.py +++ b/rootly_sdk/models/meeting_recording_detail_transcript_type_1.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 d4a6ce0a..0590db47 100644 --- a/rootly_sdk/models/meeting_recording_list.py +++ b/rootly_sdk/models/meeting_recording_list.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,12 +20,12 @@ class MeetingRecordingList: """ Attributes: - data (list['MeetingRecordingListDataItem']): - meta (Union[Unset, Meta]): + data (list[MeetingRecordingListDataItem]): + meta (Meta | Unset): """ - data: list["MeetingRecordingListDataItem"] - meta: Union[Unset, "Meta"] = UNSET + data: list[MeetingRecordingListDataItem] + meta: Meta | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: Unset | dict[str, Any] = UNSET + meta: dict[str, Any] | Unset = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() @@ -62,7 +64,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _meta = d.pop("meta", UNSET) - meta: Unset | Meta + meta: Meta | Unset 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 397d1c86..7b57bf19 100644 --- a/rootly_sdk/models/meeting_recording_list_data_item.py +++ b/rootly_sdk/models/meeting_recording_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/meeting_recording_list_data_item_type.py b/rootly_sdk/models/meeting_recording_list_data_item_type.py index 2e05597a..5dcb07cc 100644 --- a/rootly_sdk/models/meeting_recording_list_data_item_type.py +++ b/rootly_sdk/models/meeting_recording_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal MeetingRecordingListDataItemType = Literal["meeting_recordings"] @@ -11,5 +11,5 @@ def check_meeting_recording_list_data_item_type(value: str | None) -> MeetingRec if value is None: return None if value in MEETING_RECORDING_LIST_DATA_ITEM_TYPE_VALUES: - return cast(MeetingRecordingListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {MEETING_RECORDING_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/meeting_recording_platform.py b/rootly_sdk/models/meeting_recording_platform.py index 14d4efbc..fdb0eb53 100644 --- a/rootly_sdk/models/meeting_recording_platform.py +++ b/rootly_sdk/models/meeting_recording_platform.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal MeetingRecordingPlatform = Literal["google_meet", "microsoft_teams", "webex", "zoom"] @@ -14,5 +14,5 @@ def check_meeting_recording_platform(value: str | None) -> MeetingRecordingPlatf if value is None: return None if value in MEETING_RECORDING_PLATFORM_VALUES: - return cast(MeetingRecordingPlatform, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {MEETING_RECORDING_PLATFORM_VALUES!r}") diff --git a/rootly_sdk/models/meeting_recording_response.py b/rootly_sdk/models/meeting_recording_response.py index 89bdf8f6..d565ffc6 100644 --- a/rootly_sdk/models/meeting_recording_response.py +++ b/rootly_sdk/models/meeting_recording_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,7 +20,7 @@ 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]: diff --git a/rootly_sdk/models/meeting_recording_response_data.py b/rootly_sdk/models/meeting_recording_response_data.py index 85ba6a2b..768bbd7b 100644 --- a/rootly_sdk/models/meeting_recording_response_data.py +++ b/rootly_sdk/models/meeting_recording_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/meeting_recording_response_data_type.py b/rootly_sdk/models/meeting_recording_response_data_type.py index 934de58e..095ef779 100644 --- a/rootly_sdk/models/meeting_recording_response_data_type.py +++ b/rootly_sdk/models/meeting_recording_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal MeetingRecordingResponseDataType = Literal["meeting_recordings"] @@ -11,5 +11,5 @@ def check_meeting_recording_response_data_type(value: str | None) -> MeetingReco if value is None: return None if value in MEETING_RECORDING_RESPONSE_DATA_TYPE_VALUES: - return cast(MeetingRecordingResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {MEETING_RECORDING_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/meeting_recording_status.py b/rootly_sdk/models/meeting_recording_status.py index 638ecdfb..7b5f0a01 100644 --- a/rootly_sdk/models/meeting_recording_status.py +++ b/rootly_sdk/models/meeting_recording_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal MeetingRecordingStatus = Literal["analyzing", "call_ended", "completed", "failed", "paused", "pending", "recording"] @@ -17,5 +17,5 @@ def check_meeting_recording_status(value: str | None) -> MeetingRecordingStatus if value is None: return None if value in MEETING_RECORDING_STATUS_VALUES: - return cast(MeetingRecordingStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {MEETING_RECORDING_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/meeting_recording_transcript_segment.py b/rootly_sdk/models/meeting_recording_transcript_segment.py index 4d968cb3..0a265526 100644 --- a/rootly_sdk/models/meeting_recording_transcript_segment.py +++ b/rootly_sdk/models/meeting_recording_transcript_segment.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -16,11 +18,11 @@ class 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]: diff --git a/rootly_sdk/models/meeting_recording_transcript_word.py b/rootly_sdk/models/meeting_recording_transcript_word.py index 114bcf09..83d7b63f 100644 --- a/rootly_sdk/models/meeting_recording_transcript_word.py +++ b/rootly_sdk/models/meeting_recording_transcript_word.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,13 +16,13 @@ class MeetingRecordingTranscriptWord: """ Attributes: text (str): Transcribed word - start_timestamp (Union[Unset, float]): Start time in seconds from recording start - end_timestamp (Union[Unset, float]): End time in seconds from recording start + start_timestamp (float | Unset): Start time in seconds from recording start + end_timestamp (float | Unset): End time in seconds from recording start """ text: str - start_timestamp: Unset | float = UNSET - end_timestamp: Unset | float = UNSET + start_timestamp: float | Unset = UNSET + end_timestamp: float | Unset = UNSET 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 66e5874d..5612bb1e 100644 --- a/rootly_sdk/models/meta.py +++ b/rootly_sdk/models/meta.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,37 +15,37 @@ class Meta: """ Attributes: - current_page (Union[None, int]): - next_page (Union[None, int]): - prev_page (Union[None, int]): + current_page (int | None): + next_page (int | None): + prev_page (int | None): total_count (int): total_pages (int): - next_cursor (Union[None, Unset, str]): + next_cursor (None | str | Unset): """ - current_page: None | int - next_page: None | int - prev_page: None | int + current_page: int | None + next_page: int | None + prev_page: int | None total_count: int total_pages: int - next_cursor: None | Unset | str = UNSET + next_cursor: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - current_page: None | int + current_page: int | None current_page = self.current_page - next_page: None | int + next_page: int | None next_page = self.next_page - prev_page: None | int + prev_page: int | None prev_page = self.prev_page total_count = self.total_count total_pages = self.total_pages - next_cursor: None | Unset | str + next_cursor: None | str | Unset if isinstance(self.next_cursor, Unset): next_cursor = UNSET else: @@ -69,24 +71,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) -> None | int: + def _parse_current_page(data: object) -> int | None: if data is None: return data - return cast(None | int, data) + return cast(int | None, data) current_page = _parse_current_page(d.pop("current_page")) - def _parse_next_page(data: object) -> None | int: + def _parse_next_page(data: object) -> int | None: if data is None: return data - return cast(None | int, data) + return cast(int | None, data) next_page = _parse_next_page(d.pop("next_page")) - def _parse_prev_page(data: object) -> None | int: + def _parse_prev_page(data: object) -> int | None: if data is None: return data - return cast(None | int, data) + return cast(int | None, data) prev_page = _parse_prev_page(d.pop("prev_page")) @@ -94,12 +96,12 @@ def _parse_prev_page(data: object) -> None | int: total_pages = d.pop("total_pages") - def _parse_next_cursor(data: object) -> None | Unset | str: + def _parse_next_cursor(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 618e5265..91392e0a 100644 --- a/rootly_sdk/models/mitigate_incident.py +++ b/rootly_sdk/models/mitigate_incident.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.mitigate_incident_data import MitigateIncidentData @@ -18,14 +19,13 @@ class MitigateIncident: data (MitigateIncidentData): """ - data: "MitigateIncidentData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: MitigateIncidentData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - mitigate_incident.additional_properties = d return mitigate_incident - - @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/mitigate_incident_data.py b/rootly_sdk/models/mitigate_incident_data.py index 2ba8ea98..d9912ed5 100644 --- a/rootly_sdk/models/mitigate_incident_data.py +++ b/rootly_sdk/models/mitigate_incident_data.py @@ -1,10 +1,12 @@ +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.mitigate_incident_data_type import MitigateIncidentDataType, check_mitigate_incident_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.mitigate_incident_data_attributes import MitigateIncidentDataAttributes @@ -19,25 +21,31 @@ class MitigateIncidentData: Attributes: type_ (MitigateIncidentDataType): attributes (MitigateIncidentDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: MitigateIncidentDataType - attributes: "MitigateIncidentDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: MitigateIncidentDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = MitigateIncidentDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + mitigate_incident_data = cls( type_=type_, attributes=attributes, + id=id, ) - mitigate_incident_data.additional_properties = d return mitigate_incident_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/mitigate_incident_data_attributes.py b/rootly_sdk/models/mitigate_incident_data_attributes.py index d18c92cc..58606b79 100644 --- a/rootly_sdk/models/mitigate_incident_data_attributes.py +++ b/rootly_sdk/models/mitigate_incident_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,13 +14,13 @@ class MitigateIncidentDataAttributes: """ Attributes: - mitigation_message (Union[None, Unset, str]): How was the incident mitigated? + mitigation_message (None | str | Unset): How was the incident mitigated? """ - mitigation_message: None | Unset | str = UNSET + mitigation_message: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: - mitigation_message: None | Unset | str + mitigation_message: None | str | Unset if isinstance(self.mitigation_message, Unset): mitigation_message = UNSET else: @@ -36,12 +38,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 | Unset | str: + def _parse_mitigation_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) mitigation_message = _parse_mitigation_message(d.pop("mitigation_message", UNSET)) diff --git a/rootly_sdk/models/mitigate_incident_data_type.py b/rootly_sdk/models/mitigate_incident_data_type.py index a7f00d47..b1e764a9 100644 --- a/rootly_sdk/models/mitigate_incident_data_type.py +++ b/rootly_sdk/models/mitigate_incident_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal MitigateIncidentDataType = Literal["incidents"] @@ -11,5 +11,5 @@ def check_mitigate_incident_data_type(value: str | None) -> MitigateIncidentData if value is None: return None if value in MITIGATE_INCIDENT_DATA_TYPE_VALUES: - return cast(MitigateIncidentDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {MITIGATE_INCIDENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_alert.py b/rootly_sdk/models/new_alert.py index 234e2282..8e3940ea 100644 --- a/rootly_sdk/models/new_alert.py +++ b/rootly_sdk/models/new_alert.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_alert_data import NewAlertData @@ -18,14 +19,13 @@ class NewAlert: data (NewAlertData): """ - data: "NewAlertData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewAlertData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_alert.additional_properties = d return new_alert - - @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_data.py b/rootly_sdk/models/new_alert_data.py index 1c0d27b1..3527a615 100644 --- a/rootly_sdk/models/new_alert_data.py +++ b/rootly_sdk/models/new_alert_data.py @@ -1,8 +1,9 @@ +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_alert_data_type import NewAlertDataType, check_new_alert_data_type @@ -22,8 +23,7 @@ class NewAlertData: """ type_: NewAlertDataType - attributes: "NewAlertDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewAlertDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_alert_data.additional_properties = d return new_alert_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_data_attributes.py b/rootly_sdk/models/new_alert_data_attributes.py index 7082ee65..99f2e8b1 100644 --- a/rootly_sdk/models/new_alert_data_attributes.py +++ b/rootly_sdk/models/new_alert_data_attributes.py @@ -1,9 +1,10 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define -from dateutil.parser import isoparse from ..models.new_alert_data_attributes_noise import NewAlertDataAttributesNoise, check_new_alert_data_attributes_noise from ..models.new_alert_data_attributes_notification_target_type import ( @@ -17,6 +18,12 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.new_alert_data_attributes_actor_type_0 import NewAlertDataAttributesActorType0 + from ..models.new_alert_data_attributes_actor_type_1 import NewAlertDataAttributesActorType1 + from ..models.new_alert_data_attributes_actor_type_2_type_0 import NewAlertDataAttributesActorType2Type0 + from ..models.new_alert_data_attributes_actor_type_2_type_1 import NewAlertDataAttributesActorType2Type1 + from ..models.new_alert_data_attributes_actor_type_3_type_0 import NewAlertDataAttributesActorType3Type0 + from ..models.new_alert_data_attributes_actor_type_3_type_1 import NewAlertDataAttributesActorType3Type1 from ..models.new_alert_data_attributes_alert_field_values_attributes_item_type_0 import ( NewAlertDataAttributesAlertFieldValuesAttributesItemType0, ) @@ -35,68 +42,87 @@ class NewAlertDataAttributes: """ Attributes: summary (str): The summary of the alert - 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 + actor (NewAlertDataAttributesActorType0 | NewAlertDataAttributesActorType1 | + NewAlertDataAttributesActorType2Type0 | NewAlertDataAttributesActorType2Type1 | + NewAlertDataAttributesActorType3Type0 | NewAlertDataAttributesActorType3Type1 | Unset): The user to record as + performing this action. Only available when actor attribution is enabled for the organization; otherwise it is + ignored. Only supported with Global and Team API keys; with a Team API key the user must belong to one of the + key's teams. When omitted or null, the action is attributed to the API key. Otherwise provide either `email` or + `user_id`, not both. + 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 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 (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 + 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 `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 (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 + 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 """ summary: str - 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]] + actor: ( + NewAlertDataAttributesActorType0 + | NewAlertDataAttributesActorType1 + | NewAlertDataAttributesActorType2Type0 + | NewAlertDataAttributesActorType2Type1 + | NewAlertDataAttributesActorType3Type0 + | NewAlertDataAttributesActorType3Type1 + | Unset ) = UNSET + 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 + ) def to_dict(self) -> dict[str, Any]: + from ..models.new_alert_data_attributes_actor_type_0 import NewAlertDataAttributesActorType0 + from ..models.new_alert_data_attributes_actor_type_1 import NewAlertDataAttributesActorType1 + from ..models.new_alert_data_attributes_actor_type_2_type_0 import NewAlertDataAttributesActorType2Type0 + from ..models.new_alert_data_attributes_actor_type_2_type_1 import NewAlertDataAttributesActorType2Type1 + from ..models.new_alert_data_attributes_actor_type_3_type_0 import NewAlertDataAttributesActorType3Type0 from ..models.new_alert_data_attributes_alert_field_values_attributes_item_type_0 import ( NewAlertDataAttributesAlertFieldValuesAttributesItemType0, ) @@ -105,23 +131,39 @@ def to_dict(self) -> dict[str, Any]: summary = self.summary - noise: Unset | str = UNSET + actor: dict[str, Any] | Unset + if isinstance(self.actor, Unset): + actor = UNSET + elif isinstance(self.actor, NewAlertDataAttributesActorType0): + actor = self.actor.to_dict() + elif isinstance(self.actor, NewAlertDataAttributesActorType1): + actor = self.actor.to_dict() + elif isinstance(self.actor, NewAlertDataAttributesActorType2Type0): + actor = self.actor.to_dict() + elif isinstance(self.actor, NewAlertDataAttributesActorType2Type1): + actor = self.actor.to_dict() + elif isinstance(self.actor, NewAlertDataAttributesActorType3Type0): + actor = self.actor.to_dict() + else: + actor = self.actor.to_dict() + + noise: str | Unset = UNSET if not isinstance(self.noise, Unset): noise = self.noise source = self.source - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -130,7 +172,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - group_ids: None | Unset | list[str] + group_ids: list[str] | None | Unset if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -139,7 +181,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - functionality_ids: None | Unset | list[str] + functionality_ids: list[str] | None | Unset if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -148,7 +190,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - environment_ids: None | Unset | list[str] + environment_ids: list[str] | None | Unset if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -157,7 +199,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -165,7 +207,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | Unset | str + ended_at: None | str | Unset if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -173,35 +215,35 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - external_url: None | Unset | str + external_url: None | str | Unset if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - alert_urgency_id: None | Unset | str + alert_urgency_id: None | str | Unset if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - notification_target_type: Unset | str = UNSET + notification_target_type: str | Unset = UNSET if not isinstance(self.notification_target_type, Unset): notification_target_type = self.notification_target_type - notification_target_id: None | Unset | str + notification_target_id: None | str | Unset if isinstance(self.notification_target_id, Unset): notification_target_id = UNSET else: notification_target_id = self.notification_target_id - notification_targets: None | Unset | list[dict[str, Any]] + notification_targets: list[dict[str, Any]] | None | Unset if isinstance(self.notification_targets, Unset): notification_targets = UNSET elif isinstance(self.notification_targets, list): @@ -213,18 +255,18 @@ def to_dict(self) -> dict[str, Any]: else: notification_targets = self.notification_targets - labels: Unset | list[None | dict[str, Any]] = UNSET + labels: list[dict[str, Any] | None] | Unset = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: None | dict[str, Any] + labels_item: dict[str, Any] | None if isinstance(labels_item_data, NewAlertDataAttributesLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - data: None | Unset | dict[str, Any] + data: dict[str, Any] | None | Unset if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, NewAlertDataAttributesDataType0): @@ -232,17 +274,17 @@ def to_dict(self) -> dict[str, Any]: else: data = self.data - deduplication_key: None | Unset | str + deduplication_key: None | str | Unset if isinstance(self.deduplication_key, Unset): deduplication_key = UNSET else: deduplication_key = self.deduplication_key - alert_field_values_attributes: Unset | list[None | dict[str, Any]] = UNSET + alert_field_values_attributes: list[dict[str, Any] | None] | Unset = 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: None | dict[str, Any] + alert_field_values_attributes_item: dict[str, Any] | None if isinstance( alert_field_values_attributes_item_data, NewAlertDataAttributesAlertFieldValuesAttributesItemType0 ): @@ -258,6 +300,8 @@ def to_dict(self) -> dict[str, Any]: "summary": summary, } ) + if actor is not UNSET: + field_dict["actor"] = actor if noise is not UNSET: field_dict["noise"] = noise if source is not UNSET: @@ -303,6 +347,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_alert_data_attributes_actor_type_0 import NewAlertDataAttributesActorType0 + from ..models.new_alert_data_attributes_actor_type_1 import NewAlertDataAttributesActorType1 + from ..models.new_alert_data_attributes_actor_type_2_type_0 import NewAlertDataAttributesActorType2Type0 + from ..models.new_alert_data_attributes_actor_type_2_type_1 import NewAlertDataAttributesActorType2Type1 + from ..models.new_alert_data_attributes_actor_type_3_type_0 import NewAlertDataAttributesActorType3Type0 + from ..models.new_alert_data_attributes_actor_type_3_type_1 import NewAlertDataAttributesActorType3Type1 from ..models.new_alert_data_attributes_alert_field_values_attributes_item_type_0 import ( NewAlertDataAttributesAlertFieldValuesAttributesItemType0, ) @@ -315,8 +365,69 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) summary = d.pop("summary") + def _parse_actor( + data: object, + ) -> ( + NewAlertDataAttributesActorType0 + | NewAlertDataAttributesActorType1 + | NewAlertDataAttributesActorType2Type0 + | NewAlertDataAttributesActorType2Type1 + | NewAlertDataAttributesActorType3Type0 + | NewAlertDataAttributesActorType3Type1 + | Unset + ): + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_0 = NewAlertDataAttributesActorType0.from_dict(data) + + return actor_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_1 = NewAlertDataAttributesActorType1.from_dict(data) + + return actor_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_2_type_0 = NewAlertDataAttributesActorType2Type0.from_dict(data) + + return actor_type_2_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_2_type_1 = NewAlertDataAttributesActorType2Type1.from_dict(data) + + return actor_type_2_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_3_type_0 = NewAlertDataAttributesActorType3Type0.from_dict(data) + + return actor_type_3_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + actor_type_3_type_1 = NewAlertDataAttributesActorType3Type1.from_dict(data) + + return actor_type_3_type_1 + + actor = _parse_actor(d.pop("actor", UNSET)) + _noise = d.pop("noise", UNSET) - noise: Unset | NewAlertDataAttributesNoise + noise: NewAlertDataAttributesNoise | Unset if isinstance(_noise, Unset): noise = UNSET else: @@ -325,22 +436,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: source = d.pop("source", UNSET) _status = d.pop("status", UNSET) - status: Unset | NewAlertDataAttributesStatus + status: NewAlertDataAttributesStatus | Unset if isinstance(_status, Unset): status = UNSET else: status = check_new_alert_data_attributes_status(_status) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -351,13 +462,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_group_ids(data: object) -> None | Unset | list[str]: + def _parse_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -368,13 +479,13 @@ def _parse_group_ids(data: object) -> None | Unset | list[str]: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_functionality_ids(data: object) -> None | Unset | list[str]: + def _parse_functionality_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -385,13 +496,13 @@ def _parse_functionality_ids(data: object) -> None | Unset | list[str]: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_environment_ids(data: object) -> None | Unset | list[str]: + def _parse_environment_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -402,13 +513,13 @@ def _parse_environment_ids(data: object) -> None | Unset | list[str]: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_started_at(data: object) -> None | Unset | datetime.datetime: + def _parse_started_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -416,16 +527,16 @@ def _parse_started_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - started_at_type_0 = isoparse(data) + started_at_type_0 = datetime.datetime.fromisoformat(data) return started_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: + def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -433,44 +544,44 @@ def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - ended_at_type_0 = isoparse(data) + ended_at_type_0 = datetime.datetime.fromisoformat(data) return ended_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_external_url(data: object) -> None | Unset | str: + def _parse_external_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | Unset | str: + def _parse_alert_urgency_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: Unset | NewAlertDataAttributesNotificationTargetType + notification_target_type: NewAlertDataAttributesNotificationTargetType | Unset if isinstance(_notification_target_type, Unset): notification_target_type = UNSET else: @@ -478,18 +589,18 @@ def _parse_alert_urgency_id(data: object) -> None | Unset | str: _notification_target_type ) - def _parse_notification_target_id(data: object) -> None | Unset | str: + def _parse_notification_target_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) notification_target_id = _parse_notification_target_id(d.pop("notification_target_id", UNSET)) def _parse_notification_targets( data: object, - ) -> None | Unset | list["NewAlertDataAttributesNotificationTargetsType0Item"]: + ) -> list[NewAlertDataAttributesNotificationTargetsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -507,34 +618,36 @@ def _parse_notification_targets( notification_targets_type_0.append(notification_targets_type_0_item) return notification_targets_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["NewAlertDataAttributesNotificationTargetsType0Item"], data) + return cast(list[NewAlertDataAttributesNotificationTargetsType0Item] | None | Unset, data) notification_targets = _parse_notification_targets(d.pop("notification_targets", UNSET)) - labels = [] _labels = d.pop("labels", UNSET) - for labels_item_data in _labels or []: + labels: list[NewAlertDataAttributesLabelsItemType0 | None] | Unset = UNSET + if _labels is not UNSET: + labels = [] + for labels_item_data in _labels: - 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) + 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) - return labels_item_type_0 - except: # noqa: E722 - pass - return cast(Union["NewAlertDataAttributesLabelsItemType0", None], data) + return labels_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(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) -> Union["NewAlertDataAttributesDataType0", None, Unset]: + def _parse_data(data: object) -> NewAlertDataAttributesDataType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -545,50 +658,55 @@ def _parse_data(data: object) -> Union["NewAlertDataAttributesDataType0", None, data_type_0 = NewAlertDataAttributesDataType0.from_dict(data) return data_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["NewAlertDataAttributesDataType0", None, Unset], data) + return cast(NewAlertDataAttributesDataType0 | None | Unset, data) data = _parse_data(d.pop("data", UNSET)) - def _parse_deduplication_key(data: object) -> None | Unset | str: + def _parse_deduplication_key(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) - 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) - ) - - 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: ( + 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 + ) - alert_field_values_attributes.append(alert_field_values_attributes_item) + alert_field_values_attributes.append(alert_field_values_attributes_item) new_alert_data_attributes = cls( summary=summary, + actor=actor, noise=noise, source=source, status=status, diff --git a/rootly_sdk/models/new_alert_data_attributes_actor_type_0.py b/rootly_sdk/models/new_alert_data_attributes_actor_type_0.py new file mode 100644 index 00000000..51139c1b --- /dev/null +++ b/rootly_sdk/models/new_alert_data_attributes_actor_type_0.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="NewAlertDataAttributesActorType0") + + +@_attrs_define +class NewAlertDataAttributesActorType0: + """ + Attributes: + email (str): Email of the user, including verified secondary emails. + """ + + email: str + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + new_alert_data_attributes_actor_type_0 = cls( + email=email, + ) + + return new_alert_data_attributes_actor_type_0 diff --git a/rootly_sdk/models/new_alert_data_attributes_actor_type_1.py b/rootly_sdk/models/new_alert_data_attributes_actor_type_1.py new file mode 100644 index 00000000..c12b5fd4 --- /dev/null +++ b/rootly_sdk/models/new_alert_data_attributes_actor_type_1.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="NewAlertDataAttributesActorType1") + + +@_attrs_define +class NewAlertDataAttributesActorType1: + """ + Attributes: + user_id (str): Rootly ID of the user. + """ + + user_id: str + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user_id": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("user_id") + + new_alert_data_attributes_actor_type_1 = cls( + user_id=user_id, + ) + + return new_alert_data_attributes_actor_type_1 diff --git a/rootly_sdk/models/new_alert_data_attributes_actor_type_2_type_0.py b/rootly_sdk/models/new_alert_data_attributes_actor_type_2_type_0.py new file mode 100644 index 00000000..eb59808d --- /dev/null +++ b/rootly_sdk/models/new_alert_data_attributes_actor_type_2_type_0.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="NewAlertDataAttributesActorType2Type0") + + +@_attrs_define +class NewAlertDataAttributesActorType2Type0: + """ + Attributes: + email (str): Email of the user, including verified secondary emails. + """ + + email: str + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + new_alert_data_attributes_actor_type_2_type_0 = cls( + email=email, + ) + + return new_alert_data_attributes_actor_type_2_type_0 diff --git a/rootly_sdk/models/new_alert_data_attributes_actor_type_2_type_1.py b/rootly_sdk/models/new_alert_data_attributes_actor_type_2_type_1.py new file mode 100644 index 00000000..84a33b40 --- /dev/null +++ b/rootly_sdk/models/new_alert_data_attributes_actor_type_2_type_1.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="NewAlertDataAttributesActorType2Type1") + + +@_attrs_define +class NewAlertDataAttributesActorType2Type1: + """ + Attributes: + user_id (str): Rootly ID of the user. + """ + + user_id: str + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user_id": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("user_id") + + new_alert_data_attributes_actor_type_2_type_1 = cls( + user_id=user_id, + ) + + return new_alert_data_attributes_actor_type_2_type_1 diff --git a/rootly_sdk/models/new_alert_data_attributes_actor_type_3_type_0.py b/rootly_sdk/models/new_alert_data_attributes_actor_type_3_type_0.py new file mode 100644 index 00000000..0af9ac69 --- /dev/null +++ b/rootly_sdk/models/new_alert_data_attributes_actor_type_3_type_0.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="NewAlertDataAttributesActorType3Type0") + + +@_attrs_define +class NewAlertDataAttributesActorType3Type0: + """ + Attributes: + email (str): Email of the user, including verified secondary emails. + """ + + email: str + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + new_alert_data_attributes_actor_type_3_type_0 = cls( + email=email, + ) + + return new_alert_data_attributes_actor_type_3_type_0 diff --git a/rootly_sdk/models/new_alert_data_attributes_actor_type_3_type_1.py b/rootly_sdk/models/new_alert_data_attributes_actor_type_3_type_1.py new file mode 100644 index 00000000..e93acb79 --- /dev/null +++ b/rootly_sdk/models/new_alert_data_attributes_actor_type_3_type_1.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="NewAlertDataAttributesActorType3Type1") + + +@_attrs_define +class NewAlertDataAttributesActorType3Type1: + """ + Attributes: + user_id (str): Rootly ID of the user. + """ + + user_id: str + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user_id": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("user_id") + + new_alert_data_attributes_actor_type_3_type_1 = cls( + user_id=user_id, + ) + + return new_alert_data_attributes_actor_type_3_type_1 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 32034f4e..8aa71c5b 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="NewAlertDataAttributesAlertFieldValuesAttributesItemType0") @@ -17,7 +18,6 @@ class NewAlertDataAttributesAlertFieldValuesAttributesItemType0: alert_field_id: str value: str - 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 @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: value = self.value field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "alert_field_id": alert_field_id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: value=value, ) - new_alert_data_attributes_alert_field_values_attributes_item_type_0.additional_properties = d return new_alert_data_attributes_alert_field_values_attributes_item_type_0 - - @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_data_attributes_data_type_0.py b/rootly_sdk/models/new_alert_data_attributes_data_type_0.py index dd2efbaf..407a47f0 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 d3341fa6..f80404ec 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,8 +1,9 @@ +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 T = TypeVar("T", bound="NewAlertDataAttributesLabelsItemType0") @@ -12,12 +13,11 @@ class NewAlertDataAttributesLabelsItemType0: """ Attributes: key (str): Key of the tag - value (Union[bool, float, str]): Value of the tag + value (bool | float | str): Value of the tag """ key: str value: bool | float | str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: key = self.key @@ -26,7 +26,7 @@ def to_dict(self) -> dict[str, Any]: value = self.value field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "key": key, @@ -51,21 +51,4 @@ def _parse_value(data: object) -> bool | float | str: value=value, ) - new_alert_data_attributes_labels_item_type_0.additional_properties = d return new_alert_data_attributes_labels_item_type_0 - - @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_data_attributes_noise.py b/rootly_sdk/models/new_alert_data_attributes_noise.py index 7e2b67cb..2dd563ac 100644 --- a/rootly_sdk/models/new_alert_data_attributes_noise.py +++ b/rootly_sdk/models/new_alert_data_attributes_noise.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertDataAttributesNoise = Literal["noise", "not_noise"] @@ -12,5 +12,5 @@ def check_new_alert_data_attributes_noise(value: str | None) -> NewAlertDataAttr if value is None: return None if value in NEW_ALERT_DATA_ATTRIBUTES_NOISE_VALUES: - return cast(NewAlertDataAttributesNoise, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ALERT_DATA_ATTRIBUTES_NOISE_VALUES!r}") diff --git a/rootly_sdk/models/new_alert_data_attributes_notification_target_type.py b/rootly_sdk/models/new_alert_data_attributes_notification_target_type.py index 8a0d0429..68892125 100644 --- a/rootly_sdk/models/new_alert_data_attributes_notification_target_type.py +++ b/rootly_sdk/models/new_alert_data_attributes_notification_target_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertDataAttributesNotificationTargetType = Literal["EscalationPolicy", "Functionality", "Group", "Service", "User"] @@ -17,7 +17,7 @@ def check_new_alert_data_attributes_notification_target_type( if value is None: return None if value in NEW_ALERT_DATA_ATTRIBUTES_NOTIFICATION_TARGET_TYPE_VALUES: - return cast(NewAlertDataAttributesNotificationTargetType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERT_DATA_ATTRIBUTES_NOTIFICATION_TARGET_TYPE_VALUES!r}" ) 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 e36f7c7f..2016715d 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_alert_data_attributes_notification_targets_type_0_item_type.py b/rootly_sdk/models/new_alert_data_attributes_notification_targets_type_0_item_type.py index 4e4263ba..1b4b604b 100644 --- a/rootly_sdk/models/new_alert_data_attributes_notification_targets_type_0_item_type.py +++ b/rootly_sdk/models/new_alert_data_attributes_notification_targets_type_0_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertDataAttributesNotificationTargetsType0ItemType = Literal[ "EscalationPolicy", "Functionality", "Group", "Service", "User" @@ -21,7 +21,7 @@ def check_new_alert_data_attributes_notification_targets_type_0_item_type( if value is None: return None if value in NEW_ALERT_DATA_ATTRIBUTES_NOTIFICATION_TARGETS_TYPE_0_ITEM_TYPE_VALUES: - return cast(NewAlertDataAttributesNotificationTargetsType0ItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERT_DATA_ATTRIBUTES_NOTIFICATION_TARGETS_TYPE_0_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alert_data_attributes_status.py b/rootly_sdk/models/new_alert_data_attributes_status.py index 7ae094cc..96d62aee 100644 --- a/rootly_sdk/models/new_alert_data_attributes_status.py +++ b/rootly_sdk/models/new_alert_data_attributes_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertDataAttributesStatus = Literal["open", "triggered"] @@ -12,5 +12,5 @@ def check_new_alert_data_attributes_status(value: str | None) -> NewAlertDataAtt if value is None: return None if value in NEW_ALERT_DATA_ATTRIBUTES_STATUS_VALUES: - return cast(NewAlertDataAttributesStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ALERT_DATA_ATTRIBUTES_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/new_alert_data_type.py b/rootly_sdk/models/new_alert_data_type.py index 0b0ed98a..cc87d527 100644 --- a/rootly_sdk/models/new_alert_data_type.py +++ b/rootly_sdk/models/new_alert_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertDataType = Literal["alerts"] @@ -11,5 +11,5 @@ def check_new_alert_data_type(value: str | None) -> NewAlertDataType | None: if value is None: return None if value in NEW_ALERT_DATA_TYPE_VALUES: - return cast(NewAlertDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ALERT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_alert_event.py b/rootly_sdk/models/new_alert_event.py index c838ecb9..8f1d8364 100644 --- a/rootly_sdk/models/new_alert_event.py +++ b/rootly_sdk/models/new_alert_event.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_alert_event_data import NewAlertEventData @@ -18,14 +19,13 @@ class NewAlertEvent: data (NewAlertEventData): """ - data: "NewAlertEventData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewAlertEventData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_alert_event.additional_properties = d return new_alert_event - - @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_event_data.py b/rootly_sdk/models/new_alert_event_data.py index 94a35a34..a052ddcc 100644 --- a/rootly_sdk/models/new_alert_event_data.py +++ b/rootly_sdk/models/new_alert_event_data.py @@ -1,8 +1,9 @@ +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_alert_event_data_type import NewAlertEventDataType, check_new_alert_event_data_type @@ -22,8 +23,7 @@ class NewAlertEventData: """ type_: NewAlertEventDataType - attributes: "NewAlertEventDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewAlertEventDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_alert_event_data.additional_properties = d return new_alert_event_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_event_data_attributes.py b/rootly_sdk/models/new_alert_event_data_attributes.py index be5da6d1..fa2ef336 100644 --- a/rootly_sdk/models/new_alert_event_data_attributes.py +++ b/rootly_sdk/models/new_alert_event_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -18,12 +20,12 @@ class NewAlertEventDataAttributes: Attributes: kind (NewAlertEventDataAttributesKind): details (str): Note message. - user_id (Union[Unset, int]): Author of the note. + user_id (int | Unset): Author of the note. """ kind: NewAlertEventDataAttributesKind details: str - user_id: Unset | int = UNSET + user_id: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: kind: str = self.kind diff --git a/rootly_sdk/models/new_alert_event_data_attributes_kind.py b/rootly_sdk/models/new_alert_event_data_attributes_kind.py index 54b6e604..5a9616b1 100644 --- a/rootly_sdk/models/new_alert_event_data_attributes_kind.py +++ b/rootly_sdk/models/new_alert_event_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertEventDataAttributesKind = Literal["note"] @@ -11,5 +11,5 @@ def check_new_alert_event_data_attributes_kind(value: str | None) -> NewAlertEve if value is None: return None if value in NEW_ALERT_EVENT_DATA_ATTRIBUTES_KIND_VALUES: - return cast(NewAlertEventDataAttributesKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ALERT_EVENT_DATA_ATTRIBUTES_KIND_VALUES!r}") diff --git a/rootly_sdk/models/new_alert_event_data_type.py b/rootly_sdk/models/new_alert_event_data_type.py index d8f54eec..87c30f98 100644 --- a/rootly_sdk/models/new_alert_event_data_type.py +++ b/rootly_sdk/models/new_alert_event_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertEventDataType = Literal["alert_events"] @@ -11,5 +11,5 @@ def check_new_alert_event_data_type(value: str | None) -> NewAlertEventDataType if value is None: return None if value in NEW_ALERT_EVENT_DATA_TYPE_VALUES: - return cast(NewAlertEventDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ALERT_EVENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_alert_field.py b/rootly_sdk/models/new_alert_field.py index 8a07ae9c..9da34381 100644 --- a/rootly_sdk/models/new_alert_field.py +++ b/rootly_sdk/models/new_alert_field.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_alert_field_data import NewAlertFieldData @@ -18,14 +19,13 @@ class NewAlertField: data (NewAlertFieldData): """ - data: "NewAlertFieldData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewAlertFieldData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_alert_field.additional_properties = d return new_alert_field - - @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_field_data.py b/rootly_sdk/models/new_alert_field_data.py index f1029426..9f0d78cd 100644 --- a/rootly_sdk/models/new_alert_field_data.py +++ b/rootly_sdk/models/new_alert_field_data.py @@ -1,8 +1,9 @@ +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_alert_field_data_type import NewAlertFieldDataType, check_new_alert_field_data_type @@ -22,8 +23,7 @@ class NewAlertFieldData: """ type_: NewAlertFieldDataType - attributes: "NewAlertFieldDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewAlertFieldDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_alert_field_data.additional_properties = d return new_alert_field_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_field_data_attributes.py b/rootly_sdk/models/new_alert_field_data_attributes.py index 3ca9b928..43ca2dcf 100644 --- a/rootly_sdk/models/new_alert_field_data_attributes.py +++ b/rootly_sdk/models/new_alert_field_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,22 +15,36 @@ 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 + slug (None | str | Unset): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This property will be removed from the request schema in a future version. + owner_group_ids (list[str] | None | Unset): IDs of the teams that own the alert field. Callers with org-wide + alert field permissions may omit it or pass an empty list to create an org-wide field. Callers without them + (team admins, team-scoped API keys) get their administered teams by default when it is omitted, and must + otherwise pass at least one team they administer; an explicit empty list or null is rejected. """ name: str - slug: None | Unset | str = UNSET + slug: None | str | Unset = UNSET + owner_group_ids: list[str] | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug + owner_group_ids: list[str] | None | Unset + if isinstance(self.owner_group_ids, Unset): + owner_group_ids = UNSET + elif isinstance(self.owner_group_ids, list): + owner_group_ids = self.owner_group_ids + + else: + owner_group_ids = self.owner_group_ids + field_dict: dict[str, Any] = {} field_dict.update( @@ -38,6 +54,8 @@ def to_dict(self) -> dict[str, Any]: ) if slug is not UNSET: field_dict["slug"] = slug + if owner_group_ids is not UNSET: + field_dict["owner_group_ids"] = owner_group_ids return field_dict @@ -46,18 +64,36 @@ 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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) + def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + owner_group_ids_type_0 = cast(list[str], data) + + return owner_group_ids_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[str] | None | Unset, data) + + owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) + new_alert_field_data_attributes = cls( name=name, slug=slug, + owner_group_ids=owner_group_ids, ) return new_alert_field_data_attributes diff --git a/rootly_sdk/models/new_alert_field_data_type.py b/rootly_sdk/models/new_alert_field_data_type.py index b34a4091..c66ef557 100644 --- a/rootly_sdk/models/new_alert_field_data_type.py +++ b/rootly_sdk/models/new_alert_field_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertFieldDataType = Literal["alert_fields"] @@ -11,5 +11,5 @@ def check_new_alert_field_data_type(value: str | None) -> NewAlertFieldDataType if value is None: return None if value in NEW_ALERT_FIELD_DATA_TYPE_VALUES: - return cast(NewAlertFieldDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ALERT_FIELD_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_alert_group.py b/rootly_sdk/models/new_alert_group.py index e61d1901..f6b21e38 100644 --- a/rootly_sdk/models/new_alert_group.py +++ b/rootly_sdk/models/new_alert_group.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_alert_group_data import NewAlertGroupData @@ -18,14 +19,13 @@ class NewAlertGroup: data (NewAlertGroupData): """ - data: "NewAlertGroupData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewAlertGroupData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_alert_group.additional_properties = d return new_alert_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_alert_group_data.py b/rootly_sdk/models/new_alert_group_data.py index c0de3056..d4fff702 100644 --- a/rootly_sdk/models/new_alert_group_data.py +++ b/rootly_sdk/models/new_alert_group_data.py @@ -1,8 +1,9 @@ +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_alert_group_data_type import NewAlertGroupDataType, check_new_alert_group_data_type @@ -22,8 +23,7 @@ class NewAlertGroupData: """ type_: NewAlertGroupDataType - attributes: "NewAlertGroupDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewAlertGroupDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_alert_group_data.additional_properties = d return new_alert_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_alert_group_data_attributes.py b/rootly_sdk/models/new_alert_group_data_attributes.py index fbc22242..e8418eec 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes.py +++ b/rootly_sdk/models/new_alert_group_data_attributes.py @@ -1,5 +1,8 @@ +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 @@ -31,45 +34,49 @@ class NewAlertGroupDataAttributes: """ Attributes: name (str): The name of the alert group - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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']]): + 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 + owner_group_ids (list[UUID] | Unset): Teams that own this alert group. Admins of an owning team can manage it, + and an owned alert group can only target destinations that belong to its owning teams. Only available when + owning teams for alert groups are enabled for the organization. + 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): """ name: str - 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 + slug: None | str | Unset = UNSET + description: None | str | Unset = UNSET + time_window: int | Unset = UNSET + owner_group_ids: list[UUID] | 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 def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -77,33 +84,40 @@ def to_dict(self) -> dict[str, Any]: time_window = self.time_window - targets: Unset | list[dict[str, Any]] = UNSET + owner_group_ids: list[str] | Unset = UNSET + if not isinstance(self.owner_group_ids, Unset): + owner_group_ids = [] + for owner_group_ids_item_data in self.owner_group_ids: + owner_group_ids_item = str(owner_group_ids_item_data) + owner_group_ids.append(owner_group_ids_item) + + targets: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + attributes: list[dict[str, Any]] | Unset = 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: Unset | int = UNSET + group_by_alert_title: int | Unset = UNSET if not isinstance(self.group_by_alert_title, Unset): group_by_alert_title = self.group_by_alert_title - group_by_alert_urgency: Unset | int = UNSET + group_by_alert_urgency: int | Unset = UNSET if not isinstance(self.group_by_alert_urgency, Unset): group_by_alert_urgency = self.group_by_alert_urgency - condition_type: Unset | str = UNSET + condition_type: str | Unset = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - conditions: Unset | list[dict[str, Any]] = UNSET + conditions: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -123,6 +137,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if time_window is not UNSET: field_dict["time_window"] = time_window + if owner_group_ids is not UNSET: + field_dict["owner_group_ids"] = owner_group_ids if targets is not UNSET: field_dict["targets"] = targets if attributes is not UNSET: @@ -147,49 +163,62 @@ 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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) time_window = d.pop("time_window", UNSET) - targets = [] + _owner_group_ids = d.pop("owner_group_ids", UNSET) + owner_group_ids: list[UUID] | Unset = UNSET + if _owner_group_ids is not UNSET: + owner_group_ids = [] + for owner_group_ids_item_data in _owner_group_ids: + owner_group_ids_item = UUID(owner_group_ids_item_data) + + owner_group_ids.append(owner_group_ids_item) + _targets = d.pop("targets", UNSET) - for targets_item_data in _targets or []: - targets_item = NewAlertGroupDataAttributesTargetsItem.from_dict(targets_item_data) + 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) - targets.append(targets_item) + targets.append(targets_item) - attributes = [] _attributes = d.pop("attributes", UNSET) - for attributes_item_data in _attributes or []: - attributes_item = NewAlertGroupDataAttributesAttributesItem.from_dict(attributes_item_data) + 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) - attributes.append(attributes_item) + attributes.append(attributes_item) _group_by_alert_title = d.pop("group_by_alert_title", UNSET) - group_by_alert_title: Unset | NewAlertGroupDataAttributesGroupByAlertTitle + group_by_alert_title: NewAlertGroupDataAttributesGroupByAlertTitle | Unset 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: Unset | NewAlertGroupDataAttributesGroupByAlertUrgency + group_by_alert_urgency: NewAlertGroupDataAttributesGroupByAlertUrgency | Unset if isinstance(_group_by_alert_urgency, Unset): group_by_alert_urgency = UNSET else: @@ -198,24 +227,27 @@ def _parse_description(data: object) -> None | Unset | str: ) _condition_type = d.pop("condition_type", UNSET) - condition_type: Unset | NewAlertGroupDataAttributesConditionType + condition_type: NewAlertGroupDataAttributesConditionType | Unset 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) - for conditions_item_data in _conditions or []: - conditions_item = NewAlertGroupDataAttributesConditionsItem.from_dict(conditions_item_data) + 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) - conditions.append(conditions_item) + conditions.append(conditions_item) new_alert_group_data_attributes = cls( name=name, slug=slug, description=description, time_window=time_window, + owner_group_ids=owner_group_ids, targets=targets, attributes=attributes, group_by_alert_title=group_by_alert_title, 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 7137d960..a275c13c 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,8 +1,9 @@ +from __future__ import annotations + 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 @@ -13,17 +14,16 @@ class NewAlertGroupDataAttributesAttributesItem: """ Attributes: - json_path (Union[Unset, str]): The JSON path to the value to group by. + json_path (str | Unset): The JSON path to the value to group by. """ - json_path: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + json_path: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: json_path = self.json_path field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if json_path is not UNSET: field_dict["json_path"] = json_path @@ -39,21 +39,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: json_path=json_path, ) - new_alert_group_data_attributes_attributes_item.additional_properties = d return new_alert_group_data_attributes_attributes_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_group_data_attributes_condition_type.py b/rootly_sdk/models/new_alert_group_data_attributes_condition_type.py index ad212969..af0b3eb9 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes_condition_type.py +++ b/rootly_sdk/models/new_alert_group_data_attributes_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertGroupDataAttributesConditionType = Literal["all", "any"] @@ -14,7 +14,7 @@ def check_new_alert_group_data_attributes_condition_type( if value is None: return None if value in NEW_ALERT_GROUP_DATA_ATTRIBUTES_CONDITION_TYPE_VALUES: - return cast(NewAlertGroupDataAttributesConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERT_GROUP_DATA_ATTRIBUTES_CONDITION_TYPE_VALUES!r}" ) 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 bc64e1f2..5d254e7a 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,8 +1,9 @@ +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.new_alert_group_data_attributes_conditions_item_conditionable_type import ( NewAlertGroupDataAttributesConditionsItemConditionableType, @@ -28,33 +29,31 @@ 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 (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 + 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 field condition type is 'is_one_of' or 'is_not_one_of' - conditionable_type (Union[Unset, NewAlertGroupDataAttributesConditionsItemConditionableType]): The type of the + conditionable_type (NewAlertGroupDataAttributesConditionsItemConditionableType | Unset): 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. + conditionable_id (str | Unset): 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: 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) + 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 def to_dict(self) -> dict[str, Any]: property_field_type: str = self.property_field_type @@ -65,11 +64,11 @@ def to_dict(self) -> dict[str, Any]: property_field_value = self.property_field_value - property_field_values: Unset | list[str] = UNSET + property_field_values: list[str] | Unset = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values - alert_urgency_ids: None | Unset | list[str] + alert_urgency_ids: list[str] | None | Unset if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -78,14 +77,14 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: Unset | str = UNSET + conditionable_type: str | Unset = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type conditionable_id = self.conditionable_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "property_field_type": property_field_type, @@ -126,7 +125,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) -> None | Unset | list[str]: + def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -137,14 +136,14 @@ def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Unset | NewAlertGroupDataAttributesConditionsItemConditionableType + conditionable_type: NewAlertGroupDataAttributesConditionsItemConditionableType | Unset if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -165,21 +164,4 @@ def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: conditionable_id=conditionable_id, ) - new_alert_group_data_attributes_conditions_item.additional_properties = d return new_alert_group_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_group_data_attributes_conditions_item_conditionable_type.py b/rootly_sdk/models/new_alert_group_data_attributes_conditions_item_conditionable_type.py index e5c0b7a8..f9cd129d 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes_conditions_item_conditionable_type.py +++ b/rootly_sdk/models/new_alert_group_data_attributes_conditions_item_conditionable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertGroupDataAttributesConditionsItemConditionableType = Literal["AlertField"] @@ -15,7 +15,7 @@ def check_new_alert_group_data_attributes_conditions_item_conditionable_type( if value is None: return None if value in NEW_ALERT_GROUP_DATA_ATTRIBUTES_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES: - return cast(NewAlertGroupDataAttributesConditionsItemConditionableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERT_GROUP_DATA_ATTRIBUTES_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alert_group_data_attributes_conditions_item_property_field_condition_type.py b/rootly_sdk/models/new_alert_group_data_attributes_conditions_item_property_field_condition_type.py index cc4afbc6..47bba883 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes_conditions_item_property_field_condition_type.py +++ b/rootly_sdk/models/new_alert_group_data_attributes_conditions_item_property_field_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertGroupDataAttributesConditionsItemPropertyFieldConditionType = Literal[ "contains", @@ -33,7 +33,7 @@ def check_new_alert_group_data_attributes_conditions_item_property_field_conditi if value is None: return None if value in NEW_ALERT_GROUP_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES: - return cast(NewAlertGroupDataAttributesConditionsItemPropertyFieldConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERT_GROUP_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alert_group_data_attributes_conditions_item_property_field_type.py b/rootly_sdk/models/new_alert_group_data_attributes_conditions_item_property_field_type.py index f5bbd32f..ede56b80 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes_conditions_item_property_field_type.py +++ b/rootly_sdk/models/new_alert_group_data_attributes_conditions_item_property_field_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertGroupDataAttributesConditionsItemPropertyFieldType = Literal["alert_field", "attribute", "payload"] @@ -17,7 +17,7 @@ def check_new_alert_group_data_attributes_conditions_item_property_field_type( if value is None: return None if value in NEW_ALERT_GROUP_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES: - return cast(NewAlertGroupDataAttributesConditionsItemPropertyFieldType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERT_GROUP_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alert_group_data_attributes_group_by_alert_title.py b/rootly_sdk/models/new_alert_group_data_attributes_group_by_alert_title.py index ea1ac615..6935a994 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes_group_by_alert_title.py +++ b/rootly_sdk/models/new_alert_group_data_attributes_group_by_alert_title.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertGroupDataAttributesGroupByAlertTitle = Literal[0, 1] @@ -12,7 +12,7 @@ def check_new_alert_group_data_attributes_group_by_alert_title( value: int, ) -> NewAlertGroupDataAttributesGroupByAlertTitle: if value in NEW_ALERT_GROUP_DATA_ATTRIBUTES_GROUP_BY_ALERT_TITLE_VALUES: - return cast(NewAlertGroupDataAttributesGroupByAlertTitle, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERT_GROUP_DATA_ATTRIBUTES_GROUP_BY_ALERT_TITLE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alert_group_data_attributes_group_by_alert_urgency.py b/rootly_sdk/models/new_alert_group_data_attributes_group_by_alert_urgency.py index 4b299218..d8b60311 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes_group_by_alert_urgency.py +++ b/rootly_sdk/models/new_alert_group_data_attributes_group_by_alert_urgency.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertGroupDataAttributesGroupByAlertUrgency = Literal[0, 1] @@ -12,7 +12,7 @@ def check_new_alert_group_data_attributes_group_by_alert_urgency( value: int, ) -> NewAlertGroupDataAttributesGroupByAlertUrgency: if value in NEW_ALERT_GROUP_DATA_ATTRIBUTES_GROUP_BY_ALERT_URGENCY_VALUES: - return cast(NewAlertGroupDataAttributesGroupByAlertUrgency, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERT_GROUP_DATA_ATTRIBUTES_GROUP_BY_ALERT_URGENCY_VALUES!r}" ) 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 03851493..74b8e730 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,9 +1,10 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.new_alert_group_data_attributes_targets_item_target_type import ( NewAlertGroupDataAttributesTargetsItemTargetType, @@ -24,7 +25,6 @@ class NewAlertGroupDataAttributesTargetsItem: target_type: NewAlertGroupDataAttributesTargetsItemTargetType target_id: UUID - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: target_type: str = self.target_type @@ -32,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: target_id = str(self.target_id) field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "target_type": target_type, @@ -54,21 +54,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: target_id=target_id, ) - new_alert_group_data_attributes_targets_item.additional_properties = d return new_alert_group_data_attributes_targets_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_group_data_attributes_targets_item_target_type.py b/rootly_sdk/models/new_alert_group_data_attributes_targets_item_target_type.py index aa9c58d0..87bb874a 100644 --- a/rootly_sdk/models/new_alert_group_data_attributes_targets_item_target_type.py +++ b/rootly_sdk/models/new_alert_group_data_attributes_targets_item_target_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertGroupDataAttributesTargetsItemTargetType = Literal["EscalationPolicy", "Functionality", "Group", "Service"] @@ -18,7 +18,7 @@ def check_new_alert_group_data_attributes_targets_item_target_type( if value is None: return None if value in NEW_ALERT_GROUP_DATA_ATTRIBUTES_TARGETS_ITEM_TARGET_TYPE_VALUES: - return cast(NewAlertGroupDataAttributesTargetsItemTargetType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERT_GROUP_DATA_ATTRIBUTES_TARGETS_ITEM_TARGET_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alert_group_data_type.py b/rootly_sdk/models/new_alert_group_data_type.py index af13e5d1..9691d1dd 100644 --- a/rootly_sdk/models/new_alert_group_data_type.py +++ b/rootly_sdk/models/new_alert_group_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertGroupDataType = Literal["alert_groups"] @@ -11,5 +11,5 @@ def check_new_alert_group_data_type(value: str | None) -> NewAlertGroupDataType if value is None: return None if value in NEW_ALERT_GROUP_DATA_TYPE_VALUES: - return cast(NewAlertGroupDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ALERT_GROUP_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes.py b/rootly_sdk/models/new_alert_retrigger_rule_data_attributes.py deleted file mode 100644 index 1711e7d1..00000000 --- a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes.py +++ /dev/null @@ -1,124 +0,0 @@ -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 deleted file mode 100644 index ebf1e048..00000000 --- a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item.py +++ /dev/null @@ -1,123 +0,0 @@ -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 deleted file mode 100644 index 43e64777..00000000 --- a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item_kind.py +++ /dev/null @@ -1,28 +0,0 @@ -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 deleted file mode 100644 index 8203628d..00000000 --- a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_conditions_item_operator.py +++ /dev/null @@ -1,39 +0,0 @@ -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 deleted file mode 100644 index 893aa6d5..00000000 --- a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_match_mode.py +++ /dev/null @@ -1,20 +0,0 @@ -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 deleted file mode 100644 index 3ae3d4fe..00000000 --- a/rootly_sdk/models/new_alert_retrigger_rule_data_attributes_timeout_minutes.py +++ /dev/null @@ -1,34 +0,0 @@ -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 deleted file mode 100644 index 66fa671d..00000000 --- a/rootly_sdk/models/new_alert_retrigger_rule_data_type.py +++ /dev/null @@ -1,15 +0,0 @@ -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 44053e1b..1121ae25 100644 --- a/rootly_sdk/models/new_alert_route.py +++ b/rootly_sdk/models/new_alert_route.py @@ -1,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -17,19 +18,18 @@ class NewAlertRoute: """ Attributes: - data (Union[Unset, NewAlertRouteData]): + data (NewAlertRouteData | Unset): """ - data: Union[Unset, "NewAlertRouteData"] = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewAlertRouteData | Unset = UNSET def to_dict(self) -> dict[str, Any]: - data: Unset | dict[str, Any] = UNSET + data: dict[str, Any] | Unset = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if data is not UNSET: field_dict["data"] = data @@ -42,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: Unset | NewAlertRouteData + data: NewAlertRouteData | Unset if isinstance(_data, Unset): data = UNSET else: @@ -52,21 +52,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_alert_route.additional_properties = d return new_alert_route - - @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_route_data.py b/rootly_sdk/models/new_alert_route_data.py index 8f32aa22..3385bf6a 100644 --- a/rootly_sdk/models/new_alert_route_data.py +++ b/rootly_sdk/models/new_alert_route_data.py @@ -1,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.new_alert_route_data_type import NewAlertRouteDataType, check_new_alert_route_data_type from ..types import UNSET, Unset @@ -18,25 +19,24 @@ class NewAlertRouteData: """ Attributes: - type_ (Union[Unset, NewAlertRouteDataType]): - attributes (Union[Unset, NewAlertRouteDataAttributes]): + type_ (NewAlertRouteDataType | Unset): + attributes (NewAlertRouteDataAttributes | Unset): """ - type_: Unset | NewAlertRouteDataType = UNSET - attributes: Union[Unset, "NewAlertRouteDataAttributes"] = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + type_: NewAlertRouteDataType | Unset = UNSET + attributes: NewAlertRouteDataAttributes | Unset = UNSET def to_dict(self) -> dict[str, Any]: - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if type_ is not UNSET: field_dict["type"] = type_ @@ -51,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_: Unset | NewAlertRouteDataType + type_: NewAlertRouteDataType | Unset if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_new_alert_route_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Unset | NewAlertRouteDataAttributes + attributes: NewAlertRouteDataAttributes | Unset if isinstance(_attributes, Unset): attributes = UNSET else: @@ -69,21 +69,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_alert_route_data.additional_properties = d return new_alert_route_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_route_data_attributes.py b/rootly_sdk/models/new_alert_route_data_attributes.py index 6f14fe06..cc915465 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes.py +++ b/rootly_sdk/models/new_alert_route_data_attributes.py @@ -1,9 +1,10 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -20,17 +21,16 @@ class NewAlertRouteDataAttributes: Attributes: name (str): The name of the alert route alerts_source_ids (list[UUID]): - enabled (Union[Unset, bool]): Whether the alert route is enabled - owning_team_ids (Union[Unset, list[UUID]]): - rules (Union[Unset, list['NewAlertRouteDataAttributesRulesItem']]): + enabled (bool | Unset): Whether the alert route is enabled + owning_team_ids (list[UUID] | Unset): + rules (list[NewAlertRouteDataAttributesRulesItem] | Unset): """ name: str alerts_source_ids: list[UUID] - 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) + enabled: bool | Unset = UNSET + owning_team_ids: list[UUID] | Unset = UNSET + rules: list[NewAlertRouteDataAttributesRulesItem] | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -42,14 +42,14 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - owning_team_ids: Unset | list[str] = UNSET + owning_team_ids: list[str] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + rules: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -57,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: rules.append(rules_item) field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "name": name, @@ -89,19 +89,23 @@ 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) - for owning_team_ids_item_data in _owning_team_ids or []: - owning_team_ids_item = UUID(owning_team_ids_item_data) + 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) - owning_team_ids.append(owning_team_ids_item) + owning_team_ids.append(owning_team_ids_item) - rules = [] _rules = d.pop("rules", UNSET) - for rules_item_data in _rules or []: - rules_item = NewAlertRouteDataAttributesRulesItem.from_dict(rules_item_data) + 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) - rules.append(rules_item) + rules.append(rules_item) new_alert_route_data_attributes = cls( name=name, @@ -111,21 +115,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: rules=rules, ) - new_alert_route_data_attributes.additional_properties = d return new_alert_route_data_attributes - - @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_route_data_attributes_rules_item.py b/rootly_sdk/models/new_alert_route_data_attributes_rules_item.py index ccc3722c..44e4b941 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,8 +1,9 @@ +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 ..types import UNSET, Unset @@ -23,18 +24,17 @@ class NewAlertRouteDataAttributesRulesItem: """ Attributes: name (str): The name of the alert routing rule - 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. + 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. """ name: str - 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) + destinations: list[NewAlertRouteDataAttributesRulesItemDestinationsItem] + condition_groups: list[NewAlertRouteDataAttributesRulesItemConditionGroupsItem] + position: int | Unset = UNSET + fallback_rule: bool | Unset = False def to_dict(self) -> dict[str, Any]: name = self.name @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: fallback_rule = self.fallback_rule field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "name": name, @@ -109,21 +109,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: fallback_rule=fallback_rule, ) - new_alert_route_data_attributes_rules_item.additional_properties = d return new_alert_route_data_attributes_rules_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_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 68d9d2c3..a7a2d49c 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,8 +1,9 @@ +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 ..types import UNSET, Unset @@ -19,13 +20,12 @@ class NewAlertRouteDataAttributesRulesItemConditionGroupsItem: """ Attributes: - conditions (list['NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem']): - position (Union[Unset, int]): The position of the condition group + conditions (list[NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem]): + position (int | Unset): The position of the condition group """ - conditions: list["NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem"] - position: Unset | int = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + conditions: list[NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem] + position: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: conditions = [] @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "conditions": conditions, @@ -70,21 +70,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position=position, ) - new_alert_route_data_attributes_rules_item_condition_groups_item.additional_properties = d return new_alert_route_data_attributes_rules_item_condition_groups_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_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 76514557..9dc5d800 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,9 +1,10 @@ +from __future__ import annotations + 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_route_data_attributes_rules_item_condition_groups_item_conditions_item_conditionable_type import ( NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType, @@ -29,29 +30,27 @@ class NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem: property_field_condition_type (NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType): property_field_type (NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType): - 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_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_condition_type: ( NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType ) property_field_type: NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType - 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 + 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: ( - Unset | NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType + NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | Unset ) = UNSET - conditionable_id: None | UUID | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + conditionable_id: None | Unset | UUID = UNSET def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type @@ -60,13 +59,13 @@ def to_dict(self) -> dict[str, Any]: property_field_name = self.property_field_name - property_field_value: None | Unset | str + property_field_value: None | str | Unset if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: None | Unset | list[str] + property_field_values: list[str] | None | Unset if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -75,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - alert_urgency_ids: None | Unset | list[str] + alert_urgency_ids: list[str] | None | Unset if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -84,11 +83,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: Unset | str = UNSET + conditionable_type: str | Unset = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | Unset | str + conditionable_id: None | str | Unset if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -97,7 +96,7 @@ def to_dict(self) -> dict[str, Any]: conditionable_id = self.conditionable_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "property_field_condition_type": property_field_condition_type, @@ -134,16 +133,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 | Unset | str: + def _parse_property_field_value(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> None | Unset | list[str]: + def _parse_property_field_values(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -154,13 +153,13 @@ def _parse_property_field_values(data: object) -> None | Unset | list[str]: property_field_values_type_0 = cast(list[str], data) return property_field_values_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: + def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -171,15 +170,15 @@ def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) conditionable_type: ( - Unset | NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType + NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | Unset ) if isinstance(_conditionable_type, Unset): conditionable_type = UNSET @@ -188,7 +187,7 @@ def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | UUID | Unset: + def _parse_conditionable_id(data: object) -> None | Unset | UUID: if data is None: return data if isinstance(data, Unset): @@ -199,9 +198,9 @@ def _parse_conditionable_id(data: object) -> None | UUID | Unset: conditionable_id_type_0 = UUID(data) return conditionable_id_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | UUID | Unset, data) + return cast(None | Unset | UUID, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) @@ -216,21 +215,4 @@ def _parse_conditionable_id(data: object) -> None | UUID | Unset: conditionable_id=conditionable_id, ) - new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.additional_properties = d return new_alert_route_data_attributes_rules_item_condition_groups_item_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_route_data_attributes_rules_item_condition_groups_item_conditions_item_conditionable_type.py b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_conditionable_type.py index 96fda774..a890e48f 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_conditionable_type.py +++ b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_conditionable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType = Literal["AlertField"] @@ -18,7 +18,7 @@ def check_new_alert_route_data_attributes_rules_item_condition_groups_item_condi value in NEW_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES ): - return cast(NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_condition_type.py b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_condition_type.py index c644a1c4..9b03ee0b 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_condition_type.py +++ b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType = Literal[ "contains", @@ -34,9 +34,7 @@ def check_new_alert_route_data_attributes_rules_item_condition_groups_item_condi value in NEW_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES ): - return cast( - NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType, value - ) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_type.py b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_type.py index 70420b75..d11f4f75 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_type.py +++ b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType = Literal[ "alert_field", "attribute", "payload" @@ -22,7 +22,7 @@ def check_new_alert_route_data_attributes_rules_item_condition_groups_item_condi value in NEW_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES ): - return cast(NewAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES!r}" ) 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 177f40d1..9d48f26a 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,9 +1,10 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.new_alert_route_data_attributes_rules_item_destinations_item_target_type import ( NewAlertRouteDataAttributesRulesItemDestinationsItemTargetType, @@ -24,7 +25,6 @@ class NewAlertRouteDataAttributesRulesItemDestinationsItem: target_type: NewAlertRouteDataAttributesRulesItemDestinationsItemTargetType target_id: UUID - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: target_type: str = self.target_type @@ -32,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: target_id = str(self.target_id) field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "target_type": target_type, @@ -56,21 +56,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: target_id=target_id, ) - new_alert_route_data_attributes_rules_item_destinations_item.additional_properties = d return new_alert_route_data_attributes_rules_item_destinations_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_route_data_attributes_rules_item_destinations_item_target_type.py b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_destinations_item_target_type.py index 040f3ccf..4d7c6a68 100644 --- a/rootly_sdk/models/new_alert_route_data_attributes_rules_item_destinations_item_target_type.py +++ b/rootly_sdk/models/new_alert_route_data_attributes_rules_item_destinations_item_target_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertRouteDataAttributesRulesItemDestinationsItemTargetType = Literal[ "EscalationPolicy", "Functionality", "Group", "Service" @@ -20,7 +20,7 @@ def check_new_alert_route_data_attributes_rules_item_destinations_item_target_ty if value is None: return None if value in NEW_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_DESTINATIONS_ITEM_TARGET_TYPE_VALUES: - return cast(NewAlertRouteDataAttributesRulesItemDestinationsItemTargetType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_DESTINATIONS_ITEM_TARGET_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alert_route_data_type.py b/rootly_sdk/models/new_alert_route_data_type.py index 35657ff8..9f0d7a03 100644 --- a/rootly_sdk/models/new_alert_route_data_type.py +++ b/rootly_sdk/models/new_alert_route_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertRouteDataType = Literal["alert_routes"] @@ -11,5 +11,5 @@ def check_new_alert_route_data_type(value: str | None) -> NewAlertRouteDataType if value is None: return None if value in NEW_ALERT_ROUTE_DATA_TYPE_VALUES: - return cast(NewAlertRouteDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ALERT_ROUTE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_alert_routing_rule.py b/rootly_sdk/models/new_alert_routing_rule.py index 2dd1368b..c64fe59d 100644 --- a/rootly_sdk/models/new_alert_routing_rule.py +++ b/rootly_sdk/models/new_alert_routing_rule.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_alert_routing_rule_data import NewAlertRoutingRuleData @@ -18,14 +19,13 @@ class NewAlertRoutingRule: data (NewAlertRoutingRuleData): """ - data: "NewAlertRoutingRuleData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewAlertRoutingRuleData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_alert_routing_rule.additional_properties = d return new_alert_routing_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_routing_rule_data.py b/rootly_sdk/models/new_alert_routing_rule_data.py index 038cc9b0..26a6fd08 100644 --- a/rootly_sdk/models/new_alert_routing_rule_data.py +++ b/rootly_sdk/models/new_alert_routing_rule_data.py @@ -1,8 +1,9 @@ +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_alert_routing_rule_data_type import ( NewAlertRoutingRuleDataType, @@ -25,8 +26,7 @@ class NewAlertRoutingRuleData: """ type_: NewAlertRoutingRuleDataType - attributes: "NewAlertRoutingRuleDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewAlertRoutingRuleDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_alert_routing_rule_data.additional_properties = d return new_alert_routing_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_routing_rule_data_attributes.py b/rootly_sdk/models/new_alert_routing_rule_data_attributes.py index e6198f3d..384761d5 100644 --- a/rootly_sdk/models/new_alert_routing_rule_data_attributes.py +++ b/rootly_sdk/models/new_alert_routing_rule_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -27,24 +29,24 @@ class NewAlertRoutingRuleDataAttributes: name (str): The name of the alert routing rule alerts_source_id (UUID): The ID of the alerts source destination (NewAlertRoutingRuleDataAttributesDestination): - 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']]): + 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): """ name: str alerts_source_id: UUID - 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 + 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 def to_dict(self) -> dict[str, Any]: name = self.name @@ -55,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - owning_team_ids: Unset | list[str] = UNSET + owning_team_ids: list[str] | Unset = UNSET if not isinstance(self.owning_team_ids, Unset): owning_team_ids = [] for owning_team_ids_item_data in self.owning_team_ids: @@ -64,11 +66,11 @@ def to_dict(self) -> dict[str, Any]: position = self.position - condition_type: Unset | str = UNSET + condition_type: str | Unset = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - conditions: Unset | list[dict[str, Any]] = UNSET + conditions: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -115,28 +117,32 @@ 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) - for owning_team_ids_item_data in _owning_team_ids or []: - owning_team_ids_item = UUID(owning_team_ids_item_data) + 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) - 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: Unset | NewAlertRoutingRuleDataAttributesConditionType + condition_type: NewAlertRoutingRuleDataAttributesConditionType | Unset 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) - for conditions_item_data in _conditions or []: - conditions_item = NewAlertRoutingRuleDataAttributesConditionsItem.from_dict(conditions_item_data) + 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) - 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_condition_type.py b/rootly_sdk/models/new_alert_routing_rule_data_attributes_condition_type.py index c0023203..0836e767 100644 --- a/rootly_sdk/models/new_alert_routing_rule_data_attributes_condition_type.py +++ b/rootly_sdk/models/new_alert_routing_rule_data_attributes_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertRoutingRuleDataAttributesConditionType = Literal["all", "any"] @@ -14,7 +14,7 @@ def check_new_alert_routing_rule_data_attributes_condition_type( if value is None: return None if value in NEW_ALERT_ROUTING_RULE_DATA_ATTRIBUTES_CONDITION_TYPE_VALUES: - return cast(NewAlertRoutingRuleDataAttributesConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERT_ROUTING_RULE_DATA_ATTRIBUTES_CONDITION_TYPE_VALUES!r}" ) 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 2ec23593..718ba103 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,8 +1,9 @@ +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.new_alert_routing_rule_data_attributes_conditions_item_property_field_condition_type import ( NewAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType, @@ -29,19 +30,17 @@ 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 (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_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_type: NewAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType property_field_name: str property_field_condition_type: NewAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType - property_field_value: Unset | str = UNSET - property_field_values: Unset | list[str] = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + property_field_value: str | Unset = UNSET + property_field_values: list[str] | Unset = UNSET def to_dict(self) -> dict[str, Any]: property_field_type: str = self.property_field_type @@ -52,12 +51,12 @@ def to_dict(self) -> dict[str, Any]: property_field_value = self.property_field_value - property_field_values: Unset | list[str] = UNSET + property_field_values: list[str] | Unset = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "property_field_type": property_field_type, @@ -99,21 +98,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: property_field_values=property_field_values, ) - new_alert_routing_rule_data_attributes_conditions_item.additional_properties = d return new_alert_routing_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_routing_rule_data_attributes_conditions_item_property_field_condition_type.py b/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item_property_field_condition_type.py index 0a7dd12d..efa2b517 100644 --- a/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item_property_field_condition_type.py +++ b/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item_property_field_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType = Literal[ "contains", @@ -31,7 +31,7 @@ def check_new_alert_routing_rule_data_attributes_conditions_item_property_field_ if value is None: return None if value in NEW_ALERT_ROUTING_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES: - return cast(NewAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERT_ROUTING_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item_property_field_type.py b/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item_property_field_type.py index 971cccbb..af24c655 100644 --- a/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item_property_field_type.py +++ b/rootly_sdk/models/new_alert_routing_rule_data_attributes_conditions_item_property_field_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType = Literal["attribute", "payload"] @@ -16,7 +16,7 @@ def check_new_alert_routing_rule_data_attributes_conditions_item_property_field_ if value is None: return None if value in NEW_ALERT_ROUTING_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES: - return cast(NewAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERT_ROUTING_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES!r}" ) 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 9226af15..a287a34e 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,9 +1,10 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.new_alert_routing_rule_data_attributes_destination_target_type import ( NewAlertRoutingRuleDataAttributesDestinationTargetType, @@ -24,7 +25,6 @@ class NewAlertRoutingRuleDataAttributesDestination: target_type: NewAlertRoutingRuleDataAttributesDestinationTargetType target_id: UUID - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: target_type: str = self.target_type @@ -32,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: target_id = str(self.target_id) field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "target_type": target_type, @@ -54,21 +54,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: target_id=target_id, ) - new_alert_routing_rule_data_attributes_destination.additional_properties = d return new_alert_routing_rule_data_attributes_destination - - @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_routing_rule_data_attributes_destination_target_type.py b/rootly_sdk/models/new_alert_routing_rule_data_attributes_destination_target_type.py index e62ae911..3b96b50e 100644 --- a/rootly_sdk/models/new_alert_routing_rule_data_attributes_destination_target_type.py +++ b/rootly_sdk/models/new_alert_routing_rule_data_attributes_destination_target_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertRoutingRuleDataAttributesDestinationTargetType = Literal[ "EscalationPolicy", "Functionality", "Group", "Service" @@ -20,7 +20,7 @@ def check_new_alert_routing_rule_data_attributes_destination_target_type( if value is None: return None if value in NEW_ALERT_ROUTING_RULE_DATA_ATTRIBUTES_DESTINATION_TARGET_TYPE_VALUES: - return cast(NewAlertRoutingRuleDataAttributesDestinationTargetType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERT_ROUTING_RULE_DATA_ATTRIBUTES_DESTINATION_TARGET_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alert_routing_rule_data_type.py b/rootly_sdk/models/new_alert_routing_rule_data_type.py index f9ae22fd..3d6ba3cf 100644 --- a/rootly_sdk/models/new_alert_routing_rule_data_type.py +++ b/rootly_sdk/models/new_alert_routing_rule_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertRoutingRuleDataType = Literal["alert_routing_rules"] @@ -11,5 +11,5 @@ def check_new_alert_routing_rule_data_type(value: str | None) -> NewAlertRouting if value is None: return None if value in NEW_ALERT_ROUTING_RULE_DATA_TYPE_VALUES: - return cast(NewAlertRoutingRuleDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ALERT_ROUTING_RULE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_alert_urgency.py b/rootly_sdk/models/new_alert_urgency.py index 0e0e8d79..4531e39a 100644 --- a/rootly_sdk/models/new_alert_urgency.py +++ b/rootly_sdk/models/new_alert_urgency.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_alert_urgency_data import NewAlertUrgencyData @@ -18,14 +19,13 @@ class NewAlertUrgency: data (NewAlertUrgencyData): """ - data: "NewAlertUrgencyData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewAlertUrgencyData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_alert_urgency.additional_properties = d return new_alert_urgency - - @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_urgency_data.py b/rootly_sdk/models/new_alert_urgency_data.py index 345905e1..1889846a 100644 --- a/rootly_sdk/models/new_alert_urgency_data.py +++ b/rootly_sdk/models/new_alert_urgency_data.py @@ -1,8 +1,9 @@ +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_alert_urgency_data_type import NewAlertUrgencyDataType, check_new_alert_urgency_data_type @@ -22,8 +23,7 @@ class NewAlertUrgencyData: """ type_: NewAlertUrgencyDataType - attributes: "NewAlertUrgencyDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewAlertUrgencyDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_alert_urgency_data.additional_properties = d return new_alert_urgency_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_urgency_data_attributes.py b/rootly_sdk/models/new_alert_urgency_data_attributes.py index 6ec17750..b7413866 100644 --- a/rootly_sdk/models/new_alert_urgency_data_attributes.py +++ b/rootly_sdk/models/new_alert_urgency_data_attributes.py @@ -1,8 +1,14 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast from attrs import define as _attrs_define +from ..models.new_alert_urgency_data_attributes_retrigger_timeout_minutes import ( + NewAlertUrgencyDataAttributesRetriggerTimeoutMinutes, + check_new_alert_urgency_data_attributes_retrigger_timeout_minutes, +) from ..types import UNSET, Unset T = TypeVar("T", bound="NewAlertUrgencyDataAttributes") @@ -14,31 +20,29 @@ class NewAlertUrgencyDataAttributes: Attributes: name (str): The name of the alert urgency description (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. + position (int | None | Unset): Position of the alert urgency + retrigger_timeout_minutes (NewAlertUrgencyDataAttributesRetriggerTimeoutMinutes | Unset): Re-trigger + acknowledged alerts of this urgency after N minutes; null inherits the workspace default, -1 = never. """ name: str description: str - position: None | Unset | int = UNSET - retrigger_timeout_minutes: None | Unset | int = UNSET + position: int | None | Unset = UNSET + retrigger_timeout_minutes: NewAlertUrgencyDataAttributesRetriggerTimeoutMinutes | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name description = self.description - position: None | Unset | int + position: int | None | Unset 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: int | Unset = UNSET + if not isinstance(self.retrigger_timeout_minutes, Unset): retrigger_timeout_minutes = self.retrigger_timeout_minutes field_dict: dict[str, Any] = {} @@ -63,23 +67,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description") - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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)) + _retrigger_timeout_minutes = d.pop("retrigger_timeout_minutes", UNSET) + retrigger_timeout_minutes: NewAlertUrgencyDataAttributesRetriggerTimeoutMinutes | Unset + if isinstance(_retrigger_timeout_minutes, Unset): + retrigger_timeout_minutes = UNSET + else: + retrigger_timeout_minutes = check_new_alert_urgency_data_attributes_retrigger_timeout_minutes( + _retrigger_timeout_minutes + ) new_alert_urgency_data_attributes = cls( name=name, diff --git a/rootly_sdk/models/new_alert_urgency_data_attributes_retrigger_timeout_minutes.py b/rootly_sdk/models/new_alert_urgency_data_attributes_retrigger_timeout_minutes.py new file mode 100644 index 00000000..280bf17f --- /dev/null +++ b/rootly_sdk/models/new_alert_urgency_data_attributes_retrigger_timeout_minutes.py @@ -0,0 +1,35 @@ +from typing import Literal + +NewAlertUrgencyDataAttributesRetriggerTimeoutMinutes = Literal[ + -1, 10, 20, 30, 40, 50, 60, 90, 120, 180, 240, 300, 360, 720, 1440 +] + +NEW_ALERT_URGENCY_DATA_ATTRIBUTES_RETRIGGER_TIMEOUT_MINUTES_VALUES: set[ + NewAlertUrgencyDataAttributesRetriggerTimeoutMinutes +] = { + -1, + 10, + 20, + 30, + 40, + 50, + 60, + 90, + 120, + 180, + 240, + 300, + 360, + 720, + 1440, +} + + +def check_new_alert_urgency_data_attributes_retrigger_timeout_minutes( + value: int, +) -> NewAlertUrgencyDataAttributesRetriggerTimeoutMinutes: + if value in NEW_ALERT_URGENCY_DATA_ATTRIBUTES_RETRIGGER_TIMEOUT_MINUTES_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ALERT_URGENCY_DATA_ATTRIBUTES_RETRIGGER_TIMEOUT_MINUTES_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_alert_urgency_data_type.py b/rootly_sdk/models/new_alert_urgency_data_type.py index 1255acd1..3f5443ea 100644 --- a/rootly_sdk/models/new_alert_urgency_data_type.py +++ b/rootly_sdk/models/new_alert_urgency_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertUrgencyDataType = Literal["alert_urgencies"] @@ -11,5 +11,5 @@ def check_new_alert_urgency_data_type(value: str | None) -> NewAlertUrgencyDataT if value is None: return None if value in NEW_ALERT_URGENCY_DATA_TYPE_VALUES: - return cast(NewAlertUrgencyDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ALERT_URGENCY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_alerts_source.py b/rootly_sdk/models/new_alerts_source.py index ecb9f870..ff96bdf7 100644 --- a/rootly_sdk/models/new_alerts_source.py +++ b/rootly_sdk/models/new_alerts_source.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_alerts_source_data import NewAlertsSourceData @@ -18,14 +19,13 @@ class NewAlertsSource: data (NewAlertsSourceData): """ - data: "NewAlertsSourceData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewAlertsSourceData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_alerts_source.additional_properties = d return new_alerts_source - - @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_alerts_source_data.py b/rootly_sdk/models/new_alerts_source_data.py index ab42b780..708e8f6f 100644 --- a/rootly_sdk/models/new_alerts_source_data.py +++ b/rootly_sdk/models/new_alerts_source_data.py @@ -1,8 +1,9 @@ +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_alerts_source_data_type import NewAlertsSourceDataType, check_new_alerts_source_data_type @@ -22,8 +23,7 @@ class NewAlertsSourceData: """ type_: NewAlertsSourceDataType - attributes: "NewAlertsSourceDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewAlertsSourceDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_alerts_source_data.additional_properties = d return new_alerts_source_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_alerts_source_data_attributes.py b/rootly_sdk/models/new_alerts_source_data_attributes.py index 18dec5e7..b07161d5 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -39,50 +41,48 @@ class NewAlertsSourceDataAttributes: """ Attributes: name (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, 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, + 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, deduplication_key_kind and deduplication_key_path are required. - 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_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 from the request body. - 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 + 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 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. + apply to generic_webhook sources; `accept_threaded_emails`, `notification_target_type` and + `notification_target_id` apply to email sources. + 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. """ name: str - 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 + 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 alert_source_urgency_rules_attributes: ( - Unset | list["NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem"] + list[NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem] | 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 + sourceable_attributes: NewAlertsSourceDataAttributesSourceableAttributesType0 | None | Unset = UNSET + resolution_rule_attributes: NewAlertsSourceDataAttributesResolutionRuleAttributesType0 | None | Unset = UNSET + alert_source_fields_attributes: list[NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem] | Unset = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_alerts_source_data_attributes_alert_template_attributes_type_0 import ( @@ -99,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - source_type: Unset | str = UNSET + source_type: str | Unset = UNSET if not isinstance(self.source_type, Unset): source_type = self.source_type @@ -107,27 +107,27 @@ def to_dict(self) -> dict[str, Any]: deduplicate_alerts_by_key = self.deduplicate_alerts_by_key - deduplication_key_kind: Unset | str = UNSET + deduplication_key_kind: str | Unset = UNSET if not isinstance(self.deduplication_key_kind, Unset): deduplication_key_kind = self.deduplication_key_kind - deduplication_key_path: None | Unset | str + deduplication_key_path: None | str | Unset if isinstance(self.deduplication_key_path, Unset): deduplication_key_path = UNSET else: deduplication_key_path = self.deduplication_key_path - deduplication_key_regexp: None | Unset | str + deduplication_key_regexp: None | str | Unset if isinstance(self.deduplication_key_regexp, Unset): deduplication_key_regexp = UNSET else: deduplication_key_regexp = self.deduplication_key_regexp - owner_group_ids: Unset | list[str] = UNSET + owner_group_ids: list[str] | Unset = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - alert_template_attributes: None | Unset | dict[str, Any] + alert_template_attributes: dict[str, Any] | None | Unset if isinstance(self.alert_template_attributes, Unset): alert_template_attributes = UNSET elif isinstance(self.alert_template_attributes, NewAlertsSourceDataAttributesAlertTemplateAttributesType0): @@ -135,14 +135,14 @@ def to_dict(self) -> dict[str, Any]: else: alert_template_attributes = self.alert_template_attributes - alert_source_urgency_rules_attributes: Unset | list[dict[str, Any]] = UNSET + alert_source_urgency_rules_attributes: list[dict[str, Any]] | Unset = 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: None | Unset | dict[str, Any] + sourceable_attributes: dict[str, Any] | None | Unset if isinstance(self.sourceable_attributes, Unset): sourceable_attributes = UNSET elif isinstance(self.sourceable_attributes, NewAlertsSourceDataAttributesSourceableAttributesType0): @@ -150,7 +150,7 @@ def to_dict(self) -> dict[str, Any]: else: sourceable_attributes = self.sourceable_attributes - resolution_rule_attributes: None | Unset | dict[str, Any] + resolution_rule_attributes: dict[str, Any] | None | Unset if isinstance(self.resolution_rule_attributes, Unset): resolution_rule_attributes = UNSET elif isinstance(self.resolution_rule_attributes, NewAlertsSourceDataAttributesResolutionRuleAttributesType0): @@ -158,7 +158,7 @@ def to_dict(self) -> dict[str, Any]: else: resolution_rule_attributes = self.resolution_rule_attributes - alert_source_fields_attributes: Unset | list[dict[str, Any]] = UNSET + alert_source_fields_attributes: list[dict[str, Any]] | Unset = 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: @@ -225,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: Unset | NewAlertsSourceDataAttributesSourceType + source_type: NewAlertsSourceDataAttributesSourceType | Unset if isinstance(_source_type, Unset): source_type = UNSET else: @@ -236,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: Unset | NewAlertsSourceDataAttributesDeduplicationKeyKind + deduplication_key_kind: NewAlertsSourceDataAttributesDeduplicationKeyKind | Unset if isinstance(_deduplication_key_kind, Unset): deduplication_key_kind = UNSET else: @@ -244,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 | Unset | str: + def _parse_deduplication_key_path(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) deduplication_key_path = _parse_deduplication_key_path(d.pop("deduplication_key_path", UNSET)) - def _parse_deduplication_key_regexp(data: object) -> None | Unset | str: + def _parse_deduplication_key_regexp(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) deduplication_key_regexp = _parse_deduplication_key_regexp(d.pop("deduplication_key_regexp", UNSET)) @@ -266,7 +266,7 @@ def _parse_deduplication_key_regexp(data: object) -> None | Unset | str: def _parse_alert_template_attributes( data: object, - ) -> Union["NewAlertsSourceDataAttributesAlertTemplateAttributesType0", None, Unset]: + ) -> NewAlertsSourceDataAttributesAlertTemplateAttributesType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -279,26 +279,30 @@ def _parse_alert_template_attributes( ) return alert_template_attributes_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["NewAlertsSourceDataAttributesAlertTemplateAttributesType0", None, Unset], data) + return cast(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) - 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: ( + 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 + ) ) - ) - 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, - ) -> Union["NewAlertsSourceDataAttributesSourceableAttributesType0", None, Unset]: + ) -> NewAlertsSourceDataAttributesSourceableAttributesType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -309,15 +313,15 @@ def _parse_sourceable_attributes( sourceable_attributes_type_0 = NewAlertsSourceDataAttributesSourceableAttributesType0.from_dict(data) return sourceable_attributes_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["NewAlertsSourceDataAttributesSourceableAttributesType0", None, Unset], data) + return cast(NewAlertsSourceDataAttributesSourceableAttributesType0 | None | Unset, data) sourceable_attributes = _parse_sourceable_attributes(d.pop("sourceable_attributes", UNSET)) def _parse_resolution_rule_attributes( data: object, - ) -> Union["NewAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset]: + ) -> NewAlertsSourceDataAttributesResolutionRuleAttributesType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -330,22 +334,26 @@ def _parse_resolution_rule_attributes( ) return resolution_rule_attributes_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["NewAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset], data) + return cast(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) - 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: 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 + ) ) - ) - 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 9604cf22..45a64665 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,8 +1,9 @@ +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 ..types import UNSET, Unset @@ -13,26 +14,25 @@ class NewAlertsSourceDataAttributesAlertSourceFieldsAttributesItem: """ Attributes: - 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): 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: Unset | str = UNSET - template_body: None | Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + alert_field_id: str | Unset = UNSET + template_body: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: alert_field_id = self.alert_field_id - template_body: None | Unset | str + template_body: None | str | Unset if isinstance(self.template_body, Unset): template_body = UNSET else: template_body = self.template_body field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if alert_field_id is not UNSET: field_dict["alert_field_id"] = alert_field_id @@ -46,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 | Unset | str: + def _parse_template_body(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) template_body = _parse_template_body(d.pop("template_body", UNSET)) @@ -60,21 +60,4 @@ def _parse_template_body(data: object) -> None | Unset | str: template_body=template_body, ) - new_alerts_source_data_attributes_alert_source_fields_attributes_item.additional_properties = d return new_alerts_source_data_attributes_alert_source_fields_attributes_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_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 936d25df..1eb3a6cb 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,8 +1,9 @@ +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.new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_conditionable_type import ( NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType, @@ -25,64 +26,62 @@ class NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem: """ Attributes: - 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 + json_path (None | str | Unset): JSON path expression to extract a specific value from the alert's payload for + evaluation + operator (NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator | Unset): 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 + value (str | Unset): Value that the extracted payload data is compared to using the specified operator to determine a match - 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_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 - alert_urgency_id (Union[Unset, str]): The ID of the alert urgency + alert_urgency_id (str | Unset): The ID of the alert urgency """ - json_path: None | Unset | str = UNSET - operator: Unset | NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator = UNSET - value: Unset | str = UNSET - conditionable_type: Unset | NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType = ( + json_path: None | str | Unset = UNSET + operator: NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator | Unset = UNSET + value: str | Unset = UNSET + conditionable_type: NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType | 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) + conditionable_id: None | str | Unset = UNSET + kind: NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind | Unset = UNSET + alert_urgency_id: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: - json_path: None | Unset | str + json_path: None | str | Unset if isinstance(self.json_path, Unset): json_path = UNSET else: json_path = self.json_path - operator: Unset | str = UNSET + operator: str | Unset = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: Unset | str = UNSET + conditionable_type: str | Unset = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | Unset | str + conditionable_id: None | str | Unset if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind alert_urgency_id = self.alert_urgency_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if json_path is not UNSET: field_dict["json_path"] = json_path @@ -105,17 +104,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 | Unset | str: + def _parse_json_path(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) json_path = _parse_json_path(d.pop("json_path", UNSET)) _operator = d.pop("operator", UNSET) - operator: Unset | NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator + operator: NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator | Unset if isinstance(_operator, Unset): operator = UNSET else: @@ -126,7 +125,7 @@ def _parse_json_path(data: object) -> None | Unset | str: value = d.pop("value", UNSET) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Unset | NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType + conditionable_type: NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType | Unset if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -136,17 +135,17 @@ def _parse_json_path(data: object) -> None | Unset | str: ) ) - def _parse_conditionable_id(data: object) -> None | Unset | str: + def _parse_conditionable_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: Unset | NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind + kind: NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind | Unset if isinstance(_kind, Unset): kind = UNSET else: @@ -164,21 +163,4 @@ def _parse_conditionable_id(data: object) -> None | Unset | str: alert_urgency_id=alert_urgency_id, ) - new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.additional_properties = d return new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_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_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_conditionable_type.py b/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_conditionable_type.py index a9a0f22a..36319604 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_conditionable_type.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_conditionable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType = Literal["AlertField"] @@ -15,7 +15,7 @@ def check_new_alerts_source_data_attributes_alert_source_urgency_rules_attribute if value is None: return None if value in NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_ALERT_SOURCE_URGENCY_RULES_ATTRIBUTES_ITEM_CONDITIONABLE_TYPE_VALUES: - return cast(NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_ALERT_SOURCE_URGENCY_RULES_ATTRIBUTES_ITEM_CONDITIONABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_kind.py b/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_kind.py index 251f41d1..d7e0bb30 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_kind.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind = Literal["alert_field", "payload"] @@ -16,7 +16,7 @@ def check_new_alerts_source_data_attributes_alert_source_urgency_rules_attribute if value is None: return None if value in NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_ALERT_SOURCE_URGENCY_RULES_ATTRIBUTES_ITEM_KIND_VALUES: - return cast(NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_ALERT_SOURCE_URGENCY_RULES_ATTRIBUTES_ITEM_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_operator.py b/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_operator.py index 12eb47c7..f1789508 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_operator.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_operator.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator = Literal[ "contains", "does_not_contain", "is", "is_not" @@ -20,7 +20,7 @@ def check_new_alerts_source_data_attributes_alert_source_urgency_rules_attribute if value is None: return None if value in NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_ALERT_SOURCE_URGENCY_RULES_ATTRIBUTES_ITEM_OPERATOR_VALUES: - return cast(NewAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_ALERT_SOURCE_URGENCY_RULES_ATTRIBUTES_ITEM_OPERATOR_VALUES!r}" ) 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 f4593a89..0e55dc20 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,8 +1,9 @@ +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 ..types import UNSET, Unset @@ -13,37 +14,36 @@ class NewAlertsSourceDataAttributesAlertTemplateAttributesType0: """ Attributes: - 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): The alert title. + description (None | str | Unset): The alert description. + external_url (None | str | Unset): The alert URL. """ - 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) + title: None | str | Unset = UNSET + description: None | str | Unset = UNSET + external_url: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: - title: None | Unset | str + title: None | str | Unset if isinstance(self.title, Unset): title = UNSET else: title = self.title - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - external_url: None | Unset | str + external_url: None | str | Unset if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if title is not UNSET: field_dict["title"] = title @@ -58,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 | Unset | str: + def _parse_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_external_url(data: object) -> None | Unset | str: + def _parse_external_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) @@ -91,21 +91,4 @@ def _parse_external_url(data: object) -> None | Unset | str: external_url=external_url, ) - new_alerts_source_data_attributes_alert_template_attributes_type_0.additional_properties = d return new_alerts_source_data_attributes_alert_template_attributes_type_0 - - @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_alerts_source_data_attributes_deduplication_key_kind.py b/rootly_sdk/models/new_alerts_source_data_attributes_deduplication_key_kind.py index d1d118f1..e08448c8 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_deduplication_key_kind.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_deduplication_key_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertsSourceDataAttributesDeduplicationKeyKind = Literal["payload"] @@ -15,7 +15,7 @@ def check_new_alerts_source_data_attributes_deduplication_key_kind( if value is None: return None if value in NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_DEDUPLICATION_KEY_KIND_VALUES: - return cast(NewAlertsSourceDataAttributesDeduplicationKeyKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_DEDUPLICATION_KEY_KIND_VALUES!r}" ) 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 534a697e..a395dbae 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,8 +1,9 @@ +from __future__ import annotations + 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 ..models.new_alerts_source_data_attributes_resolution_rule_attributes_type_0_condition_type import ( NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType, @@ -32,76 +33,72 @@ class NewAlertsSourceDataAttributesResolutionRuleAttributesType0: """Provide additional attributes for email alerts source Attributes: - 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): 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: Unset | bool = UNSET - condition_type: Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType = UNSET + enabled: bool | Unset = UNSET + condition_type: NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType | Unset = UNSET identifier_matchable_type: ( - Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType + NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType | Unset ) = UNSET - identifier_matchable_id: None | Unset | str = UNSET + identifier_matchable_id: None | str | Unset = UNSET identifier_reference_kind: ( - Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind + NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind | Unset ) = UNSET - identifier_json_path: None | Unset | str = UNSET - identifier_value_regex: None | Unset | str = UNSET + identifier_json_path: None | str | Unset = UNSET + identifier_value_regex: None | str | Unset = UNSET conditions_attributes: ( - Unset | list["NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem"] + list[NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem] | Unset ) = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: enabled = self.enabled - condition_type: Unset | str = UNSET + condition_type: str | Unset = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - identifier_matchable_type: Unset | str = UNSET + identifier_matchable_type: str | Unset = UNSET if not isinstance(self.identifier_matchable_type, Unset): identifier_matchable_type = self.identifier_matchable_type - identifier_matchable_id: None | Unset | str + identifier_matchable_id: None | str | Unset if isinstance(self.identifier_matchable_id, Unset): identifier_matchable_id = UNSET else: identifier_matchable_id = self.identifier_matchable_id - identifier_reference_kind: Unset | str = UNSET + identifier_reference_kind: str | Unset = UNSET if not isinstance(self.identifier_reference_kind, Unset): identifier_reference_kind = self.identifier_reference_kind - identifier_json_path: None | Unset | str + identifier_json_path: None | str | Unset if isinstance(self.identifier_json_path, Unset): identifier_json_path = UNSET else: identifier_json_path = self.identifier_json_path - identifier_value_regex: None | Unset | str + identifier_value_regex: None | str | Unset if isinstance(self.identifier_value_regex, Unset): identifier_value_regex = UNSET else: identifier_value_regex = self.identifier_value_regex - conditions_attributes: Unset | list[dict[str, Any]] = UNSET + conditions_attributes: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.conditions_attributes, Unset): conditions_attributes = [] for conditions_attributes_item_data in self.conditions_attributes: @@ -109,7 +106,7 @@ def to_dict(self) -> dict[str, Any]: conditions_attributes.append(conditions_attributes_item) field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if enabled is not UNSET: field_dict["enabled"] = enabled @@ -140,7 +137,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: Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType + condition_type: NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType | Unset if isinstance(_condition_type, Unset): condition_type = UNSET else: @@ -150,7 +147,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: ( - Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType + NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType | Unset ) if isinstance(_identifier_matchable_type, Unset): identifier_matchable_type = UNSET @@ -161,18 +158,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) ) - def _parse_identifier_matchable_id(data: object) -> None | Unset | str: + def _parse_identifier_matchable_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: ( - Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind + NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind | Unset ) if isinstance(_identifier_reference_kind, Unset): identifier_reference_kind = UNSET @@ -183,34 +180,38 @@ def _parse_identifier_matchable_id(data: object) -> None | Unset | str: ) ) - def _parse_identifier_json_path(data: object) -> None | Unset | str: + def _parse_identifier_json_path(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) identifier_json_path = _parse_identifier_json_path(d.pop("identifier_json_path", UNSET)) - def _parse_identifier_value_regex(data: object) -> None | Unset | str: + def _parse_identifier_value_regex(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) identifier_value_regex = _parse_identifier_value_regex(d.pop("identifier_value_regex", UNSET)) - conditions_attributes = [] _conditions_attributes = d.pop("conditions_attributes", UNSET) - for conditions_attributes_item_data in _conditions_attributes or []: - conditions_attributes_item = ( - NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem.from_dict( - conditions_attributes_item_data + 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 + ) ) - ) - 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, @@ -223,21 +224,4 @@ def _parse_identifier_value_regex(data: object) -> None | Unset | str: conditions_attributes=conditions_attributes, ) - new_alerts_source_data_attributes_resolution_rule_attributes_type_0.additional_properties = d return new_alerts_source_data_attributes_resolution_rule_attributes_type_0 - - @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_alerts_source_data_attributes_resolution_rule_attributes_type_0_condition_type.py b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_condition_type.py index d9930903..735c2ba8 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_condition_type.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType = Literal["all", "any"] @@ -16,7 +16,7 @@ def check_new_alerts_source_data_attributes_resolution_rule_attributes_type_0_co if value is None: return None if value in NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITION_TYPE_VALUES: - return cast(NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITION_TYPE_VALUES!r}" ) 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 111fd8fc..1d9fc198 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,8 +1,9 @@ +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.new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_conditionable_type import ( NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType, @@ -25,61 +26,59 @@ class NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem: """ Attributes: - field (Union[None, Unset, str]): JSON path expression to extract a specific value from the alert's payload for + field (None | str | Unset): JSON path expression to extract a specific value from the alert's payload for evaluation - 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 + 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 determine a match - conditionable_type (Union[Unset, - NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType]): The type + 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 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 | Unset | str = UNSET - operator: Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator = UNSET - value: Unset | str = UNSET + field: None | str | Unset = UNSET + operator: NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset = UNSET + value: str | Unset = UNSET conditionable_type: ( - Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType + NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset ) = UNSET - conditionable_id: None | Unset | str = UNSET - kind: Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + conditionable_id: None | str | Unset = UNSET + kind: NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset = UNSET def to_dict(self) -> dict[str, Any]: - field: None | Unset | str + field: None | str | Unset if isinstance(self.field, Unset): field = UNSET else: field = self.field - operator: Unset | str = UNSET + operator: str | Unset = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: Unset | str = UNSET + conditionable_type: str | Unset = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | Unset | str + conditionable_id: None | str | Unset if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if field is not UNSET: field_dict["field"] = field @@ -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 | Unset | str: + def _parse_field(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) field = _parse_field(d.pop("field", UNSET)) _operator = d.pop("operator", UNSET) - operator: Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator + operator: NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset if isinstance(_operator, Unset): operator = UNSET else: @@ -122,7 +121,7 @@ def _parse_field(data: object) -> None | Unset | str: _conditionable_type = d.pop("conditionable_type", UNSET) conditionable_type: ( - Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType + NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset ) if isinstance(_conditionable_type, Unset): conditionable_type = UNSET @@ -131,17 +130,17 @@ def _parse_field(data: object) -> None | Unset | str: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | Unset | str: + def _parse_conditionable_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: Unset | NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind + kind: NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset if isinstance(_kind, Unset): kind = UNSET else: @@ -158,21 +157,4 @@ def _parse_conditionable_id(data: object) -> None | Unset | str: kind=kind, ) - new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.additional_properties = d return new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_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_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_conditionable_type.py b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_conditionable_type.py index c2e9db2e..6c765e47 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_conditionable_type.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_conditionable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType = Literal[ "AlertField" @@ -20,9 +20,7 @@ def check_new_alerts_source_data_attributes_resolution_rule_attributes_type_0_co value in NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITIONS_ATTRIBUTES_ITEM_CONDITIONABLE_TYPE_VALUES ): - return cast( - NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType, value - ) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITIONS_ATTRIBUTES_ITEM_CONDITIONABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_kind.py b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_kind.py index 5c8bca1d..ddf96e19 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_kind.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind = Literal[ "alert_field", "payload" @@ -21,7 +21,7 @@ def check_new_alerts_source_data_attributes_resolution_rule_attributes_type_0_co value in NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITIONS_ATTRIBUTES_ITEM_KIND_VALUES ): - return cast(NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITIONS_ATTRIBUTES_ITEM_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_operator.py b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_operator.py index 7db7b7db..21f4b4f5 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_operator.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_operator.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator = Literal[ "contains", "does_not_contain", "ends_with", "is", "is_not", "starts_with" @@ -25,7 +25,7 @@ def check_new_alerts_source_data_attributes_resolution_rule_attributes_type_0_co value in NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITIONS_ATTRIBUTES_ITEM_OPERATOR_VALUES ): - return cast(NewAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITIONS_ATTRIBUTES_ITEM_OPERATOR_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_identifier_matchable_type.py b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_identifier_matchable_type.py index b21eebfa..72947de8 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_identifier_matchable_type.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_identifier_matchable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType = Literal["AlertField"] @@ -15,7 +15,7 @@ def check_new_alerts_source_data_attributes_resolution_rule_attributes_type_0_id if value is None: return None if value in NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_IDENTIFIER_MATCHABLE_TYPE_VALUES: - return cast(NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_IDENTIFIER_MATCHABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_identifier_reference_kind.py b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_identifier_reference_kind.py index 20357455..94298b37 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_identifier_reference_kind.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_resolution_rule_attributes_type_0_identifier_reference_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind = Literal["alert_field", "payload"] @@ -16,7 +16,7 @@ def check_new_alerts_source_data_attributes_resolution_rule_attributes_type_0_id if value is None: return None if value in NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_IDENTIFIER_REFERENCE_KIND_VALUES: - return cast(NewAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_IDENTIFIER_REFERENCE_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_source_type.py b/rootly_sdk/models/new_alerts_source_data_attributes_source_type.py index e479af82..2af426b8 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_source_type.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_source_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertsSourceDataAttributesSourceType = Literal[ "alertmanager", @@ -61,7 +61,7 @@ def check_new_alerts_source_data_attributes_source_type( if value is None: return None if value in NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_SOURCE_TYPE_VALUES: - return cast(NewAlertsSourceDataAttributesSourceType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_SOURCE_TYPE_VALUES!r}" ) 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 4b8318ca..a3cb823c 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,9 +1,14 @@ +from __future__ import annotations + 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 ..models.new_alerts_source_data_attributes_sourceable_attributes_type_0_notification_target_type import ( + NewAlertsSourceDataAttributesSourceableAttributesType0NotificationTargetType, + check_new_alerts_source_data_attributes_sourceable_attributes_type_0_notification_target_type, +) from ..types import UNSET, Unset if TYPE_CHECKING: @@ -18,31 +23,42 @@ @_attrs_define class NewAlertsSourceDataAttributesSourceableAttributesType0: """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. + `field_mappings_attributes` apply to generic_webhook sources; `accept_threaded_emails`, `notification_target_type` + and `notification_target_id` apply to email sources. Attributes: - auto_resolve (Union[Unset, bool]): Set this to true to auto-resolve alerts based on field_mappings_attributes + auto_resolve (bool | Unset): 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 + 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 + notification_target_type (NewAlertsSourceDataAttributesSourceableAttributesType0NotificationTargetType | Unset): + Email sources only. The type of the notification target every alert from this source pages directly; While it + points to an active, pageable target, Alert Routes are not evaluated. Only used when the `email-alert-source- + notification-target` feature flag is on for the team. + notification_target_id (None | str | Unset): Email sources only. The ID of the notification target. Set to null + to clear it; this also clears `notification_target_type`. Only used when the `email-alert-source-notification- + target` feature flag is on for the team. + field_mappings_attributes + (list[NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem] | Unset): Specify rules + to auto resolve alerts """ - auto_resolve: Unset | bool = UNSET - resolve_state: None | Unset | str = UNSET - accept_threaded_emails: Unset | bool = UNSET + auto_resolve: bool | Unset = UNSET + resolve_state: None | str | Unset = UNSET + accept_threaded_emails: bool | Unset = UNSET + notification_target_type: NewAlertsSourceDataAttributesSourceableAttributesType0NotificationTargetType | Unset = ( + UNSET + ) + notification_target_id: None | str | Unset = UNSET field_mappings_attributes: ( - Unset | list["NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem"] + list[NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem] | Unset ) = 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 | Unset | str + resolve_state: None | str | Unset if isinstance(self.resolve_state, Unset): resolve_state = UNSET else: @@ -50,7 +66,17 @@ def to_dict(self) -> dict[str, Any]: accept_threaded_emails = self.accept_threaded_emails - field_mappings_attributes: Unset | list[dict[str, Any]] = UNSET + notification_target_type: str | Unset = UNSET + if not isinstance(self.notification_target_type, Unset): + notification_target_type = self.notification_target_type + + notification_target_id: None | str | Unset + if isinstance(self.notification_target_id, Unset): + notification_target_id = UNSET + else: + notification_target_id = self.notification_target_id + + field_mappings_attributes: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.field_mappings_attributes, Unset): field_mappings_attributes = [] for field_mappings_attributes_item_data in self.field_mappings_attributes: @@ -58,7 +84,7 @@ def to_dict(self) -> dict[str, Any]: field_mappings_attributes.append(field_mappings_attributes_item) field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if auto_resolve is not UNSET: field_dict["auto_resolve"] = auto_resolve @@ -66,6 +92,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["resolve_state"] = resolve_state if accept_threaded_emails is not UNSET: field_dict["accept_threaded_emails"] = accept_threaded_emails + if notification_target_type is not UNSET: + field_dict["notification_target_type"] = notification_target_type + if notification_target_id is not UNSET: + field_dict["notification_target_id"] = notification_target_id if field_mappings_attributes is not UNSET: field_dict["field_mappings_attributes"] = field_mappings_attributes @@ -80,50 +110,59 @@ 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 | Unset | str: + def _parse_resolve_state(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) - for field_mappings_attributes_item_data in _field_mappings_attributes or []: - field_mappings_attributes_item = ( - NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem.from_dict( - field_mappings_attributes_item_data + _notification_target_type = d.pop("notification_target_type", UNSET) + notification_target_type: NewAlertsSourceDataAttributesSourceableAttributesType0NotificationTargetType | Unset + if isinstance(_notification_target_type, Unset): + notification_target_type = UNSET + else: + notification_target_type = ( + check_new_alerts_source_data_attributes_sourceable_attributes_type_0_notification_target_type( + _notification_target_type ) ) - field_mappings_attributes.append(field_mappings_attributes_item) + def _parse_notification_target_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + notification_target_id = _parse_notification_target_id(d.pop("notification_target_id", UNSET)) + + _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 + ) + ) + + field_mappings_attributes.append(field_mappings_attributes_item) new_alerts_source_data_attributes_sourceable_attributes_type_0 = cls( auto_resolve=auto_resolve, resolve_state=resolve_state, accept_threaded_emails=accept_threaded_emails, + notification_target_type=notification_target_type, + notification_target_id=notification_target_id, field_mappings_attributes=field_mappings_attributes, ) - new_alerts_source_data_attributes_sourceable_attributes_type_0.additional_properties = d return new_alerts_source_data_attributes_sourceable_attributes_type_0 - - @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_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 1aa55748..a4503ef8 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,8 +1,9 @@ +from __future__ import annotations + 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.new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item_field import ( NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField, @@ -17,26 +18,25 @@ class NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem: """ Attributes: - 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 + 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 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: Unset | NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField = UNSET - json_path: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + field: NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField | Unset = UNSET + json_path: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: - field: Unset | str = UNSET + field: str | Unset = UNSET if not isinstance(self.field, Unset): field = self.field json_path = self.json_path field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if field is not UNSET: field_dict["field"] = field @@ -49,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: Unset | NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField + field: NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField | Unset if isinstance(_field, Unset): field = UNSET else: @@ -64,21 +64,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: json_path=json_path, ) - new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.additional_properties = d return new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_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_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item_field.py b/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item_field.py index 95f8d47a..b529aaff 100644 --- a/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item_field.py +++ b/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item_field.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField = Literal[ "alert_description", @@ -32,7 +32,7 @@ def check_new_alerts_source_data_attributes_sourceable_attributes_type_0_field_m value in NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_SOURCEABLE_ATTRIBUTES_TYPE_0_FIELD_MAPPINGS_ATTRIBUTES_ITEM_FIELD_VALUES ): - return cast(NewAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_SOURCEABLE_ATTRIBUTES_TYPE_0_FIELD_MAPPINGS_ATTRIBUTES_ITEM_FIELD_VALUES!r}" ) diff --git a/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0_notification_target_type.py b/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0_notification_target_type.py new file mode 100644 index 00000000..88afc63b --- /dev/null +++ b/rootly_sdk/models/new_alerts_source_data_attributes_sourceable_attributes_type_0_notification_target_type.py @@ -0,0 +1,27 @@ +from typing import Literal + +NewAlertsSourceDataAttributesSourceableAttributesType0NotificationTargetType = Literal[ + "EscalationPolicy", "Functionality", "Group", "Service", "User" +] + +NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_SOURCEABLE_ATTRIBUTES_TYPE_0_NOTIFICATION_TARGET_TYPE_VALUES: set[ + NewAlertsSourceDataAttributesSourceableAttributesType0NotificationTargetType +] = { + "EscalationPolicy", + "Functionality", + "Group", + "Service", + "User", +} + + +def check_new_alerts_source_data_attributes_sourceable_attributes_type_0_notification_target_type( + value: str | None, +) -> NewAlertsSourceDataAttributesSourceableAttributesType0NotificationTargetType | None: + if value is None: + return None + if value in NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_SOURCEABLE_ATTRIBUTES_TYPE_0_NOTIFICATION_TARGET_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ALERTS_SOURCE_DATA_ATTRIBUTES_SOURCEABLE_ATTRIBUTES_TYPE_0_NOTIFICATION_TARGET_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_alerts_source_data_type.py b/rootly_sdk/models/new_alerts_source_data_type.py index 5e64a41d..95c58733 100644 --- a/rootly_sdk/models/new_alerts_source_data_type.py +++ b/rootly_sdk/models/new_alerts_source_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAlertsSourceDataType = Literal["alert_sources"] @@ -11,5 +11,5 @@ def check_new_alerts_source_data_type(value: str | None) -> NewAlertsSourceDataT if value is None: return None if value in NEW_ALERTS_SOURCE_DATA_TYPE_VALUES: - return cast(NewAlertsSourceDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ALERTS_SOURCE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_api_key.py b/rootly_sdk/models/new_api_key.py index 90819273..afd02eb5 100644 --- a/rootly_sdk/models/new_api_key.py +++ b/rootly_sdk/models/new_api_key.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_api_key_data import NewApiKeyData @@ -18,14 +19,13 @@ class NewApiKey: data (NewApiKeyData): """ - data: "NewApiKeyData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewApiKeyData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_api_key.additional_properties = d return new_api_key - - @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_api_key_data.py b/rootly_sdk/models/new_api_key_data.py index dd7533a0..c5bd5c36 100644 --- a/rootly_sdk/models/new_api_key_data.py +++ b/rootly_sdk/models/new_api_key_data.py @@ -1,8 +1,9 @@ +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_api_key_data_type import NewApiKeyDataType, check_new_api_key_data_type @@ -22,8 +23,7 @@ class NewApiKeyData: """ type_: NewApiKeyDataType - attributes: "NewApiKeyDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewApiKeyDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_api_key_data.additional_properties = d return new_api_key_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_api_key_data_attributes.py b/rootly_sdk/models/new_api_key_data_attributes.py index 207abe0d..6e284bea 100644 --- a/rootly_sdk/models/new_api_key_data_attributes.py +++ b/rootly_sdk/models/new_api_key_data_attributes.py @@ -1,9 +1,10 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast from attrs import define as _attrs_define -from dateutil.parser import isoparse from ..models.new_api_key_data_attributes_kind import ( NewApiKeyDataAttributesKind, @@ -21,19 +22,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 (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 + 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 """ name: str kind: NewApiKeyDataAttributesKind expires_at: datetime.datetime - 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 + 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 def to_dict(self) -> dict[str, Any]: name = self.name @@ -42,25 +43,25 @@ def to_dict(self) -> dict[str, Any]: expires_at = self.expires_at.isoformat() - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - group_id: None | Unset | str + group_id: None | str | Unset if isinstance(self.group_id, Unset): group_id = UNSET else: group_id = self.group_id - role_id: None | Unset | str + role_id: None | str | Unset if isinstance(self.role_id, Unset): role_id = UNSET else: role_id = self.role_id - on_call_role_id: None | Unset | str + on_call_role_id: None | str | Unset if isinstance(self.on_call_role_id, Unset): on_call_role_id = UNSET else: @@ -93,41 +94,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: kind = check_new_api_key_data_attributes_kind(d.pop("kind")) - expires_at = isoparse(d.pop("expires_at")) + expires_at = datetime.datetime.fromisoformat(d.pop("expires_at")) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_group_id(data: object) -> None | Unset | str: + def _parse_group_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) group_id = _parse_group_id(d.pop("group_id", UNSET)) - def _parse_role_id(data: object) -> None | Unset | str: + def _parse_role_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) role_id = _parse_role_id(d.pop("role_id", UNSET)) - def _parse_on_call_role_id(data: object) -> None | Unset | str: + def _parse_on_call_role_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) on_call_role_id = _parse_on_call_role_id(d.pop("on_call_role_id", UNSET)) diff --git a/rootly_sdk/models/new_api_key_data_attributes_kind.py b/rootly_sdk/models/new_api_key_data_attributes_kind.py index 2c61f87b..f5a9c4ce 100644 --- a/rootly_sdk/models/new_api_key_data_attributes_kind.py +++ b/rootly_sdk/models/new_api_key_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewApiKeyDataAttributesKind = Literal["organization", "personal", "team"] @@ -13,5 +13,5 @@ def check_new_api_key_data_attributes_kind(value: str | None) -> NewApiKeyDataAt if value is None: return None if value in NEW_API_KEY_DATA_ATTRIBUTES_KIND_VALUES: - return cast(NewApiKeyDataAttributesKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_API_KEY_DATA_ATTRIBUTES_KIND_VALUES!r}") diff --git a/rootly_sdk/models/new_api_key_data_type.py b/rootly_sdk/models/new_api_key_data_type.py index e46744fa..4754514e 100644 --- a/rootly_sdk/models/new_api_key_data_type.py +++ b/rootly_sdk/models/new_api_key_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewApiKeyDataType = Literal["api_keys"] @@ -11,5 +11,5 @@ def check_new_api_key_data_type(value: str | None) -> NewApiKeyDataType | None: if value is None: return None if value in NEW_API_KEY_DATA_TYPE_VALUES: - return cast(NewApiKeyDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_API_KEY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_authorization.py b/rootly_sdk/models/new_authorization.py index 8aa7035b..03985d08 100644 --- a/rootly_sdk/models/new_authorization.py +++ b/rootly_sdk/models/new_authorization.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_authorization_data import NewAuthorizationData @@ -18,14 +19,13 @@ class NewAuthorization: data (NewAuthorizationData): """ - data: "NewAuthorizationData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewAuthorizationData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_authorization.additional_properties = d return new_authorization - - @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_authorization_data.py b/rootly_sdk/models/new_authorization_data.py index b92c08f5..17c874f5 100644 --- a/rootly_sdk/models/new_authorization_data.py +++ b/rootly_sdk/models/new_authorization_data.py @@ -1,8 +1,9 @@ +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_authorization_data_type import NewAuthorizationDataType, check_new_authorization_data_type @@ -22,8 +23,7 @@ class NewAuthorizationData: """ type_: NewAuthorizationDataType - attributes: "NewAuthorizationDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewAuthorizationDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_authorization_data.additional_properties = d return new_authorization_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_authorization_data_attributes.py b/rootly_sdk/models/new_authorization_data_attributes.py index 937caafc..b0ef4f6f 100644 --- a/rootly_sdk/models/new_authorization_data_attributes.py +++ b/rootly_sdk/models/new_authorization_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_authorization_data_attributes_authorizable_type.py b/rootly_sdk/models/new_authorization_data_attributes_authorizable_type.py index 57d5ec9a..3d017e25 100644 --- a/rootly_sdk/models/new_authorization_data_attributes_authorizable_type.py +++ b/rootly_sdk/models/new_authorization_data_attributes_authorizable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAuthorizationDataAttributesAuthorizableType = Literal["Dashboard"] @@ -13,7 +13,7 @@ def check_new_authorization_data_attributes_authorizable_type( if value is None: return None if value in NEW_AUTHORIZATION_DATA_ATTRIBUTES_AUTHORIZABLE_TYPE_VALUES: - return cast(NewAuthorizationDataAttributesAuthorizableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_AUTHORIZATION_DATA_ATTRIBUTES_AUTHORIZABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_authorization_data_attributes_grantee_type.py b/rootly_sdk/models/new_authorization_data_attributes_grantee_type.py index 13f4bfe5..95016627 100644 --- a/rootly_sdk/models/new_authorization_data_attributes_grantee_type.py +++ b/rootly_sdk/models/new_authorization_data_attributes_grantee_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAuthorizationDataAttributesGranteeType = Literal["Team", "User"] @@ -14,7 +14,7 @@ def check_new_authorization_data_attributes_grantee_type( if value is None: return None if value in NEW_AUTHORIZATION_DATA_ATTRIBUTES_GRANTEE_TYPE_VALUES: - return cast(NewAuthorizationDataAttributesGranteeType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_AUTHORIZATION_DATA_ATTRIBUTES_GRANTEE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_authorization_data_attributes_permissions_item.py b/rootly_sdk/models/new_authorization_data_attributes_permissions_item.py index 5255e635..19c27e80 100644 --- a/rootly_sdk/models/new_authorization_data_attributes_permissions_item.py +++ b/rootly_sdk/models/new_authorization_data_attributes_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAuthorizationDataAttributesPermissionsItem = Literal["authorize", "destroy", "read", "update"] @@ -16,7 +16,7 @@ def check_new_authorization_data_attributes_permissions_item( if value is None: return None if value in NEW_AUTHORIZATION_DATA_ATTRIBUTES_PERMISSIONS_ITEM_VALUES: - return cast(NewAuthorizationDataAttributesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_AUTHORIZATION_DATA_ATTRIBUTES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_authorization_data_type.py b/rootly_sdk/models/new_authorization_data_type.py index 1ad5f878..4cf6fae3 100644 --- a/rootly_sdk/models/new_authorization_data_type.py +++ b/rootly_sdk/models/new_authorization_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewAuthorizationDataType = Literal["authorizations"] @@ -11,5 +11,5 @@ def check_new_authorization_data_type(value: str | None) -> NewAuthorizationData if value is None: return None if value in NEW_AUTHORIZATION_DATA_TYPE_VALUES: - return cast(NewAuthorizationDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_AUTHORIZATION_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_catalog.py b/rootly_sdk/models/new_catalog.py index 48c41be3..21fae8ef 100644 --- a/rootly_sdk/models/new_catalog.py +++ b/rootly_sdk/models/new_catalog.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_catalog_data import NewCatalogData @@ -18,14 +19,13 @@ class NewCatalog: data (NewCatalogData): """ - data: "NewCatalogData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewCatalogData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_catalog.additional_properties = d return new_catalog - - @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_catalog_checklist_template.py b/rootly_sdk/models/new_catalog_checklist_template.py index a2365553..1598b250 100644 --- a/rootly_sdk/models/new_catalog_checklist_template.py +++ b/rootly_sdk/models/new_catalog_checklist_template.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_catalog_checklist_template_data import NewCatalogChecklistTemplateData @@ -18,14 +19,13 @@ class NewCatalogChecklistTemplate: data (NewCatalogChecklistTemplateData): """ - data: "NewCatalogChecklistTemplateData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewCatalogChecklistTemplateData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_catalog_checklist_template.additional_properties = d return new_catalog_checklist_template - - @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_catalog_checklist_template_data.py b/rootly_sdk/models/new_catalog_checklist_template_data.py index 9bc4435b..7b927f6c 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data.py @@ -1,8 +1,9 @@ +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_catalog_checklist_template_data_type import ( NewCatalogChecklistTemplateDataType, @@ -25,8 +26,7 @@ class NewCatalogChecklistTemplateData: """ type_: NewCatalogChecklistTemplateDataType - attributes: "NewCatalogChecklistTemplateDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewCatalogChecklistTemplateDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_catalog_checklist_template_data.additional_properties = d return new_catalog_checklist_template_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_catalog_checklist_template_data_attributes.py b/rootly_sdk/models/new_catalog_checklist_template_data_attributes.py index 3720364b..1b0cc828 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data_attributes.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -35,33 +37,30 @@ class NewCatalogChecklistTemplateDataAttributes: name (str): The name of the checklist template catalog_type (NewCatalogChecklistTemplateDataAttributesCatalogType): The catalog type scope_type (NewCatalogChecklistTemplateDataAttributesScopeType): The scope type - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + 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 """ name: str catalog_type: NewCatalogChecklistTemplateDataAttributesCatalogType scope_type: NewCatalogChecklistTemplateDataAttributesScopeType - slug: None | Unset | str = UNSET - description: None | Unset | str = UNSET - scope_id: Unset | str = UNSET + slug: None | str | Unset = UNSET + description: None | str | Unset = UNSET + scope_id: str | Unset = UNSET fields: ( - None - | Unset - | list[ - Union[ - "NewCatalogChecklistTemplateDataAttributesBuiltinField", - "NewCatalogChecklistTemplateDataAttributesCustomField", - ] + list[ + NewCatalogChecklistTemplateDataAttributesBuiltinField | NewCatalogChecklistTemplateDataAttributesCustomField ] + | None + | Unset ) = UNSET - owners: None | Unset | list["NewCatalogChecklistTemplateDataAttributesOwnersType0Item"] = UNSET + owners: list[NewCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_catalog_checklist_template_data_attributes_builtin_field import ( @@ -74,13 +73,13 @@ def to_dict(self) -> dict[str, Any]: scope_type: str = self.scope_type - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -88,7 +87,7 @@ def to_dict(self) -> dict[str, Any]: scope_id = self.scope_id - fields: None | Unset | list[dict[str, Any]] + fields: list[dict[str, Any]] | None | Unset if isinstance(self.fields, Unset): fields = UNSET elif isinstance(self.fields, list): @@ -105,7 +104,7 @@ def to_dict(self) -> dict[str, Any]: else: fields = self.fields - owners: None | Unset | list[dict[str, Any]] + owners: list[dict[str, Any]] | None | Unset if isinstance(self.owners, Unset): owners = UNSET elif isinstance(self.owners, list): @@ -158,21 +157,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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) @@ -181,14 +180,12 @@ def _parse_description(data: object) -> None | Unset | str: def _parse_fields( data: object, ) -> ( - None - | Unset - | list[ - Union[ - "NewCatalogChecklistTemplateDataAttributesBuiltinField", - "NewCatalogChecklistTemplateDataAttributesCustomField", - ] + list[ + NewCatalogChecklistTemplateDataAttributesBuiltinField + | NewCatalogChecklistTemplateDataAttributesCustomField ] + | None + | Unset ): if data is None: return data @@ -203,10 +200,10 @@ def _parse_fields( def _parse_fields_type_0_item( data: object, - ) -> Union[ - "NewCatalogChecklistTemplateDataAttributesBuiltinField", - "NewCatalogChecklistTemplateDataAttributesCustomField", - ]: + ) -> ( + NewCatalogChecklistTemplateDataAttributesBuiltinField + | NewCatalogChecklistTemplateDataAttributesCustomField + ): try: if not isinstance(data, dict): raise TypeError() @@ -215,7 +212,7 @@ def _parse_fields_type_0_item( ) return fields_type_0_item_builtin_field - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -230,17 +227,15 @@ def _parse_fields_type_0_item( fields_type_0.append(fields_type_0_item) return fields_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass return cast( - None - | Unset - | list[ - Union[ - "NewCatalogChecklistTemplateDataAttributesBuiltinField", - "NewCatalogChecklistTemplateDataAttributesCustomField", - ] - ], + list[ + NewCatalogChecklistTemplateDataAttributesBuiltinField + | NewCatalogChecklistTemplateDataAttributesCustomField + ] + | None + | Unset, data, ) @@ -248,7 +243,7 @@ def _parse_fields_type_0_item( def _parse_owners( data: object, - ) -> None | Unset | list["NewCatalogChecklistTemplateDataAttributesOwnersType0Item"]: + ) -> list[NewCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -266,9 +261,9 @@ def _parse_owners( owners_type_0.append(owners_type_0_item) return owners_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["NewCatalogChecklistTemplateDataAttributesOwnersType0Item"], data) + return cast(list[NewCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset, data) owners = _parse_owners(d.pop("owners", UNSET)) 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 53735573..59cbd408 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,3 +1,5 @@ +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_builtin_field_field_source.py b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_builtin_field_field_source.py index 6887a1b8..60d1db57 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_builtin_field_field_source.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_builtin_field_field_source.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCatalogChecklistTemplateDataAttributesBuiltinFieldFieldSource = Literal["builtin"] @@ -15,7 +15,7 @@ def check_new_catalog_checklist_template_data_attributes_builtin_field_field_sou if value is None: return None if value in NEW_CATALOG_CHECKLIST_TEMPLATE_DATA_ATTRIBUTES_BUILTIN_FIELD_FIELD_SOURCE_VALUES: - return cast(NewCatalogChecklistTemplateDataAttributesBuiltinFieldFieldSource, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_CATALOG_CHECKLIST_TEMPLATE_DATA_ATTRIBUTES_BUILTIN_FIELD_FIELD_SOURCE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_catalog_type.py b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_catalog_type.py index 4a7d4b0b..41edab27 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_catalog_type.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_catalog_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCatalogChecklistTemplateDataAttributesCatalogType = Literal[ "Catalog", "Cause", "Environment", "Functionality", "Group", "IncidentType", "Service" @@ -23,7 +23,7 @@ def check_new_catalog_checklist_template_data_attributes_catalog_type( if value is None: return None if value in NEW_CATALOG_CHECKLIST_TEMPLATE_DATA_ATTRIBUTES_CATALOG_TYPE_VALUES: - return cast(NewCatalogChecklistTemplateDataAttributesCatalogType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_CATALOG_CHECKLIST_TEMPLATE_DATA_ATTRIBUTES_CATALOG_TYPE_VALUES!r}" ) 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 df6f9e42..4c8ca431 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -19,12 +21,12 @@ class NewCatalogChecklistTemplateDataAttributesCustomField: Attributes: field_source (NewCatalogChecklistTemplateDataAttributesCustomFieldFieldSource): catalog_property_id (str): ID of the catalog property - field_key (Union[Unset, str]): Ignored for custom fields (auto-derived from catalog property) + field_key (str | Unset): Ignored for custom fields (auto-derived from catalog property) """ field_source: NewCatalogChecklistTemplateDataAttributesCustomFieldFieldSource catalog_property_id: str - field_key: Unset | str = UNSET + field_key: str | Unset = UNSET 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_custom_field_field_source.py b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_custom_field_field_source.py index 1deedafa..7bfc5409 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_custom_field_field_source.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_custom_field_field_source.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCatalogChecklistTemplateDataAttributesCustomFieldFieldSource = Literal["custom"] @@ -15,7 +15,7 @@ def check_new_catalog_checklist_template_data_attributes_custom_field_field_sour if value is None: return None if value in NEW_CATALOG_CHECKLIST_TEMPLATE_DATA_ATTRIBUTES_CUSTOM_FIELD_FIELD_SOURCE_VALUES: - return cast(NewCatalogChecklistTemplateDataAttributesCustomFieldFieldSource, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_CATALOG_CHECKLIST_TEMPLATE_DATA_ATTRIBUTES_CUSTOM_FIELD_FIELD_SOURCE_VALUES!r}" ) 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 834411cf..d998aafd 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,8 +1,9 @@ +from __future__ import annotations + 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.new_catalog_checklist_template_data_attributes_owners_type_0_item_type import ( NewCatalogChecklistTemplateDataAttributesOwnersType0ItemType, @@ -22,7 +23,6 @@ class NewCatalogChecklistTemplateDataAttributesOwnersType0Item: id: str type_: NewCatalogChecklistTemplateDataAttributesOwnersType0ItemType - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -30,7 +30,7 @@ def to_dict(self) -> dict[str, Any]: type_: str = self.type_ field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -52,21 +52,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_=type_, ) - new_catalog_checklist_template_data_attributes_owners_type_0_item.additional_properties = d return new_catalog_checklist_template_data_attributes_owners_type_0_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_catalog_checklist_template_data_attributes_owners_type_0_item_type.py b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_owners_type_0_item_type.py index d56a0db7..591db104 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_owners_type_0_item_type.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_owners_type_0_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCatalogChecklistTemplateDataAttributesOwnersType0ItemType = Literal["field", "user"] @@ -16,7 +16,7 @@ def check_new_catalog_checklist_template_data_attributes_owners_type_0_item_type if value is None: return None if value in NEW_CATALOG_CHECKLIST_TEMPLATE_DATA_ATTRIBUTES_OWNERS_TYPE_0_ITEM_TYPE_VALUES: - return cast(NewCatalogChecklistTemplateDataAttributesOwnersType0ItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_CATALOG_CHECKLIST_TEMPLATE_DATA_ATTRIBUTES_OWNERS_TYPE_0_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_scope_type.py b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_scope_type.py index 91082f94..00120067 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data_attributes_scope_type.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data_attributes_scope_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCatalogChecklistTemplateDataAttributesScopeType = Literal["Catalog", "Team"] @@ -16,7 +16,7 @@ def check_new_catalog_checklist_template_data_attributes_scope_type( if value is None: return None if value in NEW_CATALOG_CHECKLIST_TEMPLATE_DATA_ATTRIBUTES_SCOPE_TYPE_VALUES: - return cast(NewCatalogChecklistTemplateDataAttributesScopeType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_CATALOG_CHECKLIST_TEMPLATE_DATA_ATTRIBUTES_SCOPE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_catalog_checklist_template_data_type.py b/rootly_sdk/models/new_catalog_checklist_template_data_type.py index b729d4cd..b9b29b02 100644 --- a/rootly_sdk/models/new_catalog_checklist_template_data_type.py +++ b/rootly_sdk/models/new_catalog_checklist_template_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCatalogChecklistTemplateDataType = Literal["catalog_checklist_templates"] @@ -11,5 +11,5 @@ def check_new_catalog_checklist_template_data_type(value: str | None) -> NewCata if value is None: return None if value in NEW_CATALOG_CHECKLIST_TEMPLATE_DATA_TYPE_VALUES: - return cast(NewCatalogChecklistTemplateDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_CATALOG_CHECKLIST_TEMPLATE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_catalog_data.py b/rootly_sdk/models/new_catalog_data.py index 47f0b5c0..f5631374 100644 --- a/rootly_sdk/models/new_catalog_data.py +++ b/rootly_sdk/models/new_catalog_data.py @@ -1,8 +1,9 @@ +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_catalog_data_type import NewCatalogDataType, check_new_catalog_data_type @@ -22,8 +23,7 @@ class NewCatalogData: """ type_: NewCatalogDataType - attributes: "NewCatalogDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewCatalogDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_catalog_data.additional_properties = d return new_catalog_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_catalog_data_attributes.py b/rootly_sdk/models/new_catalog_data_attributes.py index cbfab9ba..e21e6eb1 100644 --- a/rootly_sdk/models/new_catalog_data_attributes.py +++ b/rootly_sdk/models/new_catalog_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,47 +19,47 @@ class NewCatalogDataAttributes: """ Attributes: name (str): - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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. + 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. """ name: str - 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 + slug: None | str | Unset = UNSET + description: None | str | Unset = UNSET + icon: NewCatalogDataAttributesIcon | Unset = UNSET + position: int | None | Unset = UNSET + external_id: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - icon: Unset | str = UNSET + icon: str | Unset = UNSET if not isinstance(self.icon, Unset): icon = self.icon - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -88,46 +90,46 @@ 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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) _icon = d.pop("icon", UNSET) - icon: Unset | NewCatalogDataAttributesIcon + icon: NewCatalogDataAttributesIcon | Unset if isinstance(_icon, Unset): icon = UNSET else: icon = check_new_catalog_data_attributes_icon(_icon) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) diff --git a/rootly_sdk/models/new_catalog_data_attributes_icon.py b/rootly_sdk/models/new_catalog_data_attributes_icon.py index 573d73d7..dc167ad2 100644 --- a/rootly_sdk/models/new_catalog_data_attributes_icon.py +++ b/rootly_sdk/models/new_catalog_data_attributes_icon.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCatalogDataAttributesIcon = Literal[ "chart-bar", "cursor-arrow-ripple", "globe-alt", "light-bulb", "server-stack", "shapes", "user-group", "users" @@ -20,5 +20,5 @@ def check_new_catalog_data_attributes_icon(value: str | None) -> NewCatalogDataA if value is None: return None if value in NEW_CATALOG_DATA_ATTRIBUTES_ICON_VALUES: - return cast(NewCatalogDataAttributesIcon, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_CATALOG_DATA_ATTRIBUTES_ICON_VALUES!r}") diff --git a/rootly_sdk/models/new_catalog_data_type.py b/rootly_sdk/models/new_catalog_data_type.py index ba9aebbb..fa6257ea 100644 --- a/rootly_sdk/models/new_catalog_data_type.py +++ b/rootly_sdk/models/new_catalog_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCatalogDataType = Literal["catalogs"] @@ -11,5 +11,5 @@ def check_new_catalog_data_type(value: str | None) -> NewCatalogDataType | None: if value is None: return None if value in NEW_CATALOG_DATA_TYPE_VALUES: - return cast(NewCatalogDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_CATALOG_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_catalog_entity.py b/rootly_sdk/models/new_catalog_entity.py index 54f5b515..eab3f36b 100644 --- a/rootly_sdk/models/new_catalog_entity.py +++ b/rootly_sdk/models/new_catalog_entity.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_catalog_entity_data import NewCatalogEntityData @@ -18,14 +19,13 @@ class NewCatalogEntity: data (NewCatalogEntityData): """ - data: "NewCatalogEntityData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewCatalogEntityData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_catalog_entity.additional_properties = d return new_catalog_entity - - @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_catalog_entity_data.py b/rootly_sdk/models/new_catalog_entity_data.py index 1b84bedf..40516e99 100644 --- a/rootly_sdk/models/new_catalog_entity_data.py +++ b/rootly_sdk/models/new_catalog_entity_data.py @@ -1,8 +1,9 @@ +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_catalog_entity_data_type import NewCatalogEntityDataType, check_new_catalog_entity_data_type @@ -22,8 +23,7 @@ class NewCatalogEntityData: """ type_: NewCatalogEntityDataType - attributes: "NewCatalogEntityDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewCatalogEntityDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_catalog_entity_data.additional_properties = d return new_catalog_entity_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_catalog_entity_data_attributes.py b/rootly_sdk/models/new_catalog_entity_data_attributes.py index ae5463dc..e5f3df1a 100644 --- a/rootly_sdk/models/new_catalog_entity_data_attributes.py +++ b/rootly_sdk/models/new_catalog_entity_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -17,67 +19,67 @@ class NewCatalogEntityDataAttributes: """ Attributes: name (str): - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + description (None | str | Unset): + public_description (None | str | Unset): The status page description of the catalog entity + 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 catalog. - properties (Union[Unset, list['NewCatalogEntityDataAttributesPropertiesItem']]): Array of property values for - this catalog entity + properties (list[NewCatalogEntityDataAttributesPropertiesItem] | Unset): Array of property values for this + catalog entity """ name: str - 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 + slug: None | str | Unset = UNSET + description: None | str | Unset = UNSET + public_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 def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | Unset | str + backstage_id: None | str | Unset if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - properties: Unset | list[dict[str, Any]] = UNSET + properties: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -117,66 +119,68 @@ 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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | Unset | str: + def _parse_backstage_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - properties = [] _properties = d.pop("properties", UNSET) - for properties_item_data in _properties or []: - properties_item = NewCatalogEntityDataAttributesPropertiesItem.from_dict(properties_item_data) + 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) - properties.append(properties_item) + properties.append(properties_item) new_catalog_entity_data_attributes = cls( name=name, 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 16aab728..f5636592 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_catalog_entity_data_type.py b/rootly_sdk/models/new_catalog_entity_data_type.py index 2417c8bf..0eb55c20 100644 --- a/rootly_sdk/models/new_catalog_entity_data_type.py +++ b/rootly_sdk/models/new_catalog_entity_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCatalogEntityDataType = Literal["catalog_entities"] @@ -11,5 +11,5 @@ def check_new_catalog_entity_data_type(value: str | None) -> NewCatalogEntityDat if value is None: return None if value in NEW_CATALOG_ENTITY_DATA_TYPE_VALUES: - return cast(NewCatalogEntityDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_CATALOG_ENTITY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_catalog_entity_property.py b/rootly_sdk/models/new_catalog_entity_property.py index 8e004ed0..e0ed9d93 100644 --- a/rootly_sdk/models/new_catalog_entity_property.py +++ b/rootly_sdk/models/new_catalog_entity_property.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_catalog_entity_property_data import NewCatalogEntityPropertyData @@ -20,14 +21,13 @@ class NewCatalogEntityProperty: data (NewCatalogEntityPropertyData): """ - data: "NewCatalogEntityPropertyData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewCatalogEntityPropertyData 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, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_catalog_entity_property.additional_properties = d return new_catalog_entity_property - - @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_catalog_entity_property_data.py b/rootly_sdk/models/new_catalog_entity_property_data.py index a0ad259e..3c5479ea 100644 --- a/rootly_sdk/models/new_catalog_entity_property_data.py +++ b/rootly_sdk/models/new_catalog_entity_property_data.py @@ -1,8 +1,9 @@ +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_catalog_entity_property_data_type import ( NewCatalogEntityPropertyDataType, @@ -25,8 +26,7 @@ class NewCatalogEntityPropertyData: """ type_: NewCatalogEntityPropertyDataType - attributes: "NewCatalogEntityPropertyDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewCatalogEntityPropertyDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_catalog_entity_property_data.additional_properties = d return new_catalog_entity_property_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_catalog_entity_property_data_attributes.py b/rootly_sdk/models/new_catalog_entity_property_data_attributes.py index c3ae6eaa..b1521147 100644 --- a/rootly_sdk/models/new_catalog_entity_property_data_attributes.py +++ b/rootly_sdk/models/new_catalog_entity_property_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -20,13 +22,13 @@ class NewCatalogEntityPropertyDataAttributes: catalog_field_id (str): key (NewCatalogEntityPropertyDataAttributesKey): value (str): - catalog_entity_id (Union[Unset, str]): + catalog_entity_id (str | Unset): """ catalog_field_id: str key: NewCatalogEntityPropertyDataAttributesKey value: str - catalog_entity_id: Unset | str = UNSET + catalog_entity_id: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: catalog_field_id = self.catalog_field_id diff --git a/rootly_sdk/models/new_catalog_entity_property_data_attributes_key.py b/rootly_sdk/models/new_catalog_entity_property_data_attributes_key.py index 2d7098cd..8bdbd0b8 100644 --- a/rootly_sdk/models/new_catalog_entity_property_data_attributes_key.py +++ b/rootly_sdk/models/new_catalog_entity_property_data_attributes_key.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCatalogEntityPropertyDataAttributesKey = Literal["catalog_entity", "slack", "text"] @@ -15,7 +15,7 @@ def check_new_catalog_entity_property_data_attributes_key( if value is None: return None if value in NEW_CATALOG_ENTITY_PROPERTY_DATA_ATTRIBUTES_KEY_VALUES: - return cast(NewCatalogEntityPropertyDataAttributesKey, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_CATALOG_ENTITY_PROPERTY_DATA_ATTRIBUTES_KEY_VALUES!r}" ) diff --git a/rootly_sdk/models/new_catalog_entity_property_data_type.py b/rootly_sdk/models/new_catalog_entity_property_data_type.py index 57c8077e..6854984f 100644 --- a/rootly_sdk/models/new_catalog_entity_property_data_type.py +++ b/rootly_sdk/models/new_catalog_entity_property_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCatalogEntityPropertyDataType = Literal["catalog_entity_properties"] @@ -11,5 +11,5 @@ def check_new_catalog_entity_property_data_type(value: str | None) -> NewCatalog if value is None: return None if value in NEW_CATALOG_ENTITY_PROPERTY_DATA_TYPE_VALUES: - return cast(NewCatalogEntityPropertyDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_CATALOG_ENTITY_PROPERTY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_catalog_field.py b/rootly_sdk/models/new_catalog_field.py index ab48fe98..a4414d0e 100644 --- a/rootly_sdk/models/new_catalog_field.py +++ b/rootly_sdk/models/new_catalog_field.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_catalog_field_data import NewCatalogFieldData @@ -19,14 +20,13 @@ class NewCatalogField: data (NewCatalogFieldData): """ - data: "NewCatalogFieldData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewCatalogFieldData 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, @@ -46,21 +46,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_catalog_field.additional_properties = d return new_catalog_field - - @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_catalog_field_data.py b/rootly_sdk/models/new_catalog_field_data.py index 2ae4472c..26a29154 100644 --- a/rootly_sdk/models/new_catalog_field_data.py +++ b/rootly_sdk/models/new_catalog_field_data.py @@ -1,8 +1,9 @@ +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_catalog_field_data_type import NewCatalogFieldDataType, check_new_catalog_field_data_type @@ -22,8 +23,7 @@ class NewCatalogFieldData: """ type_: NewCatalogFieldDataType - attributes: "NewCatalogFieldDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewCatalogFieldDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_catalog_field_data.additional_properties = d return new_catalog_field_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_catalog_field_data_attributes.py b/rootly_sdk/models/new_catalog_field_data_attributes.py index 60698e04..b4a2f542 100644 --- a/rootly_sdk/models/new_catalog_field_data_attributes.py +++ b/rootly_sdk/models/new_catalog_field_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -22,39 +24,39 @@ class NewCatalogFieldDataAttributes: Attributes: name (str): kind (NewCatalogFieldDataAttributesKind): - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + 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 scope. """ name: str kind: NewCatalogFieldDataAttributesKind - 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 + slug: None | str | Unset = UNSET + 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 def to_dict(self) -> dict[str, Any]: name = self.name kind: str = self.kind - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - kind_catalog_id: None | Unset | str + kind_catalog_id: None | str | Unset if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: @@ -62,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: multiple = self.multiple - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -70,11 +72,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: Unset | str = UNSET + catalog_type: str | Unset = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -112,50 +114,50 @@ 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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_kind_catalog_id(data: object) -> None | Unset | str: + def _parse_kind_catalog_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) multiple = d.pop("multiple", UNSET) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: Unset | NewCatalogFieldDataAttributesCatalogType + catalog_type: NewCatalogFieldDataAttributesCatalogType | Unset 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 | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) diff --git a/rootly_sdk/models/new_catalog_field_data_attributes_catalog_type.py b/rootly_sdk/models/new_catalog_field_data_attributes_catalog_type.py index 39e943f3..e6f302e5 100644 --- a/rootly_sdk/models/new_catalog_field_data_attributes_catalog_type.py +++ b/rootly_sdk/models/new_catalog_field_data_attributes_catalog_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCatalogFieldDataAttributesCatalogType = Literal[ "catalog", "cause", "environment", "functionality", "incident_type", "service", "team" @@ -21,7 +21,7 @@ def check_new_catalog_field_data_attributes_catalog_type( if value is None: return None if value in NEW_CATALOG_FIELD_DATA_ATTRIBUTES_CATALOG_TYPE_VALUES: - return cast(NewCatalogFieldDataAttributesCatalogType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_CATALOG_FIELD_DATA_ATTRIBUTES_CATALOG_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_catalog_field_data_attributes_kind.py b/rootly_sdk/models/new_catalog_field_data_attributes_kind.py index 6656cf76..3fb3e06b 100644 --- a/rootly_sdk/models/new_catalog_field_data_attributes_kind.py +++ b/rootly_sdk/models/new_catalog_field_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCatalogFieldDataAttributesKind = Literal[ "boolean", "cause", "environment", "functionality", "group", "incident_type", "reference", "service", "text", "user" @@ -22,5 +22,5 @@ def check_new_catalog_field_data_attributes_kind(value: str | None) -> NewCatalo if value is None: return None if value in NEW_CATALOG_FIELD_DATA_ATTRIBUTES_KIND_VALUES: - return cast(NewCatalogFieldDataAttributesKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_CATALOG_FIELD_DATA_ATTRIBUTES_KIND_VALUES!r}") diff --git a/rootly_sdk/models/new_catalog_field_data_type.py b/rootly_sdk/models/new_catalog_field_data_type.py index da55b11b..96f783e2 100644 --- a/rootly_sdk/models/new_catalog_field_data_type.py +++ b/rootly_sdk/models/new_catalog_field_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCatalogFieldDataType = Literal["catalog_properties"] @@ -11,5 +11,5 @@ def check_new_catalog_field_data_type(value: str | None) -> NewCatalogFieldDataT if value is None: return None if value in NEW_CATALOG_FIELD_DATA_TYPE_VALUES: - return cast(NewCatalogFieldDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_CATALOG_FIELD_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_catalog_property.py b/rootly_sdk/models/new_catalog_property.py index 10681fc0..cc587c68 100644 --- a/rootly_sdk/models/new_catalog_property.py +++ b/rootly_sdk/models/new_catalog_property.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_catalog_property_data import NewCatalogPropertyData @@ -19,14 +20,13 @@ class NewCatalogProperty: data (NewCatalogPropertyData): """ - data: "NewCatalogPropertyData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewCatalogPropertyData 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, @@ -46,21 +46,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_catalog_property.additional_properties = d return new_catalog_property - - @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_catalog_property_data.py b/rootly_sdk/models/new_catalog_property_data.py index b578a161..6cc3e394 100644 --- a/rootly_sdk/models/new_catalog_property_data.py +++ b/rootly_sdk/models/new_catalog_property_data.py @@ -1,8 +1,9 @@ +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_catalog_property_data_type import NewCatalogPropertyDataType, check_new_catalog_property_data_type @@ -22,8 +23,7 @@ class NewCatalogPropertyData: """ type_: NewCatalogPropertyDataType - attributes: "NewCatalogPropertyDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewCatalogPropertyDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_catalog_property_data.additional_properties = d return new_catalog_property_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_catalog_property_data_attributes.py b/rootly_sdk/models/new_catalog_property_data_attributes.py index 0f8c785a..e17e93ab 100644 --- a/rootly_sdk/models/new_catalog_property_data_attributes.py +++ b/rootly_sdk/models/new_catalog_property_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -22,40 +24,39 @@ class NewCatalogPropertyDataAttributes: Attributes: name (str): kind (NewCatalogPropertyDataAttributesKind): - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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. + 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. """ name: str kind: NewCatalogPropertyDataAttributesKind - 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 + slug: None | str | Unset = UNSET + 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 def to_dict(self) -> dict[str, Any]: name = self.name kind: str = self.kind - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - kind_catalog_id: None | Unset | str + kind_catalog_id: None | str | Unset if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: @@ -63,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: multiple = self.multiple - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -71,11 +72,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: Unset | str = UNSET + catalog_type: str | Unset = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -113,50 +114,50 @@ 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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_kind_catalog_id(data: object) -> None | Unset | str: + def _parse_kind_catalog_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) multiple = d.pop("multiple", UNSET) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: Unset | NewCatalogPropertyDataAttributesCatalogType + catalog_type: NewCatalogPropertyDataAttributesCatalogType | Unset 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 | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) diff --git a/rootly_sdk/models/new_catalog_property_data_attributes_catalog_type.py b/rootly_sdk/models/new_catalog_property_data_attributes_catalog_type.py index b824b8bd..def40aa8 100644 --- a/rootly_sdk/models/new_catalog_property_data_attributes_catalog_type.py +++ b/rootly_sdk/models/new_catalog_property_data_attributes_catalog_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCatalogPropertyDataAttributesCatalogType = Literal[ "catalog", "cause", "environment", "functionality", "incident_type", "service", "team" @@ -21,7 +21,7 @@ def check_new_catalog_property_data_attributes_catalog_type( if value is None: return None if value in NEW_CATALOG_PROPERTY_DATA_ATTRIBUTES_CATALOG_TYPE_VALUES: - return cast(NewCatalogPropertyDataAttributesCatalogType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_CATALOG_PROPERTY_DATA_ATTRIBUTES_CATALOG_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_catalog_property_data_attributes_kind.py b/rootly_sdk/models/new_catalog_property_data_attributes_kind.py index 07291c81..3c698fbf 100644 --- a/rootly_sdk/models/new_catalog_property_data_attributes_kind.py +++ b/rootly_sdk/models/new_catalog_property_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCatalogPropertyDataAttributesKind = Literal[ "boolean", "cause", "environment", "functionality", "group", "incident_type", "reference", "service", "text", "user" @@ -22,5 +22,5 @@ def check_new_catalog_property_data_attributes_kind(value: str | None) -> NewCat if value is None: return None if value in NEW_CATALOG_PROPERTY_DATA_ATTRIBUTES_KIND_VALUES: - return cast(NewCatalogPropertyDataAttributesKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_CATALOG_PROPERTY_DATA_ATTRIBUTES_KIND_VALUES!r}") diff --git a/rootly_sdk/models/new_catalog_property_data_type.py b/rootly_sdk/models/new_catalog_property_data_type.py index e7f2b253..bc6dd1c2 100644 --- a/rootly_sdk/models/new_catalog_property_data_type.py +++ b/rootly_sdk/models/new_catalog_property_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCatalogPropertyDataType = Literal["catalog_properties"] @@ -11,5 +11,5 @@ def check_new_catalog_property_data_type(value: str | None) -> NewCatalogPropert if value is None: return None if value in NEW_CATALOG_PROPERTY_DATA_TYPE_VALUES: - return cast(NewCatalogPropertyDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_CATALOG_PROPERTY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_cause.py b/rootly_sdk/models/new_cause.py index ba1af3e7..3b051c5f 100644 --- a/rootly_sdk/models/new_cause.py +++ b/rootly_sdk/models/new_cause.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_cause_data import NewCauseData @@ -18,14 +19,13 @@ class NewCause: data (NewCauseData): """ - data: "NewCauseData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewCauseData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_cause.additional_properties = d return new_cause - - @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_cause_data.py b/rootly_sdk/models/new_cause_data.py index 2a5015be..c19c1c89 100644 --- a/rootly_sdk/models/new_cause_data.py +++ b/rootly_sdk/models/new_cause_data.py @@ -1,8 +1,9 @@ +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_cause_data_type import NewCauseDataType, check_new_cause_data_type @@ -22,8 +23,7 @@ class NewCauseData: """ type_: NewCauseDataType - attributes: "NewCauseDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewCauseDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_cause_data.additional_properties = d return new_cause_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_cause_data_attributes.py b/rootly_sdk/models/new_cause_data_attributes.py index c44dfc09..59a82bf7 100644 --- a/rootly_sdk/models/new_cause_data_attributes.py +++ b/rootly_sdk/models/new_cause_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -17,50 +19,49 @@ class NewCauseDataAttributes: """ Attributes: name (str): The name of the cause - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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. + description (None | str | Unset): The description of the cause + public_description (None | str | Unset): The status page description of the cause + position (int | None | Unset): Position of the cause + properties (list[NewCauseDataAttributesPropertiesItem] | Unset): Array of property values for this cause. """ name: str - 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 + slug: None | str | Unset = UNSET + description: None | str | Unset = UNSET + public_description: None | str | Unset = UNSET + position: int | None | Unset = UNSET + properties: list[NewCauseDataAttributesPropertiesItem] | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - properties: Unset | list[dict[str, Any]] = UNSET + properties: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -94,48 +95,50 @@ 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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - properties = [] _properties = d.pop("properties", UNSET) - for properties_item_data in _properties or []: - properties_item = NewCauseDataAttributesPropertiesItem.from_dict(properties_item_data) + 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) - properties.append(properties_item) + properties.append(properties_item) new_cause_data_attributes = cls( name=name, 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 bf8741fb..da071245 100644 --- a/rootly_sdk/models/new_cause_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_cause_data_attributes_properties_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_cause_data_type.py b/rootly_sdk/models/new_cause_data_type.py index c44c4c92..f07f8111 100644 --- a/rootly_sdk/models/new_cause_data_type.py +++ b/rootly_sdk/models/new_cause_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCauseDataType = Literal["causes"] @@ -11,5 +11,5 @@ def check_new_cause_data_type(value: str | None) -> NewCauseDataType | None: if value is None: return None if value in NEW_CAUSE_DATA_TYPE_VALUES: - return cast(NewCauseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_CAUSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_communications_group.py b/rootly_sdk/models/new_communications_group.py index c59f5362..30ea64d8 100644 --- a/rootly_sdk/models/new_communications_group.py +++ b/rootly_sdk/models/new_communications_group.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_communications_group_data import NewCommunicationsGroupData @@ -18,14 +19,13 @@ class NewCommunicationsGroup: data (NewCommunicationsGroupData): """ - data: "NewCommunicationsGroupData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewCommunicationsGroupData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_communications_group.additional_properties = d return new_communications_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_communications_group_data.py b/rootly_sdk/models/new_communications_group_data.py index ef36edb1..e2bb5f89 100644 --- a/rootly_sdk/models/new_communications_group_data.py +++ b/rootly_sdk/models/new_communications_group_data.py @@ -1,8 +1,9 @@ +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_communications_group_data_type import ( NewCommunicationsGroupDataType, @@ -25,8 +26,7 @@ class NewCommunicationsGroupData: """ type_: NewCommunicationsGroupDataType - attributes: "NewCommunicationsGroupDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewCommunicationsGroupDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_communications_group_data.additional_properties = d return new_communications_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_communications_group_data_attributes.py b/rootly_sdk/models/new_communications_group_data_attributes.py index 8f9e4197..a605c9dc 100644 --- a/rootly_sdk/models/new_communications_group_data_attributes.py +++ b/rootly_sdk/models/new_communications_group_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -27,34 +29,34 @@ class NewCommunicationsGroupDataAttributes: Attributes: name (str): The name of the communications group communication_type_id (str): The communication type ID - 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 + 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 """ name: str communication_type_id: str - 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 + 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 communication_group_conditions: ( - None | Unset | list["NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"] + list[NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset ) = UNSET communication_external_group_members: ( - None | Unset | list["NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"] + list[NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset ) = UNSET def to_dict(self) -> dict[str, Any]: @@ -62,35 +64,35 @@ def to_dict(self) -> dict[str, Any]: communication_type_id = self.communication_type_id - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - is_private: None | Unset | bool + is_private: bool | None | Unset if isinstance(self.is_private, Unset): is_private = UNSET else: is_private = self.is_private - condition_type: Unset | str = UNSET + condition_type: str | Unset = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - sms_channel: None | Unset | bool + sms_channel: bool | None | Unset if isinstance(self.sms_channel, Unset): sms_channel = UNSET else: sms_channel = self.sms_channel - email_channel: None | Unset | bool + email_channel: bool | None | Unset if isinstance(self.email_channel, Unset): email_channel = UNSET else: email_channel = self.email_channel - member_ids: None | Unset | list[int] + member_ids: list[int] | None | Unset if isinstance(self.member_ids, Unset): member_ids = UNSET elif isinstance(self.member_ids, list): @@ -99,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: else: member_ids = self.member_ids - slack_channel_ids: None | Unset | list[str] + slack_channel_ids: list[str] | None | Unset if isinstance(self.slack_channel_ids, Unset): slack_channel_ids = UNSET elif isinstance(self.slack_channel_ids, list): @@ -108,7 +110,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel_ids = self.slack_channel_ids - communication_group_conditions: None | Unset | list[dict[str, Any]] + communication_group_conditions: list[dict[str, Any]] | None | Unset if isinstance(self.communication_group_conditions, Unset): communication_group_conditions = UNSET elif isinstance(self.communication_group_conditions, list): @@ -120,7 +122,7 @@ def to_dict(self) -> dict[str, Any]: else: communication_group_conditions = self.communication_group_conditions - communication_external_group_members: None | Unset | list[dict[str, Any]] + communication_external_group_members: list[dict[str, Any]] | None | Unset if isinstance(self.communication_external_group_members, Unset): communication_external_group_members = UNSET elif isinstance(self.communication_external_group_members, list): @@ -177,50 +179,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_is_private(data: object) -> None | Unset | bool: + def _parse_is_private(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) is_private = _parse_is_private(d.pop("is_private", UNSET)) _condition_type = d.pop("condition_type", UNSET) - condition_type: Unset | NewCommunicationsGroupDataAttributesConditionType + condition_type: NewCommunicationsGroupDataAttributesConditionType | Unset 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) -> None | Unset | bool: + def _parse_sms_channel(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) sms_channel = _parse_sms_channel(d.pop("sms_channel", UNSET)) - def _parse_email_channel(data: object) -> None | Unset | bool: + def _parse_email_channel(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) email_channel = _parse_email_channel(d.pop("email_channel", UNSET)) - def _parse_member_ids(data: object) -> None | Unset | list[int]: + def _parse_member_ids(data: object) -> list[int] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -231,13 +233,13 @@ def _parse_member_ids(data: object) -> None | Unset | list[int]: member_ids_type_0 = cast(list[int], data) return member_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[int], data) + return cast(list[int] | None | Unset, data) member_ids = _parse_member_ids(d.pop("member_ids", UNSET)) - def _parse_slack_channel_ids(data: object) -> None | Unset | list[str]: + def _parse_slack_channel_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -248,15 +250,15 @@ def _parse_slack_channel_ids(data: object) -> None | Unset | list[str]: slack_channel_ids_type_0 = cast(list[str], data) return slack_channel_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) slack_channel_ids = _parse_slack_channel_ids(d.pop("slack_channel_ids", UNSET)) def _parse_communication_group_conditions( data: object, - ) -> None | Unset | list["NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"]: + ) -> list[NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -276,11 +278,10 @@ def _parse_communication_group_conditions( communication_group_conditions_type_0.append(communication_group_conditions_type_0_item) return communication_group_conditions_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass return cast( - None | Unset | list["NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"], - data, + list[NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset, data ) communication_group_conditions = _parse_communication_group_conditions( @@ -289,7 +290,7 @@ def _parse_communication_group_conditions( def _parse_communication_external_group_members( data: object, - ) -> None | Unset | list["NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"]: + ) -> list[NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -311,10 +312,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass return cast( - None | Unset | list["NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"], + list[NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset, 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 ef8f8260..ad886b12 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,8 +1,9 @@ +from __future__ import annotations + 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 @@ -13,15 +14,14 @@ class NewCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item: """ Attributes: - 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): Name of the external member + email (str | Unset): Email of the external member + phone_number (str | Unset): Phone number of the external member """ - name: Unset | str = UNSET - email: Unset | str = UNSET - phone_number: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + name: str | Unset = UNSET + email: str | Unset = UNSET + phone_number: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: phone_number = self.phone_number field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if name is not UNSET: field_dict["name"] = name @@ -57,21 +57,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: phone_number=phone_number, ) - new_communications_group_data_attributes_communication_external_group_members_type_0_item.additional_properties = d return new_communications_group_data_attributes_communication_external_group_members_type_0_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_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 e5b2ed63..c63ef67a 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,8 +1,9 @@ +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.new_communications_group_data_attributes_communication_group_conditions_type_0_item_property_type import ( NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType, @@ -17,29 +18,28 @@ class NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item: """ Attributes: - 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): + 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: 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) + 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 def to_dict(self) -> dict[str, Any]: - property_type: Unset | str = UNSET + property_type: str | Unset = UNSET if not isinstance(self.property_type, Unset): property_type = self.property_type - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -48,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - severity_ids: None | Unset | list[str] + severity_ids: list[str] | None | Unset if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -57,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - functionality_ids: None | Unset | list[str] + functionality_ids: list[str] | None | Unset if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -66,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: None | Unset | list[str] + group_ids: list[str] | None | Unset if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -75,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: None | Unset | list[str] + incident_type_ids: list[str] | None | Unset if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -85,7 +85,7 @@ def to_dict(self) -> dict[str, Any]: incident_type_ids = self.incident_type_ids field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if property_type is not UNSET: field_dict["property_type"] = property_type @@ -106,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: Unset | NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType + property_type: NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType | Unset if isinstance(_property_type, Unset): property_type = UNSET else: @@ -116,7 +116,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) ) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -127,13 +127,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_severity_ids(data: object) -> None | Unset | list[str]: + def _parse_severity_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -144,13 +144,13 @@ def _parse_severity_ids(data: object) -> None | Unset | list[str]: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_functionality_ids(data: object) -> None | Unset | list[str]: + def _parse_functionality_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -161,13 +161,13 @@ def _parse_functionality_ids(data: object) -> None | Unset | list[str]: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> None | Unset | list[str]: + def _parse_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -178,13 +178,13 @@ def _parse_group_ids(data: object) -> None | Unset | list[str]: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: + def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -195,9 +195,9 @@ def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) @@ -210,21 +210,4 @@ def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: incident_type_ids=incident_type_ids, ) - new_communications_group_data_attributes_communication_group_conditions_type_0_item.additional_properties = d return new_communications_group_data_attributes_communication_group_conditions_type_0_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_communications_group_data_attributes_communication_group_conditions_type_0_item_property_type.py b/rootly_sdk/models/new_communications_group_data_attributes_communication_group_conditions_type_0_item_property_type.py index eb6dbc1e..0d141330 100644 --- a/rootly_sdk/models/new_communications_group_data_attributes_communication_group_conditions_type_0_item_property_type.py +++ b/rootly_sdk/models/new_communications_group_data_attributes_communication_group_conditions_type_0_item_property_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType = Literal[ "functionality", "group", "incident_type", "service", "severity" @@ -24,7 +24,7 @@ def check_new_communications_group_data_attributes_communication_group_condition value in NEW_COMMUNICATIONS_GROUP_DATA_ATTRIBUTES_COMMUNICATION_GROUP_CONDITIONS_TYPE_0_ITEM_PROPERTY_TYPE_VALUES ): - return cast(NewCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_COMMUNICATIONS_GROUP_DATA_ATTRIBUTES_COMMUNICATION_GROUP_CONDITIONS_TYPE_0_ITEM_PROPERTY_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_communications_group_data_attributes_condition_type.py b/rootly_sdk/models/new_communications_group_data_attributes_condition_type.py index d33d0b15..ba545ab7 100644 --- a/rootly_sdk/models/new_communications_group_data_attributes_condition_type.py +++ b/rootly_sdk/models/new_communications_group_data_attributes_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCommunicationsGroupDataAttributesConditionType = Literal["all", "any"] @@ -16,7 +16,7 @@ def check_new_communications_group_data_attributes_condition_type( if value is None: return None if value in NEW_COMMUNICATIONS_GROUP_DATA_ATTRIBUTES_CONDITION_TYPE_VALUES: - return cast(NewCommunicationsGroupDataAttributesConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_COMMUNICATIONS_GROUP_DATA_ATTRIBUTES_CONDITION_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_communications_group_data_type.py b/rootly_sdk/models/new_communications_group_data_type.py index f441e9f2..bd3bfff4 100644 --- a/rootly_sdk/models/new_communications_group_data_type.py +++ b/rootly_sdk/models/new_communications_group_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCommunicationsGroupDataType = Literal["communications_groups"] @@ -11,5 +11,5 @@ def check_new_communications_group_data_type(value: str | None) -> NewCommunicat if value is None: return None if value in NEW_COMMUNICATIONS_GROUP_DATA_TYPE_VALUES: - return cast(NewCommunicationsGroupDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_COMMUNICATIONS_GROUP_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_communications_stage.py b/rootly_sdk/models/new_communications_stage.py index 255f3d6e..11a530ab 100644 --- a/rootly_sdk/models/new_communications_stage.py +++ b/rootly_sdk/models/new_communications_stage.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_communications_stage_data import NewCommunicationsStageData @@ -18,14 +19,13 @@ class NewCommunicationsStage: data (NewCommunicationsStageData): """ - data: "NewCommunicationsStageData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewCommunicationsStageData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_communications_stage.additional_properties = d return new_communications_stage - - @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_communications_stage_data.py b/rootly_sdk/models/new_communications_stage_data.py index 7b63efc0..b8ba18e4 100644 --- a/rootly_sdk/models/new_communications_stage_data.py +++ b/rootly_sdk/models/new_communications_stage_data.py @@ -1,8 +1,9 @@ +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_communications_stage_data_type import ( NewCommunicationsStageDataType, @@ -25,8 +26,7 @@ class NewCommunicationsStageData: """ type_: NewCommunicationsStageDataType - attributes: "NewCommunicationsStageDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewCommunicationsStageDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_communications_stage_data.additional_properties = d return new_communications_stage_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_communications_stage_data_attributes.py b/rootly_sdk/models/new_communications_stage_data_attributes.py index 602a9fe6..8a28736b 100644 --- a/rootly_sdk/models/new_communications_stage_data_attributes.py +++ b/rootly_sdk/models/new_communications_stage_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,33 +15,33 @@ class NewCommunicationsStageDataAttributes: """ Attributes: name (str): The name of the communications stage - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + description (None | str | Unset): The description of the communications stage + position (int | None | Unset): Position of the communications stage """ name: str - slug: None | Unset | str = UNSET - description: None | Unset | str = UNSET - position: None | Unset | int = UNSET + slug: None | str | Unset = UNSET + description: None | str | Unset = UNSET + position: int | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -66,30 +68,30 @@ 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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_communications_stage_data_type.py b/rootly_sdk/models/new_communications_stage_data_type.py index ed3c4994..303e6331 100644 --- a/rootly_sdk/models/new_communications_stage_data_type.py +++ b/rootly_sdk/models/new_communications_stage_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCommunicationsStageDataType = Literal["communications_stages"] @@ -11,5 +11,5 @@ def check_new_communications_stage_data_type(value: str | None) -> NewCommunicat if value is None: return None if value in NEW_COMMUNICATIONS_STAGE_DATA_TYPE_VALUES: - return cast(NewCommunicationsStageDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_COMMUNICATIONS_STAGE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_communications_template.py b/rootly_sdk/models/new_communications_template.py index 9736c747..a320889e 100644 --- a/rootly_sdk/models/new_communications_template.py +++ b/rootly_sdk/models/new_communications_template.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_communications_template_data import NewCommunicationsTemplateData @@ -18,14 +19,13 @@ class NewCommunicationsTemplate: data (NewCommunicationsTemplateData): """ - data: "NewCommunicationsTemplateData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewCommunicationsTemplateData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_communications_template.additional_properties = d return new_communications_template - - @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_communications_template_data.py b/rootly_sdk/models/new_communications_template_data.py index d82c8d18..13e8f1e7 100644 --- a/rootly_sdk/models/new_communications_template_data.py +++ b/rootly_sdk/models/new_communications_template_data.py @@ -1,8 +1,9 @@ +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_communications_template_data_type import ( NewCommunicationsTemplateDataType, @@ -25,8 +26,7 @@ class NewCommunicationsTemplateData: """ type_: NewCommunicationsTemplateDataType - attributes: "NewCommunicationsTemplateDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewCommunicationsTemplateDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_communications_template_data.additional_properties = d return new_communications_template_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_communications_template_data_attributes.py b/rootly_sdk/models/new_communications_template_data_attributes.py index e25d102a..32c12e4a 100644 --- a/rootly_sdk/models/new_communications_template_data_attributes.py +++ b/rootly_sdk/models/new_communications_template_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -20,19 +22,19 @@ class NewCommunicationsTemplateDataAttributes: Attributes: name (str): The name of the communications template communication_type_id (str): The communication type ID - 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 + 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 """ name: str communication_type_id: str - description: None | Unset | str = UNSET - position: None | Unset | int = UNSET + description: None | str | Unset = UNSET + position: int | None | Unset = UNSET communication_template_stages_attributes: ( - None | Unset | list["NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"] + list[NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] | None | Unset ) = UNSET def to_dict(self) -> dict[str, Any]: @@ -40,19 +42,19 @@ def to_dict(self) -> dict[str, Any]: communication_type_id = self.communication_type_id - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - communication_template_stages_attributes: None | Unset | list[dict[str, Any]] + communication_template_stages_attributes: list[dict[str, Any]] | None | Unset if isinstance(self.communication_template_stages_attributes, Unset): communication_template_stages_attributes = UNSET elif isinstance(self.communication_template_stages_attributes, list): @@ -96,29 +98,27 @@ 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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) def _parse_communication_template_stages_attributes( data: object, - ) -> ( - None | Unset | list["NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"] - ): + ) -> list[NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -142,12 +142,12 @@ def _parse_communication_template_stages_attributes( ) return communication_template_stages_attributes_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass return cast( - None - | Unset - | list["NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"], + list[NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] + | None + | Unset, 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 1a52b6f1..0b7c9936 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,8 +1,9 @@ +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 ..types import UNSET, Unset @@ -13,49 +14,48 @@ class NewCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item: """ Attributes: - 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): 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: 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) + 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 def to_dict(self) -> dict[str, Any]: communication_stage_id = self.communication_stage_id - sms_content: None | Unset | str + sms_content: None | str | Unset if isinstance(self.sms_content, Unset): sms_content = UNSET else: sms_content = self.sms_content - email_subject: None | Unset | str + email_subject: None | str | Unset if isinstance(self.email_subject, Unset): email_subject = UNSET else: email_subject = self.email_subject - email_body: None | Unset | str + email_body: None | str | Unset if isinstance(self.email_body, Unset): email_body = UNSET else: email_body = self.email_body - slack_content: None | Unset | str + slack_content: None | str | Unset if isinstance(self.slack_content, Unset): slack_content = UNSET else: slack_content = self.slack_content field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if communication_stage_id is not UNSET: field_dict["communication_stage_id"] = communication_stage_id @@ -75,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 | Unset | str: + def _parse_sms_content(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) sms_content = _parse_sms_content(d.pop("sms_content", UNSET)) - def _parse_email_subject(data: object) -> None | Unset | str: + def _parse_email_subject(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) email_subject = _parse_email_subject(d.pop("email_subject", UNSET)) - def _parse_email_body(data: object) -> None | Unset | str: + def _parse_email_body(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) email_body = _parse_email_body(d.pop("email_body", UNSET)) - def _parse_slack_content(data: object) -> None | Unset | str: + def _parse_slack_content(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slack_content = _parse_slack_content(d.pop("slack_content", UNSET)) @@ -119,21 +119,4 @@ def _parse_slack_content(data: object) -> None | Unset | str: slack_content=slack_content, ) - new_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.additional_properties = d return new_communications_template_data_attributes_communication_template_stages_attributes_type_0_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_communications_template_data_type.py b/rootly_sdk/models/new_communications_template_data_type.py index deea7a7c..358d13d2 100644 --- a/rootly_sdk/models/new_communications_template_data_type.py +++ b/rootly_sdk/models/new_communications_template_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCommunicationsTemplateDataType = Literal["communications_templates"] @@ -11,5 +11,5 @@ def check_new_communications_template_data_type(value: str | None) -> NewCommuni if value is None: return None if value in NEW_COMMUNICATIONS_TEMPLATE_DATA_TYPE_VALUES: - return cast(NewCommunicationsTemplateDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_COMMUNICATIONS_TEMPLATE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_communications_type.py b/rootly_sdk/models/new_communications_type.py index 13a637a3..4c415e87 100644 --- a/rootly_sdk/models/new_communications_type.py +++ b/rootly_sdk/models/new_communications_type.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_communications_type_data import NewCommunicationsTypeData @@ -18,14 +19,13 @@ class NewCommunicationsType: data (NewCommunicationsTypeData): """ - data: "NewCommunicationsTypeData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewCommunicationsTypeData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_communications_type.additional_properties = d return new_communications_type - - @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_communications_type_data.py b/rootly_sdk/models/new_communications_type_data.py index b3f273d1..59065b8a 100644 --- a/rootly_sdk/models/new_communications_type_data.py +++ b/rootly_sdk/models/new_communications_type_data.py @@ -1,8 +1,9 @@ +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_communications_type_data_type import ( NewCommunicationsTypeDataType, @@ -25,8 +26,7 @@ class NewCommunicationsTypeData: """ type_: NewCommunicationsTypeDataType - attributes: "NewCommunicationsTypeDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewCommunicationsTypeDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_communications_type_data.additional_properties = d return new_communications_type_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_communications_type_data_attributes.py b/rootly_sdk/models/new_communications_type_data_attributes.py index d988abff..3d3ef95c 100644 --- a/rootly_sdk/models/new_communications_type_data_attributes.py +++ b/rootly_sdk/models/new_communications_type_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,18 +15,18 @@ class NewCommunicationsTypeDataAttributes: """ Attributes: name (str): The name 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 + color (None | str): The color of the communications type + slug (None | str | Unset): 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 + description (None | str | Unset): The description of the communications type + position (int | None | Unset): Position of the communications type """ name: str color: None | str - slug: None | Unset | str = UNSET - description: None | Unset | str = UNSET - position: None | Unset | int = UNSET + slug: None | str | Unset = UNSET + description: None | str | Unset = UNSET + position: int | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name @@ -32,19 +34,19 @@ def to_dict(self) -> dict[str, Any]: color: None | str color = self.color - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -79,30 +81,30 @@ def _parse_color(data: object) -> None | str: color = _parse_color(d.pop("color")) - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_communications_type_data_type.py b/rootly_sdk/models/new_communications_type_data_type.py index f146b865..a4a99dcc 100644 --- a/rootly_sdk/models/new_communications_type_data_type.py +++ b/rootly_sdk/models/new_communications_type_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCommunicationsTypeDataType = Literal["communications_types"] @@ -11,5 +11,5 @@ def check_new_communications_type_data_type(value: str | None) -> NewCommunicati if value is None: return None if value in NEW_COMMUNICATIONS_TYPE_DATA_TYPE_VALUES: - return cast(NewCommunicationsTypeDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_COMMUNICATIONS_TYPE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_custom_field.py b/rootly_sdk/models/new_custom_field.py index 4e234541..4256ab6e 100644 --- a/rootly_sdk/models/new_custom_field.py +++ b/rootly_sdk/models/new_custom_field.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_custom_field_data import NewCustomFieldData @@ -18,14 +19,13 @@ class NewCustomField: data (NewCustomFieldData): """ - data: "NewCustomFieldData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewCustomFieldData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_custom_field.additional_properties = d return new_custom_field - - @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_custom_field_data.py b/rootly_sdk/models/new_custom_field_data.py index 4d28f75f..4b6cf8ee 100644 --- a/rootly_sdk/models/new_custom_field_data.py +++ b/rootly_sdk/models/new_custom_field_data.py @@ -1,8 +1,9 @@ +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_custom_field_data_type import NewCustomFieldDataType, check_new_custom_field_data_type @@ -22,8 +23,7 @@ class NewCustomFieldData: """ type_: NewCustomFieldDataType - attributes: "NewCustomFieldDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewCustomFieldDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_custom_field_data.additional_properties = d return new_custom_field_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_custom_field_data_attributes.py b/rootly_sdk/models/new_custom_field_data_attributes.py index 93a5e0aa..f91d2f06 100644 --- a/rootly_sdk/models/new_custom_field_data_attributes.py +++ b/rootly_sdk/models/new_custom_field_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -21,37 +23,37 @@ class NewCustomFieldDataAttributes: """ Attributes: label (str): The name 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 + 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 """ label: str - 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 + 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 def to_dict(self) -> dict[str, Any]: label = self.label - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - shown: Unset | list[str] = UNSET + shown: list[str] | Unset = 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: None | Unset | list[str] + required: list[str] | None | Unset if isinstance(self.required, Unset): required = UNSET elif isinstance(self.required, list): @@ -63,7 +65,7 @@ def to_dict(self) -> dict[str, Any]: else: required = self.required - default: None | Unset | str + default: None | str | Unset if isinstance(self.default, Unset): default = UNSET else: @@ -96,23 +98,25 @@ 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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - shown = [] _shown = d.pop("shown", UNSET) - for shown_item_data in _shown or []: - shown_item = check_new_custom_field_data_attributes_shown_item(shown_item_data) + 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) - shown.append(shown_item) + shown.append(shown_item) - def _parse_required(data: object) -> None | Unset | list[NewCustomFieldDataAttributesRequiredType0Item]: + def _parse_required(data: object) -> list[NewCustomFieldDataAttributesRequiredType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -130,18 +134,18 @@ def _parse_required(data: object) -> None | Unset | list[NewCustomFieldDataAttri required_type_0.append(required_type_0_item) return required_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[NewCustomFieldDataAttributesRequiredType0Item], data) + return cast(list[NewCustomFieldDataAttributesRequiredType0Item] | None | Unset, data) required = _parse_required(d.pop("required", UNSET)) - def _parse_default(data: object) -> None | Unset | str: + def _parse_default(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) default = _parse_default(d.pop("default", UNSET)) diff --git a/rootly_sdk/models/new_custom_field_data_attributes_required_type_0_item.py b/rootly_sdk/models/new_custom_field_data_attributes_required_type_0_item.py index 9932f2cb..dfe3b307 100644 --- a/rootly_sdk/models/new_custom_field_data_attributes_required_type_0_item.py +++ b/rootly_sdk/models/new_custom_field_data_attributes_required_type_0_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCustomFieldDataAttributesRequiredType0Item = Literal[ "incident_form", @@ -27,7 +27,7 @@ def check_new_custom_field_data_attributes_required_type_0_item( if value is None: return None if value in NEW_CUSTOM_FIELD_DATA_ATTRIBUTES_REQUIRED_TYPE_0_ITEM_VALUES: - return cast(NewCustomFieldDataAttributesRequiredType0Item, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_CUSTOM_FIELD_DATA_ATTRIBUTES_REQUIRED_TYPE_0_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_custom_field_data_attributes_shown_item.py b/rootly_sdk/models/new_custom_field_data_attributes_shown_item.py index 0901c960..dc86d68d 100644 --- a/rootly_sdk/models/new_custom_field_data_attributes_shown_item.py +++ b/rootly_sdk/models/new_custom_field_data_attributes_shown_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCustomFieldDataAttributesShownItem = Literal[ "incident_form", @@ -29,7 +29,7 @@ def check_new_custom_field_data_attributes_shown_item( if value is None: return None if value in NEW_CUSTOM_FIELD_DATA_ATTRIBUTES_SHOWN_ITEM_VALUES: - return cast(NewCustomFieldDataAttributesShownItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_CUSTOM_FIELD_DATA_ATTRIBUTES_SHOWN_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_custom_field_data_type.py b/rootly_sdk/models/new_custom_field_data_type.py index 19295246..66762df1 100644 --- a/rootly_sdk/models/new_custom_field_data_type.py +++ b/rootly_sdk/models/new_custom_field_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCustomFieldDataType = Literal["custom_fields"] @@ -11,5 +11,5 @@ def check_new_custom_field_data_type(value: str | None) -> NewCustomFieldDataTyp if value is None: return None if value in NEW_CUSTOM_FIELD_DATA_TYPE_VALUES: - return cast(NewCustomFieldDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_CUSTOM_FIELD_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_custom_field_option.py b/rootly_sdk/models/new_custom_field_option.py index 21bc5210..1b8993d3 100644 --- a/rootly_sdk/models/new_custom_field_option.py +++ b/rootly_sdk/models/new_custom_field_option.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_custom_field_option_data import NewCustomFieldOptionData @@ -18,14 +19,13 @@ class NewCustomFieldOption: data (NewCustomFieldOptionData): """ - data: "NewCustomFieldOptionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewCustomFieldOptionData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_custom_field_option.additional_properties = d return new_custom_field_option - - @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_custom_field_option_data.py b/rootly_sdk/models/new_custom_field_option_data.py index 44112638..e5bc86e7 100644 --- a/rootly_sdk/models/new_custom_field_option_data.py +++ b/rootly_sdk/models/new_custom_field_option_data.py @@ -1,8 +1,9 @@ +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_custom_field_option_data_type import ( NewCustomFieldOptionDataType, @@ -25,8 +26,7 @@ class NewCustomFieldOptionData: """ type_: NewCustomFieldOptionDataType - attributes: "NewCustomFieldOptionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewCustomFieldOptionDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_custom_field_option_data.additional_properties = d return new_custom_field_option_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_custom_field_option_data_attributes.py b/rootly_sdk/models/new_custom_field_option_data_attributes.py index 6316c183..327dadf0 100644 --- a/rootly_sdk/models/new_custom_field_option_data_attributes.py +++ b/rootly_sdk/models/new_custom_field_option_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,15 +15,15 @@ class NewCustomFieldOptionDataAttributes: """ Attributes: value (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 + 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: str - color: Unset | str = UNSET - default: Unset | bool = UNSET - position: Unset | int = UNSET + color: str | Unset = UNSET + default: bool | Unset = UNSET + position: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: value = self.value diff --git a/rootly_sdk/models/new_custom_field_option_data_type.py b/rootly_sdk/models/new_custom_field_option_data_type.py index fabe4b08..0701b34d 100644 --- a/rootly_sdk/models/new_custom_field_option_data_type.py +++ b/rootly_sdk/models/new_custom_field_option_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCustomFieldOptionDataType = Literal["custom_field_options"] @@ -11,5 +11,5 @@ def check_new_custom_field_option_data_type(value: str | None) -> NewCustomField if value is None: return None if value in NEW_CUSTOM_FIELD_OPTION_DATA_TYPE_VALUES: - return cast(NewCustomFieldOptionDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_CUSTOM_FIELD_OPTION_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_custom_form.py b/rootly_sdk/models/new_custom_form.py index b4884ddc..c892d454 100644 --- a/rootly_sdk/models/new_custom_form.py +++ b/rootly_sdk/models/new_custom_form.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_custom_form_data import NewCustomFormData @@ -18,14 +19,13 @@ class NewCustomForm: data (NewCustomFormData): """ - data: "NewCustomFormData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewCustomFormData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_custom_form.additional_properties = d return new_custom_form - - @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_custom_form_data.py b/rootly_sdk/models/new_custom_form_data.py index e4300fab..c67355ad 100644 --- a/rootly_sdk/models/new_custom_form_data.py +++ b/rootly_sdk/models/new_custom_form_data.py @@ -1,8 +1,9 @@ +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_custom_form_data_type import NewCustomFormDataType, check_new_custom_form_data_type @@ -22,8 +23,7 @@ class NewCustomFormData: """ type_: NewCustomFormDataType - attributes: "NewCustomFormDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewCustomFormDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_custom_form_data.additional_properties = d return new_custom_form_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_custom_form_data_attributes.py b/rootly_sdk/models/new_custom_form_data_attributes.py index dc91ded9..fcfd6ef9 100644 --- a/rootly_sdk/models/new_custom_form_data_attributes.py +++ b/rootly_sdk/models/new_custom_form_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,30 +16,30 @@ class NewCustomFormDataAttributes: Attributes: name (str): The name of the custom form. command (str): 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 + slug (None | str | Unset): 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]): + description (None | str | Unset): + enabled (bool | Unset): """ name: str command: str - slug: None | Unset | str = UNSET - description: None | Unset | str = UNSET - enabled: Unset | bool = UNSET + slug: None | str | Unset = UNSET + description: None | str | Unset = UNSET + enabled: bool | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name command = self.command - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -69,21 +71,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: command = d.pop("command") - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/new_custom_form_data_type.py b/rootly_sdk/models/new_custom_form_data_type.py index 5a463d55..882e4603 100644 --- a/rootly_sdk/models/new_custom_form_data_type.py +++ b/rootly_sdk/models/new_custom_form_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewCustomFormDataType = Literal["custom_forms"] @@ -11,5 +11,5 @@ def check_new_custom_form_data_type(value: str | None) -> NewCustomFormDataType if value is None: return None if value in NEW_CUSTOM_FORM_DATA_TYPE_VALUES: - return cast(NewCustomFormDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_CUSTOM_FORM_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_dashboard.py b/rootly_sdk/models/new_dashboard.py index 83310749..83ada786 100644 --- a/rootly_sdk/models/new_dashboard.py +++ b/rootly_sdk/models/new_dashboard.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_dashboard_data import NewDashboardData @@ -18,14 +19,13 @@ class NewDashboard: data (NewDashboardData): """ - data: "NewDashboardData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewDashboardData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_dashboard.additional_properties = d return new_dashboard - - @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_dashboard_data.py b/rootly_sdk/models/new_dashboard_data.py index 36644464..46818d0c 100644 --- a/rootly_sdk/models/new_dashboard_data.py +++ b/rootly_sdk/models/new_dashboard_data.py @@ -1,8 +1,9 @@ +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_dashboard_data_type import NewDashboardDataType, check_new_dashboard_data_type @@ -22,8 +23,7 @@ class NewDashboardData: """ type_: NewDashboardDataType - attributes: "NewDashboardDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewDashboardDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_dashboard_data.additional_properties = d return new_dashboard_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_dashboard_data_attributes.py b/rootly_sdk/models/new_dashboard_data_attributes.py index 81e91767..95617d9a 100644 --- a/rootly_sdk/models/new_dashboard_data_attributes.py +++ b/rootly_sdk/models/new_dashboard_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -26,31 +28,31 @@ class NewDashboardDataAttributes: Attributes: name (str): The name of the dashboard owner (NewDashboardDataAttributesOwner): The owner type of the dashboard - 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 + 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 """ name: str owner: NewDashboardDataAttributesOwner - 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 + 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 def to_dict(self) -> dict[str, Any]: name = self.name owner: str = self.owner - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -58,7 +60,7 @@ def to_dict(self) -> dict[str, Any]: public = self.public - range_: None | Unset | str + range_: None | str | Unset if isinstance(self.range_, Unset): range_ = UNSET else: @@ -66,13 +68,13 @@ def to_dict(self) -> dict[str, Any]: auto_refresh = self.auto_refresh - color: Unset | str = UNSET + color: str | Unset = UNSET if not isinstance(self.color, Unset): color = self.color icon = self.icon - period: Unset | str = UNSET + period: str | Unset = UNSET if not isinstance(self.period, Unset): period = self.period @@ -108,30 +110,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) public = d.pop("public", UNSET) - def _parse_range_(data: object) -> None | Unset | str: + def _parse_range_(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) range_ = _parse_range_(d.pop("range", UNSET)) auto_refresh = d.pop("auto_refresh", UNSET) _color = d.pop("color", UNSET) - color: Unset | NewDashboardDataAttributesColor + color: NewDashboardDataAttributesColor | Unset if isinstance(_color, Unset): color = UNSET else: @@ -140,7 +142,7 @@ def _parse_range_(data: object) -> None | Unset | str: icon = d.pop("icon", UNSET) _period = d.pop("period", UNSET) - period: Unset | NewDashboardDataAttributesPeriod + period: NewDashboardDataAttributesPeriod | Unset if isinstance(_period, Unset): period = UNSET else: diff --git a/rootly_sdk/models/new_dashboard_data_attributes_color.py b/rootly_sdk/models/new_dashboard_data_attributes_color.py index 59da6c09..48cf07c7 100644 --- a/rootly_sdk/models/new_dashboard_data_attributes_color.py +++ b/rootly_sdk/models/new_dashboard_data_attributes_color.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewDashboardDataAttributesColor = Literal["#D7F5E1", "#E9E2FF", "#FAE6E8", "#FAEEE6", "#FCF2CF"] @@ -15,5 +15,5 @@ def check_new_dashboard_data_attributes_color(value: str | None) -> NewDashboard if value is None: return None if value in NEW_DASHBOARD_DATA_ATTRIBUTES_COLOR_VALUES: - return cast(NewDashboardDataAttributesColor, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_DASHBOARD_DATA_ATTRIBUTES_COLOR_VALUES!r}") diff --git a/rootly_sdk/models/new_dashboard_data_attributes_owner.py b/rootly_sdk/models/new_dashboard_data_attributes_owner.py index 569713dc..7df3bc5b 100644 --- a/rootly_sdk/models/new_dashboard_data_attributes_owner.py +++ b/rootly_sdk/models/new_dashboard_data_attributes_owner.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewDashboardDataAttributesOwner = Literal["team", "user"] @@ -12,5 +12,5 @@ def check_new_dashboard_data_attributes_owner(value: str | None) -> NewDashboard if value is None: return None if value in NEW_DASHBOARD_DATA_ATTRIBUTES_OWNER_VALUES: - return cast(NewDashboardDataAttributesOwner, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_DASHBOARD_DATA_ATTRIBUTES_OWNER_VALUES!r}") diff --git a/rootly_sdk/models/new_dashboard_data_attributes_period.py b/rootly_sdk/models/new_dashboard_data_attributes_period.py index 6450f3ff..a086dc4d 100644 --- a/rootly_sdk/models/new_dashboard_data_attributes_period.py +++ b/rootly_sdk/models/new_dashboard_data_attributes_period.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewDashboardDataAttributesPeriod = Literal["day", "month", "week"] @@ -13,5 +13,5 @@ def check_new_dashboard_data_attributes_period(value: str | None) -> NewDashboar if value is None: return None if value in NEW_DASHBOARD_DATA_ATTRIBUTES_PERIOD_VALUES: - return cast(NewDashboardDataAttributesPeriod, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_DASHBOARD_DATA_ATTRIBUTES_PERIOD_VALUES!r}") diff --git a/rootly_sdk/models/new_dashboard_data_type.py b/rootly_sdk/models/new_dashboard_data_type.py index e74befa5..bccd1a41 100644 --- a/rootly_sdk/models/new_dashboard_data_type.py +++ b/rootly_sdk/models/new_dashboard_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewDashboardDataType = Literal["dashboards"] @@ -11,5 +11,5 @@ def check_new_dashboard_data_type(value: str | None) -> NewDashboardDataType | N if value is None: return None if value in NEW_DASHBOARD_DATA_TYPE_VALUES: - return cast(NewDashboardDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_DASHBOARD_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_dashboard_panel.py b/rootly_sdk/models/new_dashboard_panel.py index 1d97f0c7..51c3a349 100644 --- a/rootly_sdk/models/new_dashboard_panel.py +++ b/rootly_sdk/models/new_dashboard_panel.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_dashboard_panel_data import NewDashboardPanelData @@ -18,14 +19,13 @@ class NewDashboardPanel: data (NewDashboardPanelData): """ - data: "NewDashboardPanelData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewDashboardPanelData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_dashboard_panel.additional_properties = d return new_dashboard_panel - - @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_dashboard_panel_data.py b/rootly_sdk/models/new_dashboard_panel_data.py index 78a4f6cf..f8614209 100644 --- a/rootly_sdk/models/new_dashboard_panel_data.py +++ b/rootly_sdk/models/new_dashboard_panel_data.py @@ -1,8 +1,9 @@ +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_dashboard_panel_data_type import NewDashboardPanelDataType, check_new_dashboard_panel_data_type @@ -22,8 +23,7 @@ class NewDashboardPanelData: """ type_: NewDashboardPanelDataType - attributes: "NewDashboardPanelDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewDashboardPanelDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_dashboard_panel_data.additional_properties = d return new_dashboard_panel_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_dashboard_panel_data_attributes.py b/rootly_sdk/models/new_dashboard_panel_data_attributes.py index 26381827..3571d9eb 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -20,13 +22,13 @@ class NewDashboardPanelDataAttributes: """ Attributes: params (NewDashboardPanelDataAttributesParams): - name (Union[None, Unset, str]): The name of the dashboard_panel - position (Union['NewDashboardPanelDataAttributesPositionType0', None, Unset]): + name (None | str | Unset): The name of the dashboard_panel + position (NewDashboardPanelDataAttributesPositionType0 | None | Unset): """ - params: "NewDashboardPanelDataAttributesParams" - name: None | Unset | str = UNSET - position: Union["NewDashboardPanelDataAttributesPositionType0", None, Unset] = UNSET + params: NewDashboardPanelDataAttributesParams + name: None | str | Unset = UNSET + position: NewDashboardPanelDataAttributesPositionType0 | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_dashboard_panel_data_attributes_position_type_0 import ( @@ -35,13 +37,13 @@ def to_dict(self) -> dict[str, Any]: params = self.params.to_dict() - name: None | Unset | str + name: None | str | Unset if isinstance(self.name, Unset): name = UNSET else: name = self.name - position: None | Unset | dict[str, Any] + position: dict[str, Any] | None | Unset if isinstance(self.position, Unset): position = UNSET elif isinstance(self.position, NewDashboardPanelDataAttributesPositionType0): @@ -73,16 +75,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 | Unset | str: + def _parse_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) name = _parse_name(d.pop("name", UNSET)) - def _parse_position(data: object) -> Union["NewDashboardPanelDataAttributesPositionType0", None, Unset]: + def _parse_position(data: object) -> NewDashboardPanelDataAttributesPositionType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -93,9 +95,9 @@ def _parse_position(data: object) -> Union["NewDashboardPanelDataAttributesPosit position_type_0 = NewDashboardPanelDataAttributesPositionType0.from_dict(data) return position_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["NewDashboardPanelDataAttributesPositionType0", None, Unset], data) + return cast(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 866c7b91..3bb4b26d 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -27,42 +29,42 @@ class NewDashboardPanelDataAttributesParams: """ Attributes: - 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): + description (str | Unset): + table_fields (list[str] | Unset): + legend (NewDashboardPanelDataAttributesParamsLegend | Unset): + datalabels (NewDashboardPanelDataAttributesParamsDatalabels | Unset): + datasets (list[NewDashboardPanelDataAttributesParamsDatasetsItem] | 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - display: Unset | str = UNSET + display: str | Unset = UNSET if not isinstance(self.display, Unset): display = self.display description = self.description - table_fields: Unset | list[str] = UNSET + table_fields: list[str] | Unset = UNSET if not isinstance(self.table_fields, Unset): table_fields = self.table_fields - legend: Unset | dict[str, Any] = UNSET + legend: dict[str, Any] | Unset = UNSET if not isinstance(self.legend, Unset): legend = self.legend.to_dict() - datalabels: Unset | dict[str, Any] = UNSET + datalabels: dict[str, Any] | Unset = UNSET if not isinstance(self.datalabels, Unset): datalabels = self.datalabels.to_dict() - datasets: Unset | list[dict[str, Any]] = UNSET + datasets: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.datasets, Unset): datasets = [] for datasets_item_data in self.datasets: @@ -101,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: Unset | NewDashboardPanelDataAttributesParamsDisplay + display: NewDashboardPanelDataAttributesParamsDisplay | Unset if isinstance(_display, Unset): display = UNSET else: @@ -112,25 +114,27 @@ 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: Unset | NewDashboardPanelDataAttributesParamsLegend + legend: NewDashboardPanelDataAttributesParamsLegend | Unset if isinstance(_legend, Unset): legend = UNSET else: legend = NewDashboardPanelDataAttributesParamsLegend.from_dict(_legend) _datalabels = d.pop("datalabels", UNSET) - datalabels: Unset | NewDashboardPanelDataAttributesParamsDatalabels + datalabels: NewDashboardPanelDataAttributesParamsDatalabels | Unset if isinstance(_datalabels, Unset): datalabels = UNSET else: datalabels = NewDashboardPanelDataAttributesParamsDatalabels.from_dict(_datalabels) - datasets = [] _datasets = d.pop("datasets", UNSET) - for datasets_item_data in _datasets or []: - datasets_item = NewDashboardPanelDataAttributesParamsDatasetsItem.from_dict(datasets_item_data) + 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) - 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 2293464d..adb508ca 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,10 +15,10 @@ class NewDashboardPanelDataAttributesParamsDatalabels: """ Attributes: - enabled (Union[Unset, bool]): + enabled (bool | Unset): """ - enabled: Unset | bool = UNSET + enabled: bool | Unset = UNSET 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 64e20254..5e2ae7c9 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,18 +31,18 @@ class NewDashboardPanelDataAttributesParamsDatasetsItem: """ Attributes: - 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): + collection (NewDashboardPanelDataAttributesParamsDatasetsItemCollection | Unset): + filter_ (list[NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem] | Unset): + group_by (NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0 | None | str | Unset): + aggregate (NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0 | None | 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,24 +53,24 @@ def to_dict(self) -> dict[str, Any]: NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0, ) - name: None | Unset | str + name: None | str | Unset if isinstance(self.name, Unset): name = UNSET else: name = self.name - collection: Unset | str = UNSET + collection: str | Unset = UNSET if not isinstance(self.collection, Unset): collection = self.collection - filter_: Unset | list[dict[str, Any]] = UNSET + filter_: list[dict[str, Any]] | Unset = 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: None | Unset | dict[str, Any] | str + group_by: dict[str, Any] | None | str | Unset if isinstance(self.group_by, Unset): group_by = UNSET elif isinstance(self.group_by, NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0): @@ -76,7 +78,7 @@ def to_dict(self) -> dict[str, Any]: else: group_by = self.group_by - aggregate: None | Unset | dict[str, Any] + aggregate: dict[str, Any] | None | Unset if isinstance(self.aggregate, Unset): aggregate = UNSET elif isinstance(self.aggregate, NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0): @@ -114,32 +116,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> None | Unset | str: + def _parse_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) name = _parse_name(d.pop("name", UNSET)) _collection = d.pop("collection", UNSET) - collection: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemCollection + collection: NewDashboardPanelDataAttributesParamsDatasetsItemCollection | Unset 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) - for filter_item_data in _filter_ or []: - filter_item = NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem.from_dict(filter_item_data) + 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) - filter_.append(filter_item) + filter_.append(filter_item) def _parse_group_by( data: object, - ) -> Union["NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0", None, Unset, str]: + ) -> NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0 | None | str | Unset: if data is None: return data if isinstance(data, Unset): @@ -152,17 +156,15 @@ def _parse_group_by( ) return group_by_type_1_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast( - Union["NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0", None, Unset, str], data - ) + return cast(NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0 | None | str | Unset, data) group_by = _parse_group_by(d.pop("group_by", UNSET)) def _parse_aggregate( data: object, - ) -> Union["NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0", None, Unset]: + ) -> NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -173,9 +175,9 @@ def _parse_aggregate( aggregate_type_0 = NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0.from_dict(data) return aggregate_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0", None, Unset], data) + return cast(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 a92aa09f..e3ed83f7 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,28 +19,28 @@ class NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0: """ Attributes: - operation (Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation]): - key (Union[None, Unset, str]): - cumulative (Union[None, Unset, bool]): + operation (NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation | Unset): + key (None | str | Unset): + cumulative (bool | None | Unset): """ - operation: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation = UNSET - key: None | Unset | str = UNSET - cumulative: None | Unset | bool = UNSET + operation: NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation | Unset = UNSET + key: None | str | Unset = UNSET + cumulative: bool | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: Unset | str = UNSET + operation: str | Unset = UNSET if not isinstance(self.operation, Unset): operation = self.operation - key: None | Unset | str + key: None | str | Unset if isinstance(self.key, Unset): key = UNSET else: key = self.key - cumulative: None | Unset | bool + cumulative: bool | None | Unset if isinstance(self.cumulative, Unset): cumulative = UNSET else: @@ -60,7 +62,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: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation + operation: NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation | Unset if isinstance(_operation, Unset): operation = UNSET else: @@ -68,21 +70,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _operation ) - def _parse_key(data: object) -> None | Unset | str: + def _parse_key(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) key = _parse_key(d.pop("key", UNSET)) - def _parse_cumulative(data: object) -> None | Unset | bool: + def _parse_cumulative(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) cumulative = _parse_cumulative(d.pop("cumulative", UNSET)) diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0_operation.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0_operation.py index 4dfb520d..e016bef4 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0_operation.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0_operation.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation = Literal["average", "count", "sum"] @@ -17,7 +17,7 @@ def check_new_dashboard_panel_data_attributes_params_datasets_item_aggregate_typ if value is None: return None if value in NEW_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_AGGREGATE_TYPE_0_OPERATION_VALUES: - return cast(NewDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_AGGREGATE_TYPE_0_OPERATION_VALUES!r}" ) diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_collection.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_collection.py index 18491e05..bc67bc9f 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_collection.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_collection.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewDashboardPanelDataAttributesParamsDatasetsItemCollection = Literal[ "alerts", "incident_action_items", "incident_post_mortems", "incidents", "users" @@ -21,7 +21,7 @@ def check_new_dashboard_panel_data_attributes_params_datasets_item_collection( if value is None: return None if value in NEW_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_COLLECTION_VALUES: - return cast(NewDashboardPanelDataAttributesParamsDatasetsItemCollection, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_COLLECTION_VALUES!r}" ) 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 628c4993..eba2d965 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,20 +25,20 @@ class NewDashboardPanelDataAttributesParamsDatasetsItemFilterItem: """ Attributes: - operation (Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation]): - rules (Union[Unset, list['NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem']]): + operation (NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation | Unset): + rules (list[NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem] | Unset): """ - operation: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation = UNSET - rules: Unset | list["NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem"] = UNSET + operation: NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation | Unset = UNSET + rules: list[NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: Unset | str = UNSET + operation: str | Unset = UNSET if not isinstance(self.operation, Unset): operation = self.operation - rules: Unset | list[dict[str, Any]] = UNSET + rules: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -61,18 +63,22 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation + operation: NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation | Unset 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) - for rules_item_data in _rules or []: - rules_item = NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem.from_dict(rules_item_data) + 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 + ) - 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_operation.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_operation.py index d300e577..78daff9c 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_operation.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_operation.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation = Literal["and", "or"] @@ -16,7 +16,7 @@ def check_new_dashboard_panel_data_attributes_params_datasets_item_filter_item_o if value is None: return None if value in NEW_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_FILTER_ITEM_OPERATION_VALUES: - return cast(NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_FILTER_ITEM_OPERATION_VALUES!r}" ) 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 64adb14c..1e50dd93 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -21,24 +23,24 @@ class NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem: """ Attributes: - operation (Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation]): - condition (Union[Unset, NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition]): - key (Union[Unset, str]): - value (Union[Unset, str]): + operation (NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation | Unset): + condition (NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition | Unset): + key (str | Unset): + value (str | Unset): """ - operation: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation = UNSET - condition: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition = UNSET - key: Unset | str = UNSET - value: Unset | str = UNSET + operation: NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation | Unset = UNSET + condition: NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition | Unset = UNSET + key: str | Unset = UNSET + value: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: Unset | str = UNSET + operation: str | Unset = UNSET if not isinstance(self.operation, Unset): operation = self.operation - condition: Unset | str = UNSET + condition: str | Unset = UNSET if not isinstance(self.condition, Unset): condition = self.condition @@ -64,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) _operation = d.pop("operation", UNSET) - operation: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation + operation: NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation | Unset if isinstance(_operation, Unset): operation = UNSET else: @@ -73,7 +75,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _condition = d.pop("condition", UNSET) - condition: Unset | NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition + condition: NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition | Unset if isinstance(_condition, Unset): condition = UNSET else: diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item_condition.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item_condition.py index fa998fdb..9609e601 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item_condition.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition = Literal[ "!=", "<=", "=", ">=", "assigned", "contains", "exists", "not_contains", "not_exists", "unassigned" @@ -26,7 +26,7 @@ def check_new_dashboard_panel_data_attributes_params_datasets_item_filter_item_r if value is None: return None if value in NEW_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_FILTER_ITEM_RULES_ITEM_CONDITION_VALUES: - return cast(NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_FILTER_ITEM_RULES_ITEM_CONDITION_VALUES!r}" ) diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item_operation.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item_operation.py index 81b24ba6..c4cdeecf 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item_operation.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item_operation.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation = Literal["and", "or"] @@ -16,7 +16,7 @@ def check_new_dashboard_panel_data_attributes_params_datasets_item_filter_item_r if value is None: return None if value in NEW_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_FILTER_ITEM_RULES_ITEM_OPERATION_VALUES: - return cast(NewDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_FILTER_ITEM_RULES_ITEM_OPERATION_VALUES!r}" ) 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 baa6f0ba..7119aaa4 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,3 +1,5 @@ +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_datasets_item_group_by_type_1_type_0_key.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0_key.py index bfe98211..1b3af1cb 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0_key.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0_key.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0Key = Literal[ "alert_field", "custom_field", "incident_role" @@ -19,7 +19,7 @@ def check_new_dashboard_panel_data_attributes_params_datasets_item_group_by_type if value is None: return None if value in NEW_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_GROUP_BY_TYPE_1_TYPE_0_KEY_VALUES: - return cast(NewDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0Key, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_GROUP_BY_TYPE_1_TYPE_0_KEY_VALUES!r}" ) diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_display.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_display.py index 352a7f60..6582b7af 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_display.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_display.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewDashboardPanelDataAttributesParamsDisplay = Literal[ "aggregate_value", @@ -29,7 +29,7 @@ def check_new_dashboard_panel_data_attributes_params_display( if value is None: return None if value in NEW_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DISPLAY_VALUES: - return cast(NewDashboardPanelDataAttributesParamsDisplay, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DISPLAY_VALUES!r}" ) 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 2b500d0d..7628e602 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -17,14 +19,14 @@ class NewDashboardPanelDataAttributesParamsLegend: """ Attributes: - groups (Union[Unset, NewDashboardPanelDataAttributesParamsLegendGroups]): Default: 'all'. + groups (NewDashboardPanelDataAttributesParamsLegendGroups | Unset): Default: 'all'. """ - groups: Unset | NewDashboardPanelDataAttributesParamsLegendGroups = "all" + groups: NewDashboardPanelDataAttributesParamsLegendGroups | Unset = "all" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - groups: Unset | str = UNSET + groups: str | Unset = UNSET if not isinstance(self.groups, Unset): groups = self.groups @@ -40,7 +42,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: Unset | NewDashboardPanelDataAttributesParamsLegendGroups + groups: NewDashboardPanelDataAttributesParamsLegendGroups | Unset if isinstance(_groups, Unset): groups = UNSET else: diff --git a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_legend_groups.py b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_legend_groups.py index aa2b2560..52dd360c 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_attributes_params_legend_groups.py +++ b/rootly_sdk/models/new_dashboard_panel_data_attributes_params_legend_groups.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewDashboardPanelDataAttributesParamsLegendGroups = Literal["all", "charted"] @@ -16,7 +16,7 @@ def check_new_dashboard_panel_data_attributes_params_legend_groups( if value is None: return None if value in NEW_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_LEGEND_GROUPS_VALUES: - return cast(NewDashboardPanelDataAttributesParamsLegendGroups, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_LEGEND_GROUPS_VALUES!r}" ) 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 bc42d2ce..4937e4d2 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_dashboard_panel_data_type.py b/rootly_sdk/models/new_dashboard_panel_data_type.py index 125c5dea..3ac2251b 100644 --- a/rootly_sdk/models/new_dashboard_panel_data_type.py +++ b/rootly_sdk/models/new_dashboard_panel_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewDashboardPanelDataType = Literal["dashboard_panels"] @@ -11,5 +11,5 @@ def check_new_dashboard_panel_data_type(value: str | None) -> NewDashboardPanelD if value is None: return None if value in NEW_DASHBOARD_PANEL_DATA_TYPE_VALUES: - return cast(NewDashboardPanelDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_DASHBOARD_PANEL_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_edge_connector.py b/rootly_sdk/models/new_edge_connector.py index c6ec30be..ad031287 100644 --- a/rootly_sdk/models/new_edge_connector.py +++ b/rootly_sdk/models/new_edge_connector.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,7 +20,7 @@ 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]: diff --git a/rootly_sdk/models/new_edge_connector_action.py b/rootly_sdk/models/new_edge_connector_action.py index 3312bc3c..83cba905 100644 --- a/rootly_sdk/models/new_edge_connector_action.py +++ b/rootly_sdk/models/new_edge_connector_action.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,7 +20,7 @@ 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]: diff --git a/rootly_sdk/models/new_edge_connector_action_action.py b/rootly_sdk/models/new_edge_connector_action_action.py index 0d749327..de102e90 100644 --- a/rootly_sdk/models/new_edge_connector_action_action.py +++ b/rootly_sdk/models/new_edge_connector_action_action.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,12 +25,12 @@ class NewEdgeConnectorActionAction: Attributes: name (str): Action name action_type (NewEdgeConnectorActionActionActionType): Action type - metadata (Union[Unset, NewEdgeConnectorActionActionMetadata]): + metadata (NewEdgeConnectorActionActionMetadata | Unset): """ name: str action_type: NewEdgeConnectorActionActionActionType - metadata: Union[Unset, "NewEdgeConnectorActionActionMetadata"] = UNSET + metadata: NewEdgeConnectorActionActionMetadata | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +38,7 @@ def to_dict(self) -> dict[str, Any]: action_type: str = self.action_type - metadata: Unset | dict[str, Any] = UNSET + metadata: dict[str, Any] | Unset = UNSET if not isinstance(self.metadata, Unset): metadata = self.metadata.to_dict() @@ -63,7 +65,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: Unset | NewEdgeConnectorActionActionMetadata + metadata: NewEdgeConnectorActionActionMetadata | Unset if isinstance(_metadata, Unset): metadata = UNSET else: diff --git a/rootly_sdk/models/new_edge_connector_action_action_action_type.py b/rootly_sdk/models/new_edge_connector_action_action_action_type.py index 8756aed7..afe20b55 100644 --- a/rootly_sdk/models/new_edge_connector_action_action_action_type.py +++ b/rootly_sdk/models/new_edge_connector_action_action_action_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEdgeConnectorActionActionActionType = Literal["http", "script"] @@ -14,7 +14,7 @@ def check_new_edge_connector_action_action_action_type( if value is None: return None if value in NEW_EDGE_CONNECTOR_ACTION_ACTION_ACTION_TYPE_VALUES: - return cast(NewEdgeConnectorActionActionActionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_EDGE_CONNECTOR_ACTION_ACTION_ACTION_TYPE_VALUES!r}" ) 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 2af21e6c..19cb7566 100644 --- a/rootly_sdk/models/new_edge_connector_action_action_metadata.py +++ b/rootly_sdk/models/new_edge_connector_action_action_metadata.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -23,36 +25,36 @@ class NewEdgeConnectorActionActionMetadata: """ Attributes: - description (Union[None, Unset, str]): - timeout (Union[None, Unset, int]): - icon (Union[Unset, NewEdgeConnectorActionActionMetadataIcon]): - parameters (Union[None, Unset, list['NewEdgeConnectorActionActionMetadataParametersType0Item']]): + description (None | str | Unset): + timeout (int | None | Unset): + icon (NewEdgeConnectorActionActionMetadataIcon | Unset): + parameters (list[NewEdgeConnectorActionActionMetadataParametersType0Item] | None | Unset): """ - description: None | Unset | str = UNSET - timeout: None | Unset | int = UNSET - icon: Unset | NewEdgeConnectorActionActionMetadataIcon = UNSET - parameters: None | Unset | list["NewEdgeConnectorActionActionMetadataParametersType0Item"] = UNSET + description: None | str | Unset = UNSET + timeout: int | None | Unset = UNSET + icon: NewEdgeConnectorActionActionMetadataIcon | Unset = UNSET + parameters: list[NewEdgeConnectorActionActionMetadataParametersType0Item] | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - timeout: None | Unset | int + timeout: int | None | Unset if isinstance(self.timeout, Unset): timeout = UNSET else: timeout = self.timeout - icon: Unset | str = UNSET + icon: str | Unset = UNSET if not isinstance(self.icon, Unset): icon = self.icon - parameters: None | Unset | list[dict[str, Any]] + parameters: list[dict[str, Any]] | None | Unset if isinstance(self.parameters, Unset): parameters = UNSET elif isinstance(self.parameters, list): @@ -86,26 +88,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_timeout(data: object) -> None | Unset | int: + def _parse_timeout(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) timeout = _parse_timeout(d.pop("timeout", UNSET)) _icon = d.pop("icon", UNSET) - icon: Unset | NewEdgeConnectorActionActionMetadataIcon + icon: NewEdgeConnectorActionActionMetadataIcon | Unset if isinstance(_icon, Unset): icon = UNSET else: @@ -113,7 +115,7 @@ def _parse_timeout(data: object) -> None | Unset | int: def _parse_parameters( data: object, - ) -> None | Unset | list["NewEdgeConnectorActionActionMetadataParametersType0Item"]: + ) -> list[NewEdgeConnectorActionActionMetadataParametersType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -131,9 +133,9 @@ def _parse_parameters( parameters_type_0.append(parameters_type_0_item) return parameters_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["NewEdgeConnectorActionActionMetadataParametersType0Item"], data) + return cast(list[NewEdgeConnectorActionActionMetadataParametersType0Item] | None | Unset, data) parameters = _parse_parameters(d.pop("parameters", UNSET)) diff --git a/rootly_sdk/models/new_edge_connector_action_action_metadata_icon.py b/rootly_sdk/models/new_edge_connector_action_action_metadata_icon.py index 9139ed57..e5aff2ab 100644 --- a/rootly_sdk/models/new_edge_connector_action_action_metadata_icon.py +++ b/rootly_sdk/models/new_edge_connector_action_action_metadata_icon.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEdgeConnectorActionActionMetadataIcon = Literal[ "arrow-path", @@ -37,7 +37,7 @@ def check_new_edge_connector_action_action_metadata_icon( if value is None: return None if value in NEW_EDGE_CONNECTOR_ACTION_ACTION_METADATA_ICON_VALUES: - return cast(NewEdgeConnectorActionActionMetadataIcon, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_EDGE_CONNECTOR_ACTION_ACTION_METADATA_ICON_VALUES!r}" ) 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 3d886db6..0cce53dd 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,44 +19,44 @@ class NewEdgeConnectorActionActionMetadataParametersType0Item: """ Attributes: - 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): + type_ (NewEdgeConnectorActionActionMetadataParametersType0ItemType | Unset): + required (bool | Unset): + description (None | str | Unset): + default (None | str | Unset): Default value (any type) + options (list[str] | None | 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ required = self.required - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - default: None | Unset | str + default: None | str | Unset if isinstance(self.default, Unset): default = UNSET else: default = self.default - options: None | Unset | list[str] + options: list[str] | None | Unset if isinstance(self.options, Unset): options = UNSET elif isinstance(self.options, list): @@ -87,7 +89,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | NewEdgeConnectorActionActionMetadataParametersType0ItemType + type_: NewEdgeConnectorActionActionMetadataParametersType0ItemType | Unset if isinstance(_type_, Unset): type_ = UNSET else: @@ -95,25 +97,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: required = d.pop("required", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_default(data: object) -> None | Unset | str: + def _parse_default(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) default = _parse_default(d.pop("default", UNSET)) - def _parse_options(data: object) -> None | Unset | list[str]: + def _parse_options(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -124,9 +126,9 @@ def _parse_options(data: object) -> None | Unset | list[str]: options_type_0 = cast(list[str], data) return options_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) options = _parse_options(d.pop("options", UNSET)) diff --git a/rootly_sdk/models/new_edge_connector_action_action_metadata_parameters_type_0_item_type.py b/rootly_sdk/models/new_edge_connector_action_action_metadata_parameters_type_0_item_type.py index 3211027a..bb8fc339 100644 --- a/rootly_sdk/models/new_edge_connector_action_action_metadata_parameters_type_0_item_type.py +++ b/rootly_sdk/models/new_edge_connector_action_action_metadata_parameters_type_0_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEdgeConnectorActionActionMetadataParametersType0ItemType = Literal["boolean", "number", "string"] @@ -17,7 +17,7 @@ def check_new_edge_connector_action_action_metadata_parameters_type_0_item_type( if value is None: return None if value in NEW_EDGE_CONNECTOR_ACTION_ACTION_METADATA_PARAMETERS_TYPE_0_ITEM_TYPE_VALUES: - return cast(NewEdgeConnectorActionActionMetadataParametersType0ItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_EDGE_CONNECTOR_ACTION_ACTION_METADATA_PARAMETERS_TYPE_0_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_edge_connector_edge_connector.py b/rootly_sdk/models/new_edge_connector_edge_connector.py index 1a8c5d5c..04ee6fcf 100644 --- a/rootly_sdk/models/new_edge_connector_edge_connector.py +++ b/rootly_sdk/models/new_edge_connector_edge_connector.py @@ -1,5 +1,8 @@ +from __future__ import annotations + 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 @@ -18,34 +21,44 @@ class NewEdgeConnectorEdgeConnector: """ Attributes: name (str): Connector name - 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 + description (None | str | Unset): Connector description + status (NewEdgeConnectorEdgeConnectorStatus | Unset): Connector status + subscriptions (list[str] | Unset): Array of event types to subscribe to + owner_group_ids (list[UUID] | Unset): IDs of the teams (groups) that own this connector. Required when the + caller is a team admin without tenant-wide edge connector permissions """ name: str - description: None | Unset | str = UNSET - status: Unset | NewEdgeConnectorEdgeConnectorStatus = UNSET - subscriptions: Unset | list[str] = UNSET + description: None | str | Unset = UNSET + status: NewEdgeConnectorEdgeConnectorStatus | Unset = UNSET + subscriptions: list[str] | Unset = UNSET + owner_group_ids: list[UUID] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status - subscriptions: Unset | list[str] = UNSET + subscriptions: list[str] | Unset = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions + owner_group_ids: list[str] | Unset = UNSET + if not isinstance(self.owner_group_ids, Unset): + owner_group_ids = [] + for owner_group_ids_item_data in self.owner_group_ids: + owner_group_ids_item = str(owner_group_ids_item_data) + owner_group_ids.append(owner_group_ids_item) + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -59,6 +72,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["status"] = status if subscriptions is not UNSET: field_dict["subscriptions"] = subscriptions + if owner_group_ids is not UNSET: + field_dict["owner_group_ids"] = owner_group_ids return field_dict @@ -67,17 +82,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) _status = d.pop("status", UNSET) - status: Unset | NewEdgeConnectorEdgeConnectorStatus + status: NewEdgeConnectorEdgeConnectorStatus | Unset if isinstance(_status, Unset): status = UNSET else: @@ -85,11 +100,21 @@ def _parse_description(data: object) -> None | Unset | str: subscriptions = cast(list[str], d.pop("subscriptions", UNSET)) + _owner_group_ids = d.pop("owner_group_ids", UNSET) + owner_group_ids: list[UUID] | Unset = UNSET + if _owner_group_ids is not UNSET: + owner_group_ids = [] + for owner_group_ids_item_data in _owner_group_ids: + owner_group_ids_item = UUID(owner_group_ids_item_data) + + owner_group_ids.append(owner_group_ids_item) + new_edge_connector_edge_connector = cls( name=name, description=description, status=status, subscriptions=subscriptions, + owner_group_ids=owner_group_ids, ) new_edge_connector_edge_connector.additional_properties = d diff --git a/rootly_sdk/models/new_edge_connector_edge_connector_status.py b/rootly_sdk/models/new_edge_connector_edge_connector_status.py index b7866e43..16a2eef9 100644 --- a/rootly_sdk/models/new_edge_connector_edge_connector_status.py +++ b/rootly_sdk/models/new_edge_connector_edge_connector_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEdgeConnectorEdgeConnectorStatus = Literal["active", "paused"] @@ -12,5 +12,5 @@ def check_new_edge_connector_edge_connector_status(value: str | None) -> NewEdge if value is None: return None if value in NEW_EDGE_CONNECTOR_EDGE_CONNECTOR_STATUS_VALUES: - return cast(NewEdgeConnectorEdgeConnectorStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_EDGE_CONNECTOR_EDGE_CONNECTOR_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/new_environment.py b/rootly_sdk/models/new_environment.py index d79e5a31..6b3f1a99 100644 --- a/rootly_sdk/models/new_environment.py +++ b/rootly_sdk/models/new_environment.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_environment_data import NewEnvironmentData @@ -18,14 +19,13 @@ class NewEnvironment: data (NewEnvironmentData): """ - data: "NewEnvironmentData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewEnvironmentData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_environment.additional_properties = d return new_environment - - @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_environment_data.py b/rootly_sdk/models/new_environment_data.py index 4408f696..caf5d54b 100644 --- a/rootly_sdk/models/new_environment_data.py +++ b/rootly_sdk/models/new_environment_data.py @@ -1,8 +1,9 @@ +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_environment_data_type import NewEnvironmentDataType, check_new_environment_data_type @@ -22,8 +23,7 @@ class NewEnvironmentData: """ type_: NewEnvironmentDataType - attributes: "NewEnvironmentDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewEnvironmentDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_environment_data.additional_properties = d return new_environment_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_environment_data_attributes.py b/rootly_sdk/models/new_environment_data_attributes.py index 654b7bf5..1d2f997a 100644 --- a/rootly_sdk/models/new_environment_data_attributes.py +++ b/rootly_sdk/models/new_environment_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -23,74 +25,74 @@ class NewEnvironmentDataAttributes: """ Attributes: name (str): The name of the environment - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + description (None | str | Unset): The description of the environment + public_description (None | str | Unset): The status page 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 associated with this environment - properties (Union[Unset, list['NewEnvironmentDataAttributesPropertiesItem']]): Array of property values for this + slack_aliases (list[NewEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases associated + with this environment + properties (list[NewEnvironmentDataAttributesPropertiesItem] | Unset): Array of property values for this environment. """ name: str - 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 + slug: None | str | Unset = UNSET + description: None | str | Unset = UNSET + public_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 def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -99,7 +101,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: None | Unset | list[dict[str, Any]] + slack_channels: list[dict[str, Any]] | None | Unset if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -111,7 +113,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: None | Unset | list[dict[str, Any]] + slack_aliases: list[dict[str, Any]] | None | Unset if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -123,7 +125,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: Unset | list[dict[str, Any]] = UNSET + properties: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -173,61 +175,61 @@ 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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -238,15 +240,15 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> None | Unset | list["NewEnvironmentDataAttributesSlackChannelsType0Item"]: + ) -> list[NewEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -264,15 +266,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["NewEnvironmentDataAttributesSlackChannelsType0Item"], data) + return cast(list[NewEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset, data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> None | Unset | list["NewEnvironmentDataAttributesSlackAliasesType0Item"]: + ) -> list[NewEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -290,18 +292,20 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["NewEnvironmentDataAttributesSlackAliasesType0Item"], data) + return cast(list[NewEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset, data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - properties = [] _properties = d.pop("properties", UNSET) - for properties_item_data in _properties or []: - properties_item = NewEnvironmentDataAttributesPropertiesItem.from_dict(properties_item_data) + 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) - properties.append(properties_item) + properties.append(properties_item) new_environment_data_attributes = cls( name=name, 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 1205e4d5..417ca4ce 100644 --- a/rootly_sdk/models/new_environment_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_environment_data_attributes_properties_item.py @@ -1,3 +1,5 @@ +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 c59113a3..49c1212f 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="NewEnvironmentDataAttributesSlackAliasesType0Item") @@ -17,7 +18,6 @@ class NewEnvironmentDataAttributesSlackAliasesType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - new_environment_data_attributes_slack_aliases_type_0_item.additional_properties = d return new_environment_data_attributes_slack_aliases_type_0_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_environment_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/new_environment_data_attributes_slack_channels_type_0_item.py index fef9736b..5789646a 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="NewEnvironmentDataAttributesSlackChannelsType0Item") @@ -17,7 +18,6 @@ class NewEnvironmentDataAttributesSlackChannelsType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - new_environment_data_attributes_slack_channels_type_0_item.additional_properties = d return new_environment_data_attributes_slack_channels_type_0_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_environment_data_type.py b/rootly_sdk/models/new_environment_data_type.py index 0103a838..9ea3aae4 100644 --- a/rootly_sdk/models/new_environment_data_type.py +++ b/rootly_sdk/models/new_environment_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEnvironmentDataType = Literal["environments"] @@ -11,5 +11,5 @@ def check_new_environment_data_type(value: str | None) -> NewEnvironmentDataType if value is None: return None if value in NEW_ENVIRONMENT_DATA_TYPE_VALUES: - return cast(NewEnvironmentDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ENVIRONMENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_escalation_policy.py b/rootly_sdk/models/new_escalation_policy.py index 3145c93b..2fddad7b 100644 --- a/rootly_sdk/models/new_escalation_policy.py +++ b/rootly_sdk/models/new_escalation_policy.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_escalation_policy_data import NewEscalationPolicyData @@ -18,14 +19,13 @@ class NewEscalationPolicy: data (NewEscalationPolicyData): """ - data: "NewEscalationPolicyData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewEscalationPolicyData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_escalation_policy.additional_properties = d return new_escalation_policy - - @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_escalation_policy_data.py b/rootly_sdk/models/new_escalation_policy_data.py index 7abe00c2..6b5d6ffa 100644 --- a/rootly_sdk/models/new_escalation_policy_data.py +++ b/rootly_sdk/models/new_escalation_policy_data.py @@ -1,8 +1,9 @@ +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_escalation_policy_data_type import NewEscalationPolicyDataType, check_new_escalation_policy_data_type @@ -22,8 +23,7 @@ class NewEscalationPolicyData: """ type_: NewEscalationPolicyDataType - attributes: "NewEscalationPolicyDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewEscalationPolicyDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_escalation_policy_data.additional_properties = d return new_escalation_policy_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_escalation_policy_data_attributes.py b/rootly_sdk/models/new_escalation_policy_data_attributes.py index 79022943..ca904842 100644 --- a/rootly_sdk/models/new_escalation_policy_data_attributes.py +++ b/rootly_sdk/models/new_escalation_policy_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -19,20 +21,20 @@ class NewEscalationPolicyDataAttributes: """ Attributes: name (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['NewEscalationPolicyDataAttributesBusinessHoursType0', None, Unset]): + 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): """ name: str - 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 + 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 def to_dict(self) -> dict[str, Any]: from ..models.new_escalation_policy_data_attributes_business_hours_type_0 import ( @@ -41,7 +43,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -49,15 +51,15 @@ def to_dict(self) -> dict[str, Any]: repeat_count = self.repeat_count - group_ids: Unset | list[str] = UNSET + group_ids: list[str] | Unset = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - service_ids: Unset | list[str] = UNSET + service_ids: list[str] | Unset = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - business_hours: None | Unset | dict[str, Any] + business_hours: dict[str, Any] | None | Unset if isinstance(self.business_hours, Unset): business_hours = UNSET elif isinstance(self.business_hours, NewEscalationPolicyDataAttributesBusinessHoursType0): @@ -94,12 +96,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) @@ -109,9 +111,7 @@ def _parse_description(data: object) -> None | Unset | str: service_ids = cast(list[str], d.pop("service_ids", UNSET)) - def _parse_business_hours( - data: object, - ) -> Union["NewEscalationPolicyDataAttributesBusinessHoursType0", None, Unset]: + def _parse_business_hours(data: object) -> NewEscalationPolicyDataAttributesBusinessHoursType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -122,9 +122,9 @@ def _parse_business_hours( business_hours_type_0 = NewEscalationPolicyDataAttributesBusinessHoursType0.from_dict(data) return business_hours_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["NewEscalationPolicyDataAttributesBusinessHoursType0", None, Unset], data) + return cast(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 3b974e86..9ec0f083 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,8 +1,9 @@ +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.new_escalation_policy_data_attributes_business_hours_type_0_days_type_0_item import ( NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item, @@ -21,25 +22,23 @@ class NewEscalationPolicyDataAttributesBusinessHoursType0: """ Attributes: - 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): 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: 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) + time_zone: NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone | Unset = UNSET + days: list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset = UNSET + start_time: None | str | Unset = UNSET + end_time: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: - time_zone: Unset | str = UNSET + time_zone: str | Unset = UNSET if not isinstance(self.time_zone, Unset): time_zone = self.time_zone - days: None | Unset | list[str] + days: list[str] | None | Unset if isinstance(self.days, Unset): days = UNSET elif isinstance(self.days, list): @@ -51,20 +50,20 @@ def to_dict(self) -> dict[str, Any]: else: days = self.days - start_time: None | Unset | str + start_time: None | str | Unset if isinstance(self.start_time, Unset): start_time = UNSET else: start_time = self.start_time - end_time: None | Unset | str + end_time: None | str | Unset if isinstance(self.end_time, Unset): end_time = UNSET else: end_time = self.end_time field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if time_zone is not UNSET: field_dict["time_zone"] = time_zone @@ -81,7 +80,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: Unset | NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone + time_zone: NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone | Unset if isinstance(_time_zone, Unset): time_zone = UNSET else: @@ -89,7 +88,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_days( data: object, - ) -> None | Unset | list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]: + ) -> list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -109,27 +108,27 @@ def _parse_days( days_type_0.append(days_type_0_item) return days_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item], data) + return cast(list[NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset, data) days = _parse_days(d.pop("days", UNSET)) - def _parse_start_time(data: object) -> None | Unset | str: + def _parse_start_time(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> None | Unset | str: + def _parse_end_time(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) end_time = _parse_end_time(d.pop("end_time", UNSET)) @@ -140,21 +139,4 @@ def _parse_end_time(data: object) -> None | Unset | str: end_time=end_time, ) - new_escalation_policy_data_attributes_business_hours_type_0.additional_properties = d return new_escalation_policy_data_attributes_business_hours_type_0 - - @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_escalation_policy_data_attributes_business_hours_type_0_days_type_0_item.py b/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0_days_type_0_item.py index 2e7a6f5e..b5ffa63a 100644 --- a/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0_days_type_0_item.py +++ b/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0_days_type_0_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item = Literal["F", "M", "R", "S", "T", "U", "W"] @@ -21,7 +21,7 @@ def check_new_escalation_policy_data_attributes_business_hours_type_0_days_type_ if value is None: return None if value in NEW_ESCALATION_POLICY_DATA_ATTRIBUTES_BUSINESS_HOURS_TYPE_0_DAYS_TYPE_0_ITEM_VALUES: - return cast(NewEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_DATA_ATTRIBUTES_BUSINESS_HOURS_TYPE_0_DAYS_TYPE_0_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0_time_zone.py b/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0_time_zone.py index 306d49f4..139a5fc7 100644 --- a/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0_time_zone.py +++ b/rootly_sdk/models/new_escalation_policy_data_attributes_business_hours_type_0_time_zone.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone = Literal[ "Abu Dhabi", @@ -84,6 +84,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -157,6 +158,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -394,6 +396,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -467,6 +470,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -625,7 +629,7 @@ def check_new_escalation_policy_data_attributes_business_hours_type_0_time_zone( if value is None: return None if value in NEW_ESCALATION_POLICY_DATA_ATTRIBUTES_BUSINESS_HOURS_TYPE_0_TIME_ZONE_VALUES: - return cast(NewEscalationPolicyDataAttributesBusinessHoursType0TimeZone, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_DATA_ATTRIBUTES_BUSINESS_HOURS_TYPE_0_TIME_ZONE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_escalation_policy_data_type.py b/rootly_sdk/models/new_escalation_policy_data_type.py index a8c2a18e..0f5dccf1 100644 --- a/rootly_sdk/models/new_escalation_policy_data_type.py +++ b/rootly_sdk/models/new_escalation_policy_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEscalationPolicyDataType = Literal["escalation_policies"] @@ -11,5 +11,5 @@ def check_new_escalation_policy_data_type(value: str | None) -> NewEscalationPol if value is None: return None if value in NEW_ESCALATION_POLICY_DATA_TYPE_VALUES: - return cast(NewEscalationPolicyDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_escalation_policy_level.py b/rootly_sdk/models/new_escalation_policy_level.py index 29fe8142..4a420196 100644 --- a/rootly_sdk/models/new_escalation_policy_level.py +++ b/rootly_sdk/models/new_escalation_policy_level.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_escalation_policy_level_data import NewEscalationPolicyLevelData @@ -18,14 +19,13 @@ class NewEscalationPolicyLevel: data (NewEscalationPolicyLevelData): """ - data: "NewEscalationPolicyLevelData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewEscalationPolicyLevelData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_escalation_policy_level.additional_properties = d return new_escalation_policy_level - - @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_escalation_policy_level_data.py b/rootly_sdk/models/new_escalation_policy_level_data.py index 519cc25e..2ea865d2 100644 --- a/rootly_sdk/models/new_escalation_policy_level_data.py +++ b/rootly_sdk/models/new_escalation_policy_level_data.py @@ -1,8 +1,9 @@ +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_escalation_policy_level_data_type import ( NewEscalationPolicyLevelDataType, @@ -25,8 +26,7 @@ class NewEscalationPolicyLevelData: """ type_: NewEscalationPolicyLevelDataType - attributes: "NewEscalationPolicyLevelDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewEscalationPolicyLevelDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_escalation_policy_level_data.additional_properties = d return new_escalation_policy_level_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_escalation_policy_level_data_attributes.py b/rootly_sdk/models/new_escalation_policy_level_data_attributes.py index 1ada703f..7495e011 100644 --- a/rootly_sdk/models/new_escalation_policy_level_data_attributes.py +++ b/rootly_sdk/models/new_escalation_policy_level_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -35,48 +37,46 @@ class NewEscalationPolicyLevelDataAttributes: """ Attributes: position (int): Position of the escalation policy level - 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 + 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'. + paging_strategy_configuration_repeats (int | None | Unset): Number of times to rotate through the roster (cycle- + based round robin). + paging_strategy_configuration_repeats_mode + (NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode | Unset): 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 + paging_strategy_configuration_rotation_scope + (NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope | Unset): Scope of rotation + ordering: active rotation members only, or entire schedule. + paging_strategy_configuration_page_users_count (int | None | Unset): Number of users to page at a time (cycle- + based round robin). + escalation_policy_path_id (None | str | Unset): 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[ - Union["NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None] - ] - delay: Unset | int = UNSET + notification_target_params: list[NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0 | None] + delay: int | Unset = UNSET paging_strategy_configuration_strategy: ( - Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy | Unset ) = "default" paging_strategy_configuration_schedule_strategy: ( - Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy | Unset ) = "on_call_only" - paging_strategy_configuration_repeats: None | Unset | int = UNSET + paging_strategy_configuration_repeats: int | None | Unset = UNSET paging_strategy_configuration_repeats_mode: ( - Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode | Unset ) = UNSET paging_strategy_configuration_rotation_scope: ( - Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope | Unset ) = UNSET - paging_strategy_configuration_page_users_count: None | Unset | int = UNSET - escalation_policy_path_id: None | Unset | str = UNSET + paging_strategy_configuration_page_users_count: int | None | Unset = UNSET + escalation_policy_path_id: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_escalation_policy_level_data_attributes_notification_target_params_item_type_0 import ( @@ -87,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: None | dict[str, Any] + notification_target_params_item: dict[str, Any] | None if isinstance( notification_target_params_item_data, NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0, @@ -99,35 +99,35 @@ def to_dict(self) -> dict[str, Any]: delay = self.delay - paging_strategy_configuration_strategy: Unset | str = UNSET + paging_strategy_configuration_strategy: str | Unset = UNSET if not isinstance(self.paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = self.paging_strategy_configuration_strategy - paging_strategy_configuration_schedule_strategy: Unset | str = UNSET + paging_strategy_configuration_schedule_strategy: str | Unset = 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 + paging_strategy_configuration_repeats: int | None | Unset 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 + paging_strategy_configuration_repeats_mode: str | Unset = 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 + paging_strategy_configuration_rotation_scope: str | Unset = 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 + paging_strategy_configuration_page_users_count: int | None | Unset 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 + escalation_policy_path_id: None | str | Unset if isinstance(self.escalation_policy_path_id, Unset): escalation_policy_path_id = UNSET else: @@ -179,7 +179,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_notification_target_params_item( data: object, - ) -> Union["NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None]: + ) -> NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0 | None: if data is None: return data try: @@ -190,11 +190,9 @@ def _parse_notification_target_params_item( ) return notification_target_params_item_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast( - Union["NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None], data - ) + return cast(NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0 | None, data) notification_target_params_item = _parse_notification_target_params_item( notification_target_params_item_data @@ -206,7 +204,7 @@ def _parse_notification_target_params_item( _paging_strategy_configuration_strategy = d.pop("paging_strategy_configuration_strategy", UNSET) paging_strategy_configuration_strategy: ( - Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy | Unset ) if isinstance(_paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = UNSET @@ -221,7 +219,7 @@ def _parse_notification_target_params_item( "paging_strategy_configuration_schedule_strategy", UNSET ) paging_strategy_configuration_schedule_strategy: ( - Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy | Unset ) if isinstance(_paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = UNSET @@ -232,12 +230,12 @@ def _parse_notification_target_params_item( ) ) - def _parse_paging_strategy_configuration_repeats(data: object) -> None | Unset | int: + def _parse_paging_strategy_configuration_repeats(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) paging_strategy_configuration_repeats = _parse_paging_strategy_configuration_repeats( d.pop("paging_strategy_configuration_repeats", UNSET) @@ -245,7 +243,7 @@ def _parse_paging_strategy_configuration_repeats(data: object) -> None | Unset | _paging_strategy_configuration_repeats_mode = d.pop("paging_strategy_configuration_repeats_mode", UNSET) paging_strategy_configuration_repeats_mode: ( - Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode | Unset ) if isinstance(_paging_strategy_configuration_repeats_mode, Unset): paging_strategy_configuration_repeats_mode = UNSET @@ -258,7 +256,7 @@ def _parse_paging_strategy_configuration_repeats(data: object) -> None | Unset | _paging_strategy_configuration_rotation_scope = d.pop("paging_strategy_configuration_rotation_scope", UNSET) paging_strategy_configuration_rotation_scope: ( - Unset | NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope + NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope | Unset ) if isinstance(_paging_strategy_configuration_rotation_scope, Unset): paging_strategy_configuration_rotation_scope = UNSET @@ -269,23 +267,23 @@ def _parse_paging_strategy_configuration_repeats(data: object) -> None | Unset | ) ) - def _parse_paging_strategy_configuration_page_users_count(data: object) -> None | Unset | int: + def _parse_paging_strategy_configuration_page_users_count(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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: + def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) escalation_policy_path_id = _parse_escalation_policy_path_id(d.pop("escalation_policy_path_id", UNSET)) 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 fa456696..e2902f3c 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,8 +1,9 @@ +from __future__ import annotations + 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.new_escalation_policy_level_data_attributes_notification_target_params_item_type_0_team_members import ( NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers, @@ -25,26 +26,25 @@ class NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0: Microsoft Teams channel, then the Rootly channel UUID. type_ (NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type): The type of the notification target - team_members (Union[Unset, NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers]): - For targets with type=team, controls whether to notify admins, all team members, or escalate to team EP. + team_members (NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers | Unset): For + targets with type=team, controls whether to notify admins, all team members, or escalate to team EP. """ id: str type_: NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type - team_members: Unset | NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + team_members: NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers | Unset = UNSET def to_dict(self) -> dict[str, Any]: id = self.id type_: str = self.type_ - team_members: Unset | str = UNSET + team_members: str | Unset = UNSET if not isinstance(self.team_members, Unset): team_members = self.team_members field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -66,7 +66,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _team_members = d.pop("team_members", UNSET) - team_members: Unset | NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers + team_members: NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers | Unset if isinstance(_team_members, Unset): team_members = UNSET else: @@ -82,21 +82,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: team_members=team_members, ) - new_escalation_policy_level_data_attributes_notification_target_params_item_type_0.additional_properties = d return new_escalation_policy_level_data_attributes_notification_target_params_item_type_0 - - @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_escalation_policy_level_data_attributes_notification_target_params_item_type_0_team_members.py b/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0_team_members.py index fe885898..1a9f400d 100644 --- a/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0_team_members.py +++ b/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0_team_members.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers = Literal[ "admins", "all", "escalate" @@ -19,7 +19,7 @@ def check_new_escalation_policy_level_data_attributes_notification_target_params if value is None: return None if value in NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_NOTIFICATION_TARGET_PARAMS_ITEM_TYPE_0_TEAM_MEMBERS_VALUES: - return cast(NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_NOTIFICATION_TARGET_PARAMS_ITEM_TYPE_0_TEAM_MEMBERS_VALUES!r}" ) diff --git a/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0_type.py b/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0_type.py index b15dd98e..11b58f8d 100644 --- a/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0_type.py +++ b/rootly_sdk/models/new_escalation_policy_level_data_attributes_notification_target_params_item_type_0_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type = Literal[ "microsoft_teams_channel", "schedule", "service", "slack_channel", "team", "user" @@ -22,7 +22,7 @@ def check_new_escalation_policy_level_data_attributes_notification_target_params if value is None: return None if value in NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_NOTIFICATION_TARGET_PARAMS_ITEM_TYPE_0_TYPE_VALUES: - return cast(NewEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_NOTIFICATION_TARGET_PARAMS_ITEM_TYPE_0_TYPE_VALUES!r}" ) 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 index ebc1070f..95db8cff 100644 --- 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 @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode = Literal["all", "users"] @@ -16,7 +16,7 @@ def check_new_escalation_policy_level_data_attributes_paging_strategy_configurat 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) + return 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 index 622265ef..9add22fe 100644 --- 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 @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope = Literal[ "active_rotation", "entire_schedule" @@ -18,7 +18,7 @@ def check_new_escalation_policy_level_data_attributes_paging_strategy_configurat 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) + return 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_level_data_attributes_paging_strategy_configuration_schedule_strategy.py b/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_schedule_strategy.py index 61c65220..faf0072f 100644 --- a/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_schedule_strategy.py +++ b/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_schedule_strategy.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy = Literal["everyone", "on_call_only"] @@ -16,7 +16,7 @@ def check_new_escalation_policy_level_data_attributes_paging_strategy_configurat if value is None: return None if value in NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_SCHEDULE_STRATEGY_VALUES: - return cast(NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_SCHEDULE_STRATEGY_VALUES!r}" ) diff --git a/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_strategy.py b/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_strategy.py index 415be8dd..d9fb2f67 100644 --- a/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_strategy.py +++ b/rootly_sdk/models/new_escalation_policy_level_data_attributes_paging_strategy_configuration_strategy.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy = Literal[ "alert", "cycle", "default", "random" @@ -20,7 +20,7 @@ def check_new_escalation_policy_level_data_attributes_paging_strategy_configurat if value is None: return None if value in NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_STRATEGY_VALUES: - return cast(NewEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_STRATEGY_VALUES!r}" ) diff --git a/rootly_sdk/models/new_escalation_policy_level_data_type.py b/rootly_sdk/models/new_escalation_policy_level_data_type.py index 9202ddd6..37b33090 100644 --- a/rootly_sdk/models/new_escalation_policy_level_data_type.py +++ b/rootly_sdk/models/new_escalation_policy_level_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEscalationPolicyLevelDataType = Literal["escalation_levels"] @@ -11,5 +11,5 @@ def check_new_escalation_policy_level_data_type(value: str | None) -> NewEscalat if value is None: return None if value in NEW_ESCALATION_POLICY_LEVEL_DATA_TYPE_VALUES: - return cast(NewEscalationPolicyLevelDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_LEVEL_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_escalation_policy_path.py b/rootly_sdk/models/new_escalation_policy_path.py index 44d4209f..8bd7fb61 100644 --- a/rootly_sdk/models/new_escalation_policy_path.py +++ b/rootly_sdk/models/new_escalation_policy_path.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_escalation_policy_path_data import NewEscalationPolicyPathData @@ -18,14 +19,13 @@ class NewEscalationPolicyPath: data (NewEscalationPolicyPathData): """ - data: "NewEscalationPolicyPathData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewEscalationPolicyPathData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_escalation_policy_path.additional_properties = d return new_escalation_policy_path - - @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_escalation_policy_path_data.py b/rootly_sdk/models/new_escalation_policy_path_data.py index 9dd2784d..349c44e9 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data.py +++ b/rootly_sdk/models/new_escalation_policy_path_data.py @@ -1,8 +1,9 @@ +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_escalation_policy_path_data_type import ( NewEscalationPolicyPathDataType, @@ -25,8 +26,7 @@ class NewEscalationPolicyPathData: """ type_: NewEscalationPolicyPathDataType - attributes: "NewEscalationPolicyPathDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewEscalationPolicyPathDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_escalation_policy_path_data.additional_properties = d return new_escalation_policy_path_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_escalation_policy_path_data_attributes.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes.py index 2e64dd84..b6e94293 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -15,10 +17,18 @@ NewEscalationPolicyPathDataAttributesNotificationType, check_new_escalation_policy_path_data_attributes_notification_type, ) +from ..models.new_escalation_policy_path_data_attributes_notification_type_fallback import ( + NewEscalationPolicyPathDataAttributesNotificationTypeFallback, + check_new_escalation_policy_path_data_attributes_notification_type_fallback, +) from ..models.new_escalation_policy_path_data_attributes_path_type import ( NewEscalationPolicyPathDataAttributesPathType, check_new_escalation_policy_path_data_attributes_path_type, ) +from ..models.new_escalation_policy_path_data_attributes_retrigger_timeout_minutes import ( + NewEscalationPolicyPathDataAttributesRetriggerTimeoutMinutes, + check_new_escalation_policy_path_data_attributes_retrigger_timeout_minutes, +) from ..models.new_escalation_policy_path_data_attributes_time_restriction_time_zone import ( NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone, check_new_escalation_policy_path_data_attributes_time_restriction_time_zone, @@ -26,29 +36,14 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_0 import ( - NewEscalationPolicyPathDataAttributesRulesItemType0, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_1 import ( - NewEscalationPolicyPathDataAttributesRulesItemType1, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_2 import ( - NewEscalationPolicyPathDataAttributesRulesItemType2, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_3 import ( - NewEscalationPolicyPathDataAttributesRulesItemType3, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_4 import ( - NewEscalationPolicyPathDataAttributesRulesItemType4, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_5 import ( - NewEscalationPolicyPathDataAttributesRulesItemType5, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_6 import ( - NewEscalationPolicyPathDataAttributesRulesItemType6, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_7 import ( - NewEscalationPolicyPathDataAttributesRulesItemType7, + from ..models.escalation_path_rule_alert_urgency import EscalationPathRuleAlertUrgency + from ..models.escalation_path_rule_deferral_window import EscalationPathRuleDeferralWindow + from ..models.escalation_path_rule_field import EscalationPathRuleField + from ..models.escalation_path_rule_json_path import EscalationPathRuleJsonPath + from ..models.escalation_path_rule_service import EscalationPathRuleService + from ..models.escalation_path_rule_working_hour import EscalationPathRuleWorkingHour + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItem, ) from ..models.new_escalation_policy_path_data_attributes_time_restrictions_item import ( NewEscalationPolicyPathDataAttributesTimeRestrictionsItem, @@ -63,128 +58,117 @@ class NewEscalationPolicyPathDataAttributes: """ Attributes: name (str): The name of the escalation path - 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 + notification_type (NewEscalationPolicyPathDataAttributesNotificationType | Unset): Notification rule type to be + used Default: 'audible'. + path_type (NewEscalationPolicyPathDataAttributesPathType | Unset): The type of escalation path to create Default: 'escalation'. - 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 (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 is execute_path. - default (Union[None, Unset, bool]): Whether this escalation path is the default path - match_mode (Union[Unset, NewEscalationPolicyPathDataAttributesMatchMode]): How path rules are matched. Default: + default (bool | None | Unset): Whether this escalation path is the default path + match_mode (NewEscalationPolicyPathDataAttributesMatchMode | Unset): 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['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 + 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). + retrigger_timeout_minutes (NewEscalationPolicyPathDataAttributesRetriggerTimeoutMinutes | Unset): Re-trigger + acknowledged alerts on this path after N minutes; null inherits the urgency/workspace default, -1 = never. + rules (list[EscalationPathRuleAlertUrgency | EscalationPathRuleDeferralWindow | EscalationPathRuleField | + EscalationPathRuleJsonPath | EscalationPathRuleService | EscalationPathRuleWorkingHour] | Unset): Escalation + path conditions + notification_type_rules (list[NewEscalationPolicyPathDataAttributesNotificationTypeRulesItem] | Unset): Rules + deciding whether an alert pages audible or quiet, evaluated in order — the first matching rule's + notification_type wins, otherwise notification_type_fallback applies. When present, the path's notification_type + is aligned to notification_type_fallback. Only available when notification type conditions are enabled for the + team. + notification_type_fallback (NewEscalationPolicyPathDataAttributesNotificationTypeFallback | Unset): Paged when + no notification type rule matches. Considered only when notification_type_rules are present — the path's + notification_type is aligned to it; without rules it is aligned to notification_type instead. Only available + when notification type conditions are enabled for the team. Default: 'audible'. + time_restriction_time_zone (NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone | Unset): Time zone + used for time restrictions. + time_restrictions (list[NewEscalationPolicyPathDataAttributesTimeRestrictionsItem] | Unset): 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: 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 + 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 + retrigger_timeout_minutes: NewEscalationPolicyPathDataAttributesRetriggerTimeoutMinutes | Unset = UNSET rules: ( - Unset - | list[ - Union[ - "NewEscalationPolicyPathDataAttributesRulesItemType0", - "NewEscalationPolicyPathDataAttributesRulesItemType1", - "NewEscalationPolicyPathDataAttributesRulesItemType2", - "NewEscalationPolicyPathDataAttributesRulesItemType3", - "NewEscalationPolicyPathDataAttributesRulesItemType4", - "NewEscalationPolicyPathDataAttributesRulesItemType5", - "NewEscalationPolicyPathDataAttributesRulesItemType6", - "NewEscalationPolicyPathDataAttributesRulesItemType7", - ] + list[ + EscalationPathRuleAlertUrgency + | EscalationPathRuleDeferralWindow + | EscalationPathRuleField + | EscalationPathRuleJsonPath + | EscalationPathRuleService + | EscalationPathRuleWorkingHour ] + | Unset ) = UNSET - time_restriction_time_zone: Unset | NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone = UNSET - time_restrictions: Unset | list["NewEscalationPolicyPathDataAttributesTimeRestrictionsItem"] = UNSET + notification_type_rules: list[NewEscalationPolicyPathDataAttributesNotificationTypeRulesItem] | Unset = UNSET + notification_type_fallback: NewEscalationPolicyPathDataAttributesNotificationTypeFallback | Unset = "audible" + time_restriction_time_zone: NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone | Unset = UNSET + time_restrictions: list[NewEscalationPolicyPathDataAttributesTimeRestrictionsItem] | Unset = UNSET def to_dict(self) -> dict[str, Any]: - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_0 import ( - NewEscalationPolicyPathDataAttributesRulesItemType0, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_1 import ( - NewEscalationPolicyPathDataAttributesRulesItemType1, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_2 import ( - NewEscalationPolicyPathDataAttributesRulesItemType2, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_3 import ( - NewEscalationPolicyPathDataAttributesRulesItemType3, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_4 import ( - NewEscalationPolicyPathDataAttributesRulesItemType4, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_5 import ( - NewEscalationPolicyPathDataAttributesRulesItemType5, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_6 import ( - NewEscalationPolicyPathDataAttributesRulesItemType6, - ) + from ..models.escalation_path_rule_alert_urgency import EscalationPathRuleAlertUrgency + from ..models.escalation_path_rule_field import EscalationPathRuleField + from ..models.escalation_path_rule_json_path import EscalationPathRuleJsonPath + from ..models.escalation_path_rule_service import EscalationPathRuleService + from ..models.escalation_path_rule_working_hour import EscalationPathRuleWorkingHour name = self.name - notification_type: Unset | str = UNSET + notification_type: str | Unset = UNSET if not isinstance(self.notification_type, Unset): notification_type = self.notification_type - path_type: Unset | str = UNSET + path_type: str | Unset = UNSET if not isinstance(self.path_type, Unset): path_type = self.path_type - after_deferral_behavior: Unset | str = UNSET + after_deferral_behavior: str | Unset = UNSET if not isinstance(self.after_deferral_behavior, Unset): after_deferral_behavior = self.after_deferral_behavior - after_deferral_path_id: None | Unset | str + after_deferral_path_id: None | str | Unset if isinstance(self.after_deferral_path_id, Unset): after_deferral_path_id = UNSET else: after_deferral_path_id = self.after_deferral_path_id - default: None | Unset | bool + default: bool | None | Unset if isinstance(self.default, Unset): default = UNSET else: default = self.default - match_mode: Unset | str = UNSET + match_mode: str | Unset = UNSET if not isinstance(self.match_mode, Unset): match_mode = self.match_mode position = self.position - repeat: None | Unset | bool + repeat: bool | None | Unset if isinstance(self.repeat, Unset): repeat = UNSET else: repeat = self.repeat - repeat_count: None | Unset | int + repeat_count: int | None | Unset if isinstance(self.repeat_count, Unset): repeat_count = UNSET else: @@ -192,41 +176,46 @@ 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: int | Unset = UNSET + if not isinstance(self.retrigger_timeout_minutes, Unset): retrigger_timeout_minutes = self.retrigger_timeout_minutes - rules: Unset | list[dict[str, Any]] = UNSET + rules: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: rules_item: dict[str, Any] - if isinstance(rules_item_data, NewEscalationPolicyPathDataAttributesRulesItemType0): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, NewEscalationPolicyPathDataAttributesRulesItemType1): + if isinstance(rules_item_data, EscalationPathRuleAlertUrgency): rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, NewEscalationPolicyPathDataAttributesRulesItemType2): + elif isinstance(rules_item_data, EscalationPathRuleWorkingHour): rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, NewEscalationPolicyPathDataAttributesRulesItemType3): + elif isinstance(rules_item_data, EscalationPathRuleJsonPath): rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, NewEscalationPolicyPathDataAttributesRulesItemType4): + elif isinstance(rules_item_data, EscalationPathRuleField): rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, NewEscalationPolicyPathDataAttributesRulesItemType5): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, NewEscalationPolicyPathDataAttributesRulesItemType6): + elif isinstance(rules_item_data, EscalationPathRuleService): rules_item = rules_item_data.to_dict() else: rules_item = rules_item_data.to_dict() rules.append(rules_item) - time_restriction_time_zone: Unset | str = UNSET + notification_type_rules: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.notification_type_rules, Unset): + notification_type_rules = [] + for notification_type_rules_item_data in self.notification_type_rules: + notification_type_rules_item = notification_type_rules_item_data.to_dict() + notification_type_rules.append(notification_type_rules_item) + + notification_type_fallback: str | Unset = UNSET + if not isinstance(self.notification_type_fallback, Unset): + notification_type_fallback = self.notification_type_fallback + + time_restriction_time_zone: str | Unset = UNSET if not isinstance(self.time_restriction_time_zone, Unset): time_restriction_time_zone = self.time_restriction_time_zone - time_restrictions: Unset | list[dict[str, Any]] = UNSET + time_restrictions: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.time_restrictions, Unset): time_restrictions = [] for time_restrictions_item_data in self.time_restrictions: @@ -264,6 +253,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["retrigger_timeout_minutes"] = retrigger_timeout_minutes if rules is not UNSET: field_dict["rules"] = rules + if notification_type_rules is not UNSET: + field_dict["notification_type_rules"] = notification_type_rules + if notification_type_fallback is not UNSET: + field_dict["notification_type_fallback"] = notification_type_fallback if time_restriction_time_zone is not UNSET: field_dict["time_restriction_time_zone"] = time_restriction_time_zone if time_restrictions is not UNSET: @@ -273,29 +266,14 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_0 import ( - NewEscalationPolicyPathDataAttributesRulesItemType0, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_1 import ( - NewEscalationPolicyPathDataAttributesRulesItemType1, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_2 import ( - NewEscalationPolicyPathDataAttributesRulesItemType2, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_3 import ( - NewEscalationPolicyPathDataAttributesRulesItemType3, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_4 import ( - NewEscalationPolicyPathDataAttributesRulesItemType4, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_5 import ( - NewEscalationPolicyPathDataAttributesRulesItemType5, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_6 import ( - NewEscalationPolicyPathDataAttributesRulesItemType6, - ) - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_7 import ( - NewEscalationPolicyPathDataAttributesRulesItemType7, + from ..models.escalation_path_rule_alert_urgency import EscalationPathRuleAlertUrgency + from ..models.escalation_path_rule_deferral_window import EscalationPathRuleDeferralWindow + from ..models.escalation_path_rule_field import EscalationPathRuleField + from ..models.escalation_path_rule_json_path import EscalationPathRuleJsonPath + from ..models.escalation_path_rule_service import EscalationPathRuleService + from ..models.escalation_path_rule_working_hour import EscalationPathRuleWorkingHour + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItem, ) from ..models.new_escalation_policy_path_data_attributes_time_restrictions_item import ( NewEscalationPolicyPathDataAttributesTimeRestrictionsItem, @@ -305,21 +283,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: Unset | NewEscalationPolicyPathDataAttributesNotificationType + notification_type: NewEscalationPolicyPathDataAttributesNotificationType | Unset 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: Unset | NewEscalationPolicyPathDataAttributesPathType + path_type: NewEscalationPolicyPathDataAttributesPathType | Unset 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: Unset | NewEscalationPolicyPathDataAttributesAfterDeferralBehavior + after_deferral_behavior: NewEscalationPolicyPathDataAttributesAfterDeferralBehavior | Unset if isinstance(_after_deferral_behavior, Unset): after_deferral_behavior = UNSET else: @@ -327,26 +305,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 | Unset | str: + def _parse_after_deferral_path_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) after_deferral_path_id = _parse_after_deferral_path_id(d.pop("after_deferral_path_id", UNSET)) - def _parse_default(data: object) -> None | Unset | bool: + def _parse_default(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) default = _parse_default(d.pop("default", UNSET)) _match_mode = d.pop("match_mode", UNSET) - match_mode: Unset | NewEscalationPolicyPathDataAttributesMatchMode + match_mode: NewEscalationPolicyPathDataAttributesMatchMode | Unset if isinstance(_match_mode, Unset): match_mode = UNSET else: @@ -354,119 +332,133 @@ def _parse_default(data: object) -> None | Unset | bool: position = d.pop("position", UNSET) - def _parse_repeat(data: object) -> None | Unset | bool: + def _parse_repeat(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) repeat = _parse_repeat(d.pop("repeat", UNSET)) - def _parse_repeat_count(data: object) -> None | Unset | int: + def _parse_repeat_count(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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)) + _retrigger_timeout_minutes = d.pop("retrigger_timeout_minutes", UNSET) + retrigger_timeout_minutes: NewEscalationPolicyPathDataAttributesRetriggerTimeoutMinutes | Unset + if isinstance(_retrigger_timeout_minutes, Unset): + retrigger_timeout_minutes = UNSET + else: + retrigger_timeout_minutes = check_new_escalation_policy_path_data_attributes_retrigger_timeout_minutes( + _retrigger_timeout_minutes + ) - rules = [] _rules = d.pop("rules", UNSET) - 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_0 = NewEscalationPolicyPathDataAttributesRulesItemType0.from_dict(data) - - 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) - - 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) - - 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: + rules: ( + list[ + EscalationPathRuleAlertUrgency + | EscalationPathRuleDeferralWindow + | EscalationPathRuleField + | EscalationPathRuleJsonPath + | EscalationPathRuleService + | EscalationPathRuleWorkingHour + ] + | Unset + ) = UNSET + if _rules is not UNSET: + rules = [] + for rules_item_data in _rules: + + def _parse_rules_item( + data: object, + ) -> ( + EscalationPathRuleAlertUrgency + | EscalationPathRuleDeferralWindow + | EscalationPathRuleField + | EscalationPathRuleJsonPath + | EscalationPathRuleService + | EscalationPathRuleWorkingHour + ): + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_0 = EscalationPathRuleAlertUrgency.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 = EscalationPathRuleWorkingHour.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 = EscalationPathRuleJsonPath.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 = EscalationPathRuleField.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 = EscalationPathRuleService.from_dict(data) + + return rules_item_type_4 + except (TypeError, ValueError, AttributeError, KeyError): + pass if not isinstance(data, dict): raise TypeError() - rules_item_type_5 = NewEscalationPolicyPathDataAttributesRulesItemType5.from_dict(data) + rules_item_type_5 = EscalationPathRuleDeferralWindow.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_item = _parse_rules_item(rules_item_data) + rules.append(rules_item) - rules.append(rules_item) + _notification_type_rules = d.pop("notification_type_rules", UNSET) + notification_type_rules: list[NewEscalationPolicyPathDataAttributesNotificationTypeRulesItem] | Unset = UNSET + if _notification_type_rules is not UNSET: + notification_type_rules = [] + for notification_type_rules_item_data in _notification_type_rules: + notification_type_rules_item = NewEscalationPolicyPathDataAttributesNotificationTypeRulesItem.from_dict( + notification_type_rules_item_data + ) + + notification_type_rules.append(notification_type_rules_item) + + _notification_type_fallback = d.pop("notification_type_fallback", UNSET) + notification_type_fallback: NewEscalationPolicyPathDataAttributesNotificationTypeFallback | Unset + if isinstance(_notification_type_fallback, Unset): + notification_type_fallback = UNSET + else: + notification_type_fallback = check_new_escalation_policy_path_data_attributes_notification_type_fallback( + _notification_type_fallback + ) _time_restriction_time_zone = d.pop("time_restriction_time_zone", UNSET) - time_restriction_time_zone: Unset | NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone + time_restriction_time_zone: NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone | Unset if isinstance(_time_restriction_time_zone, Unset): time_restriction_time_zone = UNSET else: @@ -474,14 +466,16 @@ def _parse_rules_item( _time_restriction_time_zone ) - time_restrictions = [] _time_restrictions = d.pop("time_restrictions", UNSET) - for time_restrictions_item_data in _time_restrictions or []: - time_restrictions_item = NewEscalationPolicyPathDataAttributesTimeRestrictionsItem.from_dict( - time_restrictions_item_data - ) + 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 + ) - time_restrictions.append(time_restrictions_item) + time_restrictions.append(time_restrictions_item) new_escalation_policy_path_data_attributes = cls( name=name, @@ -497,6 +491,8 @@ def _parse_rules_item( initial_delay=initial_delay, retrigger_timeout_minutes=retrigger_timeout_minutes, rules=rules, + notification_type_rules=notification_type_rules, + notification_type_fallback=notification_type_fallback, time_restriction_time_zone=time_restriction_time_zone, time_restrictions=time_restrictions, ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_after_deferral_behavior.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_after_deferral_behavior.py index ad03f930..65f040cf 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_after_deferral_behavior.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_after_deferral_behavior.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEscalationPolicyPathDataAttributesAfterDeferralBehavior = Literal["execute_path", "re_evaluate"] @@ -16,7 +16,7 @@ def check_new_escalation_policy_path_data_attributes_after_deferral_behavior( if value is None: return None if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_AFTER_DEFERRAL_BEHAVIOR_VALUES: - return cast(NewEscalationPolicyPathDataAttributesAfterDeferralBehavior, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_AFTER_DEFERRAL_BEHAVIOR_VALUES!r}" ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_match_mode.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_match_mode.py index d79afe08..88f1df37 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_match_mode.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_match_mode.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEscalationPolicyPathDataAttributesMatchMode = Literal["match-all-rules", "match-any-rule"] @@ -14,7 +14,7 @@ def check_new_escalation_policy_path_data_attributes_match_mode( if value is None: return None if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_MATCH_MODE_VALUES: - return cast(NewEscalationPolicyPathDataAttributesMatchMode, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_MATCH_MODE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type.py index 9adf8c6c..e6fddb35 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEscalationPolicyPathDataAttributesNotificationType = Literal["audible", "quiet"] @@ -16,7 +16,7 @@ def check_new_escalation_policy_path_data_attributes_notification_type( if value is None: return None if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_VALUES: - return cast(NewEscalationPolicyPathDataAttributesNotificationType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_fallback.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_fallback.py new file mode 100644 index 00000000..27c97f26 --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_fallback.py @@ -0,0 +1,22 @@ +from typing import Literal + +NewEscalationPolicyPathDataAttributesNotificationTypeFallback = Literal["audible", "quiet"] + +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_FALLBACK_VALUES: set[ + NewEscalationPolicyPathDataAttributesNotificationTypeFallback +] = { + "audible", + "quiet", +} + + +def check_new_escalation_policy_path_data_attributes_notification_type_fallback( + value: str | None, +) -> NewEscalationPolicyPathDataAttributesNotificationTypeFallback | None: + if value is None: + return None + if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_FALLBACK_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_FALLBACK_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item.py new file mode 100644 index 00000000..9f43cc1e --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item.py @@ -0,0 +1,335 @@ +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_escalation_policy_path_data_attributes_notification_type_rules_item_match_mode import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemMatchMode, + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_match_mode, +) +from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_notification_type import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemNotificationType, + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_notification_type, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_service import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemService, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours, + ) + + +T = TypeVar("T", bound="NewEscalationPolicyPathDataAttributesNotificationTypeRulesItem") + + +@_attrs_define +class NewEscalationPolicyPathDataAttributesNotificationTypeRulesItem: + """ + Attributes: + conditions (list[NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField | + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource | + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency | + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow | + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath | + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents | + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemService | + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours]): Conditions combined per + match_mode, at least one per rule. A deferral_window condition matches when the alert falls inside its time + blocks. + notification_type (NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemNotificationType | Unset): + Outcome when this rule matches Default: 'audible'. + match_mode (NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemMatchMode | Unset): Whether all or any + of the rule's conditions must match Default: 'match-all-rules'. + """ + + conditions: list[ + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField + | NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource + | NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency + | NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow + | NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath + | NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents + | NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemService + | NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours + ] + notification_type: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemNotificationType | Unset = ( + "audible" + ) + match_mode: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemMatchMode | Unset = "match-all-rules" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_service import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemService, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours, + ) + + conditions = [] + for conditions_item_data in self.conditions: + conditions_item: dict[str, Any] + if isinstance( + conditions_item_data, NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency + ): + conditions_item = conditions_item_data.to_dict() + elif isinstance( + conditions_item_data, NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours + ): + conditions_item = conditions_item_data.to_dict() + elif isinstance( + conditions_item_data, NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath + ): + conditions_item = conditions_item_data.to_dict() + elif isinstance( + conditions_item_data, NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField + ): + conditions_item = conditions_item_data.to_dict() + elif isinstance( + conditions_item_data, NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemService + ): + conditions_item = conditions_item_data.to_dict() + elif isinstance( + conditions_item_data, NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow + ): + conditions_item = conditions_item_data.to_dict() + elif isinstance( + conditions_item_data, NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource + ): + conditions_item = conditions_item_data.to_dict() + else: + conditions_item = conditions_item_data.to_dict() + + conditions.append(conditions_item) + + notification_type: str | Unset = UNSET + if not isinstance(self.notification_type, Unset): + notification_type = self.notification_type + + match_mode: str | Unset = UNSET + if not isinstance(self.match_mode, Unset): + match_mode = self.match_mode + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "conditions": conditions, + } + ) + if notification_type is not UNSET: + field_dict["notification_type"] = notification_type + if match_mode is not UNSET: + field_dict["match_mode"] = match_mode + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_service import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemService, + ) + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours, + ) + + d = dict(src_dict) + conditions = [] + _conditions = d.pop("conditions") + for conditions_item_data in _conditions: + + def _parse_conditions_item( + data: object, + ) -> ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField + | NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource + | NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency + | NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow + | NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath + | NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents + | NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemService + | NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours + ): + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_alert_urgency = ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency.from_dict(data) + ) + + return conditions_item_alert_urgency + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_working_hours = ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours.from_dict(data) + ) + + return conditions_item_working_hours + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_json_path = ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath.from_dict(data) + ) + + return conditions_item_json_path + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_alert_field = ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField.from_dict(data) + ) + + return conditions_item_alert_field + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_service = ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemService.from_dict(data) + ) + + return conditions_item_service + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_deferral_window = ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow.from_dict(data) + ) + + return conditions_item_deferral_window + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_alert_source = ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource.from_dict(data) + ) + + return conditions_item_alert_source + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + conditions_item_related_incidents = ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents.from_dict(data) + ) + + return conditions_item_related_incidents + + conditions_item = _parse_conditions_item(conditions_item_data) + + conditions.append(conditions_item) + + _notification_type = d.pop("notification_type", UNSET) + notification_type: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemNotificationType | Unset + if isinstance(_notification_type, Unset): + notification_type = UNSET + else: + notification_type = ( + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_notification_type( + _notification_type + ) + ) + + _match_mode = d.pop("match_mode", UNSET) + match_mode: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemMatchMode | Unset + if isinstance(_match_mode, Unset): + match_mode = UNSET + else: + match_mode = check_new_escalation_policy_path_data_attributes_notification_type_rules_item_match_mode( + _match_mode + ) + + new_escalation_policy_path_data_attributes_notification_type_rules_item = cls( + conditions=conditions, + notification_type=notification_type, + match_mode=match_mode, + ) + + new_escalation_policy_path_data_attributes_notification_type_rules_item.additional_properties = d + return new_escalation_policy_path_data_attributes_notification_type_rules_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_escalation_policy_path_data_attributes_rules_item_type_8_type_3.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field.py similarity index 52% rename from rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3.py rename to rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field.py index 9d1030c3..cedc33b3 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field.py @@ -1,40 +1,42 @@ +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.update_escalation_policy_path_data_attributes_rules_item_type_8_type_3_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3Operator, - check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_3_operator, +from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_operator import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldOperator, + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_operator, ) -from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_3_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_3_rule_type, +from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_rule_type import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldRuleType, + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_rule_type, ) from ..types import UNSET, Unset -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3") +T = TypeVar("T", bound="NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField") @_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3: +class NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField: """ Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3RuleType): The type of the escalation path - rule + rule_type (NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldRuleType): The type of the + escalation path rule fieldable_type (str): The type of the fieldable (e.g., AlertField) fieldable_id (str): The ID of the alert field - operator (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3Operator): How the alert field value should - be matched - values (Union[Unset, list[str]]): Values to match against + operator (NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldOperator): How the alert field + value should be matched + values (list[str] | Unset): Values to match against """ - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3RuleType + rule_type: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldRuleType fieldable_type: str fieldable_id: str - operator: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3Operator - values: Unset | list[str] = UNSET + operator: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldOperator + values: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values @@ -68,7 +70,7 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_3_rule_type( + rule_type = check_new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_rule_type( d.pop("rule_type") ) @@ -76,13 +78,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: fieldable_id = d.pop("fieldable_id") - operator = check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_3_operator( + operator = check_new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_operator( d.pop("operator") ) values = cast(list[str], d.pop("values", UNSET)) - update_escalation_policy_path_data_attributes_rules_item_type_8_type_3 = cls( + new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field = cls( rule_type=rule_type, fieldable_type=fieldable_type, fieldable_id=fieldable_id, @@ -90,8 +92,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: values=values, ) - update_escalation_policy_path_data_attributes_rules_item_type_8_type_3.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_8_type_3 + new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field.additional_properties = d + return new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_operator.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_operator.py new file mode 100644 index 00000000..1973ee37 --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_operator.py @@ -0,0 +1,49 @@ +from typing import Literal + +NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldOperator = Literal[ + "contains", + "contains_key", + "does_not_contain", + "does_not_contain_key", + "does_not_match", + "does_not_start_with", + "is", + "is_empty", + "is_not", + "is_not_empty", + "is_not_one_of", + "is_one_of", + "matches", + "starts_with", +] + +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_FIELD_OPERATOR_VALUES: set[ + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldOperator +] = { + "contains", + "contains_key", + "does_not_contain", + "does_not_contain_key", + "does_not_match", + "does_not_start_with", + "is", + "is_empty", + "is_not", + "is_not_empty", + "is_not_one_of", + "is_one_of", + "matches", + "starts_with", +} + + +def check_new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_operator( + value: str | None, +) -> NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldOperator | None: + if value is None: + return None + if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_FIELD_OPERATOR_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_FIELD_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_rule_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_rule_type.py new file mode 100644 index 00000000..ab1cfb20 --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_rule_type.py @@ -0,0 +1,21 @@ +from typing import Literal + +NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldRuleType = Literal["field"] + +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_FIELD_RULE_TYPE_VALUES: set[ + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldRuleType +] = { + "field", +} + + +def check_new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_rule_type( + value: str | None, +) -> NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldRuleType | None: + if value is None: + return None + if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_FIELD_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_FIELD_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source.py new file mode 100644 index 00000000..6426942d --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source.py @@ -0,0 +1,94 @@ +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.new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_operator import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceOperator, + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_operator, +) +from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_rule_type import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceRuleType, + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_rule_type, +) + +T = TypeVar("T", bound="NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource") + + +@_attrs_define +class NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource: + """ + Attributes: + rule_type (NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceRuleType): The type of the + escalation path rule + operator (NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceOperator): How the alert + source should be matched + values (list[str]): Alert source values to match against (e.g., manual, datadog) + """ + + rule_type: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceRuleType + operator: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceOperator + values: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + rule_type: str = self.rule_type + + operator: str = self.operator + + values = self.values + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "rule_type": rule_type, + "operator": operator, + "values": values, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + rule_type = ( + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_rule_type( + d.pop("rule_type") + ) + ) + + operator = check_new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_operator( + d.pop("operator") + ) + + values = cast(list[str], d.pop("values")) + + new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source = cls( + rule_type=rule_type, + operator=operator, + values=values, + ) + + new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source.additional_properties = d + return new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source + + @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_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_operator.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_operator.py new file mode 100644 index 00000000..eda9d161 --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_operator.py @@ -0,0 +1,26 @@ +from typing import Literal + +NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceOperator = Literal[ + "is", "is_not", "is_not_one_of", "is_one_of" +] + +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_SOURCE_OPERATOR_VALUES: set[ + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceOperator +] = { + "is", + "is_not", + "is_not_one_of", + "is_one_of", +} + + +def check_new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_operator( + value: str | None, +) -> NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceOperator | None: + if value is None: + return None + if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_SOURCE_OPERATOR_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_SOURCE_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_rule_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_rule_type.py new file mode 100644 index 00000000..139ae497 --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_rule_type.py @@ -0,0 +1,21 @@ +from typing import Literal + +NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceRuleType = Literal["source"] + +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_SOURCE_RULE_TYPE_VALUES: set[ + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceRuleType +] = { + "source", +} + + +def check_new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_rule_type( + value: str | None, +) -> NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceRuleType | None: + if value is None: + return None + if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_SOURCE_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_SOURCE_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency.py new file mode 100644 index 00000000..74198aa7 --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency.py @@ -0,0 +1,105 @@ +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.new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_operator import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyOperator, + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_operator, +) +from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_rule_type import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyRuleType, + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_rule_type, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency") + + +@_attrs_define +class NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency: + """ + Attributes: + rule_type (NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyRuleType): The type of the + escalation path rule + urgency_ids (list[str]): Alert urgency ids for which this escalation path should be used + operator (NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyOperator | Unset): How the + alert's urgency should be matched. is and is_not take exactly one id Default: 'is_one_of'. + """ + + rule_type: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyRuleType + urgency_ids: list[str] + operator: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyOperator | Unset = "is_one_of" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + rule_type: str = self.rule_type + + urgency_ids = self.urgency_ids + + operator: str | Unset = UNSET + if not isinstance(self.operator, Unset): + operator = self.operator + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "rule_type": rule_type, + "urgency_ids": urgency_ids, + } + ) + if operator is not UNSET: + field_dict["operator"] = operator + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + rule_type = ( + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_rule_type( + d.pop("rule_type") + ) + ) + + urgency_ids = cast(list[str], d.pop("urgency_ids")) + + _operator = d.pop("operator", UNSET) + operator: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyOperator | Unset + if isinstance(_operator, Unset): + operator = UNSET + else: + operator = ( + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_operator( + _operator + ) + ) + + new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency = cls( + rule_type=rule_type, + urgency_ids=urgency_ids, + operator=operator, + ) + + new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency.additional_properties = d + return new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency + + @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_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_operator.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_operator.py new file mode 100644 index 00000000..ea5c52cb --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_operator.py @@ -0,0 +1,26 @@ +from typing import Literal + +NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyOperator = Literal[ + "is", "is_not", "is_not_one_of", "is_one_of" +] + +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_URGENCY_OPERATOR_VALUES: set[ + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyOperator +] = { + "is", + "is_not", + "is_not_one_of", + "is_one_of", +} + + +def check_new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_operator( + value: str | None, +) -> NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyOperator | None: + if value is None: + return None + if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_URGENCY_OPERATOR_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_URGENCY_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_rule_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_rule_type.py new file mode 100644 index 00000000..4085e093 --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_rule_type.py @@ -0,0 +1,21 @@ +from typing import Literal + +NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyRuleType = Literal["alert_urgency"] + +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_URGENCY_RULE_TYPE_VALUES: set[ + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyRuleType +] = { + "alert_urgency", +} + + +def check_new_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_rule_type( + value: str | None, +) -> NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyRuleType | None: + if value is None: + return None + if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_URGENCY_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_URGENCY_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window.py new file mode 100644 index 00000000..d31295e9 --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window.py @@ -0,0 +1,119 @@ +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_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_rule_type import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowRuleType, + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_rule_type, +) +from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_zone import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeZone, + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_zone, +) + +if TYPE_CHECKING: + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_blocks_item import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeBlocksItem, + ) + + +T = TypeVar("T", bound="NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow") + + +@_attrs_define +class NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow: + """ + Attributes: + rule_type (NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowRuleType): The type of + the escalation path rule + time_zone (NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeZone): Time zone for + the deferral window + time_blocks (list[NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeBlocksItem]): + Time windows during which alerts are deferred + """ + + rule_type: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowRuleType + time_zone: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeZone + time_blocks: list[NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeBlocksItem] + 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 + + time_blocks = [] + for time_blocks_item_data in self.time_blocks: + time_blocks_item = time_blocks_item_data.to_dict() + time_blocks.append(time_blocks_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "rule_type": rule_type, + "time_zone": time_zone, + "time_blocks": time_blocks, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_blocks_item import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeBlocksItem, + ) + + d = dict(src_dict) + rule_type = ( + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_rule_type( + d.pop("rule_type") + ) + ) + + time_zone = ( + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_zone( + d.pop("time_zone") + ) + ) + + time_blocks = [] + _time_blocks = d.pop("time_blocks") + for time_blocks_item_data in _time_blocks: + time_blocks_item = ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeBlocksItem.from_dict( + time_blocks_item_data + ) + ) + + time_blocks.append(time_blocks_item) + + new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window = cls( + rule_type=rule_type, + time_zone=time_zone, + time_blocks=time_blocks, + ) + + new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window.additional_properties = d + return new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window + + @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_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_rule_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_rule_type.py new file mode 100644 index 00000000..c6fed64e --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_rule_type.py @@ -0,0 +1,24 @@ +from typing import Literal + +NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowRuleType = Literal["deferral_window"] + +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_DEFERRAL_WINDOW_RULE_TYPE_VALUES: set[ + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowRuleType +] = { + "deferral_window", +} + + +def check_new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_rule_type( + value: str | None, +) -> NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowRuleType | None: + if value is None: + return None + if ( + value + in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_DEFERRAL_WINDOW_RULE_TYPE_VALUES + ): + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_DEFERRAL_WINDOW_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/escalation_policy_path_rules_item_type_5_time_blocks_item.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_blocks_item.py similarity index 58% rename from rootly_sdk/models/escalation_policy_path_rules_item_type_5_time_blocks_item.py rename to rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_blocks_item.py index 4f035199..3f7b2600 100644 --- a/rootly_sdk/models/escalation_policy_path_rules_item_type_5_time_blocks_item.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_blocks_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -6,40 +8,48 @@ from ..types import UNSET, Unset -T = TypeVar("T", bound="EscalationPolicyPathRulesItemType5TimeBlocksItem") +T = TypeVar("T", bound="NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeBlocksItem") @_attrs_define -class EscalationPolicyPathRulesItemType5TimeBlocksItem: +class NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeBlocksItem: """ Attributes: - 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]): + id (str | Unset): Unique ID of the time block + 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): Order of this time block, starting at 1. Defaults to the block's 1-based position + in time_blocks when omitted. + ends_next_day (bool | Unset): Whether the window crosses midnight. Derived from start_time and end_time; + accepted and ignored on write. """ - 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 + id: str | Unset = UNSET + 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 + ends_next_day: bool | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + id = self.id + monday = self.monday tuesday = self.tuesday @@ -60,15 +70,19 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position + ends_next_day = self.ends_next_day + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id if monday is not UNSET: field_dict["monday"] = monday if tuesday is not UNSET: @@ -91,12 +105,16 @@ def to_dict(self) -> dict[str, Any]: field_dict["all_day"] = all_day if position is not UNSET: field_dict["position"] = position + if ends_next_day is not UNSET: + field_dict["ends_next_day"] = ends_next_day 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) + monday = d.pop("monday", UNSET) tuesday = d.pop("tuesday", UNSET) @@ -117,16 +135,19 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - escalation_policy_path_rules_item_type_5_time_blocks_item = cls( + ends_next_day = d.pop("ends_next_day", UNSET) + + new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_blocks_item = cls( + id=id, monday=monday, tuesday=tuesday, wednesday=wednesday, @@ -138,10 +159,11 @@ def _parse_position(data: object) -> None | Unset | int: end_time=end_time, all_day=all_day, position=position, + ends_next_day=ends_next_day, ) - escalation_policy_path_rules_item_type_5_time_blocks_item.additional_properties = d - return escalation_policy_path_rules_item_type_5_time_blocks_item + new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_blocks_item.additional_properties = d + return new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_blocks_item @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5_time_zone.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_zone.py similarity index 93% rename from rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5_time_zone.py rename to rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_zone.py index ade83f44..7ef99dcf 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5_time_zone.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_zone.py @@ -1,6 +1,6 @@ -from typing import Literal, cast +from typing import Literal -NewEscalationPolicyPathDataAttributesRulesItemType5TimeZone = Literal[ +NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeZone = Literal[ "Abu Dhabi", "Adelaide", "Africa/Algiers", @@ -84,6 +84,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -157,6 +158,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -308,8 +310,8 @@ "Zurich", ] -NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_5_TIME_ZONE_VALUES: set[ - NewEscalationPolicyPathDataAttributesRulesItemType5TimeZone +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_DEFERRAL_WINDOW_TIME_ZONE_VALUES: set[ + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeZone ] = { "Abu Dhabi", "Adelaide", @@ -394,6 +396,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -467,6 +470,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -619,13 +623,16 @@ } -def check_new_escalation_policy_path_data_attributes_rules_item_type_5_time_zone( +def check_new_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_zone( value: str | None, -) -> NewEscalationPolicyPathDataAttributesRulesItemType5TimeZone | None: +) -> NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeZone | None: if value is None: return None - if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_5_TIME_ZONE_VALUES: - return cast(NewEscalationPolicyPathDataAttributesRulesItemType5TimeZone, value) + if ( + value + in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_DEFERRAL_WINDOW_TIME_ZONE_VALUES + ): + return value raise TypeError( - f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_5_TIME_ZONE_VALUES!r}" + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_DEFERRAL_WINDOW_TIME_ZONE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path.py similarity index 50% rename from rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2.py rename to rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path.py index 50ab7788..caee3bb8 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path.py @@ -1,40 +1,42 @@ +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.update_escalation_policy_path_data_attributes_rules_item_type_9_type_2_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2Operator, - check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_2_operator, +from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_operator import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathOperator, + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_operator, ) -from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_2_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_2_rule_type, +from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_rule_type import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathRuleType, + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_rule_type, ) from ..types import UNSET, Unset -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2") +T = TypeVar("T", bound="NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath") @_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2: +class NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath: """ Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2RuleType): The type of the escalation path - rule + rule_type (NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathRuleType): The type of the + escalation path rule json_path (str): JSON path to extract value from payload - operator (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2Operator): How JSON path value should be - matched - 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) + operator (NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathOperator): 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) """ - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2RuleType + rule_type: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathRuleType json_path: str - operator: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2Operator - value: None | Unset | str = UNSET - values: Unset | list[str] = UNSET + operator: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathOperator + value: None | str | Unset = UNSET + values: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +46,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: None | Unset | str + value: None | str | Unset if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values @@ -73,28 +75,28 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_2_rule_type( + rule_type = check_new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_rule_type( d.pop("rule_type") ) json_path = d.pop("json_path") - operator = check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_2_operator( + operator = check_new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_operator( d.pop("operator") ) - def _parse_value(data: object) -> None | Unset | str: + def _parse_value(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) value = _parse_value(d.pop("value", UNSET)) values = cast(list[str], d.pop("values", UNSET)) - update_escalation_policy_path_data_attributes_rules_item_type_9_type_2 = cls( + new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path = cls( rule_type=rule_type, json_path=json_path, operator=operator, @@ -102,8 +104,8 @@ def _parse_value(data: object) -> None | Unset | str: values=values, ) - update_escalation_policy_path_data_attributes_rules_item_type_9_type_2.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_9_type_2 + new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path.additional_properties = d + return new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_operator.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_operator.py new file mode 100644 index 00000000..c7d6b611 --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_operator.py @@ -0,0 +1,49 @@ +from typing import Literal + +NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathOperator = Literal[ + "contains", + "contains_key", + "does_not_contain", + "does_not_contain_key", + "does_not_match", + "does_not_start_with", + "is", + "is_not", + "is_not_one_of", + "is_not_set", + "is_one_of", + "is_set", + "matches", + "starts_with", +] + +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_JSON_PATH_OPERATOR_VALUES: set[ + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathOperator +] = { + "contains", + "contains_key", + "does_not_contain", + "does_not_contain_key", + "does_not_match", + "does_not_start_with", + "is", + "is_not", + "is_not_one_of", + "is_not_set", + "is_one_of", + "is_set", + "matches", + "starts_with", +} + + +def check_new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_operator( + value: str | None, +) -> NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathOperator | None: + if value is None: + return None + if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_JSON_PATH_OPERATOR_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_JSON_PATH_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_rule_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_rule_type.py new file mode 100644 index 00000000..670f72da --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_rule_type.py @@ -0,0 +1,21 @@ +from typing import Literal + +NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathRuleType = Literal["json_path"] + +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_JSON_PATH_RULE_TYPE_VALUES: set[ + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathRuleType +] = { + "json_path", +} + + +def check_new_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_rule_type( + value: str | None, +) -> NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathRuleType | None: + if value is None: + return None + if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_JSON_PATH_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_JSON_PATH_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_match_mode.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_match_mode.py new file mode 100644 index 00000000..2affcfa0 --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_match_mode.py @@ -0,0 +1,22 @@ +from typing import Literal + +NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemMatchMode = Literal["match-all-rules", "match-any-rule"] + +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_MATCH_MODE_VALUES: set[ + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemMatchMode +] = { + "match-all-rules", + "match-any-rule", +} + + +def check_new_escalation_policy_path_data_attributes_notification_type_rules_item_match_mode( + value: str | None, +) -> NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemMatchMode | None: + if value is None: + return None + if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_MATCH_MODE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_MATCH_MODE_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_notification_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_notification_type.py new file mode 100644 index 00000000..4bbfcdd2 --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_notification_type.py @@ -0,0 +1,22 @@ +from typing import Literal + +NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemNotificationType = Literal["audible", "quiet"] + +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_NOTIFICATION_TYPE_VALUES: set[ + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemNotificationType +] = { + "audible", + "quiet", +} + + +def check_new_escalation_policy_path_data_attributes_notification_type_rules_item_notification_type( + value: str | None, +) -> NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemNotificationType | None: + if value is None: + return None + if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_NOTIFICATION_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_NOTIFICATION_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents.py new file mode 100644 index 00000000..aa47f2cc --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents.py @@ -0,0 +1,88 @@ +from __future__ import annotations + +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.new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_operator import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsOperator, + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_operator, +) +from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_rule_type import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsRuleType, + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_rule_type, +) + +T = TypeVar("T", bound="NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents") + + +@_attrs_define +class NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents: + """ + Attributes: + rule_type (NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsRuleType): The type of + the escalation path rule + operator (NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsOperator): Whether the + alert must (or must not) have related incidents + """ + + rule_type: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsRuleType + operator: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsOperator + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + rule_type: str = self.rule_type + + operator: str = self.operator + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "rule_type": rule_type, + "operator": operator, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + rule_type = ( + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_rule_type( + d.pop("rule_type") + ) + ) + + operator = ( + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_operator( + d.pop("operator") + ) + ) + + new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents = cls( + rule_type=rule_type, + operator=operator, + ) + + new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents.additional_properties = d + return new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents + + @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_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_operator.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_operator.py new file mode 100644 index 00000000..b05a7896 --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_operator.py @@ -0,0 +1,25 @@ +from typing import Literal + +NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsOperator = Literal["is_not_set", "is_set"] + +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_RELATED_INCIDENTS_OPERATOR_VALUES: set[ + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsOperator +] = { + "is_not_set", + "is_set", +} + + +def check_new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_operator( + value: str | None, +) -> NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsOperator | None: + if value is None: + return None + if ( + value + in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_RELATED_INCIDENTS_OPERATOR_VALUES + ): + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_RELATED_INCIDENTS_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_rule_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_rule_type.py new file mode 100644 index 00000000..241a933a --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_rule_type.py @@ -0,0 +1,24 @@ +from typing import Literal + +NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsRuleType = Literal["related_incidents"] + +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_RELATED_INCIDENTS_RULE_TYPE_VALUES: set[ + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsRuleType +] = { + "related_incidents", +} + + +def check_new_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_rule_type( + value: str | None, +) -> NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsRuleType | None: + if value is None: + return None + if ( + value + in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_RELATED_INCIDENTS_RULE_TYPE_VALUES + ): + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_RELATED_INCIDENTS_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_service.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_service.py new file mode 100644 index 00000000..b67a9e96 --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_service.py @@ -0,0 +1,101 @@ +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.new_escalation_policy_path_data_attributes_notification_type_rules_item_service_operator import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceOperator, + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_service_operator, +) +from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_service_rule_type import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceRuleType, + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_service_rule_type, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemService") + + +@_attrs_define +class NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemService: + """ + Attributes: + rule_type (NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceRuleType): The type of the + escalation path rule + service_ids (list[str]): Service ids for which this escalation path should be used + operator (NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceOperator | Unset): How the + alert's services should be matched. is and is_not take exactly one id Default: 'is_one_of'. + """ + + rule_type: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceRuleType + service_ids: list[str] + operator: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceOperator | Unset = "is_one_of" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + rule_type: str = self.rule_type + + service_ids = self.service_ids + + operator: str | Unset = UNSET + if not isinstance(self.operator, Unset): + operator = self.operator + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "rule_type": rule_type, + "service_ids": service_ids, + } + ) + if operator is not UNSET: + field_dict["operator"] = operator + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + rule_type = check_new_escalation_policy_path_data_attributes_notification_type_rules_item_service_rule_type( + d.pop("rule_type") + ) + + service_ids = cast(list[str], d.pop("service_ids")) + + _operator = d.pop("operator", UNSET) + operator: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceOperator | Unset + if isinstance(_operator, Unset): + operator = UNSET + else: + operator = check_new_escalation_policy_path_data_attributes_notification_type_rules_item_service_operator( + _operator + ) + + new_escalation_policy_path_data_attributes_notification_type_rules_item_service = cls( + rule_type=rule_type, + service_ids=service_ids, + operator=operator, + ) + + new_escalation_policy_path_data_attributes_notification_type_rules_item_service.additional_properties = d + return new_escalation_policy_path_data_attributes_notification_type_rules_item_service + + @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_escalation_policy_path_data_attributes_notification_type_rules_item_service_operator.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_service_operator.py new file mode 100644 index 00000000..cbe2d132 --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_service_operator.py @@ -0,0 +1,26 @@ +from typing import Literal + +NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceOperator = Literal[ + "is", "is_not", "is_not_one_of", "is_one_of" +] + +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_SERVICE_OPERATOR_VALUES: set[ + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceOperator +] = { + "is", + "is_not", + "is_not_one_of", + "is_one_of", +} + + +def check_new_escalation_policy_path_data_attributes_notification_type_rules_item_service_operator( + value: str | None, +) -> NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceOperator | None: + if value is None: + return None + if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_SERVICE_OPERATOR_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_SERVICE_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_service_rule_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_service_rule_type.py new file mode 100644 index 00000000..74b2cc4c --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_service_rule_type.py @@ -0,0 +1,21 @@ +from typing import Literal + +NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceRuleType = Literal["service"] + +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_SERVICE_RULE_TYPE_VALUES: set[ + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceRuleType +] = { + "service", +} + + +def check_new_escalation_policy_path_data_attributes_notification_type_rules_item_service_rule_type( + value: str | None, +) -> NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceRuleType | None: + if value is None: + return None + if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_SERVICE_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_SERVICE_RULE_TYPE_VALUES!r}" + ) 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_notification_type_rules_item_working_hours.py similarity index 55% rename from rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_1.py rename to rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours.py index d85a1090..875d1081 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_notification_type_rules_item_working_hours.py @@ -1,26 +1,29 @@ +from __future__ import annotations + 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.new_escalation_policy_path_data_attributes_rules_item_type_1_rule_type import ( - NewEscalationPolicyPathDataAttributesRulesItemType1RuleType, - check_new_escalation_policy_path_data_attributes_rules_item_type_1_rule_type, +from ..models.new_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours_rule_type import ( + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHoursRuleType, + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours_rule_type, ) -T = TypeVar("T", bound="NewEscalationPolicyPathDataAttributesRulesItemType1") +T = TypeVar("T", bound="NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours") @_attrs_define -class NewEscalationPolicyPathDataAttributesRulesItemType1: +class NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours: """ Attributes: - rule_type (NewEscalationPolicyPathDataAttributesRulesItemType1RuleType): The type of the escalation path rule + rule_type (NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHoursRuleType): The type of the + escalation path rule within_working_hour (bool): Whether the escalation path should be used within working hours """ - rule_type: NewEscalationPolicyPathDataAttributesRulesItemType1RuleType + rule_type: NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHoursRuleType within_working_hour: bool additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -43,17 +46,21 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - rule_type = check_new_escalation_policy_path_data_attributes_rules_item_type_1_rule_type(d.pop("rule_type")) + rule_type = ( + check_new_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours_rule_type( + d.pop("rule_type") + ) + ) within_working_hour = d.pop("within_working_hour") - new_escalation_policy_path_data_attributes_rules_item_type_1 = cls( + new_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours = cls( rule_type=rule_type, within_working_hour=within_working_hour, ) - new_escalation_policy_path_data_attributes_rules_item_type_1.additional_properties = d - return new_escalation_policy_path_data_attributes_rules_item_type_1 + new_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours.additional_properties = d + return new_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours_rule_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours_rule_type.py new file mode 100644 index 00000000..7de59a0b --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours_rule_type.py @@ -0,0 +1,21 @@ +from typing import Literal + +NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHoursRuleType = Literal["working_hour"] + +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_WORKING_HOURS_RULE_TYPE_VALUES: set[ + NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHoursRuleType +] = { + "working_hour", +} + + +def check_new_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours_rule_type( + value: str | None, +) -> NewEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHoursRuleType | None: + if value is None: + return None + if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_WORKING_HOURS_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_WORKING_HOURS_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_path_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_path_type.py index 1736c354..1aac585f 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_path_type.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_path_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEscalationPolicyPathDataAttributesPathType = Literal["deferral", "escalation"] @@ -14,7 +14,7 @@ def check_new_escalation_policy_path_data_attributes_path_type( if value is None: return None if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_PATH_TYPE_VALUES: - return cast(NewEscalationPolicyPathDataAttributesPathType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_PATH_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_retrigger_timeout_minutes.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_retrigger_timeout_minutes.py new file mode 100644 index 00000000..1fba2c13 --- /dev/null +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_retrigger_timeout_minutes.py @@ -0,0 +1,35 @@ +from typing import Literal + +NewEscalationPolicyPathDataAttributesRetriggerTimeoutMinutes = Literal[ + -1, 10, 20, 30, 40, 50, 60, 90, 120, 180, 240, 300, 360, 720, 1440 +] + +NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RETRIGGER_TIMEOUT_MINUTES_VALUES: set[ + NewEscalationPolicyPathDataAttributesRetriggerTimeoutMinutes +] = { + -1, + 10, + 20, + 30, + 40, + 50, + 60, + 90, + 120, + 180, + 240, + 300, + 360, + 720, + 1440, +} + + +def check_new_escalation_policy_path_data_attributes_retrigger_timeout_minutes( + value: int, +) -> NewEscalationPolicyPathDataAttributesRetriggerTimeoutMinutes: + if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RETRIGGER_TIMEOUT_MINUTES_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RETRIGGER_TIMEOUT_MINUTES_VALUES!r}" + ) 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 deleted file mode 100644 index 38c00a05..00000000 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_0.py +++ /dev/null @@ -1,72 +0,0 @@ -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.new_escalation_policy_path_data_attributes_rules_item_type_0_rule_type import ( - NewEscalationPolicyPathDataAttributesRulesItemType0RuleType, - check_new_escalation_policy_path_data_attributes_rules_item_type_0_rule_type, -) - -T = TypeVar("T", bound="NewEscalationPolicyPathDataAttributesRulesItemType0") - - -@_attrs_define -class NewEscalationPolicyPathDataAttributesRulesItemType0: - """ - Attributes: - rule_type (NewEscalationPolicyPathDataAttributesRulesItemType0RuleType): The type of the escalation path rule - urgency_ids (list[str]): Alert urgency ids for which this escalation path should be used - """ - - rule_type: NewEscalationPolicyPathDataAttributesRulesItemType0RuleType - urgency_ids: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - urgency_ids = self.urgency_ids - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "urgency_ids": urgency_ids, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_new_escalation_policy_path_data_attributes_rules_item_type_0_rule_type(d.pop("rule_type")) - - urgency_ids = cast(list[str], d.pop("urgency_ids")) - - new_escalation_policy_path_data_attributes_rules_item_type_0 = cls( - rule_type=rule_type, - urgency_ids=urgency_ids, - ) - - new_escalation_policy_path_data_attributes_rules_item_type_0.additional_properties = d - return new_escalation_policy_path_data_attributes_rules_item_type_0 - - @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_escalation_policy_path_data_attributes_rules_item_type_0_rule_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_0_rule_type.py deleted file mode 100644 index b1dfa9a7..00000000 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_0_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -NewEscalationPolicyPathDataAttributesRulesItemType0RuleType = Literal["alert_urgency"] - -NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_0_RULE_TYPE_VALUES: set[ - NewEscalationPolicyPathDataAttributesRulesItemType0RuleType -] = { - "alert_urgency", -} - - -def check_new_escalation_policy_path_data_attributes_rules_item_type_0_rule_type( - value: str | None, -) -> NewEscalationPolicyPathDataAttributesRulesItemType0RuleType | None: - if value is None: - return None - if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_0_RULE_TYPE_VALUES: - return cast(NewEscalationPolicyPathDataAttributesRulesItemType0RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_0_RULE_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_1_rule_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_1_rule_type.py deleted file mode 100644 index 2c1f68e6..00000000 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_1_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -NewEscalationPolicyPathDataAttributesRulesItemType1RuleType = Literal["working_hour"] - -NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_1_RULE_TYPE_VALUES: set[ - NewEscalationPolicyPathDataAttributesRulesItemType1RuleType -] = { - "working_hour", -} - - -def check_new_escalation_policy_path_data_attributes_rules_item_type_1_rule_type( - value: str | None, -) -> NewEscalationPolicyPathDataAttributesRulesItemType1RuleType | None: - if value is None: - return None - if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_1_RULE_TYPE_VALUES: - return cast(NewEscalationPolicyPathDataAttributesRulesItemType1RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_1_RULE_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2_operator.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2_operator.py deleted file mode 100644 index 87b1e1e7..00000000 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2_operator.py +++ /dev/null @@ -1,49 +0,0 @@ -from typing import Literal, cast - -NewEscalationPolicyPathDataAttributesRulesItemType2Operator = Literal[ - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_not", - "is_not_one_of", - "is_not_set", - "is_one_of", - "is_set", - "matches", - "starts_with", -] - -NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_2_OPERATOR_VALUES: set[ - NewEscalationPolicyPathDataAttributesRulesItemType2Operator -] = { - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_not", - "is_not_one_of", - "is_not_set", - "is_one_of", - "is_set", - "matches", - "starts_with", -} - - -def check_new_escalation_policy_path_data_attributes_rules_item_type_2_operator( - value: str | None, -) -> NewEscalationPolicyPathDataAttributesRulesItemType2Operator | None: - if value is None: - return None - if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_2_OPERATOR_VALUES: - return cast(NewEscalationPolicyPathDataAttributesRulesItemType2Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_2_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2_rule_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2_rule_type.py deleted file mode 100644 index 24525fa5..00000000 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_2_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -NewEscalationPolicyPathDataAttributesRulesItemType2RuleType = Literal["json_path"] - -NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_2_RULE_TYPE_VALUES: set[ - NewEscalationPolicyPathDataAttributesRulesItemType2RuleType -] = { - "json_path", -} - - -def check_new_escalation_policy_path_data_attributes_rules_item_type_2_rule_type( - value: str | None, -) -> NewEscalationPolicyPathDataAttributesRulesItemType2RuleType | None: - if value is None: - return None - if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_2_RULE_TYPE_VALUES: - return cast(NewEscalationPolicyPathDataAttributesRulesItemType2RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_2_RULE_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3_operator.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3_operator.py deleted file mode 100644 index bc9ff796..00000000 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3_operator.py +++ /dev/null @@ -1,49 +0,0 @@ -from typing import Literal, cast - -NewEscalationPolicyPathDataAttributesRulesItemType3Operator = Literal[ - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_empty", - "is_not", - "is_not_empty", - "is_not_one_of", - "is_one_of", - "matches", - "starts_with", -] - -NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_3_OPERATOR_VALUES: set[ - NewEscalationPolicyPathDataAttributesRulesItemType3Operator -] = { - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_empty", - "is_not", - "is_not_empty", - "is_not_one_of", - "is_one_of", - "matches", - "starts_with", -} - - -def check_new_escalation_policy_path_data_attributes_rules_item_type_3_operator( - value: str | None, -) -> NewEscalationPolicyPathDataAttributesRulesItemType3Operator | None: - if value is None: - return None - if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_3_OPERATOR_VALUES: - return cast(NewEscalationPolicyPathDataAttributesRulesItemType3Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_3_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3_rule_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3_rule_type.py deleted file mode 100644 index 5e3ed532..00000000 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_3_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -NewEscalationPolicyPathDataAttributesRulesItemType3RuleType = Literal["field"] - -NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_3_RULE_TYPE_VALUES: set[ - NewEscalationPolicyPathDataAttributesRulesItemType3RuleType -] = { - "field", -} - - -def check_new_escalation_policy_path_data_attributes_rules_item_type_3_rule_type( - value: str | None, -) -> NewEscalationPolicyPathDataAttributesRulesItemType3RuleType | None: - if value is None: - return None - if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_3_RULE_TYPE_VALUES: - return cast(NewEscalationPolicyPathDataAttributesRulesItemType3RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_3_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 969d678c..00000000 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_4.py +++ /dev/null @@ -1,72 +0,0 @@ -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.new_escalation_policy_path_data_attributes_rules_item_type_4_rule_type import ( - NewEscalationPolicyPathDataAttributesRulesItemType4RuleType, - check_new_escalation_policy_path_data_attributes_rules_item_type_4_rule_type, -) - -T = TypeVar("T", bound="NewEscalationPolicyPathDataAttributesRulesItemType4") - - -@_attrs_define -class NewEscalationPolicyPathDataAttributesRulesItemType4: - """ - Attributes: - rule_type (NewEscalationPolicyPathDataAttributesRulesItemType4RuleType): The type of the escalation path rule - service_ids (list[str]): Service ids for which this escalation path should be used - """ - - rule_type: NewEscalationPolicyPathDataAttributesRulesItemType4RuleType - service_ids: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - service_ids = self.service_ids - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "service_ids": service_ids, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_new_escalation_policy_path_data_attributes_rules_item_type_4_rule_type(d.pop("rule_type")) - - service_ids = cast(list[str], d.pop("service_ids")) - - new_escalation_policy_path_data_attributes_rules_item_type_4 = cls( - rule_type=rule_type, - service_ids=service_ids, - ) - - new_escalation_policy_path_data_attributes_rules_item_type_4.additional_properties = d - return new_escalation_policy_path_data_attributes_rules_item_type_4 - - @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_escalation_policy_path_data_attributes_rules_item_type_4_rule_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_4_rule_type.py deleted file mode 100644 index 8220fddf..00000000 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_4_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -NewEscalationPolicyPathDataAttributesRulesItemType4RuleType = Literal["service"] - -NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_4_RULE_TYPE_VALUES: set[ - NewEscalationPolicyPathDataAttributesRulesItemType4RuleType -] = { - "service", -} - - -def check_new_escalation_policy_path_data_attributes_rules_item_type_4_rule_type( - value: str | None, -) -> NewEscalationPolicyPathDataAttributesRulesItemType4RuleType | None: - if value is None: - return None - if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_4_RULE_TYPE_VALUES: - return cast(NewEscalationPolicyPathDataAttributesRulesItemType4RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_4_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index fc7aeb81..00000000 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5.py +++ /dev/null @@ -1,105 +0,0 @@ -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_escalation_policy_path_data_attributes_rules_item_type_5_rule_type import ( - NewEscalationPolicyPathDataAttributesRulesItemType5RuleType, - check_new_escalation_policy_path_data_attributes_rules_item_type_5_rule_type, -) -from ..models.new_escalation_policy_path_data_attributes_rules_item_type_5_time_zone import ( - NewEscalationPolicyPathDataAttributesRulesItemType5TimeZone, - check_new_escalation_policy_path_data_attributes_rules_item_type_5_time_zone, -) - -if TYPE_CHECKING: - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item import ( - NewEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem, - ) - - -T = TypeVar("T", bound="NewEscalationPolicyPathDataAttributesRulesItemType5") - - -@_attrs_define -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 - """ - - rule_type: NewEscalationPolicyPathDataAttributesRulesItemType5RuleType - time_zone: NewEscalationPolicyPathDataAttributesRulesItemType5TimeZone - 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 - - time_blocks = [] - for time_blocks_item_data in self.time_blocks: - time_blocks_item = time_blocks_item_data.to_dict() - time_blocks.append(time_blocks_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "time_zone": time_zone, - "time_blocks": time_blocks, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item import ( - NewEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem, - ) - - d = dict(src_dict) - rule_type = check_new_escalation_policy_path_data_attributes_rules_item_type_5_rule_type(d.pop("rule_type")) - - time_zone = check_new_escalation_policy_path_data_attributes_rules_item_type_5_time_zone(d.pop("time_zone")) - - time_blocks = [] - _time_blocks = d.pop("time_blocks") - for time_blocks_item_data in _time_blocks: - time_blocks_item = NewEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem.from_dict( - time_blocks_item_data - ) - - time_blocks.append(time_blocks_item) - - new_escalation_policy_path_data_attributes_rules_item_type_5 = cls( - rule_type=rule_type, - time_zone=time_zone, - time_blocks=time_blocks, - ) - - new_escalation_policy_path_data_attributes_rules_item_type_5.additional_properties = d - return new_escalation_policy_path_data_attributes_rules_item_type_5 - - @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_escalation_policy_path_data_attributes_rules_item_type_5_rule_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5_rule_type.py deleted file mode 100644 index 0a9a168d..00000000 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -NewEscalationPolicyPathDataAttributesRulesItemType5RuleType = Literal["deferral_window"] - -NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_5_RULE_TYPE_VALUES: set[ - NewEscalationPolicyPathDataAttributesRulesItemType5RuleType -] = { - "deferral_window", -} - - -def check_new_escalation_policy_path_data_attributes_rules_item_type_5_rule_type( - value: str | None, -) -> NewEscalationPolicyPathDataAttributesRulesItemType5RuleType | None: - if value is None: - return None - if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_5_RULE_TYPE_VALUES: - return cast(NewEscalationPolicyPathDataAttributesRulesItemType5RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_5_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index ea865059..00000000 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py +++ /dev/null @@ -1,160 +0,0 @@ -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="NewEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem") - - -@_attrs_define -class NewEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem: - """ - Attributes: - 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: 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]: - monday = self.monday - - tuesday = self.tuesday - - wednesday = self.wednesday - - thursday = self.thursday - - friday = self.friday - - saturday = self.saturday - - sunday = self.sunday - - start_time = self.start_time - - end_time = self.end_time - - all_day = self.all_day - - position: None | Unset | int - if isinstance(self.position, Unset): - position = UNSET - else: - position = self.position - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if monday is not UNSET: - field_dict["monday"] = monday - if tuesday is not UNSET: - field_dict["tuesday"] = tuesday - if wednesday is not UNSET: - field_dict["wednesday"] = wednesday - if thursday is not UNSET: - field_dict["thursday"] = thursday - if friday is not UNSET: - field_dict["friday"] = friday - if saturday is not UNSET: - field_dict["saturday"] = saturday - if sunday is not UNSET: - field_dict["sunday"] = sunday - if start_time is not UNSET: - field_dict["start_time"] = start_time - if end_time is not UNSET: - field_dict["end_time"] = end_time - if all_day is not UNSET: - field_dict["all_day"] = all_day - 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) - monday = d.pop("monday", UNSET) - - tuesday = d.pop("tuesday", UNSET) - - wednesday = d.pop("wednesday", UNSET) - - thursday = d.pop("thursday", UNSET) - - friday = d.pop("friday", UNSET) - - saturday = d.pop("saturday", UNSET) - - sunday = d.pop("sunday", UNSET) - - start_time = d.pop("start_time", UNSET) - - end_time = d.pop("end_time", UNSET) - - all_day = d.pop("all_day", 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)) - - new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item = cls( - monday=monday, - tuesday=tuesday, - wednesday=wednesday, - thursday=thursday, - friday=friday, - saturday=saturday, - sunday=sunday, - start_time=start_time, - end_time=end_time, - all_day=all_day, - position=position, - ) - - new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.additional_properties = d - return new_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_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_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 deleted file mode 100644 index f3774fac..00000000 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_6.py +++ /dev/null @@ -1,84 +0,0 @@ -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.new_escalation_policy_path_data_attributes_rules_item_type_6_operator import ( - NewEscalationPolicyPathDataAttributesRulesItemType6Operator, - check_new_escalation_policy_path_data_attributes_rules_item_type_6_operator, -) -from ..models.new_escalation_policy_path_data_attributes_rules_item_type_6_rule_type import ( - NewEscalationPolicyPathDataAttributesRulesItemType6RuleType, - check_new_escalation_policy_path_data_attributes_rules_item_type_6_rule_type, -) - -T = TypeVar("T", bound="NewEscalationPolicyPathDataAttributesRulesItemType6") - - -@_attrs_define -class NewEscalationPolicyPathDataAttributesRulesItemType6: - """ - Attributes: - rule_type (NewEscalationPolicyPathDataAttributesRulesItemType6RuleType): The type of the escalation path rule - operator (NewEscalationPolicyPathDataAttributesRulesItemType6Operator): How the alert source should be matched - values (list[str]): Alert source values to match against (e.g., manual, datadog) - """ - - rule_type: NewEscalationPolicyPathDataAttributesRulesItemType6RuleType - operator: NewEscalationPolicyPathDataAttributesRulesItemType6Operator - values: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - operator: str = self.operator - - values = self.values - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "operator": operator, - "values": values, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_new_escalation_policy_path_data_attributes_rules_item_type_6_rule_type(d.pop("rule_type")) - - operator = check_new_escalation_policy_path_data_attributes_rules_item_type_6_operator(d.pop("operator")) - - values = cast(list[str], d.pop("values")) - - new_escalation_policy_path_data_attributes_rules_item_type_6 = cls( - rule_type=rule_type, - operator=operator, - values=values, - ) - - new_escalation_policy_path_data_attributes_rules_item_type_6.additional_properties = d - return new_escalation_policy_path_data_attributes_rules_item_type_6 - - @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_escalation_policy_path_data_attributes_rules_item_type_6_operator.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_6_operator.py deleted file mode 100644 index f933ec8d..00000000 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_6_operator.py +++ /dev/null @@ -1,24 +0,0 @@ -from typing import Literal, cast - -NewEscalationPolicyPathDataAttributesRulesItemType6Operator = Literal["is", "is_not", "is_not_one_of", "is_one_of"] - -NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_6_OPERATOR_VALUES: set[ - NewEscalationPolicyPathDataAttributesRulesItemType6Operator -] = { - "is", - "is_not", - "is_not_one_of", - "is_one_of", -} - - -def check_new_escalation_policy_path_data_attributes_rules_item_type_6_operator( - value: str | None, -) -> NewEscalationPolicyPathDataAttributesRulesItemType6Operator | None: - if value is None: - return None - if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_6_OPERATOR_VALUES: - return cast(NewEscalationPolicyPathDataAttributesRulesItemType6Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_6_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_6_rule_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_6_rule_type.py deleted file mode 100644 index e845dc2e..00000000 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_6_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -NewEscalationPolicyPathDataAttributesRulesItemType6RuleType = Literal["source"] - -NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_6_RULE_TYPE_VALUES: set[ - NewEscalationPolicyPathDataAttributesRulesItemType6RuleType -] = { - "source", -} - - -def check_new_escalation_policy_path_data_attributes_rules_item_type_6_rule_type( - value: str | None, -) -> NewEscalationPolicyPathDataAttributesRulesItemType6RuleType | None: - if value is None: - return None - if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_6_RULE_TYPE_VALUES: - return cast(NewEscalationPolicyPathDataAttributesRulesItemType6RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_6_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 6aecf847..00000000 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_7.py +++ /dev/null @@ -1,77 +0,0 @@ -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.new_escalation_policy_path_data_attributes_rules_item_type_7_operator import ( - NewEscalationPolicyPathDataAttributesRulesItemType7Operator, - check_new_escalation_policy_path_data_attributes_rules_item_type_7_operator, -) -from ..models.new_escalation_policy_path_data_attributes_rules_item_type_7_rule_type import ( - NewEscalationPolicyPathDataAttributesRulesItemType7RuleType, - check_new_escalation_policy_path_data_attributes_rules_item_type_7_rule_type, -) - -T = TypeVar("T", bound="NewEscalationPolicyPathDataAttributesRulesItemType7") - - -@_attrs_define -class NewEscalationPolicyPathDataAttributesRulesItemType7: - """ - Attributes: - rule_type (NewEscalationPolicyPathDataAttributesRulesItemType7RuleType): The type of the escalation path rule - operator (NewEscalationPolicyPathDataAttributesRulesItemType7Operator): Whether the alert must (or must not) - have related incidents - """ - - rule_type: NewEscalationPolicyPathDataAttributesRulesItemType7RuleType - operator: NewEscalationPolicyPathDataAttributesRulesItemType7Operator - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - operator: str = self.operator - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "operator": operator, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_new_escalation_policy_path_data_attributes_rules_item_type_7_rule_type(d.pop("rule_type")) - - operator = check_new_escalation_policy_path_data_attributes_rules_item_type_7_operator(d.pop("operator")) - - new_escalation_policy_path_data_attributes_rules_item_type_7 = cls( - rule_type=rule_type, - operator=operator, - ) - - new_escalation_policy_path_data_attributes_rules_item_type_7.additional_properties = d - return new_escalation_policy_path_data_attributes_rules_item_type_7 - - @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_escalation_policy_path_data_attributes_rules_item_type_7_operator.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_7_operator.py deleted file mode 100644 index 57e6eef1..00000000 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_7_operator.py +++ /dev/null @@ -1,22 +0,0 @@ -from typing import Literal, cast - -NewEscalationPolicyPathDataAttributesRulesItemType7Operator = Literal["is_not_set", "is_set"] - -NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_7_OPERATOR_VALUES: set[ - NewEscalationPolicyPathDataAttributesRulesItemType7Operator -] = { - "is_not_set", - "is_set", -} - - -def check_new_escalation_policy_path_data_attributes_rules_item_type_7_operator( - value: str | None, -) -> NewEscalationPolicyPathDataAttributesRulesItemType7Operator | None: - if value is None: - return None - if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_7_OPERATOR_VALUES: - return cast(NewEscalationPolicyPathDataAttributesRulesItemType7Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_7_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_7_rule_type.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_7_rule_type.py deleted file mode 100644 index 0b7e76b5..00000000 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_rules_item_type_7_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -NewEscalationPolicyPathDataAttributesRulesItemType7RuleType = Literal["related_incidents"] - -NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_7_RULE_TYPE_VALUES: set[ - NewEscalationPolicyPathDataAttributesRulesItemType7RuleType -] = { - "related_incidents", -} - - -def check_new_escalation_policy_path_data_attributes_rules_item_type_7_rule_type( - value: str | None, -) -> NewEscalationPolicyPathDataAttributesRulesItemType7RuleType | None: - if value is None: - return None - if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_7_RULE_TYPE_VALUES: - return cast(NewEscalationPolicyPathDataAttributesRulesItemType7RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_7_RULE_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restriction_time_zone.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restriction_time_zone.py index 8f8492c7..fe81e534 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restriction_time_zone.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restriction_time_zone.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone = Literal[ "Abu Dhabi", @@ -84,6 +84,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -157,6 +158,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -394,6 +396,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -467,6 +470,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -625,7 +629,7 @@ def check_new_escalation_policy_path_data_attributes_time_restriction_time_zone( if value is None: return None if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_TIME_RESTRICTION_TIME_ZONE_VALUES: - return cast(NewEscalationPolicyPathDataAttributesTimeRestrictionTimeZone, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_TIME_RESTRICTION_TIME_ZONE_VALUES!r}" ) 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 6f80bec8..6fa6cd88 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,8 +1,9 @@ +from __future__ import annotations + 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.new_escalation_policy_path_data_attributes_time_restrictions_item_end_day import ( NewEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay, @@ -30,7 +31,6 @@ class NewEscalationPolicyPathDataAttributesTimeRestrictionsItem: start_time: str end_day: NewEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay end_time: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: start_day: str = self.start_day @@ -42,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: end_time = self.end_time field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "start_day": start_day, @@ -74,21 +74,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: end_time=end_time, ) - new_escalation_policy_path_data_attributes_time_restrictions_item.additional_properties = d return new_escalation_policy_path_data_attributes_time_restrictions_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_escalation_policy_path_data_attributes_time_restrictions_item_end_day.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restrictions_item_end_day.py index f6bc2fbc..123553da 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restrictions_item_end_day.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restrictions_item_end_day.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay = Literal[ "friday", "monday", "saturday", "sunday", "thursday", "tuesday", "wednesday" @@ -23,7 +23,7 @@ def check_new_escalation_policy_path_data_attributes_time_restrictions_item_end_ if value is None: return None if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_TIME_RESTRICTIONS_ITEM_END_DAY_VALUES: - return cast(NewEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_TIME_RESTRICTIONS_ITEM_END_DAY_VALUES!r}" ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restrictions_item_start_day.py b/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restrictions_item_start_day.py index 9847165e..33750bc7 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restrictions_item_start_day.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_attributes_time_restrictions_item_start_day.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay = Literal[ "friday", "monday", "saturday", "sunday", "thursday", "tuesday", "wednesday" @@ -23,7 +23,7 @@ def check_new_escalation_policy_path_data_attributes_time_restrictions_item_star if value is None: return None if value in NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_TIME_RESTRICTIONS_ITEM_START_DAY_VALUES: - return cast(NewEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_TIME_RESTRICTIONS_ITEM_START_DAY_VALUES!r}" ) diff --git a/rootly_sdk/models/new_escalation_policy_path_data_type.py b/rootly_sdk/models/new_escalation_policy_path_data_type.py index f9740900..64a29af4 100644 --- a/rootly_sdk/models/new_escalation_policy_path_data_type.py +++ b/rootly_sdk/models/new_escalation_policy_path_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewEscalationPolicyPathDataType = Literal["escalation_paths"] @@ -11,5 +11,5 @@ def check_new_escalation_policy_path_data_type(value: str | None) -> NewEscalati if value is None: return None if value in NEW_ESCALATION_POLICY_PATH_DATA_TYPE_VALUES: - return cast(NewEscalationPolicyPathDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ESCALATION_POLICY_PATH_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_form_field.py b/rootly_sdk/models/new_form_field.py index 478e6ca9..0fb6943e 100644 --- a/rootly_sdk/models/new_form_field.py +++ b/rootly_sdk/models/new_form_field.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_form_field_data import NewFormFieldData @@ -18,14 +19,13 @@ class NewFormField: data (NewFormFieldData): """ - data: "NewFormFieldData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewFormFieldData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_form_field.additional_properties = d return new_form_field - - @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_form_field_data.py b/rootly_sdk/models/new_form_field_data.py index 029c332a..855d5ffb 100644 --- a/rootly_sdk/models/new_form_field_data.py +++ b/rootly_sdk/models/new_form_field_data.py @@ -1,8 +1,9 @@ +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_form_field_data_type import NewFormFieldDataType, check_new_form_field_data_type @@ -22,8 +23,7 @@ class NewFormFieldData: """ type_: NewFormFieldDataType - attributes: "NewFormFieldDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewFormFieldDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_form_field_data.additional_properties = d return new_form_field_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_form_field_data_attributes.py b/rootly_sdk/models/new_form_field_data_attributes.py index 04f0bbef..8555ad67 100644 --- a/rootly_sdk/models/new_form_field_data_attributes.py +++ b/rootly_sdk/models/new_form_field_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -26,71 +28,71 @@ class NewFormFieldDataAttributes: Attributes: kind (NewFormFieldDataAttributesKind): The kind of the form field name (str): The name of the form field - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + 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 reference-kind catalog properties are supported. """ kind: NewFormFieldDataAttributesKind name: str - 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 + slug: None | str | Unset = UNSET + 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 def to_dict(self) -> dict[str, Any]: kind: str = self.kind name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - input_kind: Unset | str = UNSET + input_kind: str | Unset = UNSET if not isinstance(self.input_kind, Unset): input_kind = self.input_kind - value_kind: Unset | str = UNSET + value_kind: str | Unset = UNSET if not isinstance(self.value_kind, Unset): value_kind = self.value_kind - value_kind_catalog_id: None | Unset | str + value_kind_catalog_id: None | str | Unset 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 | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - shown: Unset | list[str] = UNSET + shown: list[str] | Unset = UNSET if not isinstance(self.shown, Unset): shown = self.shown - required: Unset | list[str] = UNSET + required: list[str] | Unset = UNSET if not isinstance(self.required, Unset): required = self.required @@ -98,11 +100,11 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - default_values: Unset | list[str] = UNSET + default_values: list[str] | Unset = UNSET if not isinstance(self.default_values, Unset): default_values = self.default_values - auto_set_by_catalog_property_id: None | Unset | str + auto_set_by_catalog_property_id: None | str | Unset if isinstance(self.auto_set_by_catalog_property_id, Unset): auto_set_by_catalog_property_id = UNSET else: @@ -148,44 +150,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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) _input_kind = d.pop("input_kind", UNSET) - input_kind: Unset | NewFormFieldDataAttributesInputKind + input_kind: NewFormFieldDataAttributesInputKind | Unset 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: Unset | NewFormFieldDataAttributesValueKind + value_kind: NewFormFieldDataAttributesValueKind | Unset 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 | Unset | str: + def _parse_value_kind_catalog_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) value_kind_catalog_id = _parse_value_kind_catalog_id(d.pop("value_kind_catalog_id", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) @@ -199,12 +201,12 @@ def _parse_description(data: object) -> None | Unset | str: default_values = cast(list[str], d.pop("default_values", UNSET)) - def _parse_auto_set_by_catalog_property_id(data: object) -> None | Unset | str: + def _parse_auto_set_by_catalog_property_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) auto_set_by_catalog_property_id = _parse_auto_set_by_catalog_property_id( d.pop("auto_set_by_catalog_property_id", UNSET) diff --git a/rootly_sdk/models/new_form_field_data_attributes_input_kind.py b/rootly_sdk/models/new_form_field_data_attributes_input_kind.py index 2c616fcc..e5add251 100644 --- a/rootly_sdk/models/new_form_field_data_attributes_input_kind.py +++ b/rootly_sdk/models/new_form_field_data_attributes_input_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewFormFieldDataAttributesInputKind = Literal[ "checkbox", "date", "datetime", "multi_select", "number", "rich_text", "select", "tags", "text", "textarea" @@ -22,5 +22,5 @@ def check_new_form_field_data_attributes_input_kind(value: str | None) -> NewFor if value is None: return None if value in NEW_FORM_FIELD_DATA_ATTRIBUTES_INPUT_KIND_VALUES: - return cast(NewFormFieldDataAttributesInputKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_FORM_FIELD_DATA_ATTRIBUTES_INPUT_KIND_VALUES!r}") diff --git a/rootly_sdk/models/new_form_field_data_attributes_kind.py b/rootly_sdk/models/new_form_field_data_attributes_kind.py index 44de3a00..5e6e99af 100644 --- a/rootly_sdk/models/new_form_field_data_attributes_kind.py +++ b/rootly_sdk/models/new_form_field_data_attributes_kind.py @@ -1,8 +1,9 @@ -from typing import Literal, cast +from typing import Literal NewFormFieldDataAttributesKind = Literal[ "acknowledged_at", "attach_alerts", + "cancellation_message", "causes", "closed_at", "custom", @@ -37,6 +38,7 @@ NEW_FORM_FIELD_DATA_ATTRIBUTES_KIND_VALUES: set[NewFormFieldDataAttributesKind] = { "acknowledged_at", "attach_alerts", + "cancellation_message", "causes", "closed_at", "custom", @@ -73,5 +75,5 @@ def check_new_form_field_data_attributes_kind(value: str | None) -> NewFormField if value is None: return None if value in NEW_FORM_FIELD_DATA_ATTRIBUTES_KIND_VALUES: - return cast(NewFormFieldDataAttributesKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_FORM_FIELD_DATA_ATTRIBUTES_KIND_VALUES!r}") diff --git a/rootly_sdk/models/new_form_field_data_attributes_value_kind.py b/rootly_sdk/models/new_form_field_data_attributes_value_kind.py index 214f2bef..1291d26b 100644 --- a/rootly_sdk/models/new_form_field_data_attributes_value_kind.py +++ b/rootly_sdk/models/new_form_field_data_attributes_value_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewFormFieldDataAttributesValueKind = Literal[ "catalog_entity", "cause", "environment", "functionality", "group", "incident_type", "inherit", "service", "user" @@ -21,5 +21,5 @@ def check_new_form_field_data_attributes_value_kind(value: str | None) -> NewFor if value is None: return None if value in NEW_FORM_FIELD_DATA_ATTRIBUTES_VALUE_KIND_VALUES: - return cast(NewFormFieldDataAttributesValueKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_FORM_FIELD_DATA_ATTRIBUTES_VALUE_KIND_VALUES!r}") diff --git a/rootly_sdk/models/new_form_field_data_type.py b/rootly_sdk/models/new_form_field_data_type.py index 389087d4..722ad333 100644 --- a/rootly_sdk/models/new_form_field_data_type.py +++ b/rootly_sdk/models/new_form_field_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewFormFieldDataType = Literal["form_fields"] @@ -11,5 +11,5 @@ def check_new_form_field_data_type(value: str | None) -> NewFormFieldDataType | if value is None: return None if value in NEW_FORM_FIELD_DATA_TYPE_VALUES: - return cast(NewFormFieldDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_FORM_FIELD_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_form_field_option.py b/rootly_sdk/models/new_form_field_option.py index 79703c57..2b760dc6 100644 --- a/rootly_sdk/models/new_form_field_option.py +++ b/rootly_sdk/models/new_form_field_option.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_form_field_option_data import NewFormFieldOptionData @@ -18,14 +19,13 @@ class NewFormFieldOption: data (NewFormFieldOptionData): """ - data: "NewFormFieldOptionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewFormFieldOptionData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_form_field_option.additional_properties = d return new_form_field_option - - @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_form_field_option_data.py b/rootly_sdk/models/new_form_field_option_data.py index 2f424967..28ed5fd3 100644 --- a/rootly_sdk/models/new_form_field_option_data.py +++ b/rootly_sdk/models/new_form_field_option_data.py @@ -1,8 +1,9 @@ +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_form_field_option_data_type import NewFormFieldOptionDataType, check_new_form_field_option_data_type @@ -22,8 +23,7 @@ class NewFormFieldOptionData: """ type_: NewFormFieldOptionDataType - attributes: "NewFormFieldOptionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewFormFieldOptionDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_form_field_option_data.additional_properties = d return new_form_field_option_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_form_field_option_data_attributes.py b/rootly_sdk/models/new_form_field_option_data_attributes.py index 0ea3b51f..b9f918b7 100644 --- a/rootly_sdk/models/new_form_field_option_data_attributes.py +++ b/rootly_sdk/models/new_form_field_option_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,16 +16,16 @@ class NewFormFieldOptionDataAttributes: Attributes: form_field_id (str): The ID of the form field value (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 + color (str | Unset): The hex color of the form field option + default (bool | Unset): + position (int | Unset): The position of the form field option """ form_field_id: str value: str - color: Unset | str = UNSET - default: Unset | bool = UNSET - position: Unset | int = UNSET + color: str | Unset = UNSET + default: bool | Unset = UNSET + position: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id diff --git a/rootly_sdk/models/new_form_field_option_data_type.py b/rootly_sdk/models/new_form_field_option_data_type.py index ff54d12c..dea5feb6 100644 --- a/rootly_sdk/models/new_form_field_option_data_type.py +++ b/rootly_sdk/models/new_form_field_option_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewFormFieldOptionDataType = Literal["form_field_options"] @@ -11,5 +11,5 @@ def check_new_form_field_option_data_type(value: str | None) -> NewFormFieldOpti if value is None: return None if value in NEW_FORM_FIELD_OPTION_DATA_TYPE_VALUES: - return cast(NewFormFieldOptionDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_FORM_FIELD_OPTION_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_form_field_placement.py b/rootly_sdk/models/new_form_field_placement.py index 3f1a430c..5b314964 100644 --- a/rootly_sdk/models/new_form_field_placement.py +++ b/rootly_sdk/models/new_form_field_placement.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_form_field_placement_data import NewFormFieldPlacementData @@ -18,14 +19,13 @@ class NewFormFieldPlacement: data (NewFormFieldPlacementData): """ - data: "NewFormFieldPlacementData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewFormFieldPlacementData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_form_field_placement.additional_properties = d return new_form_field_placement - - @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_form_field_placement_condition.py b/rootly_sdk/models/new_form_field_placement_condition.py index e70a15e2..33f5b50a 100644 --- a/rootly_sdk/models/new_form_field_placement_condition.py +++ b/rootly_sdk/models/new_form_field_placement_condition.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_form_field_placement_condition_data import NewFormFieldPlacementConditionData @@ -18,14 +19,13 @@ class NewFormFieldPlacementCondition: data (NewFormFieldPlacementConditionData): """ - data: "NewFormFieldPlacementConditionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewFormFieldPlacementConditionData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_form_field_placement_condition.additional_properties = d return new_form_field_placement_condition - - @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_form_field_placement_condition_data.py b/rootly_sdk/models/new_form_field_placement_condition_data.py index eb94f22a..dcd6b981 100644 --- a/rootly_sdk/models/new_form_field_placement_condition_data.py +++ b/rootly_sdk/models/new_form_field_placement_condition_data.py @@ -1,8 +1,9 @@ +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_form_field_placement_condition_data_type import ( NewFormFieldPlacementConditionDataType, @@ -25,8 +26,7 @@ class NewFormFieldPlacementConditionData: """ type_: NewFormFieldPlacementConditionDataType - attributes: "NewFormFieldPlacementConditionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewFormFieldPlacementConditionDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -60,21 +60,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_form_field_placement_condition_data.additional_properties = d return new_form_field_placement_condition_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_form_field_placement_condition_data_attributes.py b/rootly_sdk/models/new_form_field_placement_condition_data_attributes.py index e99d57d1..2d39e308 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,8 +1,9 @@ +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.new_form_field_placement_condition_data_attributes_comparison import ( NewFormFieldPlacementConditionDataAttributesComparison, @@ -26,15 +27,14 @@ class NewFormFieldPlacementConditionDataAttributes: form_field_id (str): The condition field. comparison (NewFormFieldPlacementConditionDataAttributesComparison): The condition comparison. values (list[str]): The values for comparison. - position (Union[Unset, int]): The condition position. + position (int | Unset): The condition position. """ conditioned: NewFormFieldPlacementConditionDataAttributesConditioned form_field_id: str comparison: NewFormFieldPlacementConditionDataAttributesComparison values: list[str] - position: Unset | int = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + position: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: conditioned: str = self.conditioned @@ -48,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "conditioned": conditioned, @@ -83,21 +83,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position=position, ) - new_form_field_placement_condition_data_attributes.additional_properties = d return new_form_field_placement_condition_data_attributes - - @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_form_field_placement_condition_data_attributes_comparison.py b/rootly_sdk/models/new_form_field_placement_condition_data_attributes_comparison.py index 138a9b48..84c2264c 100644 --- a/rootly_sdk/models/new_form_field_placement_condition_data_attributes_comparison.py +++ b/rootly_sdk/models/new_form_field_placement_condition_data_attributes_comparison.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewFormFieldPlacementConditionDataAttributesComparison = Literal["equal", "is_not_set", "is_set", "not_equal"] @@ -18,7 +18,7 @@ def check_new_form_field_placement_condition_data_attributes_comparison( if value is None: return None if value in NEW_FORM_FIELD_PLACEMENT_CONDITION_DATA_ATTRIBUTES_COMPARISON_VALUES: - return cast(NewFormFieldPlacementConditionDataAttributesComparison, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_FORM_FIELD_PLACEMENT_CONDITION_DATA_ATTRIBUTES_COMPARISON_VALUES!r}" ) diff --git a/rootly_sdk/models/new_form_field_placement_condition_data_attributes_conditioned.py b/rootly_sdk/models/new_form_field_placement_condition_data_attributes_conditioned.py index 7247ec38..48c77b95 100644 --- a/rootly_sdk/models/new_form_field_placement_condition_data_attributes_conditioned.py +++ b/rootly_sdk/models/new_form_field_placement_condition_data_attributes_conditioned.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewFormFieldPlacementConditionDataAttributesConditioned = Literal["placement", "required"] @@ -16,7 +16,7 @@ def check_new_form_field_placement_condition_data_attributes_conditioned( if value is None: return None if value in NEW_FORM_FIELD_PLACEMENT_CONDITION_DATA_ATTRIBUTES_CONDITIONED_VALUES: - return cast(NewFormFieldPlacementConditionDataAttributesConditioned, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_FORM_FIELD_PLACEMENT_CONDITION_DATA_ATTRIBUTES_CONDITIONED_VALUES!r}" ) diff --git a/rootly_sdk/models/new_form_field_placement_condition_data_type.py b/rootly_sdk/models/new_form_field_placement_condition_data_type.py index fab1f142..c489aed3 100644 --- a/rootly_sdk/models/new_form_field_placement_condition_data_type.py +++ b/rootly_sdk/models/new_form_field_placement_condition_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewFormFieldPlacementConditionDataType = Literal["form_field_placement_conditions"] @@ -13,7 +13,7 @@ def check_new_form_field_placement_condition_data_type( if value is None: return None if value in NEW_FORM_FIELD_PLACEMENT_CONDITION_DATA_TYPE_VALUES: - return cast(NewFormFieldPlacementConditionDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_FORM_FIELD_PLACEMENT_CONDITION_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_form_field_placement_data.py b/rootly_sdk/models/new_form_field_placement_data.py index 44210baf..14d711a8 100644 --- a/rootly_sdk/models/new_form_field_placement_data.py +++ b/rootly_sdk/models/new_form_field_placement_data.py @@ -1,8 +1,9 @@ +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_form_field_placement_data_type import ( NewFormFieldPlacementDataType, @@ -25,8 +26,7 @@ class NewFormFieldPlacementData: """ type_: NewFormFieldPlacementDataType - attributes: "NewFormFieldPlacementDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewFormFieldPlacementDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_form_field_placement_data.additional_properties = d return new_form_field_placement_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_form_field_placement_data_attributes.py b/rootly_sdk/models/new_form_field_placement_data_attributes.py index ae44a676..d49e5a0f 100644 --- a/rootly_sdk/models/new_form_field_placement_data_attributes.py +++ b/rootly_sdk/models/new_form_field_placement_data_attributes.py @@ -1,8 +1,9 @@ +from __future__ import annotations + 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.new_form_field_placement_data_attributes_placement_operator import ( NewFormFieldPlacementDataAttributesPlacementOperator, @@ -24,23 +25,22 @@ class NewFormFieldPlacementDataAttributes: 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 (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 + 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 evaluating multiple form_field_placement_conditions with conditioned=required - placement_operator (Union[Unset, NewFormFieldPlacementDataAttributesPlacementOperator]): Logical operator when + placement_operator (NewFormFieldPlacementDataAttributesPlacementOperator | Unset): 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. + non_editable (bool | Unset): Whether the field is read-only and cannot be edited by users. """ form_set_id: str form: str - 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) + position: int | Unset = UNSET + required: bool | Unset = UNSET + required_operator: NewFormFieldPlacementDataAttributesRequiredOperator | Unset = UNSET + placement_operator: NewFormFieldPlacementDataAttributesPlacementOperator | Unset = UNSET + non_editable: bool | Unset = UNSET def to_dict(self) -> dict[str, Any]: form_set_id = self.form_set_id @@ -51,18 +51,18 @@ def to_dict(self) -> dict[str, Any]: required = self.required - required_operator: Unset | str = UNSET + required_operator: str | Unset = UNSET if not isinstance(self.required_operator, Unset): required_operator = self.required_operator - placement_operator: Unset | str = UNSET + placement_operator: str | Unset = UNSET if not isinstance(self.placement_operator, Unset): placement_operator = self.placement_operator non_editable = self.non_editable field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "form_set_id": form_set_id, @@ -94,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: Unset | NewFormFieldPlacementDataAttributesRequiredOperator + required_operator: NewFormFieldPlacementDataAttributesRequiredOperator | Unset 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: Unset | NewFormFieldPlacementDataAttributesPlacementOperator + placement_operator: NewFormFieldPlacementDataAttributesPlacementOperator | Unset if isinstance(_placement_operator, Unset): placement_operator = UNSET else: @@ -119,21 +119,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: non_editable=non_editable, ) - new_form_field_placement_data_attributes.additional_properties = d return new_form_field_placement_data_attributes - - @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_form_field_placement_data_attributes_placement_operator.py b/rootly_sdk/models/new_form_field_placement_data_attributes_placement_operator.py index e65cc287..60fbfa10 100644 --- a/rootly_sdk/models/new_form_field_placement_data_attributes_placement_operator.py +++ b/rootly_sdk/models/new_form_field_placement_data_attributes_placement_operator.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewFormFieldPlacementDataAttributesPlacementOperator = Literal["and", "or"] @@ -16,7 +16,7 @@ def check_new_form_field_placement_data_attributes_placement_operator( if value is None: return None if value in NEW_FORM_FIELD_PLACEMENT_DATA_ATTRIBUTES_PLACEMENT_OPERATOR_VALUES: - return cast(NewFormFieldPlacementDataAttributesPlacementOperator, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_FORM_FIELD_PLACEMENT_DATA_ATTRIBUTES_PLACEMENT_OPERATOR_VALUES!r}" ) diff --git a/rootly_sdk/models/new_form_field_placement_data_attributes_required_operator.py b/rootly_sdk/models/new_form_field_placement_data_attributes_required_operator.py index 83c91654..5b126d98 100644 --- a/rootly_sdk/models/new_form_field_placement_data_attributes_required_operator.py +++ b/rootly_sdk/models/new_form_field_placement_data_attributes_required_operator.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewFormFieldPlacementDataAttributesRequiredOperator = Literal["and", "or"] @@ -16,7 +16,7 @@ def check_new_form_field_placement_data_attributes_required_operator( if value is None: return None if value in NEW_FORM_FIELD_PLACEMENT_DATA_ATTRIBUTES_REQUIRED_OPERATOR_VALUES: - return cast(NewFormFieldPlacementDataAttributesRequiredOperator, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_FORM_FIELD_PLACEMENT_DATA_ATTRIBUTES_REQUIRED_OPERATOR_VALUES!r}" ) diff --git a/rootly_sdk/models/new_form_field_placement_data_type.py b/rootly_sdk/models/new_form_field_placement_data_type.py index 388f24fd..01ffdfbb 100644 --- a/rootly_sdk/models/new_form_field_placement_data_type.py +++ b/rootly_sdk/models/new_form_field_placement_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewFormFieldPlacementDataType = Literal["form_field_placements"] @@ -11,5 +11,5 @@ def check_new_form_field_placement_data_type(value: str | None) -> NewFormFieldP if value is None: return None if value in NEW_FORM_FIELD_PLACEMENT_DATA_TYPE_VALUES: - return cast(NewFormFieldPlacementDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_FORM_FIELD_PLACEMENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_form_field_position.py b/rootly_sdk/models/new_form_field_position.py index c876c3a3..e299e6aa 100644 --- a/rootly_sdk/models/new_form_field_position.py +++ b/rootly_sdk/models/new_form_field_position.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_form_field_position_data import NewFormFieldPositionData @@ -18,14 +19,13 @@ class NewFormFieldPosition: data (NewFormFieldPositionData): """ - data: "NewFormFieldPositionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewFormFieldPositionData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_form_field_position.additional_properties = d return new_form_field_position - - @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_form_field_position_data.py b/rootly_sdk/models/new_form_field_position_data.py index 24542508..1fce6b51 100644 --- a/rootly_sdk/models/new_form_field_position_data.py +++ b/rootly_sdk/models/new_form_field_position_data.py @@ -1,8 +1,9 @@ +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_form_field_position_data_type import ( NewFormFieldPositionDataType, @@ -25,8 +26,7 @@ class NewFormFieldPositionData: """ type_: NewFormFieldPositionDataType - attributes: "NewFormFieldPositionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewFormFieldPositionDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_form_field_position_data.additional_properties = d return new_form_field_position_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_form_field_position_data_attributes.py b/rootly_sdk/models/new_form_field_position_data_attributes.py index d4037f7f..8bbc0e05 100644 --- a/rootly_sdk/models/new_form_field_position_data_attributes.py +++ b/rootly_sdk/models/new_form_field_position_data_attributes.py @@ -1,3 +1,5 @@ +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 5b74b39c..a22c51f7 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 @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewFormFieldPositionDataAttributesForm = Literal[ "incident_post_mortem", @@ -55,7 +55,7 @@ def check_new_form_field_position_data_attributes_form( if value is None: return None if value in NEW_FORM_FIELD_POSITION_DATA_ATTRIBUTES_FORM_VALUES: - return cast(NewFormFieldPositionDataAttributesForm, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_FORM_FIELD_POSITION_DATA_ATTRIBUTES_FORM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_form_field_position_data_type.py b/rootly_sdk/models/new_form_field_position_data_type.py index a60f2656..f8c770ee 100644 --- a/rootly_sdk/models/new_form_field_position_data_type.py +++ b/rootly_sdk/models/new_form_field_position_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewFormFieldPositionDataType = Literal["form_field_positions"] @@ -11,5 +11,5 @@ def check_new_form_field_position_data_type(value: str | None) -> NewFormFieldPo if value is None: return None if value in NEW_FORM_FIELD_POSITION_DATA_TYPE_VALUES: - return cast(NewFormFieldPositionDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_FORM_FIELD_POSITION_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_form_set.py b/rootly_sdk/models/new_form_set.py index af5fe62b..7ccf09c5 100644 --- a/rootly_sdk/models/new_form_set.py +++ b/rootly_sdk/models/new_form_set.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_form_set_data import NewFormSetData @@ -18,14 +19,13 @@ class NewFormSet: data (NewFormSetData): """ - data: "NewFormSetData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewFormSetData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_form_set.additional_properties = d return new_form_set - - @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_form_set_condition.py b/rootly_sdk/models/new_form_set_condition.py index 1ca4d3cd..9a86aa87 100644 --- a/rootly_sdk/models/new_form_set_condition.py +++ b/rootly_sdk/models/new_form_set_condition.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_form_set_condition_data import NewFormSetConditionData @@ -18,14 +19,13 @@ class NewFormSetCondition: data (NewFormSetConditionData): """ - data: "NewFormSetConditionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewFormSetConditionData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_form_set_condition.additional_properties = d return new_form_set_condition - - @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_form_set_condition_data.py b/rootly_sdk/models/new_form_set_condition_data.py index f5e62dc1..b7f95a95 100644 --- a/rootly_sdk/models/new_form_set_condition_data.py +++ b/rootly_sdk/models/new_form_set_condition_data.py @@ -1,8 +1,9 @@ +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_form_set_condition_data_type import ( NewFormSetConditionDataType, @@ -25,8 +26,7 @@ class NewFormSetConditionData: """ type_: NewFormSetConditionDataType - attributes: "NewFormSetConditionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewFormSetConditionDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_form_set_condition_data.additional_properties = d return new_form_set_condition_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_form_set_condition_data_attributes.py b/rootly_sdk/models/new_form_set_condition_data_attributes.py index 50e8eb01..c784ad63 100644 --- a/rootly_sdk/models/new_form_set_condition_data_attributes.py +++ b/rootly_sdk/models/new_form_set_condition_data_attributes.py @@ -1,8 +1,9 @@ +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.new_form_set_condition_data_attributes_comparison import ( NewFormSetConditionDataAttributesComparison, @@ -24,7 +25,6 @@ class NewFormSetConditionDataAttributes: form_field_id: str comparison: NewFormSetConditionDataAttributesComparison values: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: values = self.values field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "form_field_id": form_field_id, @@ -60,21 +60,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: values=values, ) - new_form_set_condition_data_attributes.additional_properties = d return new_form_set_condition_data_attributes - - @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_form_set_condition_data_attributes_comparison.py b/rootly_sdk/models/new_form_set_condition_data_attributes_comparison.py index 42f1ba4a..89973574 100644 --- a/rootly_sdk/models/new_form_set_condition_data_attributes_comparison.py +++ b/rootly_sdk/models/new_form_set_condition_data_attributes_comparison.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewFormSetConditionDataAttributesComparison = Literal["equal"] @@ -13,7 +13,7 @@ def check_new_form_set_condition_data_attributes_comparison( if value is None: return None if value in NEW_FORM_SET_CONDITION_DATA_ATTRIBUTES_COMPARISON_VALUES: - return cast(NewFormSetConditionDataAttributesComparison, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_FORM_SET_CONDITION_DATA_ATTRIBUTES_COMPARISON_VALUES!r}" ) diff --git a/rootly_sdk/models/new_form_set_condition_data_type.py b/rootly_sdk/models/new_form_set_condition_data_type.py index 64ef1452..89dc3b99 100644 --- a/rootly_sdk/models/new_form_set_condition_data_type.py +++ b/rootly_sdk/models/new_form_set_condition_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewFormSetConditionDataType = Literal["form_set_conditions"] @@ -11,5 +11,5 @@ def check_new_form_set_condition_data_type(value: str | None) -> NewFormSetCondi if value is None: return None if value in NEW_FORM_SET_CONDITION_DATA_TYPE_VALUES: - return cast(NewFormSetConditionDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_FORM_SET_CONDITION_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_form_set_data.py b/rootly_sdk/models/new_form_set_data.py index 5dd21340..faad8ad4 100644 --- a/rootly_sdk/models/new_form_set_data.py +++ b/rootly_sdk/models/new_form_set_data.py @@ -1,8 +1,9 @@ +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_form_set_data_type import NewFormSetDataType, check_new_form_set_data_type @@ -22,8 +23,7 @@ class NewFormSetData: """ type_: NewFormSetDataType - attributes: "NewFormSetDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewFormSetDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_form_set_data.additional_properties = d return new_form_set_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_form_set_data_attributes.py b/rootly_sdk/models/new_form_set_data_attributes.py index 6b8ce73d..f6a33088 100644 --- a/rootly_sdk/models/new_form_set_data_attributes.py +++ b/rootly_sdk/models/new_form_set_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -21,20 +23,20 @@ class NewFormSetDataAttributes: `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`, `microsoft_teams_new_incident_form` - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + slug: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name forms = self.forms - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -60,12 +62,12 @@ 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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) diff --git a/rootly_sdk/models/new_form_set_data_type.py b/rootly_sdk/models/new_form_set_data_type.py index a5822a72..0f2ca6ce 100644 --- a/rootly_sdk/models/new_form_set_data_type.py +++ b/rootly_sdk/models/new_form_set_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewFormSetDataType = Literal["form_sets"] @@ -11,5 +11,5 @@ def check_new_form_set_data_type(value: str | None) -> NewFormSetDataType | None if value is None: return None if value in NEW_FORM_SET_DATA_TYPE_VALUES: - return cast(NewFormSetDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_FORM_SET_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_functionality.py b/rootly_sdk/models/new_functionality.py index ab4c8a72..4c195e41 100644 --- a/rootly_sdk/models/new_functionality.py +++ b/rootly_sdk/models/new_functionality.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_functionality_data import NewFunctionalityData @@ -18,14 +19,13 @@ class NewFunctionality: data (NewFunctionalityData): """ - data: "NewFunctionalityData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewFunctionalityData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_functionality.additional_properties = d return new_functionality - - @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_functionality_data.py b/rootly_sdk/models/new_functionality_data.py index 97c55928..f99506af 100644 --- a/rootly_sdk/models/new_functionality_data.py +++ b/rootly_sdk/models/new_functionality_data.py @@ -1,8 +1,9 @@ +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_functionality_data_type import NewFunctionalityDataType, check_new_functionality_data_type @@ -22,8 +23,7 @@ class NewFunctionalityData: """ type_: NewFunctionalityDataType - attributes: "NewFunctionalityDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewFunctionalityDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_functionality_data.additional_properties = d return new_functionality_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_functionality_data_attributes.py b/rootly_sdk/models/new_functionality_data_attributes.py index 6afdde6a..8422c307 100644 --- a/rootly_sdk/models/new_functionality_data_attributes.py +++ b/rootly_sdk/models/new_functionality_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -27,84 +29,84 @@ class NewFunctionalityDataAttributes: """ Attributes: name (str): The name of the functionality - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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: + description (None | str | Unset): The description of the functionality + public_description (None | str | Unset): The status page 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: :namespace/:kind/:entity_name - 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 + 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 Default: 60. - 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 + 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 associated with this functionality - properties (Union[Unset, list['NewFunctionalityDataAttributesPropertiesItem']]): Array of property values for - this functionality. + properties (list[NewFunctionalityDataAttributesPropertiesItem] | Unset): Array of property values for this + functionality. """ name: str - 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 + slug: None | 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 + 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 def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -113,71 +115,71 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | Unset | str + backstage_id: None | str | Unset if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | Unset | str + pagerduty_id: None | str | Unset if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | Unset | str + opsgenie_id: None | str | Unset if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | Unset | str + opsgenie_team_id: None | str | Unset if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: None | Unset | str + cortex_id: None | str | Unset if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | Unset | str + service_now_ci_sys_id: None | str | Unset 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: None | Unset | bool + show_uptime: bool | None | Unset if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: Unset | int = UNSET + show_uptime_last_days: int | Unset = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - environment_ids: None | Unset | list[str] + environment_ids: list[str] | None | Unset if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -186,7 +188,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -195,7 +197,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: None | Unset | list[str] + owner_group_ids: list[str] | None | Unset if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -204,7 +206,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: None | Unset | list[int] + owner_user_ids: list[int] | None | Unset if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -213,13 +215,13 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - escalation_policy_id: None | Unset | str + escalation_policy_id: None | str | Unset if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - slack_channels: None | Unset | list[dict[str, Any]] + slack_channels: list[dict[str, Any]] | None | Unset if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -231,7 +233,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: None | Unset | list[dict[str, Any]] + slack_aliases: list[dict[str, Any]] | None | Unset if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -243,7 +245,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: Unset | list[dict[str, Any]] = UNSET + properties: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -321,34 +323,34 @@ 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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -359,104 +361,104 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | Unset | str: + def _parse_backstage_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | Unset | str: + def _parse_pagerduty_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | Unset | str: + def _parse_opsgenie_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | Unset | str: + def _parse_opsgenie_team_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> None | Unset | str: + def _parse_cortex_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: + def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) -> None | Unset | bool: + def _parse_show_uptime(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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: Unset | NewFunctionalityDataAttributesShowUptimeLastDays + show_uptime_last_days: NewFunctionalityDataAttributesShowUptimeLastDays | Unset if isinstance(_show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: @@ -464,7 +466,7 @@ def _parse_show_uptime(data: object) -> None | Unset | bool: _show_uptime_last_days ) - def _parse_environment_ids(data: object) -> None | Unset | list[str]: + def _parse_environment_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -475,13 +477,13 @@ def _parse_environment_ids(data: object) -> None | Unset | list[str]: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -492,13 +494,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: + def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -509,13 +511,13 @@ def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: owner_group_ids_type_0 = cast(list[str], data) return owner_group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: + def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -526,24 +528,24 @@ def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: owner_user_ids_type_0 = cast(list[int], data) return owner_user_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[int], data) + return cast(list[int] | None | Unset, data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_escalation_policy_id(data: object) -> None | Unset | str: + def _parse_escalation_policy_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) def _parse_slack_channels( data: object, - ) -> None | Unset | list["NewFunctionalityDataAttributesSlackChannelsType0Item"]: + ) -> list[NewFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -561,15 +563,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["NewFunctionalityDataAttributesSlackChannelsType0Item"], data) + return cast(list[NewFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset, data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> None | Unset | list["NewFunctionalityDataAttributesSlackAliasesType0Item"]: + ) -> list[NewFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -587,18 +589,20 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["NewFunctionalityDataAttributesSlackAliasesType0Item"], data) + return cast(list[NewFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset, data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - properties = [] _properties = d.pop("properties", UNSET) - for properties_item_data in _properties or []: - properties_item = NewFunctionalityDataAttributesPropertiesItem.from_dict(properties_item_data) + 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) - properties.append(properties_item) + properties.append(properties_item) new_functionality_data_attributes = cls( name=name, 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 a1cca45b..b3518fb5 100644 --- a/rootly_sdk/models/new_functionality_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_functionality_data_attributes_properties_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_functionality_data_attributes_show_uptime_last_days.py b/rootly_sdk/models/new_functionality_data_attributes_show_uptime_last_days.py index 9b09006b..0c987d12 100644 --- a/rootly_sdk/models/new_functionality_data_attributes_show_uptime_last_days.py +++ b/rootly_sdk/models/new_functionality_data_attributes_show_uptime_last_days.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewFunctionalityDataAttributesShowUptimeLastDays = Literal[30, 60, 90] @@ -15,7 +15,7 @@ def check_new_functionality_data_attributes_show_uptime_last_days( value: int, ) -> NewFunctionalityDataAttributesShowUptimeLastDays: if value in NEW_FUNCTIONALITY_DATA_ATTRIBUTES_SHOW_UPTIME_LAST_DAYS_VALUES: - return cast(NewFunctionalityDataAttributesShowUptimeLastDays, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_FUNCTIONALITY_DATA_ATTRIBUTES_SHOW_UPTIME_LAST_DAYS_VALUES!r}" ) 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 a304c3b3..865428b7 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="NewFunctionalityDataAttributesSlackAliasesType0Item") @@ -17,7 +18,6 @@ class NewFunctionalityDataAttributesSlackAliasesType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - new_functionality_data_attributes_slack_aliases_type_0_item.additional_properties = d return new_functionality_data_attributes_slack_aliases_type_0_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_functionality_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/new_functionality_data_attributes_slack_channels_type_0_item.py index 608aa018..17cb44ed 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="NewFunctionalityDataAttributesSlackChannelsType0Item") @@ -17,7 +18,6 @@ class NewFunctionalityDataAttributesSlackChannelsType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - new_functionality_data_attributes_slack_channels_type_0_item.additional_properties = d return new_functionality_data_attributes_slack_channels_type_0_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_functionality_data_type.py b/rootly_sdk/models/new_functionality_data_type.py index 6171eccb..626da6bc 100644 --- a/rootly_sdk/models/new_functionality_data_type.py +++ b/rootly_sdk/models/new_functionality_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewFunctionalityDataType = Literal["functionalities"] @@ -11,5 +11,5 @@ def check_new_functionality_data_type(value: str | None) -> NewFunctionalityData if value is None: return None if value in NEW_FUNCTIONALITY_DATA_TYPE_VALUES: - return cast(NewFunctionalityDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_FUNCTIONALITY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_heartbeat.py b/rootly_sdk/models/new_heartbeat.py index efd23daf..046afd19 100644 --- a/rootly_sdk/models/new_heartbeat.py +++ b/rootly_sdk/models/new_heartbeat.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_heartbeat_data import NewHeartbeatData @@ -18,14 +19,13 @@ class NewHeartbeat: data (NewHeartbeatData): """ - data: "NewHeartbeatData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewHeartbeatData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_heartbeat.additional_properties = d return new_heartbeat - - @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_heartbeat_data.py b/rootly_sdk/models/new_heartbeat_data.py index 14046489..972113f3 100644 --- a/rootly_sdk/models/new_heartbeat_data.py +++ b/rootly_sdk/models/new_heartbeat_data.py @@ -1,8 +1,9 @@ +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_heartbeat_data_type import NewHeartbeatDataType, check_new_heartbeat_data_type @@ -22,8 +23,7 @@ class NewHeartbeatData: """ type_: NewHeartbeatDataType - attributes: "NewHeartbeatDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewHeartbeatDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_heartbeat_data.additional_properties = d return new_heartbeat_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_heartbeat_data_attributes.py b/rootly_sdk/models/new_heartbeat_data_attributes.py index 628ddb7e..d53146f8 100644 --- a/rootly_sdk/models/new_heartbeat_data_attributes.py +++ b/rootly_sdk/models/new_heartbeat_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -27,11 +29,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 (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. + 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. """ name: str @@ -40,11 +42,11 @@ class NewHeartbeatDataAttributes: interval_unit: NewHeartbeatDataAttributesIntervalUnit notification_target_id: str notification_target_type: NewHeartbeatDataAttributesNotificationTargetType - 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 + 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 def to_dict(self) -> dict[str, Any]: name = self.name @@ -59,25 +61,25 @@ def to_dict(self) -> dict[str, Any]: notification_target_type: str = self.notification_target_type - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - alert_description: None | Unset | str + alert_description: None | str | Unset if isinstance(self.alert_description, Unset): alert_description = UNSET else: alert_description = self.alert_description - alert_urgency_id: None | Unset | str + alert_urgency_id: None | str | Unset if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - owner_group_ids: Unset | list[str] = UNSET + owner_group_ids: list[str] | Unset = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids @@ -125,30 +127,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("notification_target_type") ) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_alert_description(data: object) -> None | Unset | str: + def _parse_alert_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) alert_description = _parse_alert_description(d.pop("alert_description", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | Unset | str: + def _parse_alert_urgency_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) diff --git a/rootly_sdk/models/new_heartbeat_data_attributes_interval_unit.py b/rootly_sdk/models/new_heartbeat_data_attributes_interval_unit.py index 759e6d47..774bd3db 100644 --- a/rootly_sdk/models/new_heartbeat_data_attributes_interval_unit.py +++ b/rootly_sdk/models/new_heartbeat_data_attributes_interval_unit.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewHeartbeatDataAttributesIntervalUnit = Literal["days", "hours", "minutes"] @@ -15,7 +15,7 @@ def check_new_heartbeat_data_attributes_interval_unit( if value is None: return None if value in NEW_HEARTBEAT_DATA_ATTRIBUTES_INTERVAL_UNIT_VALUES: - return cast(NewHeartbeatDataAttributesIntervalUnit, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_HEARTBEAT_DATA_ATTRIBUTES_INTERVAL_UNIT_VALUES!r}" ) diff --git a/rootly_sdk/models/new_heartbeat_data_attributes_notification_target_type.py b/rootly_sdk/models/new_heartbeat_data_attributes_notification_target_type.py index b6f8f88b..9fb1b7e5 100644 --- a/rootly_sdk/models/new_heartbeat_data_attributes_notification_target_type.py +++ b/rootly_sdk/models/new_heartbeat_data_attributes_notification_target_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewHeartbeatDataAttributesNotificationTargetType = Literal[ "EscalationPolicy", "Functionality", "Group", "Service", "User" @@ -19,7 +19,7 @@ def check_new_heartbeat_data_attributes_notification_target_type( if value is None: return None if value in NEW_HEARTBEAT_DATA_ATTRIBUTES_NOTIFICATION_TARGET_TYPE_VALUES: - return cast(NewHeartbeatDataAttributesNotificationTargetType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_HEARTBEAT_DATA_ATTRIBUTES_NOTIFICATION_TARGET_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_heartbeat_data_type.py b/rootly_sdk/models/new_heartbeat_data_type.py index 4354dd4f..b50ba3a5 100644 --- a/rootly_sdk/models/new_heartbeat_data_type.py +++ b/rootly_sdk/models/new_heartbeat_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewHeartbeatDataType = Literal["heartbeats"] @@ -11,5 +11,5 @@ def check_new_heartbeat_data_type(value: str | None) -> NewHeartbeatDataType | N if value is None: return None if value in NEW_HEARTBEAT_DATA_TYPE_VALUES: - return cast(NewHeartbeatDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_HEARTBEAT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_incident.py b/rootly_sdk/models/new_incident.py index 9be29c67..20401cd3 100644 --- a/rootly_sdk/models/new_incident.py +++ b/rootly_sdk/models/new_incident.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_incident_data import NewIncidentData @@ -18,14 +19,13 @@ class NewIncident: data (NewIncidentData): """ - data: "NewIncidentData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewIncidentData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_incident.additional_properties = d return new_incident - - @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_incident_action_item.py b/rootly_sdk/models/new_incident_action_item.py index 004ae495..88abcfd1 100644 --- a/rootly_sdk/models/new_incident_action_item.py +++ b/rootly_sdk/models/new_incident_action_item.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_incident_action_item_data import NewIncidentActionItemData @@ -18,14 +19,13 @@ class NewIncidentActionItem: data (NewIncidentActionItemData): """ - data: "NewIncidentActionItemData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewIncidentActionItemData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_incident_action_item.additional_properties = d return new_incident_action_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_incident_action_item_data.py b/rootly_sdk/models/new_incident_action_item_data.py index 9ee79a63..98c40469 100644 --- a/rootly_sdk/models/new_incident_action_item_data.py +++ b/rootly_sdk/models/new_incident_action_item_data.py @@ -1,8 +1,9 @@ +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_incident_action_item_data_type import ( NewIncidentActionItemDataType, @@ -25,8 +26,7 @@ class NewIncidentActionItemData: """ type_: NewIncidentActionItemDataType - attributes: "NewIncidentActionItemDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewIncidentActionItemDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_incident_action_item_data.additional_properties = d return new_incident_action_item_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_incident_action_item_data_attributes.py b/rootly_sdk/models/new_incident_action_item_data_attributes.py index 9e4f798d..65b7644e 100644 --- a/rootly_sdk/models/new_incident_action_item_data_attributes.py +++ b/rootly_sdk/models/new_incident_action_item_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -31,92 +33,90 @@ class NewIncidentActionItemDataAttributes: """ Attributes: summary (str): The summary of the action item - 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. + 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. """ summary: str - 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 - ) + 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 def to_dict(self) -> dict[str, Any]: summary = self.summary - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind - assigned_to_user_id: None | Unset | int + assigned_to_user_id: int | None | Unset 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: Unset | list[str] = UNSET + assigned_to_group_ids: list[str] | Unset = UNSET if not isinstance(self.assigned_to_group_ids, Unset): assigned_to_group_ids = self.assigned_to_group_ids - priority: Unset | str = UNSET + priority: str | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status - due_date: None | Unset | str + due_date: None | str | Unset if isinstance(self.due_date, Unset): due_date = UNSET else: due_date = self.due_date - jira_issue_id: None | Unset | str + jira_issue_id: None | str | Unset if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_key: None | Unset | str + jira_issue_key: None | str | Unset if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_url: None | Unset | str + jira_issue_url: None | str | Unset if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - form_field_selections: None | Unset | list[dict[str, Any]] + form_field_selections: list[dict[str, Any]] | None | Unset if isinstance(self.form_field_selections, Unset): form_field_selections = UNSET elif isinstance(self.form_field_selections, list): @@ -169,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) _kind = d.pop("kind", UNSET) - kind: Unset | NewIncidentActionItemDataAttributesKind + kind: NewIncidentActionItemDataAttributesKind | Unset 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) -> None | Unset | int: + def _parse_assigned_to_user_id(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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: Unset | NewIncidentActionItemDataAttributesPriority + priority: NewIncidentActionItemDataAttributesPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: priority = check_new_incident_action_item_data_attributes_priority(_priority) _status = d.pop("status", UNSET) - status: Unset | NewIncidentActionItemDataAttributesStatus + status: NewIncidentActionItemDataAttributesStatus | Unset if isinstance(_status, Unset): status = UNSET else: status = check_new_incident_action_item_data_attributes_status(_status) - def _parse_due_date(data: object) -> None | Unset | str: + def _parse_due_date(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) due_date = _parse_due_date(d.pop("due_date", UNSET)) - def _parse_jira_issue_id(data: object) -> None | Unset | str: + def _parse_jira_issue_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_key(data: object) -> None | Unset | str: + def _parse_jira_issue_key(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_url(data: object) -> None | Unset | str: + def _parse_jira_issue_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) def _parse_form_field_selections( data: object, - ) -> None | Unset | list["NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item"]: + ) -> list[NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -268,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item"], data) + return cast(list[NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset, 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 d7c28de8..f8730f92 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,42 +15,41 @@ class NewIncidentActionItemDataAttributesFormFieldSelectionsType0Item: """ Attributes: form_field_id (str): ID of the custom field - 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 + 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 """ form_field_id: str - 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 + 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 def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id id = self.id - value: None | Unset | list[str] | str + value: list[str] | None | str | Unset if isinstance(self.value, Unset): value = UNSET elif isinstance(self.value, list): @@ -57,43 +58,43 @@ def to_dict(self) -> dict[str, Any]: else: value = self.value - selected_option_ids: Unset | list[str] = UNSET + selected_option_ids: list[str] | Unset = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_user_ids: Unset | list[int] = UNSET + selected_user_ids: list[int] | Unset = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_group_ids: Unset | list[str] = UNSET + selected_group_ids: list[str] | Unset = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_service_ids: Unset | list[str] = UNSET + selected_service_ids: list[str] | Unset = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: Unset | list[str] = UNSET + selected_functionality_ids: list[str] | Unset = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_catalog_entity_ids: list[str] | Unset = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_environment_ids: Unset | list[str] = UNSET + selected_environment_ids: list[str] | Unset = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: Unset | list[str] = UNSET + selected_cause_ids: list[str] | Unset = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: Unset | list[str] = UNSET + selected_incident_type_ids: list[str] | Unset = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids - field_destroy: None | Unset | bool + field_destroy: bool | None | Unset if isinstance(self.field_destroy, Unset): field_destroy = UNSET else: @@ -140,7 +141,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) - def _parse_value(data: object) -> None | Unset | list[str] | str: + def _parse_value(data: object) -> list[str] | None | str | Unset: if data is None: return data if isinstance(data, Unset): @@ -151,9 +152,9 @@ def _parse_value(data: object) -> None | Unset | list[str] | str: value_type_1 = cast(list[str], data) return value_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str] | str, data) + return cast(list[str] | None | str | Unset, data) value = _parse_value(d.pop("value", UNSET)) @@ -175,12 +176,12 @@ def _parse_value(data: object) -> None | Unset | list[str] | str: selected_incident_type_ids = cast(list[str], d.pop("selected_incident_type_ids", UNSET)) - def _parse_field_destroy(data: object) -> None | Unset | bool: + def _parse_field_destroy(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) field_destroy = _parse_field_destroy(d.pop("_destroy", UNSET)) diff --git a/rootly_sdk/models/new_incident_action_item_data_attributes_kind.py b/rootly_sdk/models/new_incident_action_item_data_attributes_kind.py index cb5f4306..8abd020b 100644 --- a/rootly_sdk/models/new_incident_action_item_data_attributes_kind.py +++ b/rootly_sdk/models/new_incident_action_item_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentActionItemDataAttributesKind = Literal["follow_up", "task"] @@ -14,7 +14,7 @@ def check_new_incident_action_item_data_attributes_kind( if value is None: return None if value in NEW_INCIDENT_ACTION_ITEM_DATA_ATTRIBUTES_KIND_VALUES: - return cast(NewIncidentActionItemDataAttributesKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_ACTION_ITEM_DATA_ATTRIBUTES_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/new_incident_action_item_data_attributes_priority.py b/rootly_sdk/models/new_incident_action_item_data_attributes_priority.py index 3ab50721..75dde751 100644 --- a/rootly_sdk/models/new_incident_action_item_data_attributes_priority.py +++ b/rootly_sdk/models/new_incident_action_item_data_attributes_priority.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentActionItemDataAttributesPriority = Literal["high", "low", "medium"] @@ -15,7 +15,7 @@ def check_new_incident_action_item_data_attributes_priority( if value is None: return None if value in NEW_INCIDENT_ACTION_ITEM_DATA_ATTRIBUTES_PRIORITY_VALUES: - return cast(NewIncidentActionItemDataAttributesPriority, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_ACTION_ITEM_DATA_ATTRIBUTES_PRIORITY_VALUES!r}" ) diff --git a/rootly_sdk/models/new_incident_action_item_data_attributes_status.py b/rootly_sdk/models/new_incident_action_item_data_attributes_status.py index 538e54be..0227fa93 100644 --- a/rootly_sdk/models/new_incident_action_item_data_attributes_status.py +++ b/rootly_sdk/models/new_incident_action_item_data_attributes_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentActionItemDataAttributesStatus = Literal["cancelled", "done", "in_progress", "open"] @@ -16,7 +16,7 @@ def check_new_incident_action_item_data_attributes_status( if value is None: return None if value in NEW_INCIDENT_ACTION_ITEM_DATA_ATTRIBUTES_STATUS_VALUES: - return cast(NewIncidentActionItemDataAttributesStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_ACTION_ITEM_DATA_ATTRIBUTES_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/new_incident_action_item_data_type.py b/rootly_sdk/models/new_incident_action_item_data_type.py index 46afc189..8f2cfb5b 100644 --- a/rootly_sdk/models/new_incident_action_item_data_type.py +++ b/rootly_sdk/models/new_incident_action_item_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentActionItemDataType = Literal["incident_action_items"] @@ -11,5 +11,5 @@ def check_new_incident_action_item_data_type(value: str | None) -> NewIncidentAc if value is None: return None if value in NEW_INCIDENT_ACTION_ITEM_DATA_TYPE_VALUES: - return cast(NewIncidentActionItemDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_ACTION_ITEM_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_incident_custom_field_selection.py b/rootly_sdk/models/new_incident_custom_field_selection.py index ed0e7abc..cee823b8 100644 --- a/rootly_sdk/models/new_incident_custom_field_selection.py +++ b/rootly_sdk/models/new_incident_custom_field_selection.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_incident_custom_field_selection_data import NewIncidentCustomFieldSelectionData @@ -18,14 +19,13 @@ class NewIncidentCustomFieldSelection: data (NewIncidentCustomFieldSelectionData): """ - data: "NewIncidentCustomFieldSelectionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewIncidentCustomFieldSelectionData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_incident_custom_field_selection.additional_properties = d return new_incident_custom_field_selection - - @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_incident_custom_field_selection_data.py b/rootly_sdk/models/new_incident_custom_field_selection_data.py index a59f3532..80d6e588 100644 --- a/rootly_sdk/models/new_incident_custom_field_selection_data.py +++ b/rootly_sdk/models/new_incident_custom_field_selection_data.py @@ -1,8 +1,9 @@ +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_incident_custom_field_selection_data_type import ( NewIncidentCustomFieldSelectionDataType, @@ -27,8 +28,7 @@ class NewIncidentCustomFieldSelectionData: """ type_: NewIncidentCustomFieldSelectionDataType - attributes: "NewIncidentCustomFieldSelectionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewIncidentCustomFieldSelectionDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -62,21 +62,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_incident_custom_field_selection_data.additional_properties = d return new_incident_custom_field_selection_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_incident_custom_field_selection_data_attributes.py b/rootly_sdk/models/new_incident_custom_field_selection_data_attributes.py index 31f89ff4..9d28b839 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,13 +15,13 @@ class NewIncidentCustomFieldSelectionDataAttributes: """ Attributes: custom_field_id (int): The custom field for this selection - value (Union[None, str]): The selected value for text kind custom fields - selected_option_ids (Union[Unset, list[int]]): + value (None | str): The selected value for text kind custom fields + selected_option_ids (list[int] | Unset): """ custom_field_id: int value: None | str - selected_option_ids: Unset | list[int] = UNSET + selected_option_ids: list[int] | Unset = UNSET def to_dict(self) -> dict[str, Any]: custom_field_id = self.custom_field_id @@ -27,7 +29,7 @@ def to_dict(self) -> dict[str, Any]: value: None | str value = self.value - selected_option_ids: Unset | list[int] = UNSET + selected_option_ids: list[int] | Unset = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids diff --git a/rootly_sdk/models/new_incident_custom_field_selection_data_type.py b/rootly_sdk/models/new_incident_custom_field_selection_data_type.py index a7e73dc9..1e78e358 100644 --- a/rootly_sdk/models/new_incident_custom_field_selection_data_type.py +++ b/rootly_sdk/models/new_incident_custom_field_selection_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentCustomFieldSelectionDataType = Literal["incident_custom_field_selections"] @@ -13,7 +13,7 @@ def check_new_incident_custom_field_selection_data_type( if value is None: return None if value in NEW_INCIDENT_CUSTOM_FIELD_SELECTION_DATA_TYPE_VALUES: - return cast(NewIncidentCustomFieldSelectionDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_CUSTOM_FIELD_SELECTION_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_incident_data.py b/rootly_sdk/models/new_incident_data.py index ebe1a219..ce24b8ef 100644 --- a/rootly_sdk/models/new_incident_data.py +++ b/rootly_sdk/models/new_incident_data.py @@ -1,8 +1,9 @@ +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_incident_data_type import NewIncidentDataType, check_new_incident_data_type @@ -22,8 +23,7 @@ class NewIncidentData: """ type_: NewIncidentDataType - attributes: "NewIncidentDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewIncidentDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_incident_data.additional_properties = d return new_incident_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_incident_data_attributes.py b/rootly_sdk/models/new_incident_data_attributes.py index abb989bf..f63eb0c4 100644 --- a/rootly_sdk/models/new_incident_data_attributes.py +++ b/rootly_sdk/models/new_incident_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -24,149 +26,155 @@ class NewIncidentDataAttributes: """ Attributes: - 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: + 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: {"platform":"osx", "version": "1.29"} - 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 + 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 + linear_issue_key (None | str | Unset): Linear issue key + linear_issue_id (None | str | Unset): Linear issue ID + linear_issue_url (None | str | Unset): Linear 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 """ - 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 + 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 + linear_issue_key: None | str | Unset = UNSET + linear_issue_id: None | str | Unset = UNSET + linear_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 def to_dict(self) -> dict[str, Any]: from ..models.new_incident_data_attributes_labels_type_0 import NewIncidentDataAttributesLabelsType0 - title: None | Unset | str + title: None | str | Unset if isinstance(self.title, Unset): title = UNSET else: title = self.title - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind - parent_incident_id: None | Unset | str + parent_incident_id: None | str | Unset if isinstance(self.parent_incident_id, Unset): parent_incident_id = UNSET else: parent_incident_id = self.parent_incident_id - duplicate_incident_id: None | Unset | str + duplicate_incident_id: None | str | Unset if isinstance(self.duplicate_incident_id, Unset): duplicate_incident_id = UNSET else: duplicate_incident_id = self.duplicate_incident_id - private: None | Unset | bool + private: bool | None | Unset if isinstance(self.private, Unset): private = UNSET else: private = self.private - summary: None | Unset | str + summary: None | str | Unset if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - user_id: None | Unset | str + user_id: None | str | Unset if isinstance(self.user_id, Unset): user_id = UNSET else: user_id = self.user_id - severity_id: None | Unset | str + severity_id: None | str | Unset if isinstance(self.severity_id, Unset): severity_id = UNSET else: severity_id = self.severity_id - public_title: None | Unset | str + public_title: None | str | Unset if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - alert_ids: None | Unset | list[str] + alert_ids: list[str] | None | Unset if isinstance(self.alert_ids, Unset): alert_ids = UNSET elif isinstance(self.alert_ids, list): @@ -175,7 +183,7 @@ def to_dict(self) -> dict[str, Any]: else: alert_ids = self.alert_ids - environment_ids: None | Unset | list[str] + environment_ids: list[str] | None | Unset if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -184,7 +192,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - incident_type_ids: None | Unset | list[str] + incident_type_ids: list[str] | None | Unset if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -193,7 +201,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_type_ids = self.incident_type_ids - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -202,7 +210,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: None | Unset | list[str] + functionality_ids: list[str] | None | Unset if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -211,7 +219,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: None | Unset | list[str] + group_ids: list[str] | None | Unset if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -220,7 +228,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - cause_ids: None | Unset | list[str] + cause_ids: list[str] | None | Unset if isinstance(self.cause_ids, Unset): cause_ids = UNSET elif isinstance(self.cause_ids, list): @@ -229,7 +237,7 @@ def to_dict(self) -> dict[str, Any]: else: cause_ids = self.cause_ids - muted_service_ids: None | Unset | list[str] + muted_service_ids: list[str] | None | Unset if isinstance(self.muted_service_ids, Unset): muted_service_ids = UNSET elif isinstance(self.muted_service_ids, list): @@ -238,7 +246,7 @@ def to_dict(self) -> dict[str, Any]: else: muted_service_ids = self.muted_service_ids - labels: None | Unset | dict[str, Any] + labels: dict[str, Any] | None | Unset if isinstance(self.labels, Unset): labels = UNSET elif isinstance(self.labels, NewIncidentDataAttributesLabelsType0): @@ -246,61 +254,79 @@ def to_dict(self) -> dict[str, Any]: else: labels = self.labels - slack_channel_name: None | Unset | str + slack_channel_name: None | str | Unset if isinstance(self.slack_channel_name, Unset): slack_channel_name = UNSET else: slack_channel_name = self.slack_channel_name - slack_channel_id: None | Unset | str + slack_channel_id: None | str | Unset if isinstance(self.slack_channel_id, Unset): slack_channel_id = UNSET else: slack_channel_id = self.slack_channel_id - slack_channel_url: None | Unset | str + slack_channel_url: None | str | Unset if isinstance(self.slack_channel_url, Unset): slack_channel_url = UNSET else: slack_channel_url = self.slack_channel_url - slack_channel_archived: None | Unset | bool + slack_channel_archived: bool | None | Unset if isinstance(self.slack_channel_archived, Unset): slack_channel_archived = UNSET else: slack_channel_archived = self.slack_channel_archived - google_drive_parent_id: None | Unset | str + google_drive_parent_id: None | str | Unset 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 | Unset | str + google_drive_url: None | str | Unset if isinstance(self.google_drive_url, Unset): google_drive_url = UNSET else: google_drive_url = self.google_drive_url - jira_issue_key: None | Unset | str + jira_issue_key: None | str | Unset if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_id: None | Unset | str + jira_issue_id: None | str | Unset if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_url: None | Unset | str + jira_issue_url: None | str | Unset if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - notify_emails: None | Unset | list[str] + linear_issue_key: None | str | Unset + if isinstance(self.linear_issue_key, Unset): + linear_issue_key = UNSET + else: + linear_issue_key = self.linear_issue_key + + linear_issue_id: None | str | Unset + 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 + if isinstance(self.linear_issue_url, Unset): + linear_issue_url = UNSET + else: + linear_issue_url = self.linear_issue_url + + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -309,67 +335,67 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status url = self.url - scheduled_for: None | Unset | str + scheduled_for: None | str | Unset if isinstance(self.scheduled_for, Unset): scheduled_for = UNSET else: scheduled_for = self.scheduled_for - scheduled_until: None | Unset | str + scheduled_until: None | str | Unset if isinstance(self.scheduled_until, Unset): scheduled_until = UNSET else: scheduled_until = self.scheduled_until - in_triage_at: None | Unset | str + in_triage_at: None | str | Unset if isinstance(self.in_triage_at, Unset): in_triage_at = UNSET else: in_triage_at = self.in_triage_at - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - detected_at: None | Unset | str + detected_at: None | str | Unset if isinstance(self.detected_at, Unset): detected_at = UNSET else: detected_at = self.detected_at - acknowledged_at: None | Unset | str + acknowledged_at: None | str | Unset if isinstance(self.acknowledged_at, Unset): acknowledged_at = UNSET else: acknowledged_at = self.acknowledged_at - mitigated_at: None | Unset | str + mitigated_at: None | str | Unset if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: None | Unset | str + resolved_at: None | str | Unset if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: resolved_at = self.resolved_at - closed_at: None | Unset | str + closed_at: None | str | Unset if isinstance(self.closed_at, Unset): closed_at = UNSET else: closed_at = self.closed_at - cancelled_at: None | Unset | str + cancelled_at: None | str | Unset if isinstance(self.cancelled_at, Unset): cancelled_at = UNSET else: @@ -432,6 +458,12 @@ def to_dict(self) -> dict[str, Any]: field_dict["jira_issue_id"] = jira_issue_id if jira_issue_url is not UNSET: field_dict["jira_issue_url"] = jira_issue_url + if linear_issue_key is not UNSET: + field_dict["linear_issue_key"] = linear_issue_key + if linear_issue_id is not UNSET: + field_dict["linear_issue_id"] = linear_issue_id + if linear_issue_url is not UNSET: + field_dict["linear_issue_url"] = linear_issue_url if notify_emails is not UNSET: field_dict["notify_emails"] = notify_emails if status is not UNSET: @@ -467,86 +499,86 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_title(data: object) -> None | Unset | str: + def _parse_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) title = _parse_title(d.pop("title", UNSET)) _kind = d.pop("kind", UNSET) - kind: Unset | NewIncidentDataAttributesKind + kind: NewIncidentDataAttributesKind | Unset if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_incident_data_attributes_kind(_kind) - def _parse_parent_incident_id(data: object) -> None | Unset | str: + def _parse_parent_incident_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) parent_incident_id = _parse_parent_incident_id(d.pop("parent_incident_id", UNSET)) - def _parse_duplicate_incident_id(data: object) -> None | Unset | str: + def _parse_duplicate_incident_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) duplicate_incident_id = _parse_duplicate_incident_id(d.pop("duplicate_incident_id", UNSET)) - def _parse_private(data: object) -> None | Unset | bool: + def _parse_private(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) private = _parse_private(d.pop("private", UNSET)) - def _parse_summary(data: object) -> None | Unset | str: + def _parse_summary(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_user_id(data: object) -> None | Unset | str: + def _parse_user_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) user_id = _parse_user_id(d.pop("user_id", UNSET)) - def _parse_severity_id(data: object) -> None | Unset | str: + def _parse_severity_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) severity_id = _parse_severity_id(d.pop("severity_id", UNSET)) - def _parse_public_title(data: object) -> None | Unset | str: + def _parse_public_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_alert_ids(data: object) -> None | Unset | list[str]: + def _parse_alert_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -557,13 +589,13 @@ def _parse_alert_ids(data: object) -> None | Unset | list[str]: alert_ids_type_0 = cast(list[str], data) return alert_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) alert_ids = _parse_alert_ids(d.pop("alert_ids", UNSET)) - def _parse_environment_ids(data: object) -> None | Unset | list[str]: + def _parse_environment_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -574,13 +606,13 @@ def _parse_environment_ids(data: object) -> None | Unset | list[str]: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: + def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -591,13 +623,13 @@ def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -608,13 +640,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> None | Unset | list[str]: + def _parse_functionality_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -625,13 +657,13 @@ def _parse_functionality_ids(data: object) -> None | Unset | list[str]: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> None | Unset | list[str]: + def _parse_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -642,13 +674,13 @@ def _parse_group_ids(data: object) -> None | Unset | list[str]: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_cause_ids(data: object) -> None | Unset | list[str]: + def _parse_cause_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -659,13 +691,13 @@ def _parse_cause_ids(data: object) -> None | Unset | list[str]: cause_ids_type_0 = cast(list[str], data) return cause_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) cause_ids = _parse_cause_ids(d.pop("cause_ids", UNSET)) - def _parse_muted_service_ids(data: object) -> None | Unset | list[str]: + def _parse_muted_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -676,13 +708,13 @@ def _parse_muted_service_ids(data: object) -> None | Unset | list[str]: muted_service_ids_type_0 = cast(list[str], data) return muted_service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) muted_service_ids = _parse_muted_service_ids(d.pop("muted_service_ids", UNSET)) - def _parse_labels(data: object) -> Union["NewIncidentDataAttributesLabelsType0", None, Unset]: + def _parse_labels(data: object) -> NewIncidentDataAttributesLabelsType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -693,94 +725,121 @@ def _parse_labels(data: object) -> Union["NewIncidentDataAttributesLabelsType0", labels_type_0 = NewIncidentDataAttributesLabelsType0.from_dict(data) return labels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["NewIncidentDataAttributesLabelsType0", None, Unset], data) + return cast(NewIncidentDataAttributesLabelsType0 | None | Unset, data) labels = _parse_labels(d.pop("labels", UNSET)) - def _parse_slack_channel_name(data: object) -> None | Unset | str: + def _parse_slack_channel_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slack_channel_name = _parse_slack_channel_name(d.pop("slack_channel_name", UNSET)) - def _parse_slack_channel_id(data: object) -> None | Unset | str: + def _parse_slack_channel_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slack_channel_id = _parse_slack_channel_id(d.pop("slack_channel_id", UNSET)) - def _parse_slack_channel_url(data: object) -> None | Unset | str: + def _parse_slack_channel_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slack_channel_url = _parse_slack_channel_url(d.pop("slack_channel_url", UNSET)) - def _parse_slack_channel_archived(data: object) -> None | Unset | bool: + def _parse_slack_channel_archived(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) slack_channel_archived = _parse_slack_channel_archived(d.pop("slack_channel_archived", UNSET)) - def _parse_google_drive_parent_id(data: object) -> None | Unset | str: + def _parse_google_drive_parent_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_google_drive_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) google_drive_url = _parse_google_drive_url(d.pop("google_drive_url", UNSET)) - def _parse_jira_issue_key(data: object) -> None | Unset | str: + def _parse_jira_issue_key(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_id(data: object) -> None | Unset | str: + def _parse_jira_issue_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_url(data: object) -> None | Unset | str: + def _parse_jira_issue_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_linear_issue_key(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + linear_issue_key = _parse_linear_issue_key(d.pop("linear_issue_key", UNSET)) + + def _parse_linear_issue_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + linear_issue_id = _parse_linear_issue_id(d.pop("linear_issue_id", UNSET)) + + def _parse_linear_issue_url(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + linear_issue_url = _parse_linear_issue_url(d.pop("linear_issue_url", UNSET)) + + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -791,14 +850,14 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) _status = d.pop("status", UNSET) - status: Unset | NewIncidentDataAttributesStatus + status: NewIncidentDataAttributesStatus | Unset if isinstance(_status, Unset): status = UNSET else: @@ -806,93 +865,93 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: url = d.pop("url", UNSET) - def _parse_scheduled_for(data: object) -> None | Unset | str: + def _parse_scheduled_for(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) scheduled_for = _parse_scheduled_for(d.pop("scheduled_for", UNSET)) - def _parse_scheduled_until(data: object) -> None | Unset | str: + def _parse_scheduled_until(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) scheduled_until = _parse_scheduled_until(d.pop("scheduled_until", UNSET)) - def _parse_in_triage_at(data: object) -> None | Unset | str: + def _parse_in_triage_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) in_triage_at = _parse_in_triage_at(d.pop("in_triage_at", UNSET)) - def _parse_started_at(data: object) -> None | Unset | str: + def _parse_started_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_detected_at(data: object) -> None | Unset | str: + def _parse_detected_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) detected_at = _parse_detected_at(d.pop("detected_at", UNSET)) - def _parse_acknowledged_at(data: object) -> None | Unset | str: + def _parse_acknowledged_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) acknowledged_at = _parse_acknowledged_at(d.pop("acknowledged_at", UNSET)) - def _parse_mitigated_at(data: object) -> None | Unset | str: + def _parse_mitigated_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> None | Unset | str: + def _parse_resolved_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) - def _parse_closed_at(data: object) -> None | Unset | str: + def _parse_closed_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) closed_at = _parse_closed_at(d.pop("closed_at", UNSET)) - def _parse_cancelled_at(data: object) -> None | Unset | str: + def _parse_cancelled_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) cancelled_at = _parse_cancelled_at(d.pop("cancelled_at", UNSET)) @@ -924,6 +983,9 @@ def _parse_cancelled_at(data: object) -> None | Unset | str: jira_issue_key=jira_issue_key, jira_issue_id=jira_issue_id, jira_issue_url=jira_issue_url, + linear_issue_key=linear_issue_key, + linear_issue_id=linear_issue_id, + linear_issue_url=linear_issue_url, notify_emails=notify_emails, status=status, url=url, diff --git a/rootly_sdk/models/new_incident_data_attributes_kind.py b/rootly_sdk/models/new_incident_data_attributes_kind.py index b803b17c..3f0b6d80 100644 --- a/rootly_sdk/models/new_incident_data_attributes_kind.py +++ b/rootly_sdk/models/new_incident_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentDataAttributesKind = Literal[ "backfilled", "example", "example_sub", "normal", "normal_sub", "scheduled", "scheduled_sub", "test", "test_sub" @@ -21,5 +21,5 @@ def check_new_incident_data_attributes_kind(value: str | None) -> NewIncidentDat if value is None: return None if value in NEW_INCIDENT_DATA_ATTRIBUTES_KIND_VALUES: - return cast(NewIncidentDataAttributesKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_DATA_ATTRIBUTES_KIND_VALUES!r}") 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 538c971f..5e4e81b3 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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_data_attributes_status.py b/rootly_sdk/models/new_incident_data_attributes_status.py index ffca1712..d510e483 100644 --- a/rootly_sdk/models/new_incident_data_attributes_status.py +++ b/rootly_sdk/models/new_incident_data_attributes_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentDataAttributesStatus = Literal[ "acknowledged", @@ -33,5 +33,5 @@ def check_new_incident_data_attributes_status(value: str | None) -> NewIncidentD if value is None: return None if value in NEW_INCIDENT_DATA_ATTRIBUTES_STATUS_VALUES: - return cast(NewIncidentDataAttributesStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_DATA_ATTRIBUTES_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/new_incident_data_type.py b/rootly_sdk/models/new_incident_data_type.py index e0af4f83..10a10072 100644 --- a/rootly_sdk/models/new_incident_data_type.py +++ b/rootly_sdk/models/new_incident_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentDataType = Literal["incidents"] @@ -11,5 +11,5 @@ def check_new_incident_data_type(value: str | None) -> NewIncidentDataType | Non if value is None: return None if value in NEW_INCIDENT_DATA_TYPE_VALUES: - return cast(NewIncidentDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_incident_event.py b/rootly_sdk/models/new_incident_event.py index 86de32cc..842a8612 100644 --- a/rootly_sdk/models/new_incident_event.py +++ b/rootly_sdk/models/new_incident_event.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_incident_event_data import NewIncidentEventData @@ -18,14 +19,13 @@ class NewIncidentEvent: data (NewIncidentEventData): """ - data: "NewIncidentEventData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewIncidentEventData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_incident_event.additional_properties = d return new_incident_event - - @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_incident_event_data.py b/rootly_sdk/models/new_incident_event_data.py index 6304f06d..171780e1 100644 --- a/rootly_sdk/models/new_incident_event_data.py +++ b/rootly_sdk/models/new_incident_event_data.py @@ -1,8 +1,9 @@ +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_incident_event_data_type import NewIncidentEventDataType, check_new_incident_event_data_type @@ -22,8 +23,7 @@ class NewIncidentEventData: """ type_: NewIncidentEventDataType - attributes: "NewIncidentEventDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewIncidentEventDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_incident_event_data.additional_properties = d return new_incident_event_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_incident_event_data_attributes.py b/rootly_sdk/models/new_incident_event_data_attributes.py index 1255db60..c7702049 100644 --- a/rootly_sdk/models/new_incident_event_data_attributes.py +++ b/rootly_sdk/models/new_incident_event_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -17,16 +19,16 @@ class NewIncidentEventDataAttributes: """ Attributes: event (str): The summary of the incident event - visibility (Union[Unset, NewIncidentEventDataAttributesVisibility]): The visibility of the incident action item + visibility (NewIncidentEventDataAttributesVisibility | Unset): The visibility of the incident action item """ event: str - visibility: Unset | NewIncidentEventDataAttributesVisibility = UNSET + visibility: NewIncidentEventDataAttributesVisibility | Unset = UNSET def to_dict(self) -> dict[str, Any]: event = self.event - visibility: Unset | str = UNSET + visibility: str | Unset = UNSET if not isinstance(self.visibility, Unset): visibility = self.visibility @@ -48,7 +50,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: event = d.pop("event") _visibility = d.pop("visibility", UNSET) - visibility: Unset | NewIncidentEventDataAttributesVisibility + visibility: NewIncidentEventDataAttributesVisibility | Unset if isinstance(_visibility, Unset): visibility = UNSET else: diff --git a/rootly_sdk/models/new_incident_event_data_attributes_visibility.py b/rootly_sdk/models/new_incident_event_data_attributes_visibility.py index 58fa1f6d..6304c80b 100644 --- a/rootly_sdk/models/new_incident_event_data_attributes_visibility.py +++ b/rootly_sdk/models/new_incident_event_data_attributes_visibility.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentEventDataAttributesVisibility = Literal["external", "internal"] @@ -14,7 +14,7 @@ def check_new_incident_event_data_attributes_visibility( if value is None: return None if value in NEW_INCIDENT_EVENT_DATA_ATTRIBUTES_VISIBILITY_VALUES: - return cast(NewIncidentEventDataAttributesVisibility, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_EVENT_DATA_ATTRIBUTES_VISIBILITY_VALUES!r}" ) diff --git a/rootly_sdk/models/new_incident_event_data_type.py b/rootly_sdk/models/new_incident_event_data_type.py index 55411908..fba466fc 100644 --- a/rootly_sdk/models/new_incident_event_data_type.py +++ b/rootly_sdk/models/new_incident_event_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentEventDataType = Literal["incident_events"] @@ -11,5 +11,5 @@ def check_new_incident_event_data_type(value: str | None) -> NewIncidentEventDat if value is None: return None if value in NEW_INCIDENT_EVENT_DATA_TYPE_VALUES: - return cast(NewIncidentEventDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_EVENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_incident_event_functionality.py b/rootly_sdk/models/new_incident_event_functionality.py index 14bfcce4..4844deb2 100644 --- a/rootly_sdk/models/new_incident_event_functionality.py +++ b/rootly_sdk/models/new_incident_event_functionality.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_incident_event_functionality_data import NewIncidentEventFunctionalityData @@ -18,14 +19,13 @@ class NewIncidentEventFunctionality: data (NewIncidentEventFunctionalityData): """ - data: "NewIncidentEventFunctionalityData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewIncidentEventFunctionalityData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_incident_event_functionality.additional_properties = d return new_incident_event_functionality - - @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_incident_event_functionality_data.py b/rootly_sdk/models/new_incident_event_functionality_data.py index 16c96a63..3436bb6d 100644 --- a/rootly_sdk/models/new_incident_event_functionality_data.py +++ b/rootly_sdk/models/new_incident_event_functionality_data.py @@ -1,8 +1,9 @@ +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_incident_event_functionality_data_type import ( NewIncidentEventFunctionalityDataType, @@ -25,8 +26,7 @@ class NewIncidentEventFunctionalityData: """ type_: NewIncidentEventFunctionalityDataType - attributes: "NewIncidentEventFunctionalityDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewIncidentEventFunctionalityDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -60,21 +60,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_incident_event_functionality_data.additional_properties = d return new_incident_event_functionality_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_incident_event_functionality_data_attributes.py b/rootly_sdk/models/new_incident_event_functionality_data_attributes.py index 26cb7912..e14b6383 100644 --- a/rootly_sdk/models/new_incident_event_functionality_data_attributes.py +++ b/rootly_sdk/models/new_incident_event_functionality_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_incident_event_functionality_data_attributes_status.py b/rootly_sdk/models/new_incident_event_functionality_data_attributes_status.py index 68734c07..cf442c70 100644 --- a/rootly_sdk/models/new_incident_event_functionality_data_attributes_status.py +++ b/rootly_sdk/models/new_incident_event_functionality_data_attributes_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentEventFunctionalityDataAttributesStatus = Literal["major_outage", "operational", "partial_outage"] @@ -17,7 +17,7 @@ def check_new_incident_event_functionality_data_attributes_status( if value is None: return None if value in NEW_INCIDENT_EVENT_FUNCTIONALITY_DATA_ATTRIBUTES_STATUS_VALUES: - return cast(NewIncidentEventFunctionalityDataAttributesStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_EVENT_FUNCTIONALITY_DATA_ATTRIBUTES_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/new_incident_event_functionality_data_type.py b/rootly_sdk/models/new_incident_event_functionality_data_type.py index 3185b86d..64811829 100644 --- a/rootly_sdk/models/new_incident_event_functionality_data_type.py +++ b/rootly_sdk/models/new_incident_event_functionality_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentEventFunctionalityDataType = Literal["incident_event_functionalities"] @@ -11,7 +11,7 @@ def check_new_incident_event_functionality_data_type(value: str | None) -> NewIn if value is None: return None if value in NEW_INCIDENT_EVENT_FUNCTIONALITY_DATA_TYPE_VALUES: - return cast(NewIncidentEventFunctionalityDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_EVENT_FUNCTIONALITY_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_incident_event_service.py b/rootly_sdk/models/new_incident_event_service.py index 97f4925c..fd222b1d 100644 --- a/rootly_sdk/models/new_incident_event_service.py +++ b/rootly_sdk/models/new_incident_event_service.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_incident_event_service_data import NewIncidentEventServiceData @@ -18,14 +19,13 @@ class NewIncidentEventService: data (NewIncidentEventServiceData): """ - data: "NewIncidentEventServiceData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewIncidentEventServiceData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_incident_event_service.additional_properties = d return new_incident_event_service - - @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_incident_event_service_data.py b/rootly_sdk/models/new_incident_event_service_data.py index 71e69bfd..f88ab62e 100644 --- a/rootly_sdk/models/new_incident_event_service_data.py +++ b/rootly_sdk/models/new_incident_event_service_data.py @@ -1,8 +1,9 @@ +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_incident_event_service_data_type import ( NewIncidentEventServiceDataType, @@ -25,8 +26,7 @@ class NewIncidentEventServiceData: """ type_: NewIncidentEventServiceDataType - attributes: "NewIncidentEventServiceDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewIncidentEventServiceDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_incident_event_service_data.additional_properties = d return new_incident_event_service_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_incident_event_service_data_attributes.py b/rootly_sdk/models/new_incident_event_service_data_attributes.py index 7e6413f0..8e2c72b4 100644 --- a/rootly_sdk/models/new_incident_event_service_data_attributes.py +++ b/rootly_sdk/models/new_incident_event_service_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_incident_event_service_data_attributes_status.py b/rootly_sdk/models/new_incident_event_service_data_attributes_status.py index 4c2594c2..9694b97f 100644 --- a/rootly_sdk/models/new_incident_event_service_data_attributes_status.py +++ b/rootly_sdk/models/new_incident_event_service_data_attributes_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentEventServiceDataAttributesStatus = Literal["major_outage", "operational", "partial_outage"] @@ -15,7 +15,7 @@ def check_new_incident_event_service_data_attributes_status( if value is None: return None if value in NEW_INCIDENT_EVENT_SERVICE_DATA_ATTRIBUTES_STATUS_VALUES: - return cast(NewIncidentEventServiceDataAttributesStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_EVENT_SERVICE_DATA_ATTRIBUTES_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/new_incident_event_service_data_type.py b/rootly_sdk/models/new_incident_event_service_data_type.py index 77fae034..69be2396 100644 --- a/rootly_sdk/models/new_incident_event_service_data_type.py +++ b/rootly_sdk/models/new_incident_event_service_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentEventServiceDataType = Literal["incident_event_services"] @@ -11,5 +11,5 @@ def check_new_incident_event_service_data_type(value: str | None) -> NewIncident if value is None: return None if value in NEW_INCIDENT_EVENT_SERVICE_DATA_TYPE_VALUES: - return cast(NewIncidentEventServiceDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_EVENT_SERVICE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_incident_feedback.py b/rootly_sdk/models/new_incident_feedback.py index 93f6dcb0..cd7327d9 100644 --- a/rootly_sdk/models/new_incident_feedback.py +++ b/rootly_sdk/models/new_incident_feedback.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_incident_feedback_data import NewIncidentFeedbackData @@ -18,14 +19,13 @@ class NewIncidentFeedback: data (NewIncidentFeedbackData): """ - data: "NewIncidentFeedbackData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewIncidentFeedbackData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_incident_feedback.additional_properties = d return new_incident_feedback - - @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_incident_feedback_data.py b/rootly_sdk/models/new_incident_feedback_data.py index dfb54c06..ca360fb5 100644 --- a/rootly_sdk/models/new_incident_feedback_data.py +++ b/rootly_sdk/models/new_incident_feedback_data.py @@ -1,8 +1,9 @@ +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_incident_feedback_data_type import NewIncidentFeedbackDataType, check_new_incident_feedback_data_type @@ -22,8 +23,7 @@ class NewIncidentFeedbackData: """ type_: NewIncidentFeedbackDataType - attributes: "NewIncidentFeedbackDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewIncidentFeedbackDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_incident_feedback_data.additional_properties = d return new_incident_feedback_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_incident_feedback_data_attributes.py b/rootly_sdk/models/new_incident_feedback_data_attributes.py index eea1850a..0f7b6fec 100644 --- a/rootly_sdk/models/new_incident_feedback_data_attributes.py +++ b/rootly_sdk/models/new_incident_feedback_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -18,12 +20,12 @@ class NewIncidentFeedbackDataAttributes: Attributes: feedback (str): The feedback of the incident feedback rating (NewIncidentFeedbackDataAttributesRating): The rating of the incident feedback - anonymous (Union[Unset, bool]): Is the feedback anonymous? + anonymous (bool | Unset): Is the feedback anonymous? """ feedback: str rating: NewIncidentFeedbackDataAttributesRating - anonymous: Unset | bool = UNSET + anonymous: bool | Unset = UNSET def to_dict(self) -> dict[str, Any]: feedback = self.feedback diff --git a/rootly_sdk/models/new_incident_feedback_data_attributes_rating.py b/rootly_sdk/models/new_incident_feedback_data_attributes_rating.py index 65c67e12..d1428f57 100644 --- a/rootly_sdk/models/new_incident_feedback_data_attributes_rating.py +++ b/rootly_sdk/models/new_incident_feedback_data_attributes_rating.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentFeedbackDataAttributesRating = Literal[0, 1, 2, 3, 4] @@ -13,7 +13,7 @@ def check_new_incident_feedback_data_attributes_rating(value: int) -> NewIncidentFeedbackDataAttributesRating: if value in NEW_INCIDENT_FEEDBACK_DATA_ATTRIBUTES_RATING_VALUES: - return cast(NewIncidentFeedbackDataAttributesRating, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_FEEDBACK_DATA_ATTRIBUTES_RATING_VALUES!r}" ) diff --git a/rootly_sdk/models/new_incident_feedback_data_type.py b/rootly_sdk/models/new_incident_feedback_data_type.py index 84912a43..b7cc27fc 100644 --- a/rootly_sdk/models/new_incident_feedback_data_type.py +++ b/rootly_sdk/models/new_incident_feedback_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentFeedbackDataType = Literal["incident_feedbacks"] @@ -11,5 +11,5 @@ def check_new_incident_feedback_data_type(value: str | None) -> NewIncidentFeedb if value is None: return None if value in NEW_INCIDENT_FEEDBACK_DATA_TYPE_VALUES: - return cast(NewIncidentFeedbackDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_FEEDBACK_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_incident_form_field_selection.py b/rootly_sdk/models/new_incident_form_field_selection.py index c3af5a5d..903bd9b6 100644 --- a/rootly_sdk/models/new_incident_form_field_selection.py +++ b/rootly_sdk/models/new_incident_form_field_selection.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_incident_form_field_selection_data import NewIncidentFormFieldSelectionData @@ -18,14 +19,13 @@ class NewIncidentFormFieldSelection: data (NewIncidentFormFieldSelectionData): """ - data: "NewIncidentFormFieldSelectionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewIncidentFormFieldSelectionData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_incident_form_field_selection.additional_properties = d return new_incident_form_field_selection - - @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_incident_form_field_selection_data.py b/rootly_sdk/models/new_incident_form_field_selection_data.py index 5468b67e..41e03ac6 100644 --- a/rootly_sdk/models/new_incident_form_field_selection_data.py +++ b/rootly_sdk/models/new_incident_form_field_selection_data.py @@ -1,8 +1,9 @@ +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_incident_form_field_selection_data_type import ( NewIncidentFormFieldSelectionDataType, @@ -25,8 +26,7 @@ class NewIncidentFormFieldSelectionData: """ type_: NewIncidentFormFieldSelectionDataType - attributes: "NewIncidentFormFieldSelectionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewIncidentFormFieldSelectionDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -60,21 +60,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_incident_form_field_selection_data.additional_properties = d return new_incident_form_field_selection_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_incident_form_field_selection_data_attributes.py b/rootly_sdk/models/new_incident_form_field_selection_data_attributes.py index 5eb356f5..10a4cf9e 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,75 +16,75 @@ class NewIncidentFormFieldSelectionDataAttributes: Attributes: incident_id (str): form_field_id (str): The custom field for this selection - 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): 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): """ incident_id: str form_field_id: str - 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 + 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 def to_dict(self) -> dict[str, Any]: incident_id = self.incident_id form_field_id = self.form_field_id - value: None | Unset | str + value: None | str | Unset if isinstance(self.value, Unset): value = UNSET else: value = self.value - selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_catalog_entity_ids: list[str] | Unset = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_group_ids: Unset | list[str] = UNSET + selected_group_ids: list[str] | Unset = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: Unset | list[str] = UNSET + selected_option_ids: list[str] | Unset = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: Unset | list[str] = UNSET + selected_service_ids: list[str] | Unset = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: Unset | list[str] = UNSET + selected_functionality_ids: list[str] | Unset = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_user_ids: Unset | list[int] = UNSET + selected_user_ids: list[int] | Unset = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_environment_ids: Unset | list[str] = UNSET + selected_environment_ids: list[str] | Unset = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: Unset | list[str] = UNSET + selected_cause_ids: list[str] | Unset = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: Unset | list[str] = UNSET + selected_incident_type_ids: list[str] | Unset = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -124,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 | Unset | str: + def _parse_value(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/new_incident_form_field_selection_data_type.py b/rootly_sdk/models/new_incident_form_field_selection_data_type.py index 0d997079..b3034767 100644 --- a/rootly_sdk/models/new_incident_form_field_selection_data_type.py +++ b/rootly_sdk/models/new_incident_form_field_selection_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentFormFieldSelectionDataType = Literal["incident_form_field_selections"] @@ -13,7 +13,7 @@ def check_new_incident_form_field_selection_data_type( if value is None: return None if value in NEW_INCIDENT_FORM_FIELD_SELECTION_DATA_TYPE_VALUES: - return cast(NewIncidentFormFieldSelectionDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_FORM_FIELD_SELECTION_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_incident_permission_set.py b/rootly_sdk/models/new_incident_permission_set.py index a6e79085..3ddc8f45 100644 --- a/rootly_sdk/models/new_incident_permission_set.py +++ b/rootly_sdk/models/new_incident_permission_set.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_incident_permission_set_data import NewIncidentPermissionSetData @@ -18,14 +19,13 @@ class NewIncidentPermissionSet: data (NewIncidentPermissionSetData): """ - data: "NewIncidentPermissionSetData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewIncidentPermissionSetData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_incident_permission_set.additional_properties = d return new_incident_permission_set - - @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_incident_permission_set_boolean.py b/rootly_sdk/models/new_incident_permission_set_boolean.py index 5cb940b0..199a7b29 100644 --- a/rootly_sdk/models/new_incident_permission_set_boolean.py +++ b/rootly_sdk/models/new_incident_permission_set_boolean.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_incident_permission_set_boolean_data import NewIncidentPermissionSetBooleanData @@ -18,14 +19,13 @@ class NewIncidentPermissionSetBoolean: data (NewIncidentPermissionSetBooleanData): """ - data: "NewIncidentPermissionSetBooleanData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewIncidentPermissionSetBooleanData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_incident_permission_set_boolean.additional_properties = d return new_incident_permission_set_boolean - - @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_incident_permission_set_boolean_data.py b/rootly_sdk/models/new_incident_permission_set_boolean_data.py index 616b4b97..1c60c1a3 100644 --- a/rootly_sdk/models/new_incident_permission_set_boolean_data.py +++ b/rootly_sdk/models/new_incident_permission_set_boolean_data.py @@ -1,8 +1,9 @@ +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_incident_permission_set_boolean_data_type import ( NewIncidentPermissionSetBooleanDataType, @@ -27,8 +28,7 @@ class NewIncidentPermissionSetBooleanData: """ type_: NewIncidentPermissionSetBooleanDataType - attributes: "NewIncidentPermissionSetBooleanDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewIncidentPermissionSetBooleanDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -62,21 +62,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_incident_permission_set_boolean_data.additional_properties = d return new_incident_permission_set_boolean_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_incident_permission_set_boolean_data_attributes.py b/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes.py index ae802724..1410bb1e 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -24,16 +26,16 @@ class NewIncidentPermissionSetBooleanDataAttributes: Attributes: incident_permission_set_id (str): kind (NewIncidentPermissionSetBooleanDataAttributesKind): - private (Union[Unset, bool]): - enabled (Union[Unset, bool]): - severity_params (Union[Unset, NewIncidentPermissionSetBooleanDataAttributesSeverityParams]): + private (bool | Unset): + enabled (bool | Unset): + severity_params (NewIncidentPermissionSetBooleanDataAttributesSeverityParams | Unset): """ incident_permission_set_id: str kind: NewIncidentPermissionSetBooleanDataAttributesKind - private: Unset | bool = UNSET - enabled: Unset | bool = UNSET - severity_params: Union[Unset, "NewIncidentPermissionSetBooleanDataAttributesSeverityParams"] = UNSET + private: bool | Unset = UNSET + enabled: bool | Unset = UNSET + severity_params: NewIncidentPermissionSetBooleanDataAttributesSeverityParams | Unset = UNSET def to_dict(self) -> dict[str, Any]: incident_permission_set_id = self.incident_permission_set_id @@ -44,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - severity_params: Unset | dict[str, Any] = UNSET + severity_params: dict[str, Any] | Unset = UNSET if not isinstance(self.severity_params, Unset): severity_params = self.severity_params.to_dict() @@ -81,7 +83,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: Unset | NewIncidentPermissionSetBooleanDataAttributesSeverityParams + severity_params: NewIncidentPermissionSetBooleanDataAttributesSeverityParams | Unset if isinstance(_severity_params, Unset): severity_params = UNSET else: diff --git a/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes_kind.py b/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes_kind.py index c455158f..8f1e90d7 100644 --- a/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes_kind.py +++ b/rootly_sdk/models/new_incident_permission_set_boolean_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentPermissionSetBooleanDataAttributesKind = Literal[ "assign_incident_roles", @@ -39,7 +39,7 @@ def check_new_incident_permission_set_boolean_data_attributes_kind( if value is None: return None if value in NEW_INCIDENT_PERMISSION_SET_BOOLEAN_DATA_ATTRIBUTES_KIND_VALUES: - return cast(NewIncidentPermissionSetBooleanDataAttributesKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_PERMISSION_SET_BOOLEAN_DATA_ATTRIBUTES_KIND_VALUES!r}" ) 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 fd4c5616..82deffdc 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,8 +1,9 @@ +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 ..types import UNSET, Unset @@ -13,19 +14,18 @@ class NewIncidentPermissionSetBooleanDataAttributesSeverityParams: """ Attributes: - 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 + 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 matching severity """ - 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) + fully_enabled: bool | Unset = True + create_enabled: bool | Unset = False + applies_to_unassigned: bool | Unset = True + severity_ids: list[str] | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: fully_enabled = self.fully_enabled @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: applies_to_unassigned = self.applies_to_unassigned - severity_ids: None | Unset | list[str] + severity_ids: list[str] | None | Unset if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: severity_ids = self.severity_ids field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if fully_enabled is not UNSET: field_dict["fully_enabled"] = fully_enabled @@ -66,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) -> None | Unset | list[str]: + def _parse_severity_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -77,9 +77,9 @@ def _parse_severity_ids(data: object) -> None | Unset | list[str]: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) @@ -90,21 +90,4 @@ def _parse_severity_ids(data: object) -> None | Unset | list[str]: severity_ids=severity_ids, ) - new_incident_permission_set_boolean_data_attributes_severity_params.additional_properties = d return new_incident_permission_set_boolean_data_attributes_severity_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/new_incident_permission_set_boolean_data_type.py b/rootly_sdk/models/new_incident_permission_set_boolean_data_type.py index 00121cdd..ea614e9f 100644 --- a/rootly_sdk/models/new_incident_permission_set_boolean_data_type.py +++ b/rootly_sdk/models/new_incident_permission_set_boolean_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentPermissionSetBooleanDataType = Literal["incident_permission_set_booleans"] @@ -13,7 +13,7 @@ def check_new_incident_permission_set_boolean_data_type( if value is None: return None if value in NEW_INCIDENT_PERMISSION_SET_BOOLEAN_DATA_TYPE_VALUES: - return cast(NewIncidentPermissionSetBooleanDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_PERMISSION_SET_BOOLEAN_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_incident_permission_set_data.py b/rootly_sdk/models/new_incident_permission_set_data.py index a4a36ed2..9cf70e30 100644 --- a/rootly_sdk/models/new_incident_permission_set_data.py +++ b/rootly_sdk/models/new_incident_permission_set_data.py @@ -1,8 +1,9 @@ +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_incident_permission_set_data_type import ( NewIncidentPermissionSetDataType, @@ -25,8 +26,7 @@ class NewIncidentPermissionSetData: """ type_: NewIncidentPermissionSetDataType - attributes: "NewIncidentPermissionSetDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewIncidentPermissionSetDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_incident_permission_set_data.additional_properties = d return new_incident_permission_set_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_incident_permission_set_data_attributes.py b/rootly_sdk/models/new_incident_permission_set_data_attributes.py index dc5020e0..75eabcb4 100644 --- a/rootly_sdk/models/new_incident_permission_set_data_attributes.py +++ b/rootly_sdk/models/new_incident_permission_set_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -21,48 +23,47 @@ class NewIncidentPermissionSetDataAttributes: """ Attributes: name (str): The incident permission set name. - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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]]): + description (None | str | Unset): The incident permission set description. + private_incident_permissions (list[NewIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] | + Unset): + public_incident_permissions (list[NewIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] | Unset): """ name: str - slug: None | Unset | str = UNSET - description: None | Unset | str = UNSET - private_incident_permissions: Unset | list[NewIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] = ( + slug: None | str | Unset = UNSET + description: None | str | Unset = UNSET + private_incident_permissions: list[NewIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] | Unset = ( UNSET ) - public_incident_permissions: Unset | list[NewIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] = ( + public_incident_permissions: list[NewIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] | Unset = ( UNSET ) def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - private_incident_permissions: Unset | list[str] = UNSET + private_incident_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + public_incident_permissions: list[str] | Unset = UNSET if not isinstance(self.public_incident_permissions, Unset): public_incident_permissions = [] for public_incident_permissions_item_data in self.public_incident_permissions: @@ -92,45 +93,53 @@ 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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - private_incident_permissions = [] _private_incident_permissions = d.pop("private_incident_permissions", UNSET) - 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: ( + 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 + ) ) - ) - 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) - 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: ( + 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 + ) ) - ) - 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, diff --git a/rootly_sdk/models/new_incident_permission_set_data_attributes_private_incident_permissions_item.py b/rootly_sdk/models/new_incident_permission_set_data_attributes_private_incident_permissions_item.py index 954a676d..9be0eb7c 100644 --- a/rootly_sdk/models/new_incident_permission_set_data_attributes_private_incident_permissions_item.py +++ b/rootly_sdk/models/new_incident_permission_set_data_attributes_private_incident_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_incident_permission_set_data_attributes_private_incident_permissio if value is None: return None if value in NEW_INCIDENT_PERMISSION_SET_DATA_ATTRIBUTES_PRIVATE_INCIDENT_PERMISSIONS_ITEM_VALUES: - return cast(NewIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_PERMISSION_SET_DATA_ATTRIBUTES_PRIVATE_INCIDENT_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_incident_permission_set_data_attributes_public_incident_permissions_item.py b/rootly_sdk/models/new_incident_permission_set_data_attributes_public_incident_permissions_item.py index e6c9b751..b08ce6fa 100644 --- a/rootly_sdk/models/new_incident_permission_set_data_attributes_public_incident_permissions_item.py +++ b/rootly_sdk/models/new_incident_permission_set_data_attributes_public_incident_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_incident_permission_set_data_attributes_public_incident_permission if value is None: return None if value in NEW_INCIDENT_PERMISSION_SET_DATA_ATTRIBUTES_PUBLIC_INCIDENT_PERMISSIONS_ITEM_VALUES: - return cast(NewIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_PERMISSION_SET_DATA_ATTRIBUTES_PUBLIC_INCIDENT_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_incident_permission_set_data_type.py b/rootly_sdk/models/new_incident_permission_set_data_type.py index 7b3b5699..4fc14d14 100644 --- a/rootly_sdk/models/new_incident_permission_set_data_type.py +++ b/rootly_sdk/models/new_incident_permission_set_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentPermissionSetDataType = Literal["incident_permission_sets"] @@ -11,5 +11,5 @@ def check_new_incident_permission_set_data_type(value: str | None) -> NewInciden if value is None: return None if value in NEW_INCIDENT_PERMISSION_SET_DATA_TYPE_VALUES: - return cast(NewIncidentPermissionSetDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_PERMISSION_SET_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_incident_permission_set_resource.py b/rootly_sdk/models/new_incident_permission_set_resource.py index df9037a6..ae3197cc 100644 --- a/rootly_sdk/models/new_incident_permission_set_resource.py +++ b/rootly_sdk/models/new_incident_permission_set_resource.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_incident_permission_set_resource_data import NewIncidentPermissionSetResourceData @@ -18,14 +19,13 @@ class NewIncidentPermissionSetResource: data (NewIncidentPermissionSetResourceData): """ - data: "NewIncidentPermissionSetResourceData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewIncidentPermissionSetResourceData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_incident_permission_set_resource.additional_properties = d return new_incident_permission_set_resource - - @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_incident_permission_set_resource_data.py b/rootly_sdk/models/new_incident_permission_set_resource_data.py index e42e991f..a858b8c5 100644 --- a/rootly_sdk/models/new_incident_permission_set_resource_data.py +++ b/rootly_sdk/models/new_incident_permission_set_resource_data.py @@ -1,8 +1,9 @@ +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_incident_permission_set_resource_data_type import ( NewIncidentPermissionSetResourceDataType, @@ -27,8 +28,7 @@ class NewIncidentPermissionSetResourceData: """ type_: NewIncidentPermissionSetResourceDataType - attributes: "NewIncidentPermissionSetResourceDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewIncidentPermissionSetResourceDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -62,21 +62,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_incident_permission_set_resource_data.additional_properties = d return new_incident_permission_set_resource_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_incident_permission_set_resource_data_attributes.py b/rootly_sdk/models/new_incident_permission_set_resource_data_attributes.py index e195b196..579e08c2 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -24,18 +26,18 @@ class NewIncidentPermissionSetResourceDataAttributes: Attributes: incident_permission_set_id (str): kind (NewIncidentPermissionSetResourceDataAttributesKind): - private (Union[Unset, bool]): - resource_id (Union[Unset, str]): - resource_type (Union[Unset, str]): - severity_params (Union[Unset, NewIncidentPermissionSetResourceDataAttributesSeverityParams]): + private (bool | Unset): + resource_id (str | Unset): + resource_type (str | Unset): + severity_params (NewIncidentPermissionSetResourceDataAttributesSeverityParams | Unset): """ incident_permission_set_id: str kind: NewIncidentPermissionSetResourceDataAttributesKind - private: Unset | bool = UNSET - resource_id: Unset | str = UNSET - resource_type: Unset | str = UNSET - severity_params: Union[Unset, "NewIncidentPermissionSetResourceDataAttributesSeverityParams"] = UNSET + private: bool | Unset = UNSET + resource_id: str | Unset = UNSET + resource_type: str | Unset = UNSET + severity_params: NewIncidentPermissionSetResourceDataAttributesSeverityParams | Unset = UNSET def to_dict(self) -> dict[str, Any]: incident_permission_set_id = self.incident_permission_set_id @@ -48,7 +50,7 @@ def to_dict(self) -> dict[str, Any]: resource_type = self.resource_type - severity_params: Unset | dict[str, Any] = UNSET + severity_params: dict[str, Any] | Unset = UNSET if not isinstance(self.severity_params, Unset): severity_params = self.severity_params.to_dict() @@ -89,7 +91,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: Unset | NewIncidentPermissionSetResourceDataAttributesSeverityParams + severity_params: NewIncidentPermissionSetResourceDataAttributesSeverityParams | Unset if isinstance(_severity_params, Unset): severity_params = UNSET else: diff --git a/rootly_sdk/models/new_incident_permission_set_resource_data_attributes_kind.py b/rootly_sdk/models/new_incident_permission_set_resource_data_attributes_kind.py index b5a36d90..1e6cf488 100644 --- a/rootly_sdk/models/new_incident_permission_set_resource_data_attributes_kind.py +++ b/rootly_sdk/models/new_incident_permission_set_resource_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentPermissionSetResourceDataAttributesKind = Literal["incident_types", "severities", "statuses", "sub_statuses"] @@ -18,7 +18,7 @@ def check_new_incident_permission_set_resource_data_attributes_kind( if value is None: return None if value in NEW_INCIDENT_PERMISSION_SET_RESOURCE_DATA_ATTRIBUTES_KIND_VALUES: - return cast(NewIncidentPermissionSetResourceDataAttributesKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_PERMISSION_SET_RESOURCE_DATA_ATTRIBUTES_KIND_VALUES!r}" ) 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 e610b5e1..85afbc42 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,8 +1,9 @@ +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 ..types import UNSET, Unset @@ -13,19 +14,18 @@ class NewIncidentPermissionSetResourceDataAttributesSeverityParams: """ Attributes: - 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 + 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 matching severity """ - 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) + fully_enabled: bool | Unset = True + create_enabled: bool | Unset = False + applies_to_unassigned: bool | Unset = True + severity_ids: list[str] | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: fully_enabled = self.fully_enabled @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: applies_to_unassigned = self.applies_to_unassigned - severity_ids: None | Unset | list[str] + severity_ids: list[str] | None | Unset if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: severity_ids = self.severity_ids field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if fully_enabled is not UNSET: field_dict["fully_enabled"] = fully_enabled @@ -66,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) -> None | Unset | list[str]: + def _parse_severity_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -77,9 +77,9 @@ def _parse_severity_ids(data: object) -> None | Unset | list[str]: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) @@ -90,21 +90,4 @@ def _parse_severity_ids(data: object) -> None | Unset | list[str]: severity_ids=severity_ids, ) - new_incident_permission_set_resource_data_attributes_severity_params.additional_properties = d return new_incident_permission_set_resource_data_attributes_severity_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/new_incident_permission_set_resource_data_type.py b/rootly_sdk/models/new_incident_permission_set_resource_data_type.py index 63a69798..2ff644f7 100644 --- a/rootly_sdk/models/new_incident_permission_set_resource_data_type.py +++ b/rootly_sdk/models/new_incident_permission_set_resource_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentPermissionSetResourceDataType = Literal["incident_permission_set_resources"] @@ -13,7 +13,7 @@ def check_new_incident_permission_set_resource_data_type( if value is None: return None if value in NEW_INCIDENT_PERMISSION_SET_RESOURCE_DATA_TYPE_VALUES: - return cast(NewIncidentPermissionSetResourceDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_PERMISSION_SET_RESOURCE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_incident_role.py b/rootly_sdk/models/new_incident_role.py index 6638789a..c344bf84 100644 --- a/rootly_sdk/models/new_incident_role.py +++ b/rootly_sdk/models/new_incident_role.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_incident_role_data import NewIncidentRoleData @@ -18,14 +19,13 @@ class NewIncidentRole: data (NewIncidentRoleData): """ - data: "NewIncidentRoleData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewIncidentRoleData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_incident_role.additional_properties = d return new_incident_role - - @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_incident_role_data.py b/rootly_sdk/models/new_incident_role_data.py index b7be2d03..63af4377 100644 --- a/rootly_sdk/models/new_incident_role_data.py +++ b/rootly_sdk/models/new_incident_role_data.py @@ -1,8 +1,9 @@ +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_incident_role_data_type import NewIncidentRoleDataType, check_new_incident_role_data_type @@ -22,8 +23,7 @@ class NewIncidentRoleData: """ type_: NewIncidentRoleDataType - attributes: "NewIncidentRoleDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewIncidentRoleDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_incident_role_data.additional_properties = d return new_incident_role_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_incident_role_data_attributes.py b/rootly_sdk/models/new_incident_role_data_attributes.py index b9d3caf1..8e43d9d3 100644 --- a/rootly_sdk/models/new_incident_role_data_attributes.py +++ b/rootly_sdk/models/new_incident_role_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,47 +15,47 @@ class NewIncidentRoleDataAttributes: """ Attributes: name (str): The name of the incident role - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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]): + 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): """ name: str - 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 + slug: None | 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 def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - summary: None | Unset | str + summary: None | str | Unset if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -94,39 +96,39 @@ 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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_summary(data: object) -> None | Unset | str: + def _parse_summary(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_incident_role_data_type.py b/rootly_sdk/models/new_incident_role_data_type.py index a494c03c..125b6386 100644 --- a/rootly_sdk/models/new_incident_role_data_type.py +++ b/rootly_sdk/models/new_incident_role_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentRoleDataType = Literal["incident_roles"] @@ -11,5 +11,5 @@ def check_new_incident_role_data_type(value: str | None) -> NewIncidentRoleDataT if value is None: return None if value in NEW_INCIDENT_ROLE_DATA_TYPE_VALUES: - return cast(NewIncidentRoleDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_ROLE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_incident_role_task.py b/rootly_sdk/models/new_incident_role_task.py index b9c26306..1339a75b 100644 --- a/rootly_sdk/models/new_incident_role_task.py +++ b/rootly_sdk/models/new_incident_role_task.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_incident_role_task_data import NewIncidentRoleTaskData @@ -18,14 +19,13 @@ class NewIncidentRoleTask: data (NewIncidentRoleTaskData): """ - data: "NewIncidentRoleTaskData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewIncidentRoleTaskData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_incident_role_task.additional_properties = d return new_incident_role_task - - @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_incident_role_task_data.py b/rootly_sdk/models/new_incident_role_task_data.py index 47f96898..3cd0a225 100644 --- a/rootly_sdk/models/new_incident_role_task_data.py +++ b/rootly_sdk/models/new_incident_role_task_data.py @@ -1,8 +1,9 @@ +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_incident_role_task_data_type import ( NewIncidentRoleTaskDataType, @@ -25,8 +26,7 @@ class NewIncidentRoleTaskData: """ type_: NewIncidentRoleTaskDataType - attributes: "NewIncidentRoleTaskDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewIncidentRoleTaskDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_incident_role_task_data.additional_properties = d return new_incident_role_task_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_incident_role_task_data_attributes.py b/rootly_sdk/models/new_incident_role_task_data_attributes.py index 02f7f4c8..9de0da86 100644 --- a/rootly_sdk/models/new_incident_role_task_data_attributes.py +++ b/rootly_sdk/models/new_incident_role_task_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,28 +19,28 @@ class NewIncidentRoleTaskDataAttributes: """ Attributes: task (str): The task 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 + incident_role_id (str | Unset): + description (None | str | Unset): The description of the incident task + priority (NewIncidentRoleTaskDataAttributesPriority | Unset): The priority of the incident task """ task: str - incident_role_id: Unset | str = UNSET - description: None | Unset | str = UNSET - priority: Unset | NewIncidentRoleTaskDataAttributesPriority = UNSET + incident_role_id: str | Unset = UNSET + description: None | str | Unset = UNSET + priority: NewIncidentRoleTaskDataAttributesPriority | Unset = UNSET def to_dict(self) -> dict[str, Any]: task = self.task incident_role_id = self.incident_role_id - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - priority: Unset | str = UNSET + priority: str | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -65,17 +67,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) _priority = d.pop("priority", UNSET) - priority: Unset | NewIncidentRoleTaskDataAttributesPriority + priority: NewIncidentRoleTaskDataAttributesPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/new_incident_role_task_data_attributes_priority.py b/rootly_sdk/models/new_incident_role_task_data_attributes_priority.py index cad33385..222c321b 100644 --- a/rootly_sdk/models/new_incident_role_task_data_attributes_priority.py +++ b/rootly_sdk/models/new_incident_role_task_data_attributes_priority.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentRoleTaskDataAttributesPriority = Literal["high", "low", "medium"] @@ -15,7 +15,7 @@ def check_new_incident_role_task_data_attributes_priority( if value is None: return None if value in NEW_INCIDENT_ROLE_TASK_DATA_ATTRIBUTES_PRIORITY_VALUES: - return cast(NewIncidentRoleTaskDataAttributesPriority, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_ROLE_TASK_DATA_ATTRIBUTES_PRIORITY_VALUES!r}" ) diff --git a/rootly_sdk/models/new_incident_role_task_data_type.py b/rootly_sdk/models/new_incident_role_task_data_type.py index 0f9246cb..54cbf946 100644 --- a/rootly_sdk/models/new_incident_role_task_data_type.py +++ b/rootly_sdk/models/new_incident_role_task_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentRoleTaskDataType = Literal["incident_role_tasks"] @@ -11,5 +11,5 @@ def check_new_incident_role_task_data_type(value: str | None) -> NewIncidentRole if value is None: return None if value in NEW_INCIDENT_ROLE_TASK_DATA_TYPE_VALUES: - return cast(NewIncidentRoleTaskDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_ROLE_TASK_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_incident_status_page_event.py b/rootly_sdk/models/new_incident_status_page_event.py index 084ae8e3..6307d1d7 100644 --- a/rootly_sdk/models/new_incident_status_page_event.py +++ b/rootly_sdk/models/new_incident_status_page_event.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_incident_status_page_event_data import NewIncidentStatusPageEventData @@ -18,14 +19,13 @@ class NewIncidentStatusPageEvent: data (NewIncidentStatusPageEventData): """ - data: "NewIncidentStatusPageEventData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewIncidentStatusPageEventData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_incident_status_page_event.additional_properties = d return new_incident_status_page_event - - @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_incident_status_page_event_data.py b/rootly_sdk/models/new_incident_status_page_event_data.py index 2eb740df..74d9f93d 100644 --- a/rootly_sdk/models/new_incident_status_page_event_data.py +++ b/rootly_sdk/models/new_incident_status_page_event_data.py @@ -1,8 +1,9 @@ +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_incident_status_page_event_data_type import ( NewIncidentStatusPageEventDataType, @@ -25,8 +26,7 @@ class NewIncidentStatusPageEventData: """ type_: NewIncidentStatusPageEventDataType - attributes: "NewIncidentStatusPageEventDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewIncidentStatusPageEventDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_incident_status_page_event_data.additional_properties = d return new_incident_status_page_event_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_incident_status_page_event_data_attributes.py b/rootly_sdk/models/new_incident_status_page_event_data_attributes.py index 064c28c0..ff156111 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,9 +1,10 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define -from dateutil.parser import isoparse from ..models.new_incident_status_page_event_data_attributes_status import ( NewIncidentStatusPageEventDataAttributesStatus, @@ -25,27 +26,26 @@ class NewIncidentStatusPageEventDataAttributes: """ Attributes: event (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, 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. + 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_components (list[NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item] | None | + Unset): Affected status page components and their statuses. This field is in Early Access and is not generally + available; contact Rootly Support to request access. 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: 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_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_components: ( - None | Unset | list["NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item"] + list[NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item] | None | Unset ) = UNSET def to_dict(self) -> dict[str, Any]: @@ -53,23 +53,23 @@ def to_dict(self) -> dict[str, Any]: status_page_id = self.status_page_id - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status - notify_subscribers: None | Unset | bool + notify_subscribers: bool | None | Unset if isinstance(self.notify_subscribers, Unset): notify_subscribers = UNSET else: notify_subscribers = self.notify_subscribers - should_tweet: None | Unset | bool + should_tweet: bool | None | Unset if isinstance(self.should_tweet, Unset): should_tweet = UNSET else: should_tweet = self.should_tweet - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -77,7 +77,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - status_page_components: None | Unset | list[dict[str, Any]] + status_page_components: list[dict[str, Any]] | None | Unset if isinstance(self.status_page_components, Unset): status_page_components = UNSET elif isinstance(self.status_page_components, list): @@ -123,31 +123,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: Unset | NewIncidentStatusPageEventDataAttributesStatus + status: NewIncidentStatusPageEventDataAttributesStatus | Unset if isinstance(_status, Unset): status = UNSET else: status = check_new_incident_status_page_event_data_attributes_status(_status) - def _parse_notify_subscribers(data: object) -> None | Unset | bool: + def _parse_notify_subscribers(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) notify_subscribers = _parse_notify_subscribers(d.pop("notify_subscribers", UNSET)) - def _parse_should_tweet(data: object) -> None | Unset | bool: + def _parse_should_tweet(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) should_tweet = _parse_should_tweet(d.pop("should_tweet", UNSET)) - def _parse_started_at(data: object) -> None | Unset | datetime.datetime: + def _parse_started_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -155,18 +155,18 @@ def _parse_started_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - started_at_type_0 = isoparse(data) + started_at_type_0 = datetime.datetime.fromisoformat(data) return started_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) def _parse_status_page_components( data: object, - ) -> None | Unset | list["NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item"]: + ) -> list[NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -186,10 +186,10 @@ def _parse_status_page_components( status_page_components_type_0.append(status_page_components_type_0_item) return status_page_components_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass return cast( - None | Unset | list["NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item"], data + list[NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0Item] | None | Unset, data ) status_page_components = _parse_status_page_components(d.pop("status_page_components", UNSET)) diff --git a/rootly_sdk/models/new_incident_status_page_event_data_attributes_status.py b/rootly_sdk/models/new_incident_status_page_event_data_attributes_status.py index 02e7fe76..f10219f1 100644 --- a/rootly_sdk/models/new_incident_status_page_event_data_attributes_status.py +++ b/rootly_sdk/models/new_incident_status_page_event_data_attributes_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentStatusPageEventDataAttributesStatus = Literal[ "completed", "identified", "in_progress", "investigating", "monitoring", "resolved", "scheduled" @@ -21,7 +21,7 @@ def check_new_incident_status_page_event_data_attributes_status( if value is None: return None if value in NEW_INCIDENT_STATUS_PAGE_EVENT_DATA_ATTRIBUTES_STATUS_VALUES: - return cast(NewIncidentStatusPageEventDataAttributesStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_STATUS_PAGE_EVENT_DATA_ATTRIBUTES_STATUS_VALUES!r}" ) 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 index 61be84a5..b27a8fc5 100644 --- 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 @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -17,17 +19,17 @@ 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 (NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus | Unset): The status to + record for the component """ status_page_component_id: str - status: Unset | NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus = UNSET + status: NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus | Unset = UNSET def to_dict(self) -> dict[str, Any]: status_page_component_id = self.status_page_component_id - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status @@ -49,7 +51,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_component_id = d.pop("status_page_component_id") _status = d.pop("status", UNSET) - status: Unset | NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus + status: NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus | Unset if isinstance(_status, Unset): status = UNSET else: 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 index 041e8b02..993b283e 100644 --- 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 @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentStatusPageEventDataAttributesStatusPageComponentsType0ItemStatus = Literal[ "degraded_performance", "major_outage", "operational", "partial_outage" @@ -20,7 +20,7 @@ def check_new_incident_status_page_event_data_attributes_status_page_components_ 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) + return 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_status_page_event_data_type.py b/rootly_sdk/models/new_incident_status_page_event_data_type.py index 44678527..4f94c75f 100644 --- a/rootly_sdk/models/new_incident_status_page_event_data_type.py +++ b/rootly_sdk/models/new_incident_status_page_event_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentStatusPageEventDataType = Literal["incident_status_page_events"] @@ -11,5 +11,5 @@ def check_new_incident_status_page_event_data_type(value: str | None) -> NewInci if value is None: return None if value in NEW_INCIDENT_STATUS_PAGE_EVENT_DATA_TYPE_VALUES: - return cast(NewIncidentStatusPageEventDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_STATUS_PAGE_EVENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_incident_sub_status.py b/rootly_sdk/models/new_incident_sub_status.py index 8a1dd81b..a378821f 100644 --- a/rootly_sdk/models/new_incident_sub_status.py +++ b/rootly_sdk/models/new_incident_sub_status.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_incident_sub_status_data import NewIncidentSubStatusData @@ -18,14 +19,13 @@ class NewIncidentSubStatus: data (NewIncidentSubStatusData): """ - data: "NewIncidentSubStatusData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewIncidentSubStatusData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_incident_sub_status.additional_properties = d return new_incident_sub_status - - @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_incident_sub_status_data.py b/rootly_sdk/models/new_incident_sub_status_data.py index 7d41ff0f..17907edb 100644 --- a/rootly_sdk/models/new_incident_sub_status_data.py +++ b/rootly_sdk/models/new_incident_sub_status_data.py @@ -1,8 +1,9 @@ +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_incident_sub_status_data_type import ( NewIncidentSubStatusDataType, @@ -25,8 +26,7 @@ class NewIncidentSubStatusData: """ type_: NewIncidentSubStatusDataType - attributes: "NewIncidentSubStatusDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewIncidentSubStatusDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_incident_sub_status_data.additional_properties = d return new_incident_sub_status_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_incident_sub_status_data_attributes.py b/rootly_sdk/models/new_incident_sub_status_data_attributes.py index 27d2e96e..b63d1823 100644 --- a/rootly_sdk/models/new_incident_sub_status_data_attributes.py +++ b/rootly_sdk/models/new_incident_sub_status_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,19 +18,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 (Union[None, Unset, int]): + assigned_by_user_id (int | None | Unset): """ sub_status_id: str assigned_at: str - assigned_by_user_id: None | Unset | int = UNSET + assigned_by_user_id: int | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: sub_status_id = self.sub_status_id assigned_at = self.assigned_at - assigned_by_user_id: None | Unset | int + assigned_by_user_id: int | None | Unset if isinstance(self.assigned_by_user_id, Unset): assigned_by_user_id = UNSET else: @@ -54,12 +56,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) -> None | Unset | int: + def _parse_assigned_by_user_id(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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_sub_status_data_type.py b/rootly_sdk/models/new_incident_sub_status_data_type.py index 2f838872..347df0e4 100644 --- a/rootly_sdk/models/new_incident_sub_status_data_type.py +++ b/rootly_sdk/models/new_incident_sub_status_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentSubStatusDataType = Literal["incident_sub_statuses"] @@ -11,5 +11,5 @@ def check_new_incident_sub_status_data_type(value: str | None) -> NewIncidentSub if value is None: return None if value in NEW_INCIDENT_SUB_STATUS_DATA_TYPE_VALUES: - return cast(NewIncidentSubStatusDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_SUB_STATUS_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_incident_type.py b/rootly_sdk/models/new_incident_type.py index 114709ac..0c895d05 100644 --- a/rootly_sdk/models/new_incident_type.py +++ b/rootly_sdk/models/new_incident_type.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_incident_type_data import NewIncidentTypeData @@ -18,14 +19,13 @@ class NewIncidentType: data (NewIncidentTypeData): """ - data: "NewIncidentTypeData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewIncidentTypeData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_incident_type.additional_properties = d return new_incident_type - - @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_incident_type_data.py b/rootly_sdk/models/new_incident_type_data.py index 59b64a71..11285808 100644 --- a/rootly_sdk/models/new_incident_type_data.py +++ b/rootly_sdk/models/new_incident_type_data.py @@ -1,8 +1,9 @@ +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_incident_type_data_type import NewIncidentTypeDataType, check_new_incident_type_data_type @@ -22,8 +23,7 @@ class NewIncidentTypeData: """ type_: NewIncidentTypeDataType - attributes: "NewIncidentTypeDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewIncidentTypeDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_incident_type_data.additional_properties = d return new_incident_type_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_incident_type_data_attributes.py b/rootly_sdk/models/new_incident_type_data_attributes.py index 895db080..07b96a33 100644 --- a/rootly_sdk/models/new_incident_type_data_attributes.py +++ b/rootly_sdk/models/new_incident_type_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -23,66 +25,66 @@ class NewIncidentTypeDataAttributes: """ Attributes: name (str): The name of the incident type - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + description (None | str | Unset): The description of the incident type + public_description (None | str | Unset): The status page 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 associated with this incident type - slack_aliases (Union[None, Unset, list['NewIncidentTypeDataAttributesSlackAliasesType0Item']]): Slack Aliases + slack_aliases (list[NewIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases associated with this incident type - properties (Union[Unset, list['NewIncidentTypeDataAttributesPropertiesItem']]): Array of property values for - this incident type. + properties (list[NewIncidentTypeDataAttributesPropertiesItem] | Unset): Array of property values for this + incident type. """ name: str - 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 + slug: None | str | Unset = UNSET + description: None | str | Unset = UNSET + public_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 def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -91,7 +93,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: None | Unset | list[dict[str, Any]] + slack_channels: list[dict[str, Any]] | None | Unset if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -103,7 +105,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: None | Unset | list[dict[str, Any]] + slack_aliases: list[dict[str, Any]] | None | Unset if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -115,7 +117,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: Unset | list[dict[str, Any]] = UNSET + properties: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -165,52 +167,52 @@ 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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -221,15 +223,15 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> None | Unset | list["NewIncidentTypeDataAttributesSlackChannelsType0Item"]: + ) -> list[NewIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -247,15 +249,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["NewIncidentTypeDataAttributesSlackChannelsType0Item"], data) + return cast(list[NewIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset, data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> None | Unset | list["NewIncidentTypeDataAttributesSlackAliasesType0Item"]: + ) -> list[NewIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -273,18 +275,20 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["NewIncidentTypeDataAttributesSlackAliasesType0Item"], data) + return cast(list[NewIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset, data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - properties = [] _properties = d.pop("properties", UNSET) - for properties_item_data in _properties or []: - properties_item = NewIncidentTypeDataAttributesPropertiesItem.from_dict(properties_item_data) + 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) - properties.append(properties_item) + properties.append(properties_item) new_incident_type_data_attributes = cls( name=name, 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 87ffc52a..5d2658eb 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,3 +1,5 @@ +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 3bb39fbe..ddccc5fc 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="NewIncidentTypeDataAttributesSlackAliasesType0Item") @@ -17,7 +18,6 @@ class NewIncidentTypeDataAttributesSlackAliasesType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - new_incident_type_data_attributes_slack_aliases_type_0_item.additional_properties = d return new_incident_type_data_attributes_slack_aliases_type_0_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_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 b7bde900..3cc8ad3c 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="NewIncidentTypeDataAttributesSlackChannelsType0Item") @@ -17,7 +18,6 @@ class NewIncidentTypeDataAttributesSlackChannelsType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - new_incident_type_data_attributes_slack_channels_type_0_item.additional_properties = d return new_incident_type_data_attributes_slack_channels_type_0_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_incident_type_data_type.py b/rootly_sdk/models/new_incident_type_data_type.py index c91f0f5d..d0c6d8e7 100644 --- a/rootly_sdk/models/new_incident_type_data_type.py +++ b/rootly_sdk/models/new_incident_type_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewIncidentTypeDataType = Literal["incident_types"] @@ -11,5 +11,5 @@ def check_new_incident_type_data_type(value: str | None) -> NewIncidentTypeDataT if value is None: return None if value in NEW_INCIDENT_TYPE_DATA_TYPE_VALUES: - return cast(NewIncidentTypeDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_INCIDENT_TYPE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_live_call_router.py b/rootly_sdk/models/new_live_call_router.py index 6bc1a616..78c8175b 100644 --- a/rootly_sdk/models/new_live_call_router.py +++ b/rootly_sdk/models/new_live_call_router.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_live_call_router_data import NewLiveCallRouterData @@ -18,14 +19,13 @@ class NewLiveCallRouter: data (NewLiveCallRouterData): """ - data: "NewLiveCallRouterData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewLiveCallRouterData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_live_call_router.additional_properties = d return new_live_call_router - - @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_live_call_router_data.py b/rootly_sdk/models/new_live_call_router_data.py index db6aba36..92b78311 100644 --- a/rootly_sdk/models/new_live_call_router_data.py +++ b/rootly_sdk/models/new_live_call_router_data.py @@ -1,8 +1,9 @@ +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_live_call_router_data_type import NewLiveCallRouterDataType, check_new_live_call_router_data_type @@ -22,8 +23,7 @@ class NewLiveCallRouterData: """ type_: NewLiveCallRouterDataType - attributes: "NewLiveCallRouterDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewLiveCallRouterDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_live_call_router_data.additional_properties = d return new_live_call_router_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_live_call_router_data_attributes.py b/rootly_sdk/models/new_live_call_router_data_attributes.py index af5e361b..d5954ee2 100644 --- a/rootly_sdk/models/new_live_call_router_data_attributes.py +++ b/rootly_sdk/models/new_live_call_router_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -45,34 +47,30 @@ 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 (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 + 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 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 + 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 callers to press a key before being connected - calling_tree_prompt (Union[Unset, str]): The audio instructions callers will hear when they call this number, + calling_tree_prompt (str | Unset): 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 (Union[Unset, NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams]): + escalation_policy_trigger_params (NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams | Unset): """ kind: NewLiveCallRouterDataAttributesKind @@ -81,24 +79,22 @@ class NewLiveCallRouterDataAttributes: phone_type: NewLiveCallRouterDataAttributesPhoneType phone_number: str voicemail_greeting: str - 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 - ) + 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 def to_dict(self) -> dict[str, Any]: kind: str = self.kind @@ -122,13 +118,13 @@ def to_dict(self) -> dict[str, Any]: caller_greeting = self.caller_greeting - unavailable_responder_message: None | Unset | str + unavailable_responder_message: None | str | Unset if isinstance(self.unavailable_responder_message, Unset): unavailable_responder_message = UNSET else: unavailable_responder_message = self.unavailable_responder_message - waiting_music_url: Unset | str = UNSET + waiting_music_url: str | Unset = UNSET if not isinstance(self.waiting_music_url, Unset): waiting_music_url = self.waiting_music_url @@ -144,7 +140,7 @@ def to_dict(self) -> dict[str, Any]: notify_via_push_notification = self.notify_via_push_notification - informational_notification_message: None | Unset | str + informational_notification_message: None | str | Unset if isinstance(self.informational_notification_message, Unset): informational_notification_message = UNSET else: @@ -156,7 +152,7 @@ def to_dict(self) -> dict[str, Any]: calling_tree_prompt = self.calling_tree_prompt - escalation_policy_trigger_params: Unset | dict[str, Any] = UNSET + escalation_policy_trigger_params: dict[str, Any] | Unset = UNSET if not isinstance(self.escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = self.escalation_policy_trigger_params.to_dict() @@ -239,19 +235,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 | Unset | str: + def _parse_unavailable_responder_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: Unset | NewLiveCallRouterDataAttributesWaitingMusicUrl + waiting_music_url: NewLiveCallRouterDataAttributesWaitingMusicUrl | Unset if isinstance(_waiting_music_url, Unset): waiting_music_url = UNSET else: @@ -269,12 +265,12 @@ def _parse_unavailable_responder_message(data: object) -> None | Unset | str: notify_via_push_notification = d.pop("notify_via_push_notification", UNSET) - def _parse_informational_notification_message(data: object) -> None | Unset | str: + def _parse_informational_notification_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) informational_notification_message = _parse_informational_notification_message( d.pop("informational_notification_message", UNSET) @@ -287,7 +283,7 @@ def _parse_informational_notification_message(data: object) -> None | Unset | st calling_tree_prompt = d.pop("calling_tree_prompt", UNSET) _escalation_policy_trigger_params = d.pop("escalation_policy_trigger_params", UNSET) - escalation_policy_trigger_params: Unset | NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams + escalation_policy_trigger_params: NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams | Unset 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_country_code.py b/rootly_sdk/models/new_live_call_router_data_attributes_country_code.py index c4917ffb..309db8b5 100644 --- a/rootly_sdk/models/new_live_call_router_data_attributes_country_code.py +++ b/rootly_sdk/models/new_live_call_router_data_attributes_country_code.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewLiveCallRouterDataAttributesCountryCode = Literal["AU", "CA", "CH", "DE", "GB", "NL", "NZ", "SE", "US"] @@ -21,7 +21,7 @@ def check_new_live_call_router_data_attributes_country_code( if value is None: return None if value in NEW_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_COUNTRY_CODE_VALUES: - return cast(NewLiveCallRouterDataAttributesCountryCode, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_COUNTRY_CODE_VALUES!r}" ) 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 c3c3136b..e2c86873 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,8 +1,9 @@ +from __future__ import annotations + 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.new_live_call_router_data_attributes_escalation_policy_trigger_params_type import ( NewLiveCallRouterDataAttributesEscalationPolicyTriggerParamsType, @@ -23,7 +24,6 @@ class NewLiveCallRouterDataAttributesEscalationPolicyTriggerParams: id: str type_: NewLiveCallRouterDataAttributesEscalationPolicyTriggerParamsType - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: type_: str = self.type_ field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -53,21 +53,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_=type_, ) - new_live_call_router_data_attributes_escalation_policy_trigger_params.additional_properties = d return new_live_call_router_data_attributes_escalation_policy_trigger_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/new_live_call_router_data_attributes_escalation_policy_trigger_params_type.py b/rootly_sdk/models/new_live_call_router_data_attributes_escalation_policy_trigger_params_type.py index 17cae63a..85eacd8f 100644 --- a/rootly_sdk/models/new_live_call_router_data_attributes_escalation_policy_trigger_params_type.py +++ b/rootly_sdk/models/new_live_call_router_data_attributes_escalation_policy_trigger_params_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewLiveCallRouterDataAttributesEscalationPolicyTriggerParamsType = Literal[ "escalation_policy", "functionality", "group", "service" @@ -20,7 +20,7 @@ def check_new_live_call_router_data_attributes_escalation_policy_trigger_params_ if value is None: return None if value in NEW_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_ESCALATION_POLICY_TRIGGER_PARAMS_TYPE_VALUES: - return cast(NewLiveCallRouterDataAttributesEscalationPolicyTriggerParamsType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_ESCALATION_POLICY_TRIGGER_PARAMS_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_live_call_router_data_attributes_kind.py b/rootly_sdk/models/new_live_call_router_data_attributes_kind.py index 843b13bf..00f52832 100644 --- a/rootly_sdk/models/new_live_call_router_data_attributes_kind.py +++ b/rootly_sdk/models/new_live_call_router_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewLiveCallRouterDataAttributesKind = Literal["live", "voicemail"] @@ -12,5 +12,5 @@ def check_new_live_call_router_data_attributes_kind(value: str | None) -> NewLiv if value is None: return None if value in NEW_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_KIND_VALUES: - return cast(NewLiveCallRouterDataAttributesKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_KIND_VALUES!r}") 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 8993b484..c1acb21a 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,8 +1,9 @@ +from __future__ import annotations + 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.new_live_call_router_data_attributes_paging_targets_item_type import ( NewLiveCallRouterDataAttributesPagingTargetsItemType, @@ -25,7 +26,6 @@ class NewLiveCallRouterDataAttributesPagingTargetsItem: id: str type_: NewLiveCallRouterDataAttributesPagingTargetsItemType alert_urgency_id: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -35,7 +35,7 @@ def to_dict(self) -> dict[str, Any]: alert_urgency_id = self.alert_urgency_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -61,21 +61,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alert_urgency_id=alert_urgency_id, ) - new_live_call_router_data_attributes_paging_targets_item.additional_properties = d return new_live_call_router_data_attributes_paging_targets_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_live_call_router_data_attributes_paging_targets_item_type.py b/rootly_sdk/models/new_live_call_router_data_attributes_paging_targets_item_type.py index 920d1eed..974c1352 100644 --- a/rootly_sdk/models/new_live_call_router_data_attributes_paging_targets_item_type.py +++ b/rootly_sdk/models/new_live_call_router_data_attributes_paging_targets_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewLiveCallRouterDataAttributesPagingTargetsItemType = Literal["escalation_policy", "functionality", "service", "team"] @@ -18,7 +18,7 @@ def check_new_live_call_router_data_attributes_paging_targets_item_type( if value is None: return None if value in NEW_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_PAGING_TARGETS_ITEM_TYPE_VALUES: - return cast(NewLiveCallRouterDataAttributesPagingTargetsItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_PAGING_TARGETS_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_live_call_router_data_attributes_phone_type.py b/rootly_sdk/models/new_live_call_router_data_attributes_phone_type.py index 3fcc70a7..6cc5f296 100644 --- a/rootly_sdk/models/new_live_call_router_data_attributes_phone_type.py +++ b/rootly_sdk/models/new_live_call_router_data_attributes_phone_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewLiveCallRouterDataAttributesPhoneType = Literal["local", "mobile", "toll_free"] @@ -15,7 +15,7 @@ def check_new_live_call_router_data_attributes_phone_type( if value is None: return None if value in NEW_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_PHONE_TYPE_VALUES: - return cast(NewLiveCallRouterDataAttributesPhoneType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_PHONE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_live_call_router_data_attributes_waiting_music_url.py b/rootly_sdk/models/new_live_call_router_data_attributes_waiting_music_url.py index ebec4871..e425f04b 100644 --- a/rootly_sdk/models/new_live_call_router_data_attributes_waiting_music_url.py +++ b/rootly_sdk/models/new_live_call_router_data_attributes_waiting_music_url.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewLiveCallRouterDataAttributesWaitingMusicUrl = Literal[ "https://storage.rootly.com/twilio/voicemail/BusyStrings.mp3", @@ -27,7 +27,7 @@ def check_new_live_call_router_data_attributes_waiting_music_url( if value is None: return None if value in NEW_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_WAITING_MUSIC_URL_VALUES: - return cast(NewLiveCallRouterDataAttributesWaitingMusicUrl, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_WAITING_MUSIC_URL_VALUES!r}" ) diff --git a/rootly_sdk/models/new_live_call_router_data_type.py b/rootly_sdk/models/new_live_call_router_data_type.py index bad5b7c9..3a303e99 100644 --- a/rootly_sdk/models/new_live_call_router_data_type.py +++ b/rootly_sdk/models/new_live_call_router_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewLiveCallRouterDataType = Literal["live_call_routers"] @@ -11,5 +11,5 @@ def check_new_live_call_router_data_type(value: str | None) -> NewLiveCallRouter if value is None: return None if value in NEW_LIVE_CALL_ROUTER_DATA_TYPE_VALUES: - return cast(NewLiveCallRouterDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_LIVE_CALL_ROUTER_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_on_call_pay_report.py b/rootly_sdk/models/new_on_call_pay_report.py index cdcb2e67..99a9bd09 100644 --- a/rootly_sdk/models/new_on_call_pay_report.py +++ b/rootly_sdk/models/new_on_call_pay_report.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_on_call_pay_report_data import NewOnCallPayReportData @@ -18,14 +19,13 @@ class NewOnCallPayReport: data (NewOnCallPayReportData): """ - data: "NewOnCallPayReportData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewOnCallPayReportData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_on_call_pay_report.additional_properties = d return new_on_call_pay_report - - @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_on_call_pay_report_data.py b/rootly_sdk/models/new_on_call_pay_report_data.py index 84e4a7df..4857a67b 100644 --- a/rootly_sdk/models/new_on_call_pay_report_data.py +++ b/rootly_sdk/models/new_on_call_pay_report_data.py @@ -1,8 +1,9 @@ +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_on_call_pay_report_data_type import NewOnCallPayReportDataType, check_new_on_call_pay_report_data_type @@ -22,8 +23,7 @@ class NewOnCallPayReportData: """ type_: NewOnCallPayReportDataType - attributes: "NewOnCallPayReportDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewOnCallPayReportDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_on_call_pay_report_data.additional_properties = d return new_on_call_pay_report_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_on_call_pay_report_data_attributes.py b/rootly_sdk/models/new_on_call_pay_report_data_attributes.py index 120e42a2..42ec1ade 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,9 +1,10 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast from attrs import define as _attrs_define -from dateutil.parser import isoparse from ..types import UNSET, Unset @@ -16,25 +17,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 (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 + 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 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. + 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: datetime.date end_date: datetime.date - schedule_ids: Unset | list[str] = UNSET - time_zone: Unset | str = UNSET - use_responders_time_zone: Unset | bool = UNSET + schedule_ids: list[str] | Unset = UNSET + time_zone: str | Unset = UNSET + use_responders_time_zone: bool | Unset = UNSET def to_dict(self) -> dict[str, Any]: start_date = self.start_date.isoformat() end_date = self.end_date.isoformat() - schedule_ids: Unset | list[str] = UNSET + schedule_ids: list[str] | Unset = UNSET if not isinstance(self.schedule_ids, Unset): schedule_ids = self.schedule_ids @@ -62,9 +63,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - start_date = isoparse(d.pop("start_date")).date() + start_date = datetime.date.fromisoformat(d.pop("start_date")) - end_date = isoparse(d.pop("end_date")).date() + end_date = datetime.date.fromisoformat(d.pop("end_date")) schedule_ids = cast(list[str], d.pop("schedule_ids", UNSET)) diff --git a/rootly_sdk/models/new_on_call_pay_report_data_type.py b/rootly_sdk/models/new_on_call_pay_report_data_type.py index 76ca4518..ec1dd68d 100644 --- a/rootly_sdk/models/new_on_call_pay_report_data_type.py +++ b/rootly_sdk/models/new_on_call_pay_report_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallPayReportDataType = Literal["on_call_pay_reports"] @@ -11,5 +11,5 @@ def check_new_on_call_pay_report_data_type(value: str | None) -> NewOnCallPayRep if value is None: return None if value in NEW_ON_CALL_PAY_REPORT_DATA_TYPE_VALUES: - return cast(NewOnCallPayReportDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_PAY_REPORT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_on_call_role.py b/rootly_sdk/models/new_on_call_role.py index 62976edf..68c436ac 100644 --- a/rootly_sdk/models/new_on_call_role.py +++ b/rootly_sdk/models/new_on_call_role.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_on_call_role_data import NewOnCallRoleData @@ -18,14 +19,13 @@ class NewOnCallRole: data (NewOnCallRoleData): """ - data: "NewOnCallRoleData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewOnCallRoleData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_on_call_role.additional_properties = d return new_on_call_role - - @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_on_call_role_data.py b/rootly_sdk/models/new_on_call_role_data.py index 05e59c36..6e85ad19 100644 --- a/rootly_sdk/models/new_on_call_role_data.py +++ b/rootly_sdk/models/new_on_call_role_data.py @@ -1,8 +1,9 @@ +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_on_call_role_data_type import NewOnCallRoleDataType, check_new_on_call_role_data_type @@ -22,8 +23,7 @@ class NewOnCallRoleData: """ type_: NewOnCallRoleDataType - attributes: "NewOnCallRoleDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewOnCallRoleDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_on_call_role_data.additional_properties = d return new_on_call_role_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_on_call_role_data_attributes.py b/rootly_sdk/models/new_on_call_role_data_attributes.py index cd1c4d48..7c2d06bc 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -71,6 +73,10 @@ NewOnCallRoleDataAttributesLiveCallRoutingPermissionsItem, check_new_on_call_role_data_attributes_live_call_routing_permissions_item, ) +from ..models.new_on_call_role_data_attributes_members_permissions_item import ( + NewOnCallRoleDataAttributesMembersPermissionsItem, + check_new_on_call_role_data_attributes_members_permissions_item, +) from ..models.new_on_call_role_data_attributes_on_call_readiness_report_permissions_item import ( NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem, check_new_on_call_role_data_attributes_on_call_readiness_report_permissions_item, @@ -109,73 +115,72 @@ class NewOnCallRoleDataAttributes: """ Attributes: name (str): The role name. - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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]]): + 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): + members_permissions (list[NewOnCallRoleDataAttributesMembersPermissionsItem] | 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): """ name: str - 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 + slug: None | str | Unset = UNSET + 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 on_call_readiness_report_permissions: ( - Unset | list[NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] + list[NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] | 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 + 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 + members_permissions: list[NewOnCallRoleDataAttributesMembersPermissionsItem] | 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 def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -183,168 +188,175 @@ def to_dict(self) -> dict[str, Any]: system_role = self.system_role - alert_fields_permissions: Unset | list[str] = UNSET + alert_fields_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + alert_groups_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + alert_routing_rules_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + on_call_readiness_report_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + on_call_roles_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + alert_sources_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + alert_urgency_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + alerts_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + api_keys_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + audits_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + contacts_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + escalation_policies_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + groups_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + heartbeats_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + integrations_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + invitations_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + live_call_routing_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + members_permissions: list[str] | Unset = UNSET + if not isinstance(self.members_permissions, Unset): + members_permissions = [] + for members_permissions_item_data in self.members_permissions: + members_permissions_item: str = members_permissions_item_data + members_permissions.append(members_permissions_item) + + schedule_override_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + schedules_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + services_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + functionalities_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + webhooks_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + workflows_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + catalogs_permissions: list[str] | Unset = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: @@ -396,6 +408,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["invitations_permissions"] = invitations_permissions if live_call_routing_permissions is not UNSET: field_dict["live_call_routing_permissions"] = live_call_routing_permissions + if members_permissions is not UNSET: + field_dict["members_permissions"] = members_permissions if schedule_override_permissions is not UNSET: field_dict["schedule_override_permissions"] = schedule_override_permissions if schedules_permissions is not UNSET: @@ -418,242 +432,309 @@ 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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) - 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: 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 + ) - 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) - 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: 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 + ) - 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) - 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: 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 + ) ) - ) - 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) - 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: ( + 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 + ) ) - ) - 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) - 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: 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 + ) - 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) - 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: 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 + ) - 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) - 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: 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 + ) - 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) - 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: 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 + ) - alerts_permissions.append(alerts_permissions_item) + alerts_permissions.append(alerts_permissions_item) - api_keys_permissions = [] _api_keys_permissions = d.pop("api_keys_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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 + ) - audits_permissions.append(audits_permissions_item) + audits_permissions.append(audits_permissions_item) - contacts_permissions = [] _contacts_permissions = d.pop("contacts_permissions", UNSET) - 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: 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 + ) - contacts_permissions.append(contacts_permissions_item) + contacts_permissions.append(contacts_permissions_item) - escalation_policies_permissions = [] _escalation_policies_permissions = d.pop("escalation_policies_permissions", UNSET) - 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: 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 + ) ) - ) - 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) - 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: 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 + ) - groups_permissions.append(groups_permissions_item) + groups_permissions.append(groups_permissions_item) - heartbeats_permissions = [] _heartbeats_permissions = d.pop("heartbeats_permissions", UNSET) - 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: 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 + ) - heartbeats_permissions.append(heartbeats_permissions_item) + heartbeats_permissions.append(heartbeats_permissions_item) - integrations_permissions = [] _integrations_permissions = d.pop("integrations_permissions", UNSET) - 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: 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 + ) - integrations_permissions.append(integrations_permissions_item) + integrations_permissions.append(integrations_permissions_item) - invitations_permissions = [] _invitations_permissions = d.pop("invitations_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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 + ) ) - ) - live_call_routing_permissions.append(live_call_routing_permissions_item) + live_call_routing_permissions.append(live_call_routing_permissions_item) + + _members_permissions = d.pop("members_permissions", UNSET) + members_permissions: list[NewOnCallRoleDataAttributesMembersPermissionsItem] | Unset = UNSET + if _members_permissions is not UNSET: + members_permissions = [] + for members_permissions_item_data in _members_permissions: + members_permissions_item = check_new_on_call_role_data_attributes_members_permissions_item( + members_permissions_item_data + ) + + members_permissions.append(members_permissions_item) - schedule_override_permissions = [] _schedule_override_permissions = d.pop("schedule_override_permissions", UNSET) - 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: 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 + ) ) - ) - 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) - 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: 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 + ) - schedules_permissions.append(schedules_permissions_item) + schedules_permissions.append(schedules_permissions_item) - services_permissions = [] _services_permissions = d.pop("services_permissions", UNSET) - 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: 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 + ) - services_permissions.append(services_permissions_item) + services_permissions.append(services_permissions_item) - functionalities_permissions = [] _functionalities_permissions = d.pop("functionalities_permissions", UNSET) - 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: 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 + ) + ) - functionalities_permissions.append(functionalities_permissions_item) + functionalities_permissions.append(functionalities_permissions_item) - webhooks_permissions = [] _webhooks_permissions = d.pop("webhooks_permissions", UNSET) - 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: 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 + ) - webhooks_permissions.append(webhooks_permissions_item) + webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions = [] _workflows_permissions = d.pop("workflows_permissions", UNSET) - 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: 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 + ) - workflows_permissions.append(workflows_permissions_item) + workflows_permissions.append(workflows_permissions_item) - catalogs_permissions = [] _catalogs_permissions = d.pop("catalogs_permissions", UNSET) - 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: 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 + ) - catalogs_permissions.append(catalogs_permissions_item) + catalogs_permissions.append(catalogs_permissions_item) new_on_call_role_data_attributes = cls( name=name, @@ -676,6 +757,7 @@ def _parse_slug(data: object) -> None | Unset | str: integrations_permissions=integrations_permissions, invitations_permissions=invitations_permissions, live_call_routing_permissions=live_call_routing_permissions, + members_permissions=members_permissions, schedule_override_permissions=schedule_override_permissions, schedules_permissions=schedules_permissions, services_permissions=services_permissions, diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_alert_fields_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_alert_fields_permissions_item.py index 801b981c..7ee1fa64 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_alert_fields_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_alert_fields_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesAlertFieldsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_alert_fields_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_FIELDS_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesAlertFieldsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_FIELDS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_alert_groups_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_alert_groups_permissions_item.py index 9d5ce6e0..a72f8bfa 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_alert_groups_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_alert_groups_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesAlertGroupsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_alert_groups_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_GROUPS_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesAlertGroupsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_GROUPS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_alert_routing_rules_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_alert_routing_rules_permissions_item.py index e88df6a3..c534468a 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_alert_routing_rules_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_alert_routing_rules_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_alert_routing_rules_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_ROUTING_RULES_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_ROUTING_RULES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_alert_sources_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_alert_sources_permissions_item.py index 474193e1..d53f8bf1 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_alert_sources_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_alert_sources_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesAlertSourcesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_alert_sources_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_SOURCES_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesAlertSourcesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_SOURCES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_alert_urgency_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_alert_urgency_permissions_item.py index 0ebcc686..0bbfa371 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_alert_urgency_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_alert_urgency_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesAlertUrgencyPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_alert_urgency_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_URGENCY_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesAlertUrgencyPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_URGENCY_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_alerts_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_alerts_permissions_item.py index fe0481c6..14d4a037 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_alerts_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_alerts_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesAlertsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_alerts_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERTS_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesAlertsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERTS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_api_keys_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_api_keys_permissions_item.py index 7ffdd94a..7219b08b 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_api_keys_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_api_keys_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesApiKeysPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_api_keys_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_API_KEYS_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesApiKeysPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_API_KEYS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_audits_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_audits_permissions_item.py index f39de3f8..a5920211 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_audits_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_audits_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesAuditsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_audits_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_AUDITS_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesAuditsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_AUDITS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_catalogs_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_catalogs_permissions_item.py index 67995029..695ffd16 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_catalogs_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_catalogs_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesCatalogsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_catalogs_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_CATALOGS_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesCatalogsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_CATALOGS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_contacts_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_contacts_permissions_item.py index e1b067e6..882df933 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_contacts_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_contacts_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesContactsPermissionsItem = Literal["read"] @@ -15,7 +15,7 @@ def check_new_on_call_role_data_attributes_contacts_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_CONTACTS_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesContactsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_CONTACTS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_escalation_policies_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_escalation_policies_permissions_item.py index a2a859d6..40516c9c 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_escalation_policies_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_escalation_policies_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesEscalationPoliciesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_escalation_policies_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_ESCALATION_POLICIES_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesEscalationPoliciesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_ESCALATION_POLICIES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_functionalities_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_functionalities_permissions_item.py index 8782bccc..15fcc79f 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_functionalities_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_functionalities_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesFunctionalitiesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_functionalities_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_FUNCTIONALITIES_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesFunctionalitiesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_FUNCTIONALITIES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_groups_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_groups_permissions_item.py index f00a5a1a..4d79d007 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_groups_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_groups_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesGroupsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_groups_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_GROUPS_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesGroupsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_GROUPS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_heartbeats_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_heartbeats_permissions_item.py index 11d856fd..321772bf 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_heartbeats_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_heartbeats_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesHeartbeatsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_heartbeats_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_HEARTBEATS_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesHeartbeatsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_HEARTBEATS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_integrations_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_integrations_permissions_item.py index 83928638..66573b19 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_integrations_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_integrations_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesIntegrationsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_integrations_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_INTEGRATIONS_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesIntegrationsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_INTEGRATIONS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_invitations_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_invitations_permissions_item.py index 1be5df98..6287d708 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_invitations_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_invitations_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesInvitationsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_invitations_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_INVITATIONS_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesInvitationsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_INVITATIONS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_live_call_routing_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_live_call_routing_permissions_item.py index a4d33bc1..e4080840 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_live_call_routing_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_live_call_routing_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesLiveCallRoutingPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_live_call_routing_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_LIVE_CALL_ROUTING_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesLiveCallRoutingPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_LIVE_CALL_ROUTING_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_members_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_members_permissions_item.py new file mode 100644 index 00000000..f8657ed6 --- /dev/null +++ b/rootly_sdk/models/new_on_call_role_data_attributes_members_permissions_item.py @@ -0,0 +1,23 @@ +from typing import Literal + +NewOnCallRoleDataAttributesMembersPermissionsItem = Literal["delete", "read", "update"] + +NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_MEMBERS_PERMISSIONS_ITEM_VALUES: set[ + NewOnCallRoleDataAttributesMembersPermissionsItem +] = { + "delete", + "read", + "update", +} + + +def check_new_on_call_role_data_attributes_members_permissions_item( + value: str | None, +) -> NewOnCallRoleDataAttributesMembersPermissionsItem | None: + if value is None: + return None + if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_MEMBERS_PERMISSIONS_ITEM_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_MEMBERS_PERMISSIONS_ITEM_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_on_call_readiness_report_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_on_call_readiness_report_permissions_item.py index 9fe232ed..03e91893 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_on_call_readiness_report_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_on_call_readiness_report_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem = Literal["read"] @@ -15,7 +15,7 @@ def check_new_on_call_role_data_attributes_on_call_readiness_report_permissions_ if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_ON_CALL_READINESS_REPORT_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_ON_CALL_READINESS_REPORT_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_on_call_roles_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_on_call_roles_permissions_item.py index 60829b0b..26cdf60d 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_on_call_roles_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_on_call_roles_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesOnCallRolesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_on_call_roles_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_ON_CALL_ROLES_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesOnCallRolesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_ON_CALL_ROLES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_schedule_override_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_schedule_override_permissions_item.py index edcecf1b..86949b26 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_schedule_override_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_schedule_override_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesScheduleOverridePermissionsItem = Literal["create", "update"] @@ -16,7 +16,7 @@ def check_new_on_call_role_data_attributes_schedule_override_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_SCHEDULE_OVERRIDE_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesScheduleOverridePermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_SCHEDULE_OVERRIDE_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_schedules_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_schedules_permissions_item.py index 702d6ca9..e6c2b71e 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_schedules_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_schedules_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesSchedulesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_schedules_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_SCHEDULES_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesSchedulesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_SCHEDULES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_services_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_services_permissions_item.py index ad8a05d2..b7e7659e 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_services_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_services_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesServicesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_services_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_SERVICES_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesServicesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_SERVICES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_webhooks_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_webhooks_permissions_item.py index abb61de4..acf371f9 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_webhooks_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_webhooks_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesWebhooksPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_webhooks_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_WEBHOOKS_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesWebhooksPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_WEBHOOKS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_attributes_workflows_permissions_item.py b/rootly_sdk/models/new_on_call_role_data_attributes_workflows_permissions_item.py index 483016be..9ef44bf2 100644 --- a/rootly_sdk/models/new_on_call_role_data_attributes_workflows_permissions_item.py +++ b/rootly_sdk/models/new_on_call_role_data_attributes_workflows_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataAttributesWorkflowsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_on_call_role_data_attributes_workflows_permissions_item( if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_WORKFLOWS_PERMISSIONS_ITEM_VALUES: - return cast(NewOnCallRoleDataAttributesWorkflowsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_ATTRIBUTES_WORKFLOWS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_role_data_type.py b/rootly_sdk/models/new_on_call_role_data_type.py index 568208f7..e9172dbc 100644 --- a/rootly_sdk/models/new_on_call_role_data_type.py +++ b/rootly_sdk/models/new_on_call_role_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallRoleDataType = Literal["on_call_roles"] @@ -11,5 +11,5 @@ def check_new_on_call_role_data_type(value: str | None) -> NewOnCallRoleDataType if value is None: return None if value in NEW_ON_CALL_ROLE_DATA_TYPE_VALUES: - return cast(NewOnCallRoleDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_ROLE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_on_call_shadow.py b/rootly_sdk/models/new_on_call_shadow.py index 789a48c4..d13103f1 100644 --- a/rootly_sdk/models/new_on_call_shadow.py +++ b/rootly_sdk/models/new_on_call_shadow.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_on_call_shadow_data import NewOnCallShadowData @@ -18,14 +19,13 @@ class NewOnCallShadow: data (NewOnCallShadowData): """ - data: "NewOnCallShadowData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewOnCallShadowData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_on_call_shadow.additional_properties = d return new_on_call_shadow - - @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_on_call_shadow_data.py b/rootly_sdk/models/new_on_call_shadow_data.py index 50063cff..fde7ae53 100644 --- a/rootly_sdk/models/new_on_call_shadow_data.py +++ b/rootly_sdk/models/new_on_call_shadow_data.py @@ -1,8 +1,9 @@ +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_on_call_shadow_data_type import NewOnCallShadowDataType, check_new_on_call_shadow_data_type @@ -22,8 +23,7 @@ class NewOnCallShadowData: """ type_: NewOnCallShadowDataType - attributes: "NewOnCallShadowDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewOnCallShadowDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_on_call_shadow_data.additional_properties = d return new_on_call_shadow_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_on_call_shadow_data_attributes.py b/rootly_sdk/models/new_on_call_shadow_data_attributes.py index 038e3f86..4f99eb0f 100644 --- a/rootly_sdk/models/new_on_call_shadow_data_attributes.py +++ b/rootly_sdk/models/new_on_call_shadow_data_attributes.py @@ -1,9 +1,10 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from dateutil.parser import isoparse from ..models.new_on_call_shadow_data_attributes_shadowable_type import ( NewOnCallShadowDataAttributesShadowableType, @@ -64,9 +65,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: shadow_user_id = d.pop("shadow_user_id") - starts_at = isoparse(d.pop("starts_at")) + starts_at = datetime.datetime.fromisoformat(d.pop("starts_at")) - ends_at = isoparse(d.pop("ends_at")) + ends_at = datetime.datetime.fromisoformat(d.pop("ends_at")) new_on_call_shadow_data_attributes = cls( shadowable_type=shadowable_type, diff --git a/rootly_sdk/models/new_on_call_shadow_data_attributes_shadowable_type.py b/rootly_sdk/models/new_on_call_shadow_data_attributes_shadowable_type.py index 4411528f..057e81ed 100644 --- a/rootly_sdk/models/new_on_call_shadow_data_attributes_shadowable_type.py +++ b/rootly_sdk/models/new_on_call_shadow_data_attributes_shadowable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallShadowDataAttributesShadowableType = Literal["Schedule", "User"] @@ -14,7 +14,7 @@ def check_new_on_call_shadow_data_attributes_shadowable_type( if value is None: return None if value in NEW_ON_CALL_SHADOW_DATA_ATTRIBUTES_SHADOWABLE_TYPE_VALUES: - return cast(NewOnCallShadowDataAttributesShadowableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_SHADOW_DATA_ATTRIBUTES_SHADOWABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_on_call_shadow_data_type.py b/rootly_sdk/models/new_on_call_shadow_data_type.py index 69a9d058..bae3685a 100644 --- a/rootly_sdk/models/new_on_call_shadow_data_type.py +++ b/rootly_sdk/models/new_on_call_shadow_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOnCallShadowDataType = Literal["on_call_shadows"] @@ -11,5 +11,5 @@ def check_new_on_call_shadow_data_type(value: str | None) -> NewOnCallShadowData if value is None: return None if value in NEW_ON_CALL_SHADOW_DATA_TYPE_VALUES: - return cast(NewOnCallShadowDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ON_CALL_SHADOW_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_override_shift.py b/rootly_sdk/models/new_override_shift.py index 6ded75a5..abdfdc67 100644 --- a/rootly_sdk/models/new_override_shift.py +++ b/rootly_sdk/models/new_override_shift.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_override_shift_data import NewOverrideShiftData @@ -18,14 +19,13 @@ class NewOverrideShift: data (NewOverrideShiftData): """ - data: "NewOverrideShiftData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewOverrideShiftData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_override_shift.additional_properties = d return new_override_shift - - @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_override_shift_data.py b/rootly_sdk/models/new_override_shift_data.py index 725b9463..a82efce1 100644 --- a/rootly_sdk/models/new_override_shift_data.py +++ b/rootly_sdk/models/new_override_shift_data.py @@ -1,8 +1,9 @@ +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_override_shift_data_type import NewOverrideShiftDataType, check_new_override_shift_data_type @@ -22,8 +23,7 @@ class NewOverrideShiftData: """ type_: NewOverrideShiftDataType - attributes: "NewOverrideShiftDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewOverrideShiftDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_override_shift_data.additional_properties = d return new_override_shift_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_override_shift_data_attributes.py b/rootly_sdk/models/new_override_shift_data_attributes.py index 41ca3559..4d7e806e 100644 --- a/rootly_sdk/models/new_override_shift_data_attributes.py +++ b/rootly_sdk/models/new_override_shift_data_attributes.py @@ -1,9 +1,10 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from dateutil.parser import isoparse T = TypeVar("T", bound="NewOverrideShiftDataAttributes") @@ -43,9 +44,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - starts_at = isoparse(d.pop("starts_at")) + starts_at = datetime.datetime.fromisoformat(d.pop("starts_at")) - ends_at = isoparse(d.pop("ends_at")) + ends_at = datetime.datetime.fromisoformat(d.pop("ends_at")) user_id = d.pop("user_id") diff --git a/rootly_sdk/models/new_override_shift_data_type.py b/rootly_sdk/models/new_override_shift_data_type.py index a678663f..46543a04 100644 --- a/rootly_sdk/models/new_override_shift_data_type.py +++ b/rootly_sdk/models/new_override_shift_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewOverrideShiftDataType = Literal["shifts"] @@ -11,5 +11,5 @@ def check_new_override_shift_data_type(value: str | None) -> NewOverrideShiftDat if value is None: return None if value in NEW_OVERRIDE_SHIFT_DATA_TYPE_VALUES: - return cast(NewOverrideShiftDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_OVERRIDE_SHIFT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_playbook.py b/rootly_sdk/models/new_playbook.py index 67ea823c..004e6f6e 100644 --- a/rootly_sdk/models/new_playbook.py +++ b/rootly_sdk/models/new_playbook.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_playbook_data import NewPlaybookData @@ -18,14 +19,13 @@ class NewPlaybook: data (NewPlaybookData): """ - data: "NewPlaybookData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewPlaybookData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_playbook.additional_properties = d return new_playbook - - @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_playbook_data.py b/rootly_sdk/models/new_playbook_data.py index d1ca1d51..40208480 100644 --- a/rootly_sdk/models/new_playbook_data.py +++ b/rootly_sdk/models/new_playbook_data.py @@ -1,8 +1,9 @@ +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_playbook_data_type import NewPlaybookDataType, check_new_playbook_data_type @@ -22,8 +23,7 @@ class NewPlaybookData: """ type_: NewPlaybookDataType - attributes: "NewPlaybookDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewPlaybookDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_playbook_data.additional_properties = d return new_playbook_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_playbook_data_attributes.py b/rootly_sdk/models/new_playbook_data_attributes.py index bf242c06..23be58bc 100644 --- a/rootly_sdk/models/new_playbook_data_attributes.py +++ b/rootly_sdk/models/new_playbook_data_attributes.py @@ -1,8 +1,14 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast from attrs import define as _attrs_define +from ..models.new_playbook_data_attributes_kind import ( + NewPlaybookDataAttributesKind, + check_new_playbook_data_attributes_kind, +) from ..types import UNSET, Unset T = TypeVar("T", bound="NewPlaybookDataAttributes") @@ -13,42 +19,60 @@ class NewPlaybookDataAttributes: """ Attributes: title (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 + summary (None | str | Unset): The summary of the playbook + kind (NewPlaybookDataAttributesKind | Unset): Whether the playbook body lives in Rootly (`internal_document`) or + at an external link (`external_url`). + content (None | str | Unset): Sanitized HTML instructions. Still returned when `kind` is `external_url`, where + the body may be stale — branch on `kind`, not on `content` being present. + 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 + cause_ids (list[str] | None | Unset): The Cause IDs to attach to the incident """ title: str - 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 + summary: None | str | Unset = UNSET + kind: NewPlaybookDataAttributesKind | Unset = UNSET + content: 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 + cause_ids: list[str] | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - summary: None | Unset | str + summary: None | str | Unset if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - external_url: None | Unset | str + kind: str | Unset = UNSET + if not isinstance(self.kind, Unset): + kind = self.kind + + content: None | str | Unset + if isinstance(self.content, Unset): + content = UNSET + else: + content = self.content + + external_url: None | str | Unset if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - severity_ids: None | Unset | list[str] + severity_ids: list[str] | None | Unset if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -57,7 +81,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - environment_ids: None | Unset | list[str] + environment_ids: list[str] | None | Unset if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -66,7 +90,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -75,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: None | Unset | list[str] + functionality_ids: list[str] | None | Unset if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -84,7 +108,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: None | Unset | list[str] + group_ids: list[str] | None | Unset if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -93,7 +117,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: None | Unset | list[str] + incident_type_ids: list[str] | None | Unset if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -102,6 +126,15 @@ def to_dict(self) -> dict[str, Any]: else: incident_type_ids = self.incident_type_ids + cause_ids: list[str] | None | Unset + if isinstance(self.cause_ids, Unset): + cause_ids = UNSET + elif isinstance(self.cause_ids, list): + cause_ids = self.cause_ids + + else: + cause_ids = self.cause_ids + field_dict: dict[str, Any] = {} field_dict.update( @@ -111,6 +144,10 @@ def to_dict(self) -> dict[str, Any]: ) if summary is not UNSET: field_dict["summary"] = summary + if kind is not UNSET: + field_dict["kind"] = kind + if content is not UNSET: + field_dict["content"] = content if external_url is not UNSET: field_dict["external_url"] = external_url if severity_ids is not UNSET: @@ -125,6 +162,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["group_ids"] = group_ids if incident_type_ids is not UNSET: field_dict["incident_type_ids"] = incident_type_ids + if cause_ids is not UNSET: + field_dict["cause_ids"] = cause_ids return field_dict @@ -133,25 +172,41 @@ 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 | Unset | str: + def _parse_summary(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_external_url(data: object) -> None | Unset | str: + _kind = d.pop("kind", UNSET) + kind: NewPlaybookDataAttributesKind | Unset + if isinstance(_kind, Unset): + kind = UNSET + else: + kind = check_new_playbook_data_attributes_kind(_kind) + + def _parse_content(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + content = _parse_content(d.pop("content", UNSET)) + + def _parse_external_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_severity_ids(data: object) -> None | Unset | list[str]: + def _parse_severity_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -162,13 +217,13 @@ def _parse_severity_ids(data: object) -> None | Unset | list[str]: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_environment_ids(data: object) -> None | Unset | list[str]: + def _parse_environment_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -179,13 +234,13 @@ def _parse_environment_ids(data: object) -> None | Unset | list[str]: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -196,13 +251,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> None | Unset | list[str]: + def _parse_functionality_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -213,13 +268,13 @@ def _parse_functionality_ids(data: object) -> None | Unset | list[str]: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> None | Unset | list[str]: + def _parse_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -230,13 +285,13 @@ def _parse_group_ids(data: object) -> None | Unset | list[str]: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: + def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -247,15 +302,34 @@ def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) + def _parse_cause_ids(data: object) -> list[str] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + cause_ids_type_0 = cast(list[str], data) + + return cause_ids_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[str] | None | Unset, data) + + cause_ids = _parse_cause_ids(d.pop("cause_ids", UNSET)) + new_playbook_data_attributes = cls( title=title, summary=summary, + kind=kind, + content=content, external_url=external_url, severity_ids=severity_ids, environment_ids=environment_ids, @@ -263,6 +337,7 @@ def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: functionality_ids=functionality_ids, group_ids=group_ids, incident_type_ids=incident_type_ids, + cause_ids=cause_ids, ) return new_playbook_data_attributes diff --git a/rootly_sdk/models/new_playbook_data_attributes_kind.py b/rootly_sdk/models/new_playbook_data_attributes_kind.py new file mode 100644 index 00000000..b5ba269e --- /dev/null +++ b/rootly_sdk/models/new_playbook_data_attributes_kind.py @@ -0,0 +1,16 @@ +from typing import Literal + +NewPlaybookDataAttributesKind = Literal["external_url", "internal_document"] + +NEW_PLAYBOOK_DATA_ATTRIBUTES_KIND_VALUES: set[NewPlaybookDataAttributesKind] = { + "external_url", + "internal_document", +} + + +def check_new_playbook_data_attributes_kind(value: str | None) -> NewPlaybookDataAttributesKind | None: + if value is None: + return None + if value in NEW_PLAYBOOK_DATA_ATTRIBUTES_KIND_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_PLAYBOOK_DATA_ATTRIBUTES_KIND_VALUES!r}") diff --git a/rootly_sdk/models/new_playbook_data_type.py b/rootly_sdk/models/new_playbook_data_type.py index 46d5d5a4..893ad465 100644 --- a/rootly_sdk/models/new_playbook_data_type.py +++ b/rootly_sdk/models/new_playbook_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewPlaybookDataType = Literal["playbooks"] @@ -11,5 +11,5 @@ def check_new_playbook_data_type(value: str | None) -> NewPlaybookDataType | Non if value is None: return None if value in NEW_PLAYBOOK_DATA_TYPE_VALUES: - return cast(NewPlaybookDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_PLAYBOOK_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_playbook_task.py b/rootly_sdk/models/new_playbook_task.py index b7f5a3d5..c18e9146 100644 --- a/rootly_sdk/models/new_playbook_task.py +++ b/rootly_sdk/models/new_playbook_task.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_playbook_task_data import NewPlaybookTaskData @@ -18,14 +19,13 @@ class NewPlaybookTask: data (NewPlaybookTaskData): """ - data: "NewPlaybookTaskData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewPlaybookTaskData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_playbook_task.additional_properties = d return new_playbook_task - - @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_playbook_task_data.py b/rootly_sdk/models/new_playbook_task_data.py index e9008bb8..ed423cf5 100644 --- a/rootly_sdk/models/new_playbook_task_data.py +++ b/rootly_sdk/models/new_playbook_task_data.py @@ -1,8 +1,9 @@ +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_playbook_task_data_type import NewPlaybookTaskDataType, check_new_playbook_task_data_type @@ -22,8 +23,7 @@ class NewPlaybookTaskData: """ type_: NewPlaybookTaskDataType - attributes: "NewPlaybookTaskDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewPlaybookTaskDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_playbook_task_data.additional_properties = d return new_playbook_task_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_playbook_task_data_attributes.py b/rootly_sdk/models/new_playbook_task_data_attributes.py index b3f89bfd..7888c99c 100644 --- a/rootly_sdk/models/new_playbook_task_data_attributes.py +++ b/rootly_sdk/models/new_playbook_task_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,24 +15,24 @@ class NewPlaybookTaskDataAttributes: """ Attributes: task (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 + description (None | str | Unset): The description of the task + position (int | None | Unset): The position of the task """ task: str - description: None | Unset | str = UNSET - position: None | Unset | int = UNSET + description: None | str | Unset = UNSET + position: int | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: task = self.task - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -55,21 +57,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_playbook_task_data_type.py b/rootly_sdk/models/new_playbook_task_data_type.py index adc842a9..ecbd4481 100644 --- a/rootly_sdk/models/new_playbook_task_data_type.py +++ b/rootly_sdk/models/new_playbook_task_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewPlaybookTaskDataType = Literal["playbook_tasks"] @@ -11,5 +11,5 @@ def check_new_playbook_task_data_type(value: str | None) -> NewPlaybookTaskDataT if value is None: return None if value in NEW_PLAYBOOK_TASK_DATA_TYPE_VALUES: - return cast(NewPlaybookTaskDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_PLAYBOOK_TASK_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_post_mortem_template.py b/rootly_sdk/models/new_post_mortem_template.py index 0c6828d4..2ddeecb5 100644 --- a/rootly_sdk/models/new_post_mortem_template.py +++ b/rootly_sdk/models/new_post_mortem_template.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_post_mortem_template_data import NewPostMortemTemplateData @@ -18,14 +19,13 @@ class NewPostMortemTemplate: data (NewPostMortemTemplateData): """ - data: "NewPostMortemTemplateData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewPostMortemTemplateData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_post_mortem_template.additional_properties = d return new_post_mortem_template - - @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_post_mortem_template_data.py b/rootly_sdk/models/new_post_mortem_template_data.py index 538680f1..833f5f60 100644 --- a/rootly_sdk/models/new_post_mortem_template_data.py +++ b/rootly_sdk/models/new_post_mortem_template_data.py @@ -1,8 +1,9 @@ +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_post_mortem_template_data_type import ( NewPostMortemTemplateDataType, @@ -25,8 +26,7 @@ class NewPostMortemTemplateData: """ type_: NewPostMortemTemplateDataType - attributes: "NewPostMortemTemplateDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewPostMortemTemplateDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_post_mortem_template_data.additional_properties = d return new_post_mortem_template_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_post_mortem_template_data_attributes.py b/rootly_sdk/models/new_post_mortem_template_data_attributes.py index 7a2c63dd..316b17a6 100644 --- a/rootly_sdk/models/new_post_mortem_template_data_attributes.py +++ b/rootly_sdk/models/new_post_mortem_template_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,30 +19,30 @@ class NewPostMortemTemplateDataAttributes: """ Attributes: name (str): The name of the postmortem template - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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), + default (bool | None | Unset): Default selected template when editing a postmortem + content (str | Unset): 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_ (Union[Unset, NewPostMortemTemplateDataAttributesFormat]): The format of the input Default: 'html'. + format_ (NewPostMortemTemplateDataAttributesFormat | Unset): The format of the input Default: 'html'. """ name: str - slug: None | Unset | str = UNSET - default: None | Unset | bool = UNSET - content: Unset | str = UNSET - format_: Unset | NewPostMortemTemplateDataAttributesFormat = "html" + slug: None | str | Unset = UNSET + default: bool | None | Unset = UNSET + content: str | Unset = UNSET + format_: NewPostMortemTemplateDataAttributesFormat | Unset = "html" def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - default: None | Unset | bool + default: bool | None | Unset if isinstance(self.default, Unset): default = UNSET else: @@ -48,7 +50,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - format_: Unset | str = UNSET + format_: str | Unset = UNSET if not isinstance(self.format_, Unset): format_ = self.format_ @@ -75,28 +77,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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_default(data: object) -> None | Unset | bool: + def _parse_default(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) default = _parse_default(d.pop("default", UNSET)) content = d.pop("content", UNSET) _format_ = d.pop("format", UNSET) - format_: Unset | NewPostMortemTemplateDataAttributesFormat + format_: NewPostMortemTemplateDataAttributesFormat | Unset if isinstance(_format_, Unset): format_ = UNSET else: diff --git a/rootly_sdk/models/new_post_mortem_template_data_attributes_format.py b/rootly_sdk/models/new_post_mortem_template_data_attributes_format.py index d27961db..5f81aaaf 100644 --- a/rootly_sdk/models/new_post_mortem_template_data_attributes_format.py +++ b/rootly_sdk/models/new_post_mortem_template_data_attributes_format.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewPostMortemTemplateDataAttributesFormat = Literal["html", "markdown"] @@ -14,7 +14,7 @@ def check_new_post_mortem_template_data_attributes_format( if value is None: return None if value in NEW_POST_MORTEM_TEMPLATE_DATA_ATTRIBUTES_FORMAT_VALUES: - return cast(NewPostMortemTemplateDataAttributesFormat, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_POST_MORTEM_TEMPLATE_DATA_ATTRIBUTES_FORMAT_VALUES!r}" ) diff --git a/rootly_sdk/models/new_post_mortem_template_data_type.py b/rootly_sdk/models/new_post_mortem_template_data_type.py index 068be20b..7beb6f94 100644 --- a/rootly_sdk/models/new_post_mortem_template_data_type.py +++ b/rootly_sdk/models/new_post_mortem_template_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewPostMortemTemplateDataType = Literal["post_mortem_templates"] @@ -11,5 +11,5 @@ def check_new_post_mortem_template_data_type(value: str | None) -> NewPostMortem if value is None: return None if value in NEW_POST_MORTEM_TEMPLATE_DATA_TYPE_VALUES: - return cast(NewPostMortemTemplateDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_POST_MORTEM_TEMPLATE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_problem.py b/rootly_sdk/models/new_problem.py new file mode 100644 index 00000000..4ad99be5 --- /dev/null +++ b/rootly_sdk/models/new_problem.py @@ -0,0 +1,48 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.new_problem_data import NewProblemData + + +T = TypeVar("T", bound="NewProblem") + + +@_attrs_define +class NewProblem: + """ + Attributes: + data (NewProblemData): + """ + + data: NewProblemData + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_problem_data import NewProblemData + + d = dict(src_dict) + data = NewProblemData.from_dict(d.pop("data")) + + new_problem = cls( + data=data, + ) + + return new_problem diff --git a/rootly_sdk/models/new_problem_action_item.py b/rootly_sdk/models/new_problem_action_item.py new file mode 100644 index 00000000..26802c10 --- /dev/null +++ b/rootly_sdk/models/new_problem_action_item.py @@ -0,0 +1,48 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.new_problem_action_item_data import NewProblemActionItemData + + +T = TypeVar("T", bound="NewProblemActionItem") + + +@_attrs_define +class NewProblemActionItem: + """ + Attributes: + data (NewProblemActionItemData): + """ + + data: NewProblemActionItemData + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_problem_action_item_data import NewProblemActionItemData + + d = dict(src_dict) + data = NewProblemActionItemData.from_dict(d.pop("data")) + + new_problem_action_item = cls( + data=data, + ) + + return new_problem_action_item diff --git a/rootly_sdk/models/new_problem_action_item_data.py b/rootly_sdk/models/new_problem_action_item_data.py new file mode 100644 index 00000000..0b08f12b --- /dev/null +++ b/rootly_sdk/models/new_problem_action_item_data.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.new_problem_action_item_data_type import ( + NewProblemActionItemDataType, + check_new_problem_action_item_data_type, +) + +if TYPE_CHECKING: + from ..models.new_problem_action_item_data_attributes import NewProblemActionItemDataAttributes + + +T = TypeVar("T", bound="NewProblemActionItemData") + + +@_attrs_define +class NewProblemActionItemData: + """ + Attributes: + type_ (NewProblemActionItemDataType): + attributes (NewProblemActionItemDataAttributes): + """ + + type_: NewProblemActionItemDataType + attributes: NewProblemActionItemDataAttributes + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + + 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_problem_action_item_data_attributes import NewProblemActionItemDataAttributes + + d = dict(src_dict) + type_ = check_new_problem_action_item_data_type(d.pop("type")) + + attributes = NewProblemActionItemDataAttributes.from_dict(d.pop("attributes")) + + new_problem_action_item_data = cls( + type_=type_, + attributes=attributes, + ) + + return new_problem_action_item_data diff --git a/rootly_sdk/models/new_problem_action_item_data_attributes.py b/rootly_sdk/models/new_problem_action_item_data_attributes.py new file mode 100644 index 00000000..aae29191 --- /dev/null +++ b/rootly_sdk/models/new_problem_action_item_data_attributes.py @@ -0,0 +1,164 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..models.new_problem_action_item_data_attributes_priority import ( + NewProblemActionItemDataAttributesPriority, + check_new_problem_action_item_data_attributes_priority, +) +from ..models.new_problem_action_item_data_attributes_status import ( + NewProblemActionItemDataAttributesStatus, + check_new_problem_action_item_data_attributes_status, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NewProblemActionItemDataAttributes") + + +@_attrs_define +class NewProblemActionItemDataAttributes: + """ + Attributes: + summary (str): The summary of the action item + description (None | str | Unset): The description of the action item + assigned_to_user_id (int | None | Unset): ID of user you wish to assign this action item + priority (NewProblemActionItemDataAttributesPriority | Unset): The priority of the action item + status (NewProblemActionItemDataAttributesStatus | Unset): The status of the action item + due_date (None | str | Unset): The due date of the action item + jira_issue_url (None | str | Unset): The Jira issue URL. + """ + + summary: str + description: None | str | Unset = UNSET + assigned_to_user_id: int | None | Unset = UNSET + priority: NewProblemActionItemDataAttributesPriority | Unset = UNSET + status: NewProblemActionItemDataAttributesStatus | Unset = UNSET + due_date: None | str | Unset = UNSET + jira_issue_url: None | str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + summary = self.summary + + description: None | str | Unset + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + assigned_to_user_id: int | None | Unset + if isinstance(self.assigned_to_user_id, Unset): + assigned_to_user_id = UNSET + else: + assigned_to_user_id = self.assigned_to_user_id + + priority: str | Unset = UNSET + if not isinstance(self.priority, Unset): + priority = self.priority + + status: str | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status + + due_date: None | str | Unset + if isinstance(self.due_date, Unset): + due_date = UNSET + else: + due_date = self.due_date + + jira_issue_url: None | str | Unset + if isinstance(self.jira_issue_url, Unset): + jira_issue_url = UNSET + else: + jira_issue_url = self.jira_issue_url + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "summary": summary, + } + ) + if description is not UNSET: + field_dict["description"] = description + if assigned_to_user_id is not UNSET: + field_dict["assigned_to_user_id"] = assigned_to_user_id + if priority is not UNSET: + field_dict["priority"] = priority + if status is not UNSET: + field_dict["status"] = status + if due_date is not UNSET: + field_dict["due_date"] = due_date + if jira_issue_url is not UNSET: + field_dict["jira_issue_url"] = jira_issue_url + + return field_dict + + @classmethod + 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: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_assigned_to_user_id(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + assigned_to_user_id = _parse_assigned_to_user_id(d.pop("assigned_to_user_id", UNSET)) + + _priority = d.pop("priority", UNSET) + priority: NewProblemActionItemDataAttributesPriority | Unset + if isinstance(_priority, Unset): + priority = UNSET + else: + priority = check_new_problem_action_item_data_attributes_priority(_priority) + + _status = d.pop("status", UNSET) + status: NewProblemActionItemDataAttributesStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = check_new_problem_action_item_data_attributes_status(_status) + + def _parse_due_date(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + due_date = _parse_due_date(d.pop("due_date", UNSET)) + + def _parse_jira_issue_url(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) + + new_problem_action_item_data_attributes = cls( + summary=summary, + description=description, + assigned_to_user_id=assigned_to_user_id, + priority=priority, + status=status, + due_date=due_date, + jira_issue_url=jira_issue_url, + ) + + return new_problem_action_item_data_attributes diff --git a/rootly_sdk/models/new_problem_action_item_data_attributes_priority.py b/rootly_sdk/models/new_problem_action_item_data_attributes_priority.py new file mode 100644 index 00000000..9400fe4c --- /dev/null +++ b/rootly_sdk/models/new_problem_action_item_data_attributes_priority.py @@ -0,0 +1,21 @@ +from typing import Literal + +NewProblemActionItemDataAttributesPriority = Literal["high", "low", "medium"] + +NEW_PROBLEM_ACTION_ITEM_DATA_ATTRIBUTES_PRIORITY_VALUES: set[NewProblemActionItemDataAttributesPriority] = { + "high", + "low", + "medium", +} + + +def check_new_problem_action_item_data_attributes_priority( + value: str | None, +) -> NewProblemActionItemDataAttributesPriority | None: + if value is None: + return None + if value in NEW_PROBLEM_ACTION_ITEM_DATA_ATTRIBUTES_PRIORITY_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_PROBLEM_ACTION_ITEM_DATA_ATTRIBUTES_PRIORITY_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_problem_action_item_data_attributes_status.py b/rootly_sdk/models/new_problem_action_item_data_attributes_status.py new file mode 100644 index 00000000..7e54c98a --- /dev/null +++ b/rootly_sdk/models/new_problem_action_item_data_attributes_status.py @@ -0,0 +1,22 @@ +from typing import Literal + +NewProblemActionItemDataAttributesStatus = Literal["cancelled", "done", "in_progress", "open"] + +NEW_PROBLEM_ACTION_ITEM_DATA_ATTRIBUTES_STATUS_VALUES: set[NewProblemActionItemDataAttributesStatus] = { + "cancelled", + "done", + "in_progress", + "open", +} + + +def check_new_problem_action_item_data_attributes_status( + value: str | None, +) -> NewProblemActionItemDataAttributesStatus | None: + if value is None: + return None + if value in NEW_PROBLEM_ACTION_ITEM_DATA_ATTRIBUTES_STATUS_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_PROBLEM_ACTION_ITEM_DATA_ATTRIBUTES_STATUS_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_problem_action_item_data_type.py b/rootly_sdk/models/new_problem_action_item_data_type.py new file mode 100644 index 00000000..3aa258c4 --- /dev/null +++ b/rootly_sdk/models/new_problem_action_item_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +NewProblemActionItemDataType = Literal["problem_action_items"] + +NEW_PROBLEM_ACTION_ITEM_DATA_TYPE_VALUES: set[NewProblemActionItemDataType] = { + "problem_action_items", +} + + +def check_new_problem_action_item_data_type(value: str | None) -> NewProblemActionItemDataType | None: + if value is None: + return None + if value in NEW_PROBLEM_ACTION_ITEM_DATA_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_PROBLEM_ACTION_ITEM_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_problem_data.py b/rootly_sdk/models/new_problem_data.py new file mode 100644 index 00000000..96620179 --- /dev/null +++ b/rootly_sdk/models/new_problem_data.py @@ -0,0 +1,58 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.new_problem_data_type import NewProblemDataType, check_new_problem_data_type + +if TYPE_CHECKING: + from ..models.new_problem_data_attributes import NewProblemDataAttributes + + +T = TypeVar("T", bound="NewProblemData") + + +@_attrs_define +class NewProblemData: + """ + Attributes: + type_ (NewProblemDataType): + attributes (NewProblemDataAttributes): + """ + + type_: NewProblemDataType + attributes: NewProblemDataAttributes + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + + 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_problem_data_attributes import NewProblemDataAttributes + + d = dict(src_dict) + type_ = check_new_problem_data_type(d.pop("type")) + + attributes = NewProblemDataAttributes.from_dict(d.pop("attributes")) + + new_problem_data = cls( + type_=type_, + attributes=attributes, + ) + + return new_problem_data diff --git a/rootly_sdk/models/new_problem_data_attributes.py b/rootly_sdk/models/new_problem_data_attributes.py new file mode 100644 index 00000000..007bdc05 --- /dev/null +++ b/rootly_sdk/models/new_problem_data_attributes.py @@ -0,0 +1,380 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..models.new_problem_data_attributes_priority import ( + NewProblemDataAttributesPriority, + check_new_problem_data_attributes_priority, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.new_problem_data_attributes_form_field_selections_item import ( + NewProblemDataAttributesFormFieldSelectionsItem, + ) + + +T = TypeVar("T", bound="NewProblemDataAttributes") + + +@_attrs_define +class NewProblemDataAttributes: + """ + Attributes: + title (str): The title of the problem + description (None | str | Unset): The description of the problem + owner_user_id (int | None | Unset): ID of the user who owns the problem + owner_group_id (None | str | Unset): ID of the group (team) that owns the problem + priority (NewProblemDataAttributesPriority | Unset): The priority of the problem + due_date (datetime.date | None | Unset): The due date of the problem + scope (None | str | Unset): The scope of the problem + exit_criteria (None | str | Unset): The exit criteria of the problem + impact_so_far (None | str | Unset): The impact observed so far + root_cause (None | str | Unset): The root cause of the problem + resolution (None | str | Unset): The resolution of the problem + deferral_reason (None | str | Unset): The reason and accepted risk for deferring the problem + cancellation_reason (None | str | Unset): The reason for cancelling the problem + next_review_at (None | str | Unset): The next review date for a deferred problem + re_review_cadence (int | None | Unset): Days between reviews for a deferred problem + incident_ids (list[str] | Unset): IDs of incidents to link to the problem + form_field_selections (list[NewProblemDataAttributesFormFieldSelectionsItem] | Unset): Custom (form) field + selections for the problem + """ + + title: str + description: None | str | Unset = UNSET + owner_user_id: int | None | Unset = UNSET + owner_group_id: None | str | Unset = UNSET + priority: NewProblemDataAttributesPriority | Unset = UNSET + due_date: datetime.date | None | Unset = UNSET + scope: None | str | Unset = UNSET + exit_criteria: None | str | Unset = UNSET + impact_so_far: None | str | Unset = UNSET + root_cause: None | str | Unset = UNSET + resolution: None | str | Unset = UNSET + deferral_reason: None | str | Unset = UNSET + cancellation_reason: None | str | Unset = UNSET + next_review_at: None | str | Unset = UNSET + re_review_cadence: int | None | Unset = UNSET + incident_ids: list[str] | Unset = UNSET + form_field_selections: list[NewProblemDataAttributesFormFieldSelectionsItem] | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + title = self.title + + description: None | str | Unset + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + owner_user_id: int | None | Unset + if isinstance(self.owner_user_id, Unset): + owner_user_id = UNSET + else: + owner_user_id = self.owner_user_id + + owner_group_id: None | str | Unset + if isinstance(self.owner_group_id, Unset): + owner_group_id = UNSET + else: + owner_group_id = self.owner_group_id + + priority: str | Unset = UNSET + if not isinstance(self.priority, Unset): + priority = self.priority + + due_date: None | str | Unset + if isinstance(self.due_date, Unset): + due_date = UNSET + elif isinstance(self.due_date, datetime.date): + due_date = self.due_date.isoformat() + else: + due_date = self.due_date + + scope: None | str | Unset + if isinstance(self.scope, Unset): + scope = UNSET + else: + scope = self.scope + + exit_criteria: None | str | Unset + if isinstance(self.exit_criteria, Unset): + exit_criteria = UNSET + else: + exit_criteria = self.exit_criteria + + impact_so_far: None | str | Unset + if isinstance(self.impact_so_far, Unset): + impact_so_far = UNSET + else: + impact_so_far = self.impact_so_far + + root_cause: None | str | Unset + if isinstance(self.root_cause, Unset): + root_cause = UNSET + else: + root_cause = self.root_cause + + resolution: None | str | Unset + if isinstance(self.resolution, Unset): + resolution = UNSET + else: + resolution = self.resolution + + deferral_reason: None | str | Unset + if isinstance(self.deferral_reason, Unset): + deferral_reason = UNSET + else: + deferral_reason = self.deferral_reason + + cancellation_reason: None | str | Unset + if isinstance(self.cancellation_reason, Unset): + cancellation_reason = UNSET + else: + cancellation_reason = self.cancellation_reason + + next_review_at: None | str | Unset + if isinstance(self.next_review_at, Unset): + next_review_at = UNSET + else: + next_review_at = self.next_review_at + + re_review_cadence: int | None | Unset + if isinstance(self.re_review_cadence, Unset): + re_review_cadence = UNSET + else: + re_review_cadence = self.re_review_cadence + + incident_ids: list[str] | Unset = UNSET + if not isinstance(self.incident_ids, Unset): + incident_ids = self.incident_ids + + form_field_selections: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.form_field_selections, Unset): + form_field_selections = [] + for form_field_selections_item_data in self.form_field_selections: + form_field_selections_item = form_field_selections_item_data.to_dict() + form_field_selections.append(form_field_selections_item) + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "title": title, + } + ) + if description is not UNSET: + field_dict["description"] = description + if owner_user_id is not UNSET: + field_dict["owner_user_id"] = owner_user_id + if owner_group_id is not UNSET: + field_dict["owner_group_id"] = owner_group_id + if priority is not UNSET: + field_dict["priority"] = priority + if due_date is not UNSET: + field_dict["due_date"] = due_date + if scope is not UNSET: + field_dict["scope"] = scope + if exit_criteria is not UNSET: + field_dict["exit_criteria"] = exit_criteria + if impact_so_far is not UNSET: + field_dict["impact_so_far"] = impact_so_far + if root_cause is not UNSET: + field_dict["root_cause"] = root_cause + if resolution is not UNSET: + field_dict["resolution"] = resolution + if deferral_reason is not UNSET: + field_dict["deferral_reason"] = deferral_reason + if cancellation_reason is not UNSET: + field_dict["cancellation_reason"] = cancellation_reason + if next_review_at is not UNSET: + field_dict["next_review_at"] = next_review_at + if re_review_cadence is not UNSET: + field_dict["re_review_cadence"] = re_review_cadence + if incident_ids is not UNSET: + field_dict["incident_ids"] = incident_ids + if form_field_selections is not UNSET: + field_dict["form_field_selections"] = form_field_selections + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_problem_data_attributes_form_field_selections_item import ( + NewProblemDataAttributesFormFieldSelectionsItem, + ) + + d = dict(src_dict) + title = d.pop("title") + + def _parse_description(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_owner_user_id(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + owner_user_id = _parse_owner_user_id(d.pop("owner_user_id", UNSET)) + + def _parse_owner_group_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + owner_group_id = _parse_owner_group_id(d.pop("owner_group_id", UNSET)) + + _priority = d.pop("priority", UNSET) + priority: NewProblemDataAttributesPriority | Unset + if isinstance(_priority, Unset): + priority = UNSET + else: + priority = check_new_problem_data_attributes_priority(_priority) + + def _parse_due_date(data: object) -> datetime.date | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + due_date_type_0 = datetime.date.fromisoformat(data) + + return due_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None | Unset, data) + + due_date = _parse_due_date(d.pop("due_date", UNSET)) + + def _parse_scope(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + scope = _parse_scope(d.pop("scope", UNSET)) + + def _parse_exit_criteria(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + exit_criteria = _parse_exit_criteria(d.pop("exit_criteria", UNSET)) + + def _parse_impact_so_far(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + impact_so_far = _parse_impact_so_far(d.pop("impact_so_far", UNSET)) + + def _parse_root_cause(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + root_cause = _parse_root_cause(d.pop("root_cause", UNSET)) + + def _parse_resolution(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + resolution = _parse_resolution(d.pop("resolution", UNSET)) + + def _parse_deferral_reason(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + deferral_reason = _parse_deferral_reason(d.pop("deferral_reason", UNSET)) + + def _parse_cancellation_reason(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + cancellation_reason = _parse_cancellation_reason(d.pop("cancellation_reason", UNSET)) + + def _parse_next_review_at(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + next_review_at = _parse_next_review_at(d.pop("next_review_at", UNSET)) + + def _parse_re_review_cadence(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + re_review_cadence = _parse_re_review_cadence(d.pop("re_review_cadence", UNSET)) + + incident_ids = cast(list[str], d.pop("incident_ids", UNSET)) + + _form_field_selections = d.pop("form_field_selections", UNSET) + form_field_selections: list[NewProblemDataAttributesFormFieldSelectionsItem] | Unset = UNSET + if _form_field_selections is not UNSET: + form_field_selections = [] + for form_field_selections_item_data in _form_field_selections: + form_field_selections_item = NewProblemDataAttributesFormFieldSelectionsItem.from_dict( + form_field_selections_item_data + ) + + form_field_selections.append(form_field_selections_item) + + new_problem_data_attributes = cls( + title=title, + description=description, + owner_user_id=owner_user_id, + owner_group_id=owner_group_id, + priority=priority, + due_date=due_date, + scope=scope, + exit_criteria=exit_criteria, + impact_so_far=impact_so_far, + root_cause=root_cause, + resolution=resolution, + deferral_reason=deferral_reason, + cancellation_reason=cancellation_reason, + next_review_at=next_review_at, + re_review_cadence=re_review_cadence, + incident_ids=incident_ids, + form_field_selections=form_field_selections, + ) + + return new_problem_data_attributes diff --git a/rootly_sdk/models/new_problem_data_attributes_form_field_selections_item.py b/rootly_sdk/models/new_problem_data_attributes_form_field_selections_item.py new file mode 100644 index 00000000..59db44e7 --- /dev/null +++ b/rootly_sdk/models/new_problem_data_attributes_form_field_selections_item.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="NewProblemDataAttributesFormFieldSelectionsItem") + + +@_attrs_define +class NewProblemDataAttributesFormFieldSelectionsItem: + """ """ + + 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) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + new_problem_data_attributes_form_field_selections_item = cls() + + new_problem_data_attributes_form_field_selections_item.additional_properties = d + return new_problem_data_attributes_form_field_selections_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_problem_data_attributes_priority.py b/rootly_sdk/models/new_problem_data_attributes_priority.py new file mode 100644 index 00000000..b76c5bde --- /dev/null +++ b/rootly_sdk/models/new_problem_data_attributes_priority.py @@ -0,0 +1,18 @@ +from typing import Literal + +NewProblemDataAttributesPriority = Literal["P0", "P1", "P2", "P3"] + +NEW_PROBLEM_DATA_ATTRIBUTES_PRIORITY_VALUES: set[NewProblemDataAttributesPriority] = { + "P0", + "P1", + "P2", + "P3", +} + + +def check_new_problem_data_attributes_priority(value: str | None) -> NewProblemDataAttributesPriority | None: + if value is None: + return None + if value in NEW_PROBLEM_DATA_ATTRIBUTES_PRIORITY_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_PROBLEM_DATA_ATTRIBUTES_PRIORITY_VALUES!r}") diff --git a/rootly_sdk/models/new_problem_data_type.py b/rootly_sdk/models/new_problem_data_type.py new file mode 100644 index 00000000..cc4dcaa7 --- /dev/null +++ b/rootly_sdk/models/new_problem_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +NewProblemDataType = Literal["problems"] + +NEW_PROBLEM_DATA_TYPE_VALUES: set[NewProblemDataType] = { + "problems", +} + + +def check_new_problem_data_type(value: str | None) -> NewProblemDataType | None: + if value is None: + return None + if value in NEW_PROBLEM_DATA_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_PROBLEM_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_pulse.py b/rootly_sdk/models/new_pulse.py index 0d6e9db2..58947c24 100644 --- a/rootly_sdk/models/new_pulse.py +++ b/rootly_sdk/models/new_pulse.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_pulse_data import NewPulseData @@ -18,14 +19,13 @@ class NewPulse: data (NewPulseData): """ - data: "NewPulseData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewPulseData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_pulse.additional_properties = d return new_pulse - - @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_pulse_data.py b/rootly_sdk/models/new_pulse_data.py index 7d35da03..92d88edb 100644 --- a/rootly_sdk/models/new_pulse_data.py +++ b/rootly_sdk/models/new_pulse_data.py @@ -1,8 +1,9 @@ +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_pulse_data_type import NewPulseDataType, check_new_pulse_data_type @@ -22,8 +23,7 @@ class NewPulseData: """ type_: NewPulseDataType - attributes: "NewPulseDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewPulseDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_pulse_data.additional_properties = d return new_pulse_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_pulse_data_attributes.py b/rootly_sdk/models/new_pulse_data_attributes.py index b230c418..a7e63a21 100644 --- a/rootly_sdk/models/new_pulse_data_attributes.py +++ b/rootly_sdk/models/new_pulse_data_attributes.py @@ -1,9 +1,10 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define -from dateutil.parser import isoparse from ..types import UNSET, Unset @@ -21,27 +22,27 @@ class NewPulseDataAttributes: """ Attributes: summary (str): The summary of the pulse - 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 + 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 """ summary: str - 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 + 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 def to_dict(self) -> dict[str, Any]: from ..models.new_pulse_data_attributes_data_type_0 import NewPulseDataAttributesDataType0 @@ -50,13 +51,13 @@ def to_dict(self) -> dict[str, Any]: summary = self.summary - source: None | Unset | str + source: None | str | Unset if isinstance(self.source, Unset): source = UNSET else: source = self.source - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -65,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - environment_ids: None | Unset | list[str] + environment_ids: list[str] | None | Unset if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -74,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -82,7 +83,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | Unset | str + ended_at: None | str | Unset if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -90,35 +91,35 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - external_url: None | Unset | str + external_url: None | str | Unset if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - labels: Unset | list[None | dict[str, Any]] = UNSET + labels: list[dict[str, Any] | None] | Unset = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: None | dict[str, Any] + labels_item: dict[str, Any] | None if isinstance(labels_item_data, NewPulseDataAttributesLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - refs: Unset | list[None | dict[str, Any]] = UNSET + refs: list[dict[str, Any] | None] | Unset = UNSET if not isinstance(self.refs, Unset): refs = [] for refs_item_data in self.refs: - refs_item: None | dict[str, Any] + refs_item: dict[str, Any] | None if isinstance(refs_item_data, NewPulseDataAttributesRefsItemType0): refs_item = refs_item_data.to_dict() else: refs_item = refs_item_data refs.append(refs_item) - data: None | Unset | dict[str, Any] + data: dict[str, Any] | None | Unset if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, NewPulseDataAttributesDataType0): @@ -163,16 +164,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 | Unset | str: + def _parse_source(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) source = _parse_source(d.pop("source", UNSET)) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -183,13 +184,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_environment_ids(data: object) -> None | Unset | list[str]: + def _parse_environment_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -200,13 +201,13 @@ def _parse_environment_ids(data: object) -> None | Unset | list[str]: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_started_at(data: object) -> None | Unset | datetime.datetime: + def _parse_started_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -214,16 +215,16 @@ def _parse_started_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - started_at_type_0 = isoparse(data) + started_at_type_0 = datetime.datetime.fromisoformat(data) return started_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: + def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -231,67 +232,71 @@ def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - ended_at_type_0 = isoparse(data) + ended_at_type_0 = datetime.datetime.fromisoformat(data) return ended_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_external_url(data: object) -> None | Unset | str: + def _parse_external_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - labels = [] _labels = d.pop("labels", UNSET) - for labels_item_data in _labels or []: + labels: list[NewPulseDataAttributesLabelsItemType0 | None] | Unset = UNSET + if _labels is not UNSET: + labels = [] + for labels_item_data in _labels: - 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) + 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) - return labels_item_type_0 - except: # noqa: E722 - pass - return cast(Union["NewPulseDataAttributesLabelsItemType0", None], data) + return labels_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(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) - for refs_item_data in _refs or []: + refs: list[NewPulseDataAttributesRefsItemType0 | None] | Unset = UNSET + if _refs is not UNSET: + refs = [] + for refs_item_data in _refs: - 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) + 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) - return refs_item_type_0 - except: # noqa: E722 - pass - return cast(Union["NewPulseDataAttributesRefsItemType0", None], data) + return refs_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(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) -> Union["NewPulseDataAttributesDataType0", None, Unset]: + def _parse_data(data: object) -> NewPulseDataAttributesDataType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -302,9 +307,9 @@ def _parse_data(data: object) -> Union["NewPulseDataAttributesDataType0", None, data_type_0 = NewPulseDataAttributesDataType0.from_dict(data) return data_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["NewPulseDataAttributesDataType0", None, Unset], data) + return cast(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 cbb26d78..03734676 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 66fe8bd4..c0345017 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="NewPulseDataAttributesLabelsItemType0") @@ -17,7 +18,6 @@ class NewPulseDataAttributesLabelsItemType0: key: str value: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: key = self.key @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: value = self.value field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "key": key, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: value=value, ) - new_pulse_data_attributes_labels_item_type_0.additional_properties = d return new_pulse_data_attributes_labels_item_type_0 - - @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_pulse_data_attributes_refs_item_type_0.py b/rootly_sdk/models/new_pulse_data_attributes_refs_item_type_0.py index 100089af..ad056a17 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="NewPulseDataAttributesRefsItemType0") @@ -17,7 +18,6 @@ class NewPulseDataAttributesRefsItemType0: key: str value: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: key = self.key @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: value = self.value field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "key": key, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: value=value, ) - new_pulse_data_attributes_refs_item_type_0.additional_properties = d return new_pulse_data_attributes_refs_item_type_0 - - @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_pulse_data_type.py b/rootly_sdk/models/new_pulse_data_type.py index 8ed40026..d3738da0 100644 --- a/rootly_sdk/models/new_pulse_data_type.py +++ b/rootly_sdk/models/new_pulse_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewPulseDataType = Literal["pulses"] @@ -11,5 +11,5 @@ def check_new_pulse_data_type(value: str | None) -> NewPulseDataType | None: if value is None: return None if value in NEW_PULSE_DATA_TYPE_VALUES: - return cast(NewPulseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_PULSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_retrospective_process.py b/rootly_sdk/models/new_retrospective_process.py index b24711b4..44109a56 100644 --- a/rootly_sdk/models/new_retrospective_process.py +++ b/rootly_sdk/models/new_retrospective_process.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_retrospective_process_data import NewRetrospectiveProcessData @@ -18,14 +19,13 @@ class NewRetrospectiveProcess: data (NewRetrospectiveProcessData): """ - data: "NewRetrospectiveProcessData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewRetrospectiveProcessData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_retrospective_process.additional_properties = d return new_retrospective_process - - @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_retrospective_process_data.py b/rootly_sdk/models/new_retrospective_process_data.py index d6925f7d..9f287888 100644 --- a/rootly_sdk/models/new_retrospective_process_data.py +++ b/rootly_sdk/models/new_retrospective_process_data.py @@ -1,8 +1,9 @@ +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_retrospective_process_data_type import ( NewRetrospectiveProcessDataType, @@ -25,8 +26,7 @@ class NewRetrospectiveProcessData: """ type_: NewRetrospectiveProcessDataType - attributes: "NewRetrospectiveProcessDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewRetrospectiveProcessDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_retrospective_process_data.additional_properties = d return new_retrospective_process_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_retrospective_process_data_attributes.py b/rootly_sdk/models/new_retrospective_process_data_attributes.py index b8865f21..49bfd3bf 100644 --- a/rootly_sdk/models/new_retrospective_process_data_attributes.py +++ b/rootly_sdk/models/new_retrospective_process_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -27,22 +29,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 (Union[None, Unset, str]): The description of the retrospective process + description (None | str | Unset): The description of the retrospective process retrospective_process_matching_criteria - (Union['NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0', - 'NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1', - 'NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2', Unset]): + (NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0 | + NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1 | + NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2 | Unset): """ name: str copy_from: str - description: None | Unset | str = UNSET - retrospective_process_matching_criteria: Union[ - "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0", - "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1", - "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2", - Unset, - ] = UNSET + description: None | str | Unset = UNSET + retrospective_process_matching_criteria: ( + 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 ( @@ -56,13 +58,13 @@ def to_dict(self) -> dict[str, Any]: copy_from = self.copy_from - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - retrospective_process_matching_criteria: Unset | dict[str, Any] + retrospective_process_matching_criteria: dict[str, Any] | Unset if isinstance(self.retrospective_process_matching_criteria, Unset): retrospective_process_matching_criteria = UNSET elif isinstance( @@ -110,23 +112,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) def _parse_retrospective_process_matching_criteria( data: object, - ) -> Union[ - "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0", - "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1", - "NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2", - Unset, - ]: + ) -> ( + NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0 + | NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1 + | NewRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2 + | Unset + ): if isinstance(data, Unset): return data try: @@ -137,7 +139,7 @@ def _parse_retrospective_process_matching_criteria( ) return retrospective_process_matching_criteria_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -147,7 +149,7 @@ def _parse_retrospective_process_matching_criteria( ) return retrospective_process_matching_criteria_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): 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 e4a84e85..bb07129a 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,3 +1,5 @@ +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 98eba687..452c2da5 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,3 +1,5 @@ +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 1a35d6a4..5645b537 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,3 +1,5 @@ +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_type.py b/rootly_sdk/models/new_retrospective_process_data_type.py index a2c5675e..aeebc465 100644 --- a/rootly_sdk/models/new_retrospective_process_data_type.py +++ b/rootly_sdk/models/new_retrospective_process_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRetrospectiveProcessDataType = Literal["retrospective_processes"] @@ -11,5 +11,5 @@ def check_new_retrospective_process_data_type(value: str | None) -> NewRetrospec if value is None: return None if value in NEW_RETROSPECTIVE_PROCESS_DATA_TYPE_VALUES: - return cast(NewRetrospectiveProcessDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_RETROSPECTIVE_PROCESS_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_retrospective_process_group.py b/rootly_sdk/models/new_retrospective_process_group.py index 6aa11d4a..5c4158f0 100644 --- a/rootly_sdk/models/new_retrospective_process_group.py +++ b/rootly_sdk/models/new_retrospective_process_group.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_retrospective_process_group_data import NewRetrospectiveProcessGroupData @@ -18,14 +19,13 @@ class NewRetrospectiveProcessGroup: data (NewRetrospectiveProcessGroupData): """ - data: "NewRetrospectiveProcessGroupData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewRetrospectiveProcessGroupData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_retrospective_process_group.additional_properties = d return new_retrospective_process_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_retrospective_process_group_data.py b/rootly_sdk/models/new_retrospective_process_group_data.py index 25dcfe6d..9a24e1ae 100644 --- a/rootly_sdk/models/new_retrospective_process_group_data.py +++ b/rootly_sdk/models/new_retrospective_process_group_data.py @@ -1,8 +1,9 @@ +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_retrospective_process_group_data_type import ( NewRetrospectiveProcessGroupDataType, @@ -25,8 +26,7 @@ class NewRetrospectiveProcessGroupData: """ type_: NewRetrospectiveProcessGroupDataType - attributes: "NewRetrospectiveProcessGroupDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewRetrospectiveProcessGroupDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_retrospective_process_group_data.additional_properties = d return new_retrospective_process_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_retrospective_process_group_data_attributes.py b/rootly_sdk/models/new_retrospective_process_group_data_attributes.py index 151d9a3e..a9d822d9 100644 --- a/rootly_sdk/models/new_retrospective_process_group_data_attributes.py +++ b/rootly_sdk/models/new_retrospective_process_group_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,11 +15,11 @@ class NewRetrospectiveProcessGroupDataAttributes: """ Attributes: sub_status_id (str): - position (Union[Unset, int]): + position (int | Unset): """ sub_status_id: str - position: Unset | int = UNSET + position: int | Unset = 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_data_type.py b/rootly_sdk/models/new_retrospective_process_group_data_type.py index 7fd20073..4ad5ebf4 100644 --- a/rootly_sdk/models/new_retrospective_process_group_data_type.py +++ b/rootly_sdk/models/new_retrospective_process_group_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRetrospectiveProcessGroupDataType = Literal["retrospective_process_groups"] @@ -11,5 +11,5 @@ def check_new_retrospective_process_group_data_type(value: str | None) -> NewRet if value is None: return None if value in NEW_RETROSPECTIVE_PROCESS_GROUP_DATA_TYPE_VALUES: - return cast(NewRetrospectiveProcessGroupDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_RETROSPECTIVE_PROCESS_GROUP_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_retrospective_process_group_step.py b/rootly_sdk/models/new_retrospective_process_group_step.py index 7ab02994..fa4f3d29 100644 --- a/rootly_sdk/models/new_retrospective_process_group_step.py +++ b/rootly_sdk/models/new_retrospective_process_group_step.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_retrospective_process_group_step_data import NewRetrospectiveProcessGroupStepData @@ -18,14 +19,13 @@ class NewRetrospectiveProcessGroupStep: data (NewRetrospectiveProcessGroupStepData): """ - data: "NewRetrospectiveProcessGroupStepData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewRetrospectiveProcessGroupStepData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_retrospective_process_group_step.additional_properties = d return new_retrospective_process_group_step - - @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_retrospective_process_group_step_data.py b/rootly_sdk/models/new_retrospective_process_group_step_data.py index ca566165..01bb01a0 100644 --- a/rootly_sdk/models/new_retrospective_process_group_step_data.py +++ b/rootly_sdk/models/new_retrospective_process_group_step_data.py @@ -1,8 +1,9 @@ +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_retrospective_process_group_step_data_type import ( NewRetrospectiveProcessGroupStepDataType, @@ -27,8 +28,7 @@ class NewRetrospectiveProcessGroupStepData: """ type_: NewRetrospectiveProcessGroupStepDataType - attributes: "NewRetrospectiveProcessGroupStepDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewRetrospectiveProcessGroupStepDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -62,21 +62,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_retrospective_process_group_step_data.additional_properties = d return new_retrospective_process_group_step_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_retrospective_process_group_step_data_attributes.py b/rootly_sdk/models/new_retrospective_process_group_step_data_attributes.py index c25b7f09..5374e922 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,11 +15,11 @@ class NewRetrospectiveProcessGroupStepDataAttributes: """ Attributes: retrospective_step_id (str): - position (Union[Unset, int]): + position (int | Unset): """ retrospective_step_id: str - position: Unset | int = UNSET + position: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: retrospective_step_id = self.retrospective_step_id diff --git a/rootly_sdk/models/new_retrospective_process_group_step_data_type.py b/rootly_sdk/models/new_retrospective_process_group_step_data_type.py index 8a054bb6..4ccc8b73 100644 --- a/rootly_sdk/models/new_retrospective_process_group_step_data_type.py +++ b/rootly_sdk/models/new_retrospective_process_group_step_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRetrospectiveProcessGroupStepDataType = Literal["retrospective_process_group_steps"] @@ -13,7 +13,7 @@ def check_new_retrospective_process_group_step_data_type( if value is None: return None if value in NEW_RETROSPECTIVE_PROCESS_GROUP_STEP_DATA_TYPE_VALUES: - return cast(NewRetrospectiveProcessGroupStepDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_RETROSPECTIVE_PROCESS_GROUP_STEP_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_retrospective_step.py b/rootly_sdk/models/new_retrospective_step.py index af77e064..c1023f51 100644 --- a/rootly_sdk/models/new_retrospective_step.py +++ b/rootly_sdk/models/new_retrospective_step.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_retrospective_step_data import NewRetrospectiveStepData @@ -18,14 +19,13 @@ class NewRetrospectiveStep: data (NewRetrospectiveStepData): """ - data: "NewRetrospectiveStepData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewRetrospectiveStepData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_retrospective_step.additional_properties = d return new_retrospective_step - - @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_retrospective_step_data.py b/rootly_sdk/models/new_retrospective_step_data.py index d15c1567..642b408f 100644 --- a/rootly_sdk/models/new_retrospective_step_data.py +++ b/rootly_sdk/models/new_retrospective_step_data.py @@ -1,8 +1,9 @@ +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_retrospective_step_data_type import ( NewRetrospectiveStepDataType, @@ -25,8 +26,7 @@ class NewRetrospectiveStepData: """ type_: NewRetrospectiveStepDataType - attributes: "NewRetrospectiveStepDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewRetrospectiveStepDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_retrospective_step_data.additional_properties = d return new_retrospective_step_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_retrospective_step_data_attributes.py b/rootly_sdk/models/new_retrospective_step_data_attributes.py index 7a87c57d..418c789c 100644 --- a/rootly_sdk/models/new_retrospective_step_data_attributes.py +++ b/rootly_sdk/models/new_retrospective_step_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,52 +15,52 @@ class NewRetrospectiveStepDataAttributes: """ Attributes: title (str): The name of the step - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `title`; any submitted value is ignored. This + slug (None | str | Unset): 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? + 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? """ title: str - 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 + slug: None | str | Unset = UNSET + 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 def to_dict(self) -> dict[str, Any]: title = self.title - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - due_after_days: None | Unset | int + due_after_days: int | None | Unset if isinstance(self.due_after_days, Unset): due_after_days = UNSET else: due_after_days = self.due_after_days - incident_role_id: None | Unset | str + incident_role_id: None | str | Unset if isinstance(self.incident_role_id, Unset): incident_role_id = UNSET else: incident_role_id = self.incident_role_id - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -93,48 +95,48 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) title = d.pop("title") - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_due_after_days(data: object) -> None | Unset | int: + def _parse_due_after_days(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) due_after_days = _parse_due_after_days(d.pop("due_after_days", UNSET)) - def _parse_incident_role_id(data: object) -> None | Unset | str: + def _parse_incident_role_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) incident_role_id = _parse_incident_role_id(d.pop("incident_role_id", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_retrospective_step_data_type.py b/rootly_sdk/models/new_retrospective_step_data_type.py index 9945c8f2..c51f3503 100644 --- a/rootly_sdk/models/new_retrospective_step_data_type.py +++ b/rootly_sdk/models/new_retrospective_step_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRetrospectiveStepDataType = Literal["retrospective_steps"] @@ -11,5 +11,5 @@ def check_new_retrospective_step_data_type(value: str | None) -> NewRetrospectiv if value is None: return None if value in NEW_RETROSPECTIVE_STEP_DATA_TYPE_VALUES: - return cast(NewRetrospectiveStepDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_RETROSPECTIVE_STEP_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_role.py b/rootly_sdk/models/new_role.py index d8bedece..168c18f2 100644 --- a/rootly_sdk/models/new_role.py +++ b/rootly_sdk/models/new_role.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_role_data import NewRoleData @@ -18,14 +19,13 @@ class NewRole: data (NewRoleData): """ - data: "NewRoleData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewRoleData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_role.additional_properties = d return new_role - - @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_role_data.py b/rootly_sdk/models/new_role_data.py index 69f3ba5f..f3262054 100644 --- a/rootly_sdk/models/new_role_data.py +++ b/rootly_sdk/models/new_role_data.py @@ -1,8 +1,9 @@ +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_role_data_type import NewRoleDataType, check_new_role_data_type @@ -22,8 +23,7 @@ class NewRoleData: """ type_: NewRoleDataType - attributes: "NewRoleDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewRoleDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_role_data.additional_properties = d return new_role_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_role_data_attributes.py b/rootly_sdk/models/new_role_data_attributes.py index 748e90ff..6ac74f6e 100644 --- a/rootly_sdk/models/new_role_data_attributes.py +++ b/rootly_sdk/models/new_role_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -87,6 +89,10 @@ NewRoleDataAttributesPlaybooksPermissionsItem, check_new_role_data_attributes_playbooks_permissions_item, ) +from ..models.new_role_data_attributes_private_agent_permissions_item import ( + NewRoleDataAttributesPrivateAgentPermissionsItem, + check_new_role_data_attributes_private_agent_permissions_item, +) from ..models.new_role_data_attributes_private_incidents_permissions_item import ( NewRoleDataAttributesPrivateIncidentsPermissionsItem, check_new_role_data_attributes_private_incidents_permissions_item, @@ -119,6 +125,10 @@ NewRoleDataAttributesSlasPermissionsItem, check_new_role_data_attributes_slas_permissions_item, ) +from ..models.new_role_data_attributes_status_page_updates_permissions_type_0_item import ( + NewRoleDataAttributesStatusPageUpdatesPermissionsType0Item, + check_new_role_data_attributes_status_page_updates_permissions_type_0_item, +) from ..models.new_role_data_attributes_status_pages_permissions_item import ( NewRoleDataAttributesStatusPagesPermissionsItem, check_new_role_data_attributes_status_pages_permissions_item, @@ -145,323 +155,351 @@ class NewRoleDataAttributes: """ Attributes: name (str): The role name. - 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 + slug (None | str | Unset): 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]]): + 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): + status_page_updates_permissions (list[NewRoleDataAttributesStatusPageUpdatesPermissionsType0Item] | None | + 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): + private_agent_permissions (list[NewRoleDataAttributesPrivateAgentPermissionsItem] | Unset): Private Agent + management permissions: create issues enrollment tokens, read views agent inventory and details, and delete + revokes agent credentials. Create and delete can be used independently through the API; browser inventory + requires read. + slas_permissions (list[NewRoleDataAttributesSlasPermissionsItem] | Unset): + paging_permissions (list[NewRoleDataAttributesPagingPermissionsItem] | Unset): + incident_communication_permissions (list[NewRoleDataAttributesIncidentCommunicationPermissionsItem] | Unset): + communication_permissions (list[NewRoleDataAttributesCommunicationPermissionsItem] | Unset): """ name: str - 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 + slug: None | str | Unset = UNSET + 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 + status_page_updates_permissions: list[NewRoleDataAttributesStatusPageUpdatesPermissionsType0Item] | None | 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 + private_agent_permissions: list[NewRoleDataAttributesPrivateAgentPermissionsItem] | 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 def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - incident_permission_set_id: None | Unset | str + incident_permission_set_id: None | str | Unset 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: Unset | list[str] = UNSET + alerts_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + api_keys_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + audits_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + billing_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + environments_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + form_fields_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + functionalities_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + groups_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + incident_causes_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + incident_feedbacks_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + incident_roles_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + incident_types_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + incidents_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + integrations_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + invitations_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + playbooks_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + private_incidents_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + pulses_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + retrospective_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + roles_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + secrets_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + services_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + severities_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + status_pages_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + status_page_updates_permissions: list[str] | None | Unset + if isinstance(self.status_page_updates_permissions, Unset): + status_page_updates_permissions = UNSET + elif isinstance(self.status_page_updates_permissions, list): + status_page_updates_permissions = [] + for status_page_updates_permissions_type_0_item_data in self.status_page_updates_permissions: + status_page_updates_permissions_type_0_item: str = status_page_updates_permissions_type_0_item_data + status_page_updates_permissions.append(status_page_updates_permissions_type_0_item) + + else: + status_page_updates_permissions = self.status_page_updates_permissions + + webhooks_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + workflows_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + catalogs_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + sub_statuses_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + edge_connector_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + private_agent_permissions: list[str] | Unset = UNSET + if not isinstance(self.private_agent_permissions, Unset): + private_agent_permissions = [] + for private_agent_permissions_item_data in self.private_agent_permissions: + private_agent_permissions_item: str = private_agent_permissions_item_data + private_agent_permissions.append(private_agent_permissions_item) + + slas_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + paging_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + incident_communication_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + communication_permissions: list[str] | Unset = UNSET if not isinstance(self.communication_permissions, Unset): communication_permissions = [] for communication_permissions_item_data in self.communication_permissions: @@ -527,6 +565,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["severities_permissions"] = severities_permissions if status_pages_permissions is not UNSET: field_dict["status_pages_permissions"] = status_pages_permissions + if status_page_updates_permissions is not UNSET: + field_dict["status_page_updates_permissions"] = status_page_updates_permissions if webhooks_permissions is not UNSET: field_dict["webhooks_permissions"] = webhooks_permissions if workflows_permissions is not UNSET: @@ -537,6 +577,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["sub_statuses_permissions"] = sub_statuses_permissions if edge_connector_permissions is not UNSET: field_dict["edge_connector_permissions"] = edge_connector_permissions + if private_agent_permissions is not UNSET: + field_dict["private_agent_permissions"] = private_agent_permissions if slas_permissions is not UNSET: field_dict["slas_permissions"] = slas_permissions if paging_permissions is not UNSET: @@ -553,318 +595,431 @@ 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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_incident_permission_set_id(data: object) -> None | Unset | str: + def _parse_incident_permission_set_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) - 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: 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 + ) - alerts_permissions.append(alerts_permissions_item) + alerts_permissions.append(alerts_permissions_item) - api_keys_permissions = [] _api_keys_permissions = d.pop("api_keys_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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 + ) - audits_permissions.append(audits_permissions_item) + audits_permissions.append(audits_permissions_item) - billing_permissions = [] _billing_permissions = d.pop("billing_permissions", UNSET) - 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: 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 + ) - billing_permissions.append(billing_permissions_item) + billing_permissions.append(billing_permissions_item) - environments_permissions = [] _environments_permissions = d.pop("environments_permissions", UNSET) - 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: 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 + ) - environments_permissions.append(environments_permissions_item) + environments_permissions.append(environments_permissions_item) - form_fields_permissions = [] _form_fields_permissions = d.pop("form_fields_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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 + ) - functionalities_permissions.append(functionalities_permissions_item) + functionalities_permissions.append(functionalities_permissions_item) - groups_permissions = [] _groups_permissions = d.pop("groups_permissions", UNSET) - 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: 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 + ) - groups_permissions.append(groups_permissions_item) + groups_permissions.append(groups_permissions_item) - incident_causes_permissions = [] _incident_causes_permissions = d.pop("incident_causes_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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 + ) + ) - 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) - 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: 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 + ) - 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) - 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: 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 + ) - 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) - 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: 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 + ) - incidents_permissions.append(incidents_permissions_item) + incidents_permissions.append(incidents_permissions_item) - integrations_permissions = [] _integrations_permissions = d.pop("integrations_permissions", UNSET) - 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: 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 + ) - integrations_permissions.append(integrations_permissions_item) + integrations_permissions.append(integrations_permissions_item) - invitations_permissions = [] _invitations_permissions = d.pop("invitations_permissions", UNSET) - 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: 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 + ) - invitations_permissions.append(invitations_permissions_item) + invitations_permissions.append(invitations_permissions_item) - playbooks_permissions = [] _playbooks_permissions = d.pop("playbooks_permissions", UNSET) - 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: 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 + ) - playbooks_permissions.append(playbooks_permissions_item) + playbooks_permissions.append(playbooks_permissions_item) - private_incidents_permissions = [] _private_incidents_permissions = d.pop("private_incidents_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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 + ) - pulses_permissions.append(pulses_permissions_item) + pulses_permissions.append(pulses_permissions_item) - retrospective_permissions = [] _retrospective_permissions = d.pop("retrospective_permissions", UNSET) - 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: 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 + ) - retrospective_permissions.append(retrospective_permissions_item) + retrospective_permissions.append(retrospective_permissions_item) - roles_permissions = [] _roles_permissions = d.pop("roles_permissions", UNSET) - 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: 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 + ) - roles_permissions.append(roles_permissions_item) + roles_permissions.append(roles_permissions_item) - secrets_permissions = [] _secrets_permissions = d.pop("secrets_permissions", UNSET) - 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: 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 + ) - secrets_permissions.append(secrets_permissions_item) + secrets_permissions.append(secrets_permissions_item) - services_permissions = [] _services_permissions = d.pop("services_permissions", UNSET) - 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: 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 + ) - services_permissions.append(services_permissions_item) + services_permissions.append(services_permissions_item) - severities_permissions = [] _severities_permissions = d.pop("severities_permissions", UNSET) - 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: 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 + ) - severities_permissions.append(severities_permissions_item) + severities_permissions.append(severities_permissions_item) - status_pages_permissions = [] _status_pages_permissions = d.pop("status_pages_permissions", UNSET) - 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: 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 + ) + + status_pages_permissions.append(status_pages_permissions_item) - status_pages_permissions.append(status_pages_permissions_item) + def _parse_status_page_updates_permissions( + data: object, + ) -> list[NewRoleDataAttributesStatusPageUpdatesPermissionsType0Item] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + status_page_updates_permissions_type_0 = [] + _status_page_updates_permissions_type_0 = data + for status_page_updates_permissions_type_0_item_data in _status_page_updates_permissions_type_0: + status_page_updates_permissions_type_0_item = ( + check_new_role_data_attributes_status_page_updates_permissions_type_0_item( + status_page_updates_permissions_type_0_item_data + ) + ) + + status_page_updates_permissions_type_0.append(status_page_updates_permissions_type_0_item) + + return status_page_updates_permissions_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[NewRoleDataAttributesStatusPageUpdatesPermissionsType0Item] | None | Unset, data) + + status_page_updates_permissions = _parse_status_page_updates_permissions( + d.pop("status_page_updates_permissions", UNSET) + ) - webhooks_permissions = [] _webhooks_permissions = d.pop("webhooks_permissions", UNSET) - 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: 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 + ) - webhooks_permissions.append(webhooks_permissions_item) + webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions = [] _workflows_permissions = d.pop("workflows_permissions", UNSET) - 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: 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 + ) - workflows_permissions.append(workflows_permissions_item) + workflows_permissions.append(workflows_permissions_item) - catalogs_permissions = [] _catalogs_permissions = d.pop("catalogs_permissions", UNSET) - 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: 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 + ) - catalogs_permissions.append(catalogs_permissions_item) + catalogs_permissions.append(catalogs_permissions_item) - sub_statuses_permissions = [] _sub_statuses_permissions = d.pop("sub_statuses_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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 + ) + + edge_connector_permissions.append(edge_connector_permissions_item) + + _private_agent_permissions = d.pop("private_agent_permissions", UNSET) + private_agent_permissions: list[NewRoleDataAttributesPrivateAgentPermissionsItem] | Unset = UNSET + if _private_agent_permissions is not UNSET: + private_agent_permissions = [] + for private_agent_permissions_item_data in _private_agent_permissions: + private_agent_permissions_item = check_new_role_data_attributes_private_agent_permissions_item( + private_agent_permissions_item_data + ) - edge_connector_permissions.append(edge_connector_permissions_item) + private_agent_permissions.append(private_agent_permissions_item) - slas_permissions = [] _slas_permissions = d.pop("slas_permissions", UNSET) - 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: 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) - slas_permissions.append(slas_permissions_item) + slas_permissions.append(slas_permissions_item) - paging_permissions = [] _paging_permissions = d.pop("paging_permissions", UNSET) - 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: 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 + ) - paging_permissions.append(paging_permissions_item) + paging_permissions.append(paging_permissions_item) - incident_communication_permissions = [] _incident_communication_permissions = d.pop("incident_communication_permissions", UNSET) - 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: 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 + ) ) - ) - 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) - 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: 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 + ) - communication_permissions.append(communication_permissions_item) + communication_permissions.append(communication_permissions_item) new_role_data_attributes = cls( name=name, @@ -894,11 +1049,13 @@ def _parse_incident_permission_set_id(data: object) -> None | Unset | str: services_permissions=services_permissions, severities_permissions=severities_permissions, status_pages_permissions=status_pages_permissions, + status_page_updates_permissions=status_page_updates_permissions, webhooks_permissions=webhooks_permissions, workflows_permissions=workflows_permissions, catalogs_permissions=catalogs_permissions, sub_statuses_permissions=sub_statuses_permissions, edge_connector_permissions=edge_connector_permissions, + private_agent_permissions=private_agent_permissions, slas_permissions=slas_permissions, paging_permissions=paging_permissions, incident_communication_permissions=incident_communication_permissions, diff --git a/rootly_sdk/models/new_role_data_attributes_alerts_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_alerts_permissions_item.py index 9cff4321..4d789269 100644 --- a/rootly_sdk/models/new_role_data_attributes_alerts_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_alerts_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesAlertsPermissionsItem = Literal["create", "read"] @@ -14,7 +14,7 @@ def check_new_role_data_attributes_alerts_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_ALERTS_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesAlertsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_ALERTS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_api_keys_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_api_keys_permissions_item.py index 905a0a9e..cfdb84f7 100644 --- a/rootly_sdk/models/new_role_data_attributes_api_keys_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_api_keys_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesApiKeysPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_api_keys_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_API_KEYS_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesApiKeysPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_API_KEYS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_audits_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_audits_permissions_item.py index 1b423ae0..7bca5824 100644 --- a/rootly_sdk/models/new_role_data_attributes_audits_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_audits_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesAuditsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_audits_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_AUDITS_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesAuditsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_AUDITS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_billing_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_billing_permissions_item.py index aafbd6ab..18bf4194 100644 --- a/rootly_sdk/models/new_role_data_attributes_billing_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_billing_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesBillingPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_billing_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_BILLING_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesBillingPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_BILLING_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_catalogs_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_catalogs_permissions_item.py index e2faa29a..3387b22f 100644 --- a/rootly_sdk/models/new_role_data_attributes_catalogs_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_catalogs_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesCatalogsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_catalogs_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_CATALOGS_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesCatalogsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_CATALOGS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_communication_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_communication_permissions_item.py index a6c8b3b5..c4ab8e01 100644 --- a/rootly_sdk/models/new_role_data_attributes_communication_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_communication_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesCommunicationPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_role_data_attributes_communication_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_COMMUNICATION_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesCommunicationPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_COMMUNICATION_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_edge_connector_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_edge_connector_permissions_item.py index b97f8ad6..9923083c 100644 --- a/rootly_sdk/models/new_role_data_attributes_edge_connector_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_edge_connector_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesEdgeConnectorPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_role_data_attributes_edge_connector_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_EDGE_CONNECTOR_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesEdgeConnectorPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_EDGE_CONNECTOR_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_environments_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_environments_permissions_item.py index 8b11d3a4..73c2ed67 100644 --- a/rootly_sdk/models/new_role_data_attributes_environments_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_environments_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesEnvironmentsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_environments_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_ENVIRONMENTS_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesEnvironmentsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_ENVIRONMENTS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_form_fields_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_form_fields_permissions_item.py index 8035445a..df872ecb 100644 --- a/rootly_sdk/models/new_role_data_attributes_form_fields_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_form_fields_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesFormFieldsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_form_fields_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_FORM_FIELDS_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesFormFieldsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_FORM_FIELDS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_functionalities_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_functionalities_permissions_item.py index 0310411b..4e6386e3 100644 --- a/rootly_sdk/models/new_role_data_attributes_functionalities_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_functionalities_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesFunctionalitiesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_role_data_attributes_functionalities_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_FUNCTIONALITIES_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesFunctionalitiesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_FUNCTIONALITIES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_groups_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_groups_permissions_item.py index f9ae8658..1a15c4b2 100644 --- a/rootly_sdk/models/new_role_data_attributes_groups_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_groups_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesGroupsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_groups_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_GROUPS_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesGroupsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_GROUPS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_incident_causes_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_incident_causes_permissions_item.py index c14b21c0..27a43d48 100644 --- a/rootly_sdk/models/new_role_data_attributes_incident_causes_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_incident_causes_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesIncidentCausesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_role_data_attributes_incident_causes_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_INCIDENT_CAUSES_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesIncidentCausesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_INCIDENT_CAUSES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_incident_communication_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_incident_communication_permissions_item.py index 2225ec35..5f627723 100644 --- a/rootly_sdk/models/new_role_data_attributes_incident_communication_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_incident_communication_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesIncidentCommunicationPermissionsItem = Literal["create", "delete", "read", "send", "update"] @@ -19,7 +19,7 @@ def check_new_role_data_attributes_incident_communication_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_INCIDENT_COMMUNICATION_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesIncidentCommunicationPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_INCIDENT_COMMUNICATION_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_incident_feedbacks_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_incident_feedbacks_permissions_item.py index dfdaf7ab..7db3a313 100644 --- a/rootly_sdk/models/new_role_data_attributes_incident_feedbacks_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_incident_feedbacks_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesIncidentFeedbacksPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_role_data_attributes_incident_feedbacks_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_INCIDENT_FEEDBACKS_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesIncidentFeedbacksPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_INCIDENT_FEEDBACKS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_incident_roles_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_incident_roles_permissions_item.py index 02547b04..f5bb2ffa 100644 --- a/rootly_sdk/models/new_role_data_attributes_incident_roles_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_incident_roles_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesIncidentRolesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_role_data_attributes_incident_roles_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_INCIDENT_ROLES_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesIncidentRolesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_INCIDENT_ROLES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_incident_types_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_incident_types_permissions_item.py index 4f4d5b1a..f2376b16 100644 --- a/rootly_sdk/models/new_role_data_attributes_incident_types_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_incident_types_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesIncidentTypesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_role_data_attributes_incident_types_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_INCIDENT_TYPES_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesIncidentTypesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_INCIDENT_TYPES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_incidents_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_incidents_permissions_item.py index 04a57f56..5bee06b4 100644 --- a/rootly_sdk/models/new_role_data_attributes_incidents_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_incidents_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesIncidentsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_incidents_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_INCIDENTS_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesIncidentsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_INCIDENTS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_integrations_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_integrations_permissions_item.py index f23d5aab..c6ef364c 100644 --- a/rootly_sdk/models/new_role_data_attributes_integrations_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_integrations_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesIntegrationsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_integrations_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_INTEGRATIONS_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesIntegrationsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_INTEGRATIONS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_invitations_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_invitations_permissions_item.py index 971fd2ae..dc7510bb 100644 --- a/rootly_sdk/models/new_role_data_attributes_invitations_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_invitations_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesInvitationsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_invitations_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_INVITATIONS_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesInvitationsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_INVITATIONS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_paging_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_paging_permissions_item.py index e0cd334c..207a0fbf 100644 --- a/rootly_sdk/models/new_role_data_attributes_paging_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_paging_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesPagingPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_paging_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_PAGING_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesPagingPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_PAGING_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_playbooks_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_playbooks_permissions_item.py index 12cebc02..bc0e8baa 100644 --- a/rootly_sdk/models/new_role_data_attributes_playbooks_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_playbooks_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesPlaybooksPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_playbooks_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_PLAYBOOKS_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesPlaybooksPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_PLAYBOOKS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_private_agent_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_private_agent_permissions_item.py new file mode 100644 index 00000000..c27aba44 --- /dev/null +++ b/rootly_sdk/models/new_role_data_attributes_private_agent_permissions_item.py @@ -0,0 +1,24 @@ +from typing import Literal + +NewRoleDataAttributesPrivateAgentPermissionsItem = Literal["create", "delete", "read", "update"] + +NEW_ROLE_DATA_ATTRIBUTES_PRIVATE_AGENT_PERMISSIONS_ITEM_VALUES: set[ + NewRoleDataAttributesPrivateAgentPermissionsItem +] = { + "create", + "delete", + "read", + "update", +} + + +def check_new_role_data_attributes_private_agent_permissions_item( + value: str | None, +) -> NewRoleDataAttributesPrivateAgentPermissionsItem | None: + if value is None: + return None + if value in NEW_ROLE_DATA_ATTRIBUTES_PRIVATE_AGENT_PERMISSIONS_ITEM_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_PRIVATE_AGENT_PERMISSIONS_ITEM_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_role_data_attributes_private_incidents_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_private_incidents_permissions_item.py index 285571c8..8028d382 100644 --- a/rootly_sdk/models/new_role_data_attributes_private_incidents_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_private_incidents_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesPrivateIncidentsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_role_data_attributes_private_incidents_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_PRIVATE_INCIDENTS_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesPrivateIncidentsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_PRIVATE_INCIDENTS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_pulses_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_pulses_permissions_item.py index c8c48d11..c761370e 100644 --- a/rootly_sdk/models/new_role_data_attributes_pulses_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_pulses_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesPulsesPermissionsItem = Literal["create", "read", "update"] @@ -15,7 +15,7 @@ def check_new_role_data_attributes_pulses_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_PULSES_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesPulsesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_PULSES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_retrospective_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_retrospective_permissions_item.py index 5be7d20f..ab94e35e 100644 --- a/rootly_sdk/models/new_role_data_attributes_retrospective_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_retrospective_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesRetrospectivePermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_new_role_data_attributes_retrospective_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_RETROSPECTIVE_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesRetrospectivePermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_RETROSPECTIVE_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_roles_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_roles_permissions_item.py index e9fd9f39..78352f42 100644 --- a/rootly_sdk/models/new_role_data_attributes_roles_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_roles_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesRolesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_roles_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_ROLES_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesRolesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_ROLES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_secrets_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_secrets_permissions_item.py index 4c82616a..98472b94 100644 --- a/rootly_sdk/models/new_role_data_attributes_secrets_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_secrets_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesSecretsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_secrets_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_SECRETS_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesSecretsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_SECRETS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_services_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_services_permissions_item.py index a454ea43..2b268e98 100644 --- a/rootly_sdk/models/new_role_data_attributes_services_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_services_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesServicesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_services_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_SERVICES_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesServicesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_SERVICES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_severities_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_severities_permissions_item.py index f03c900e..e9af2fc1 100644 --- a/rootly_sdk/models/new_role_data_attributes_severities_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_severities_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesSeveritiesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_severities_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_SEVERITIES_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesSeveritiesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_SEVERITIES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_slas_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_slas_permissions_item.py index e29e24b4..c505f7e6 100644 --- a/rootly_sdk/models/new_role_data_attributes_slas_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_slas_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesSlasPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_slas_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_SLAS_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesSlasPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_SLAS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_status_page_updates_permissions_type_0_item.py b/rootly_sdk/models/new_role_data_attributes_status_page_updates_permissions_type_0_item.py new file mode 100644 index 00000000..98631f49 --- /dev/null +++ b/rootly_sdk/models/new_role_data_attributes_status_page_updates_permissions_type_0_item.py @@ -0,0 +1,24 @@ +from typing import Literal + +NewRoleDataAttributesStatusPageUpdatesPermissionsType0Item = Literal["create", "delete", "read", "update"] + +NEW_ROLE_DATA_ATTRIBUTES_STATUS_PAGE_UPDATES_PERMISSIONS_TYPE_0_ITEM_VALUES: set[ + NewRoleDataAttributesStatusPageUpdatesPermissionsType0Item +] = { + "create", + "delete", + "read", + "update", +} + + +def check_new_role_data_attributes_status_page_updates_permissions_type_0_item( + value: str | None, +) -> NewRoleDataAttributesStatusPageUpdatesPermissionsType0Item | None: + if value is None: + return None + if value in NEW_ROLE_DATA_ATTRIBUTES_STATUS_PAGE_UPDATES_PERMISSIONS_TYPE_0_ITEM_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_STATUS_PAGE_UPDATES_PERMISSIONS_TYPE_0_ITEM_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_role_data_attributes_status_pages_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_status_pages_permissions_item.py index 8ece1e57..cd5735aa 100644 --- a/rootly_sdk/models/new_role_data_attributes_status_pages_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_status_pages_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesStatusPagesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_status_pages_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_STATUS_PAGES_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesStatusPagesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_STATUS_PAGES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_sub_statuses_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_sub_statuses_permissions_item.py index f044fd89..4c81d2d4 100644 --- a/rootly_sdk/models/new_role_data_attributes_sub_statuses_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_sub_statuses_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesSubStatusesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_sub_statuses_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_SUB_STATUSES_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesSubStatusesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_SUB_STATUSES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_webhooks_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_webhooks_permissions_item.py index 3926917f..321ecfc5 100644 --- a/rootly_sdk/models/new_role_data_attributes_webhooks_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_webhooks_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesWebhooksPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_webhooks_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_WEBHOOKS_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesWebhooksPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_WEBHOOKS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_attributes_workflows_permissions_item.py b/rootly_sdk/models/new_role_data_attributes_workflows_permissions_item.py index 361770dc..153db6c1 100644 --- a/rootly_sdk/models/new_role_data_attributes_workflows_permissions_item.py +++ b/rootly_sdk/models/new_role_data_attributes_workflows_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataAttributesWorkflowsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_new_role_data_attributes_workflows_permissions_item( if value is None: return None if value in NEW_ROLE_DATA_ATTRIBUTES_WORKFLOWS_PERMISSIONS_ITEM_VALUES: - return cast(NewRoleDataAttributesWorkflowsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_ATTRIBUTES_WORKFLOWS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_role_data_type.py b/rootly_sdk/models/new_role_data_type.py index 3b5a9998..14967216 100644 --- a/rootly_sdk/models/new_role_data_type.py +++ b/rootly_sdk/models/new_role_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewRoleDataType = Literal["roles"] @@ -11,5 +11,5 @@ def check_new_role_data_type(value: str | None) -> NewRoleDataType | None: if value is None: return None if value in NEW_ROLE_DATA_TYPE_VALUES: - return cast(NewRoleDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_ROLE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_schedule.py b/rootly_sdk/models/new_schedule.py index 27b30e61..16da2c0a 100644 --- a/rootly_sdk/models/new_schedule.py +++ b/rootly_sdk/models/new_schedule.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_schedule_data import NewScheduleData @@ -18,14 +19,13 @@ class NewSchedule: data (NewScheduleData): """ - data: "NewScheduleData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewScheduleData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_schedule.additional_properties = d return new_schedule - - @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_schedule_data.py b/rootly_sdk/models/new_schedule_data.py index 099fc2e5..447f4b55 100644 --- a/rootly_sdk/models/new_schedule_data.py +++ b/rootly_sdk/models/new_schedule_data.py @@ -1,8 +1,9 @@ +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_schedule_data_type import NewScheduleDataType, check_new_schedule_data_type @@ -22,8 +23,7 @@ class NewScheduleData: """ type_: NewScheduleDataType - attributes: "NewScheduleDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewScheduleDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_schedule_data.additional_properties = d return new_schedule_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_schedule_data_attributes.py b/rootly_sdk/models/new_schedule_data_attributes.py index 99d05545..a767a4b7 100644 --- a/rootly_sdk/models/new_schedule_data_attributes.py +++ b/rootly_sdk/models/new_schedule_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -10,6 +12,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.new_schedule_data_attributes_business_hours_type_0 import NewScheduleDataAttributesBusinessHoursType0 from ..models.new_schedule_data_attributes_slack_channel_type_0 import NewScheduleDataAttributesSlackChannelType0 from ..models.new_schedule_data_attributes_slack_user_group import NewScheduleDataAttributesSlackUserGroup @@ -23,45 +26,54 @@ class NewScheduleDataAttributes: Attributes: name (str): The name of the schedule owner_user_id (int): ID of the owner 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, 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 + description (None | str | Unset): The description of the schedule + all_time_coverage (bool | None | Unset): 24/7 coverage of the schedule + time_zone (None | str | Unset): IANA time zone the schedule's rotations are rendered in. Only writable for + organizations configured with one timezone per schedule; otherwise it is derived from the rotations. + 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 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[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. + 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. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_report_enabled (Union[None, Unset, bool]): Whether the weekly shift summary report is enabled. Requires + shift_report_enabled (bool | None | Unset): 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 (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 + 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 + business_hours (NewScheduleDataAttributesBusinessHoursType0 | None | Unset): Controls shadow paging on the + schedule. Null disables shadow paging. start_time and end_time are HH:MM 24-hour format strings. """ name: str owner_user_id: int - 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 + description: None | str | Unset = UNSET + all_time_coverage: bool | None | Unset = UNSET + time_zone: None | str | 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 + business_hours: NewScheduleDataAttributesBusinessHoursType0 | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: + from ..models.new_schedule_data_attributes_business_hours_type_0 import ( + NewScheduleDataAttributesBusinessHoursType0, + ) from ..models.new_schedule_data_attributes_slack_channel_type_0 import ( NewScheduleDataAttributesSlackChannelType0, ) @@ -70,23 +82,29 @@ def to_dict(self) -> dict[str, Any]: owner_user_id = self.owner_user_id - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - all_time_coverage: None | Unset | bool + all_time_coverage: bool | None | Unset if isinstance(self.all_time_coverage, Unset): all_time_coverage = UNSET else: all_time_coverage = self.all_time_coverage - slack_user_group: Unset | dict[str, Any] = UNSET + time_zone: None | str | Unset + if isinstance(self.time_zone, Unset): + time_zone = UNSET + else: + time_zone = self.time_zone + + slack_user_group: dict[str, Any] | Unset = UNSET if not isinstance(self.slack_user_group, Unset): slack_user_group = self.slack_user_group.to_dict() - slack_channel: None | Unset | dict[str, Any] + slack_channel: dict[str, Any] | None | Unset if isinstance(self.slack_channel, Unset): slack_channel = UNSET elif isinstance(self.slack_channel, NewScheduleDataAttributesSlackChannelType0): @@ -94,56 +112,64 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel = self.slack_channel - owner_group_ids: Unset | list[str] = UNSET + owner_group_ids: list[str] | Unset = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - sync_linear_enabled: None | Unset | bool + sync_linear_enabled: bool | None | Unset if isinstance(self.sync_linear_enabled, Unset): sync_linear_enabled = UNSET else: sync_linear_enabled = self.sync_linear_enabled - include_shadows_in_slack_notifications: None | Unset | bool + include_shadows_in_slack_notifications: bool | None | Unset 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: None | Unset | bool + shift_start_notifications_enabled: bool | None | Unset 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: None | Unset | bool + shift_update_notifications_enabled: bool | None | Unset 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: None | Unset | bool + shift_report_enabled: bool | None | Unset if isinstance(self.shift_report_enabled, Unset): shift_report_enabled = UNSET else: shift_report_enabled = self.shift_report_enabled - shift_report_day_of_week: Unset | str = UNSET + shift_report_day_of_week: str | Unset = 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 | Unset | str + shift_report_time_of_day: None | str | Unset 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 | Unset | str + shift_report_time_zone: None | str | Unset if isinstance(self.shift_report_time_zone, Unset): shift_report_time_zone = UNSET else: shift_report_time_zone = self.shift_report_time_zone + business_hours: dict[str, Any] | None | Unset + if isinstance(self.business_hours, Unset): + business_hours = UNSET + elif isinstance(self.business_hours, NewScheduleDataAttributesBusinessHoursType0): + business_hours = self.business_hours.to_dict() + else: + business_hours = self.business_hours + field_dict: dict[str, Any] = {} field_dict.update( @@ -156,6 +182,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if all_time_coverage is not UNSET: field_dict["all_time_coverage"] = all_time_coverage + if time_zone is not UNSET: + field_dict["time_zone"] = time_zone if slack_user_group is not UNSET: field_dict["slack_user_group"] = slack_user_group if slack_channel is not UNSET: @@ -178,11 +206,16 @@ def to_dict(self) -> dict[str, Any]: field_dict["shift_report_time_of_day"] = shift_report_time_of_day if shift_report_time_zone is not UNSET: field_dict["shift_report_time_zone"] = shift_report_time_zone + if business_hours is not UNSET: + field_dict["business_hours"] = business_hours return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.new_schedule_data_attributes_business_hours_type_0 import ( + NewScheduleDataAttributesBusinessHoursType0, + ) from ..models.new_schedule_data_attributes_slack_channel_type_0 import ( NewScheduleDataAttributesSlackChannelType0, ) @@ -193,32 +226,41 @@ 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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_all_time_coverage(data: object) -> None | Unset | bool: + def _parse_all_time_coverage(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) all_time_coverage = _parse_all_time_coverage(d.pop("all_time_coverage", UNSET)) + def _parse_time_zone(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) + _slack_user_group = d.pop("slack_user_group", UNSET) - slack_user_group: Unset | NewScheduleDataAttributesSlackUserGroup + slack_user_group: NewScheduleDataAttributesSlackUserGroup | Unset 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) -> Union["NewScheduleDataAttributesSlackChannelType0", None, Unset]: + def _parse_slack_channel(data: object) -> NewScheduleDataAttributesSlackChannelType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -229,67 +271,67 @@ def _parse_slack_channel(data: object) -> Union["NewScheduleDataAttributesSlackC slack_channel_type_0 = NewScheduleDataAttributesSlackChannelType0.from_dict(data) return slack_channel_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["NewScheduleDataAttributesSlackChannelType0", None, Unset], data) + return cast(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) -> None | Unset | bool: + def _parse_sync_linear_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) sync_linear_enabled = _parse_sync_linear_enabled(d.pop("sync_linear_enabled", UNSET)) - def _parse_include_shadows_in_slack_notifications(data: object) -> None | Unset | bool: + def _parse_include_shadows_in_slack_notifications(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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) -> None | Unset | bool: + def _parse_shift_start_notifications_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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) -> None | Unset | bool: + def _parse_shift_update_notifications_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) shift_update_notifications_enabled = _parse_shift_update_notifications_enabled( d.pop("shift_update_notifications_enabled", UNSET) ) - def _parse_shift_report_enabled(data: object) -> None | Unset | bool: + def _parse_shift_report_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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: Unset | NewScheduleDataAttributesShiftReportDayOfWeek + shift_report_day_of_week: NewScheduleDataAttributesShiftReportDayOfWeek | Unset if isinstance(_shift_report_day_of_week, Unset): shift_report_day_of_week = UNSET else: @@ -297,29 +339,47 @@ def _parse_shift_report_enabled(data: object) -> None | Unset | bool: _shift_report_day_of_week ) - def _parse_shift_report_time_of_day(data: object) -> None | Unset | str: + def _parse_shift_report_time_of_day(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_shift_report_time_zone(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) shift_report_time_zone = _parse_shift_report_time_zone(d.pop("shift_report_time_zone", UNSET)) + def _parse_business_hours(data: object) -> NewScheduleDataAttributesBusinessHoursType0 | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + business_hours_type_0 = NewScheduleDataAttributesBusinessHoursType0.from_dict(data) + + return business_hours_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(NewScheduleDataAttributesBusinessHoursType0 | None | Unset, data) + + business_hours = _parse_business_hours(d.pop("business_hours", UNSET)) + new_schedule_data_attributes = cls( name=name, owner_user_id=owner_user_id, description=description, all_time_coverage=all_time_coverage, + time_zone=time_zone, slack_user_group=slack_user_group, slack_channel=slack_channel, owner_group_ids=owner_group_ids, @@ -331,6 +391,7 @@ def _parse_shift_report_time_zone(data: object) -> None | Unset | str: shift_report_day_of_week=shift_report_day_of_week, shift_report_time_of_day=shift_report_time_of_day, shift_report_time_zone=shift_report_time_zone, + business_hours=business_hours, ) return new_schedule_data_attributes diff --git a/rootly_sdk/models/new_schedule_data_attributes_business_hours_type_0.py b/rootly_sdk/models/new_schedule_data_attributes_business_hours_type_0.py new file mode 100644 index 00000000..a9ab95f4 --- /dev/null +++ b/rootly_sdk/models/new_schedule_data_attributes_business_hours_type_0.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="NewScheduleDataAttributesBusinessHoursType0") + + +@_attrs_define +class NewScheduleDataAttributesBusinessHoursType0: + """Controls shadow paging on the schedule. Null disables shadow paging. start_time and end_time are HH:MM 24-hour + format strings. + + Attributes: + start_time (str): + end_time (str): + include_weekends (bool): + """ + + start_time: str + end_time: str + include_weekends: bool + + def to_dict(self) -> dict[str, Any]: + start_time = self.start_time + + end_time = self.end_time + + include_weekends = self.include_weekends + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "start_time": start_time, + "end_time": end_time, + "include_weekends": include_weekends, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + start_time = d.pop("start_time") + + end_time = d.pop("end_time") + + include_weekends = d.pop("include_weekends") + + new_schedule_data_attributes_business_hours_type_0 = cls( + start_time=start_time, + end_time=end_time, + include_weekends=include_weekends, + ) + + return new_schedule_data_attributes_business_hours_type_0 diff --git a/rootly_sdk/models/new_schedule_data_attributes_shift_report_day_of_week.py b/rootly_sdk/models/new_schedule_data_attributes_shift_report_day_of_week.py index 06bc44a2..624354c5 100644 --- a/rootly_sdk/models/new_schedule_data_attributes_shift_report_day_of_week.py +++ b/rootly_sdk/models/new_schedule_data_attributes_shift_report_day_of_week.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewScheduleDataAttributesShiftReportDayOfWeek = Literal[ "friday", "monday", "saturday", "sunday", "thursday", "tuesday", "wednesday" @@ -21,7 +21,7 @@ def check_new_schedule_data_attributes_shift_report_day_of_week( if value is None: return None if value in NEW_SCHEDULE_DATA_ATTRIBUTES_SHIFT_REPORT_DAY_OF_WEEK_VALUES: - return cast(NewScheduleDataAttributesShiftReportDayOfWeek, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SCHEDULE_DATA_ATTRIBUTES_SHIFT_REPORT_DAY_OF_WEEK_VALUES!r}" ) 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 88d154f3..bdfee21a 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,8 +1,9 @@ +from __future__ import annotations + 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 @@ -13,13 +14,12 @@ class NewScheduleDataAttributesSlackChannelType0: """ Attributes: - id (Union[Unset, str]): Slack channel ID - name (Union[Unset, str]): Slack channel name + id (str | Unset): Slack channel ID + name (str | Unset): Slack channel name """ - id: Unset | str = UNSET - name: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + id: str | Unset = UNSET + name: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: id = self.id @@ -27,7 +27,7 @@ def to_dict(self) -> dict[str, Any]: 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 @@ -48,21 +48,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - new_schedule_data_attributes_slack_channel_type_0.additional_properties = d return new_schedule_data_attributes_slack_channel_type_0 - - @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_schedule_data_attributes_slack_user_group.py b/rootly_sdk/models/new_schedule_data_attributes_slack_user_group.py index cf79f8e0..d03686d0 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,8 +1,9 @@ +from __future__ import annotations + 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 @@ -13,13 +14,12 @@ class NewScheduleDataAttributesSlackUserGroup: """ Attributes: - id (Union[Unset, str]): Slack user group ID - name (Union[Unset, str]): Slack user group name + id (str | Unset): Slack user group ID + name (str | Unset): Slack user group name """ - id: Unset | str = UNSET - name: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + id: str | Unset = UNSET + name: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: id = self.id @@ -27,7 +27,7 @@ def to_dict(self) -> dict[str, Any]: 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 @@ -48,21 +48,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - new_schedule_data_attributes_slack_user_group.additional_properties = d return new_schedule_data_attributes_slack_user_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_schedule_data_type.py b/rootly_sdk/models/new_schedule_data_type.py index 918dff2b..861a6a4c 100644 --- a/rootly_sdk/models/new_schedule_data_type.py +++ b/rootly_sdk/models/new_schedule_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewScheduleDataType = Literal["schedules"] @@ -11,5 +11,5 @@ def check_new_schedule_data_type(value: str | None) -> NewScheduleDataType | Non if value is None: return None if value in NEW_SCHEDULE_DATA_TYPE_VALUES: - return cast(NewScheduleDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_SCHEDULE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_schedule_rotation.py b/rootly_sdk/models/new_schedule_rotation.py index 307e1325..619dc66f 100644 --- a/rootly_sdk/models/new_schedule_rotation.py +++ b/rootly_sdk/models/new_schedule_rotation.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_schedule_rotation_data import NewScheduleRotationData @@ -18,14 +19,13 @@ class NewScheduleRotation: data (NewScheduleRotationData): """ - data: "NewScheduleRotationData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewScheduleRotationData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_schedule_rotation.additional_properties = d return new_schedule_rotation - - @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_schedule_rotation_active_day.py b/rootly_sdk/models/new_schedule_rotation_active_day.py index d6df5007..16768ed7 100644 --- a/rootly_sdk/models/new_schedule_rotation_active_day.py +++ b/rootly_sdk/models/new_schedule_rotation_active_day.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_schedule_rotation_active_day_data import NewScheduleRotationActiveDayData @@ -18,14 +19,13 @@ class NewScheduleRotationActiveDay: data (NewScheduleRotationActiveDayData): """ - data: "NewScheduleRotationActiveDayData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewScheduleRotationActiveDayData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_schedule_rotation_active_day.additional_properties = d return new_schedule_rotation_active_day - - @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_schedule_rotation_active_day_data.py b/rootly_sdk/models/new_schedule_rotation_active_day_data.py index 1d357cf3..46bef780 100644 --- a/rootly_sdk/models/new_schedule_rotation_active_day_data.py +++ b/rootly_sdk/models/new_schedule_rotation_active_day_data.py @@ -1,8 +1,9 @@ +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_schedule_rotation_active_day_data_type import ( NewScheduleRotationActiveDayDataType, @@ -25,8 +26,7 @@ class NewScheduleRotationActiveDayData: """ type_: NewScheduleRotationActiveDayDataType - attributes: "NewScheduleRotationActiveDayDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewScheduleRotationActiveDayDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_schedule_rotation_active_day_data.additional_properties = d return new_schedule_rotation_active_day_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_schedule_rotation_active_day_data_attributes.py b/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes.py index 80542d68..d8ce7dc3 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,12 +25,12 @@ 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 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 b99cbf6b..b870879f 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,8 +1,9 @@ +from __future__ import annotations + 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 @@ -13,13 +14,12 @@ class NewScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem: """ Attributes: - 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): Start time for schedule rotation active time + end_time (str | Unset): End time for schedule rotation active time """ - start_time: Unset | str = UNSET - end_time: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + start_time: str | Unset = UNSET + end_time: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: start_time = self.start_time @@ -27,7 +27,7 @@ def to_dict(self) -> dict[str, Any]: end_time = self.end_time field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if start_time is not UNSET: field_dict["start_time"] = start_time @@ -48,21 +48,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: end_time=end_time, ) - new_schedule_rotation_active_day_data_attributes_active_time_attributes_item.additional_properties = d return new_schedule_rotation_active_day_data_attributes_active_time_attributes_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_schedule_rotation_active_day_data_attributes_day_name.py b/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes_day_name.py index fb595cff..beaeb2a7 100644 --- a/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes_day_name.py +++ b/rootly_sdk/models/new_schedule_rotation_active_day_data_attributes_day_name.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewScheduleRotationActiveDayDataAttributesDayName = Literal["F", "M", "R", "S", "T", "U", "W"] @@ -21,7 +21,7 @@ def check_new_schedule_rotation_active_day_data_attributes_day_name( if value is None: return None if value in NEW_SCHEDULE_ROTATION_ACTIVE_DAY_DATA_ATTRIBUTES_DAY_NAME_VALUES: - return cast(NewScheduleRotationActiveDayDataAttributesDayName, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SCHEDULE_ROTATION_ACTIVE_DAY_DATA_ATTRIBUTES_DAY_NAME_VALUES!r}" ) diff --git a/rootly_sdk/models/new_schedule_rotation_active_day_data_type.py b/rootly_sdk/models/new_schedule_rotation_active_day_data_type.py index 24faac7a..2e6057cd 100644 --- a/rootly_sdk/models/new_schedule_rotation_active_day_data_type.py +++ b/rootly_sdk/models/new_schedule_rotation_active_day_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewScheduleRotationActiveDayDataType = Literal["schedule_rotation_active_days"] @@ -11,7 +11,7 @@ def check_new_schedule_rotation_active_day_data_type(value: str | None) -> NewSc if value is None: return None if value in NEW_SCHEDULE_ROTATION_ACTIVE_DAY_DATA_TYPE_VALUES: - return cast(NewScheduleRotationActiveDayDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SCHEDULE_ROTATION_ACTIVE_DAY_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_schedule_rotation_data.py b/rootly_sdk/models/new_schedule_rotation_data.py index e505b64a..faf2840d 100644 --- a/rootly_sdk/models/new_schedule_rotation_data.py +++ b/rootly_sdk/models/new_schedule_rotation_data.py @@ -1,8 +1,9 @@ +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_schedule_rotation_data_type import NewScheduleRotationDataType, check_new_schedule_rotation_data_type @@ -22,8 +23,7 @@ class NewScheduleRotationData: """ type_: NewScheduleRotationDataType - attributes: "NewScheduleRotationDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewScheduleRotationDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_schedule_rotation_data.additional_properties = d return new_schedule_rotation_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_schedule_rotation_data_attributes.py b/rootly_sdk/models/new_schedule_rotation_data_attributes.py index 726f5b1a..9988bb46 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes.py @@ -1,9 +1,10 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define -from dateutil.parser import isoparse from ..models.new_schedule_rotation_data_attributes_active_days_item import ( NewScheduleRotationDataAttributesActiveDaysItem, @@ -45,44 +46,44 @@ class NewScheduleRotationDataAttributes: Attributes: name (str): The name of the schedule rotation schedule_rotationable_type (NewScheduleRotationDataAttributesScheduleRotationableType): Schedule rotation type - 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 + 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. Organizations with one timezone per schedule manage this + on the schedule; a value differing from the schedule's is rejected. Default: 'Etc/UTC'. + start_time (datetime.datetime | None | Unset): RFC3339 date-time when rotation starts. Shifts will only be created after this time. - 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 + 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 """ name: str schedule_rotationable_type: NewScheduleRotationDataAttributesScheduleRotationableType - 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_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_rotation_members: ( - None | Unset | list["NewScheduleRotationDataAttributesScheduleRotationMembersType0Item"] + list[NewScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | Unset ) = UNSET def to_dict(self) -> dict[str, Any]: @@ -120,7 +121,7 @@ def to_dict(self) -> dict[str, Any]: active_all_week = self.active_all_week - active_days: Unset | list[str] = UNSET + active_days: list[str] | Unset = UNSET if not isinstance(self.active_days, Unset): active_days = [] for active_days_item_data in self.active_days: @@ -129,7 +130,7 @@ def to_dict(self) -> dict[str, Any]: active_time_type = self.active_time_type - active_time_attributes: Unset | list[dict[str, Any]] = UNSET + active_time_attributes: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.active_time_attributes, Unset): active_time_attributes = [] for active_time_attributes_item_data in self.active_time_attributes: @@ -138,7 +139,7 @@ def to_dict(self) -> dict[str, Any]: time_zone = self.time_zone - start_time: None | Unset | str + start_time: None | str | Unset if isinstance(self.start_time, Unset): start_time = UNSET elif isinstance(self.start_time, datetime.datetime): @@ -146,7 +147,7 @@ def to_dict(self) -> dict[str, Any]: else: start_time = self.start_time - end_time: None | Unset | str + end_time: None | str | Unset if isinstance(self.end_time, Unset): end_time = UNSET elif isinstance(self.end_time, datetime.datetime): @@ -154,7 +155,7 @@ def to_dict(self) -> dict[str, Any]: else: end_time = self.end_time - schedule_rotation_members: None | Unset | list[dict[str, Any]] + schedule_rotation_members: list[dict[str, Any]] | None | Unset if isinstance(self.schedule_rotation_members, Unset): schedule_rotation_members = UNSET elif isinstance(self.schedule_rotation_members, list): @@ -226,12 +227,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_schedule_rotationable_attributes( data: object, - ) -> Union[ - "NewScheduleRotationDataAttributesScheduleRotationableAttributesType0", - "NewScheduleRotationDataAttributesScheduleRotationableAttributesType1", - "NewScheduleRotationDataAttributesScheduleRotationableAttributesType2", - "NewScheduleRotationDataAttributesScheduleRotationableAttributesType3", - ]: + ) -> ( + NewScheduleRotationDataAttributesScheduleRotationableAttributesType0 + | NewScheduleRotationDataAttributesScheduleRotationableAttributesType1 + | NewScheduleRotationDataAttributesScheduleRotationableAttributesType2 + | NewScheduleRotationDataAttributesScheduleRotationableAttributesType3 + ): try: if not isinstance(data, dict): raise TypeError() @@ -240,7 +241,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -250,7 +251,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -260,7 +261,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_2 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -278,27 +279,31 @@ def _parse_schedule_rotationable_attributes( active_all_week = d.pop("active_all_week", UNSET) - active_days = [] _active_days = d.pop("active_days", UNSET) - 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: 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) - 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) - 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: 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 + ) - 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) -> None | Unset | datetime.datetime: + def _parse_start_time(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -306,16 +311,16 @@ def _parse_start_time(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - start_time_type_0 = isoparse(data) + start_time_type_0 = datetime.datetime.fromisoformat(data) return start_time_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> None | Unset | datetime.datetime: + def _parse_end_time(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -323,18 +328,18 @@ def _parse_end_time(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - end_time_type_0 = isoparse(data) + end_time_type_0 = datetime.datetime.fromisoformat(data) return end_time_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) end_time = _parse_end_time(d.pop("end_time", UNSET)) def _parse_schedule_rotation_members( data: object, - ) -> None | Unset | list["NewScheduleRotationDataAttributesScheduleRotationMembersType0Item"]: + ) -> list[NewScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -354,9 +359,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["NewScheduleRotationDataAttributesScheduleRotationMembersType0Item"], data) + return cast(list[NewScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | Unset, 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_days_item.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_active_days_item.py index 07d480d5..49beb3bd 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_active_days_item.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_active_days_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewScheduleRotationDataAttributesActiveDaysItem = Literal["F", "M", "R", "S", "T", "U", "W"] @@ -19,7 +19,7 @@ def check_new_schedule_rotation_data_attributes_active_days_item( if value is None: return None if value in NEW_SCHEDULE_ROTATION_DATA_ATTRIBUTES_ACTIVE_DAYS_ITEM_VALUES: - return cast(NewScheduleRotationDataAttributesActiveDaysItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SCHEDULE_ROTATION_DATA_ATTRIBUTES_ACTIVE_DAYS_ITEM_VALUES!r}" ) 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 537d6cc7..f28b0d38 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="NewScheduleRotationDataAttributesActiveTimeAttributesItem") @@ -17,7 +18,6 @@ class NewScheduleRotationDataAttributesActiveTimeAttributesItem: start_time: str end_time: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: start_time = self.start_time @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: end_time = self.end_time field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "start_time": start_time, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: end_time=end_time, ) - new_schedule_rotation_data_attributes_active_time_attributes_item.additional_properties = d return new_schedule_rotation_data_attributes_active_time_attributes_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_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 7d563c07..52d86155 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,8 +1,9 @@ +from __future__ import annotations + 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.new_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item_member_type import ( NewScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType, @@ -19,13 +20,12 @@ class NewScheduleRotationDataAttributesScheduleRotationMembersType0Item: Attributes: member_type (NewScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType): Type of member member_id (str): ID of the member - position (Union[Unset, int]): Position of the member in rotation + position (int | Unset): Position of the member in rotation """ member_type: NewScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType member_id: str - position: Unset | int = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + position: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: member_type: str = self.member_type @@ -35,7 +35,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "member_type": member_type, @@ -64,21 +64,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position=position, ) - new_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.additional_properties = d return new_schedule_rotation_data_attributes_schedule_rotation_members_type_0_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_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item_member_type.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item_member_type.py index 7ab30762..2542f451 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item_member_type.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item_member_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType = Literal["Schedule", "User"] @@ -16,7 +16,7 @@ def check_new_schedule_rotation_data_attributes_schedule_rotation_members_type_0 if value is None: return None if value in NEW_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATION_MEMBERS_TYPE_0_ITEM_MEMBER_TYPE_VALUES: - return cast(NewScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATION_MEMBERS_TYPE_0_ITEM_MEMBER_TYPE_VALUES!r}" ) 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 eefc9fec..449f524c 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,3 +1,5 @@ +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 072117a6..e9acdcbb 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,3 +1,5 @@ +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_handoff_day.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1_handoff_day.py index f28c4684..9371c111 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1_handoff_day.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1_handoff_day.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewScheduleRotationDataAttributesScheduleRotationableAttributesType1HandoffDay = Literal[ "F", "M", "R", "S", "T", "U", "W" @@ -23,7 +23,7 @@ def check_new_schedule_rotation_data_attributes_schedule_rotationable_attributes if value is None: return None if value in NEW_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATIONABLE_ATTRIBUTES_TYPE_1_HANDOFF_DAY_VALUES: - return cast(NewScheduleRotationDataAttributesScheduleRotationableAttributesType1HandoffDay, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATIONABLE_ATTRIBUTES_TYPE_1_HANDOFF_DAY_VALUES!r}" ) 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 a360a993..138831b9 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,3 +1,5 @@ +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_handoff_day.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2_handoff_day.py index 1e0f1d65..e48f1d0c 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2_handoff_day.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2_handoff_day.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewScheduleRotationDataAttributesScheduleRotationableAttributesType2HandoffDay = Literal[ "first_day_of_month", "last_day_of_month" @@ -18,7 +18,7 @@ def check_new_schedule_rotation_data_attributes_schedule_rotationable_attributes if value is None: return None if value in NEW_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATIONABLE_ATTRIBUTES_TYPE_2_HANDOFF_DAY_VALUES: - return cast(NewScheduleRotationDataAttributesScheduleRotationableAttributesType2HandoffDay, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATIONABLE_ATTRIBUTES_TYPE_2_HANDOFF_DAY_VALUES!r}" ) 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 3aeaa7eb..2f076f7f 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,3 +1,5 @@ +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_shift_length_unit.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3_shift_length_unit.py index b623d0e1..c84ef25e 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3_shift_length_unit.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3_shift_length_unit.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewScheduleRotationDataAttributesScheduleRotationableAttributesType3ShiftLengthUnit = Literal["days", "hours", "weeks"] @@ -17,7 +17,7 @@ def check_new_schedule_rotation_data_attributes_schedule_rotationable_attributes if value is None: return None if value in NEW_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATIONABLE_ATTRIBUTES_TYPE_3_SHIFT_LENGTH_UNIT_VALUES: - return cast(NewScheduleRotationDataAttributesScheduleRotationableAttributesType3ShiftLengthUnit, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATIONABLE_ATTRIBUTES_TYPE_3_SHIFT_LENGTH_UNIT_VALUES!r}" ) diff --git a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_type.py b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_type.py index fc1c939b..89892d0e 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_type.py +++ b/rootly_sdk/models/new_schedule_rotation_data_attributes_schedule_rotationable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewScheduleRotationDataAttributesScheduleRotationableType = Literal[ "ScheduleBiweeklyRotation", @@ -25,7 +25,7 @@ def check_new_schedule_rotation_data_attributes_schedule_rotationable_type( if value is None: return None if value in NEW_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATIONABLE_TYPE_VALUES: - return cast(NewScheduleRotationDataAttributesScheduleRotationableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATIONABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_schedule_rotation_data_type.py b/rootly_sdk/models/new_schedule_rotation_data_type.py index b2b2e667..79e84774 100644 --- a/rootly_sdk/models/new_schedule_rotation_data_type.py +++ b/rootly_sdk/models/new_schedule_rotation_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewScheduleRotationDataType = Literal["schedule_rotations"] @@ -11,5 +11,5 @@ def check_new_schedule_rotation_data_type(value: str | None) -> NewScheduleRotat if value is None: return None if value in NEW_SCHEDULE_ROTATION_DATA_TYPE_VALUES: - return cast(NewScheduleRotationDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_SCHEDULE_ROTATION_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_schedule_rotation_user.py b/rootly_sdk/models/new_schedule_rotation_user.py index 70c1f040..27709fee 100644 --- a/rootly_sdk/models/new_schedule_rotation_user.py +++ b/rootly_sdk/models/new_schedule_rotation_user.py @@ -1,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -17,19 +18,18 @@ class NewScheduleRotationUser: """ Attributes: - data (Union[Unset, NewScheduleRotationUserData]): + data (NewScheduleRotationUserData | Unset): """ - data: Union[Unset, "NewScheduleRotationUserData"] = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewScheduleRotationUserData | Unset = UNSET def to_dict(self) -> dict[str, Any]: - data: Unset | dict[str, Any] = UNSET + data: dict[str, Any] | Unset = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if data is not UNSET: field_dict["data"] = data @@ -42,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: Unset | NewScheduleRotationUserData + data: NewScheduleRotationUserData | Unset if isinstance(_data, Unset): data = UNSET else: @@ -52,21 +52,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_schedule_rotation_user.additional_properties = d return new_schedule_rotation_user - - @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_schedule_rotation_user_data.py b/rootly_sdk/models/new_schedule_rotation_user_data.py index 45266c80..bc09c2a9 100644 --- a/rootly_sdk/models/new_schedule_rotation_user_data.py +++ b/rootly_sdk/models/new_schedule_rotation_user_data.py @@ -1,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.new_schedule_rotation_user_data_type import ( NewScheduleRotationUserDataType, @@ -21,25 +22,24 @@ class NewScheduleRotationUserData: """ Attributes: - type_ (Union[Unset, NewScheduleRotationUserDataType]): - attributes (Union[Unset, NewScheduleRotationUserDataAttributes]): + type_ (NewScheduleRotationUserDataType | Unset): + attributes (NewScheduleRotationUserDataAttributes | Unset): """ - type_: Unset | NewScheduleRotationUserDataType = UNSET - attributes: Union[Unset, "NewScheduleRotationUserDataAttributes"] = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + type_: NewScheduleRotationUserDataType | Unset = UNSET + attributes: NewScheduleRotationUserDataAttributes | Unset = UNSET def to_dict(self) -> dict[str, Any]: - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if type_ is not UNSET: field_dict["type"] = type_ @@ -54,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_: Unset | NewScheduleRotationUserDataType + type_: NewScheduleRotationUserDataType | Unset if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_new_schedule_rotation_user_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Unset | NewScheduleRotationUserDataAttributes + attributes: NewScheduleRotationUserDataAttributes | Unset if isinstance(_attributes, Unset): attributes = UNSET else: @@ -72,21 +72,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_schedule_rotation_user_data.additional_properties = d return new_schedule_rotation_user_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_schedule_rotation_user_data_attributes.py b/rootly_sdk/models/new_schedule_rotation_user_data_attributes.py index ce6d4a42..0c5bb168 100644 --- a/rootly_sdk/models/new_schedule_rotation_user_data_attributes.py +++ b/rootly_sdk/models/new_schedule_rotation_user_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,11 +15,11 @@ class NewScheduleRotationUserDataAttributes: """ Attributes: user_id (int): Schedule rotation user - position (Union[Unset, int]): Position of the user inside rotation + position (int | Unset): Position of the user inside rotation """ user_id: int - position: Unset | int = UNSET + position: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: user_id = self.user_id diff --git a/rootly_sdk/models/new_schedule_rotation_user_data_type.py b/rootly_sdk/models/new_schedule_rotation_user_data_type.py index 5baa6ab2..14a9602b 100644 --- a/rootly_sdk/models/new_schedule_rotation_user_data_type.py +++ b/rootly_sdk/models/new_schedule_rotation_user_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewScheduleRotationUserDataType = Literal["schedule_rotation_users"] @@ -11,5 +11,5 @@ def check_new_schedule_rotation_user_data_type(value: str | None) -> NewSchedule if value is None: return None if value in NEW_SCHEDULE_ROTATION_USER_DATA_TYPE_VALUES: - return cast(NewScheduleRotationUserDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_SCHEDULE_ROTATION_USER_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_secret.py b/rootly_sdk/models/new_secret.py index ce538bb4..740c0133 100644 --- a/rootly_sdk/models/new_secret.py +++ b/rootly_sdk/models/new_secret.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_secret_data import NewSecretData @@ -18,14 +19,13 @@ class NewSecret: data (NewSecretData): """ - data: "NewSecretData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewSecretData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_secret.additional_properties = d return new_secret - - @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_secret_data.py b/rootly_sdk/models/new_secret_data.py index 8afbb5d3..fec3185b 100644 --- a/rootly_sdk/models/new_secret_data.py +++ b/rootly_sdk/models/new_secret_data.py @@ -1,8 +1,9 @@ +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_secret_data_type import NewSecretDataType, check_new_secret_data_type @@ -22,8 +23,7 @@ class NewSecretData: """ type_: NewSecretDataType - attributes: "NewSecretDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewSecretDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_secret_data.additional_properties = d return new_secret_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_secret_data_attributes.py b/rootly_sdk/models/new_secret_data_attributes.py index 47851d3b..ea126541 100644 --- a/rootly_sdk/models/new_secret_data_attributes.py +++ b/rootly_sdk/models/new_secret_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -15,46 +17,59 @@ class NewSecretDataAttributes: Attributes: name (str): The name of the secret secret (str): The secret - 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'. + 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'. + owner_group_ids (list[str] | None | Unset): IDs of the teams whose members can see and pick this secret; their + team admins can manage it. Empty means only users with the org Secrets permission can. Ignored unless team + scoping is enabled for the organization. """ name: str secret: str - 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" + 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" + owner_group_ids: list[str] | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name secret = self.secret - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind - hashicorp_vault_mount: None | Unset | str + hashicorp_vault_mount: None | str | Unset if isinstance(self.hashicorp_vault_mount, Unset): hashicorp_vault_mount = UNSET else: hashicorp_vault_mount = self.hashicorp_vault_mount - hashicorp_vault_path: None | Unset | str + hashicorp_vault_path: None | str | Unset if isinstance(self.hashicorp_vault_path, Unset): hashicorp_vault_path = UNSET else: hashicorp_vault_path = self.hashicorp_vault_path - hashicorp_vault_version: None | Unset | str + hashicorp_vault_version: None | str | Unset if isinstance(self.hashicorp_vault_version, Unset): hashicorp_vault_version = UNSET else: hashicorp_vault_version = self.hashicorp_vault_version + owner_group_ids: list[str] | None | Unset + if isinstance(self.owner_group_ids, Unset): + owner_group_ids = UNSET + elif isinstance(self.owner_group_ids, list): + owner_group_ids = self.owner_group_ids + + else: + owner_group_ids = self.owner_group_ids + field_dict: dict[str, Any] = {} field_dict.update( @@ -71,6 +86,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["hashicorp_vault_path"] = hashicorp_vault_path if hashicorp_vault_version is not UNSET: field_dict["hashicorp_vault_version"] = hashicorp_vault_version + if owner_group_ids is not UNSET: + field_dict["owner_group_ids"] = owner_group_ids return field_dict @@ -82,39 +99,56 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: secret = d.pop("secret") _kind = d.pop("kind", UNSET) - kind: Unset | NewSecretDataAttributesKind + kind: NewSecretDataAttributesKind | Unset if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_secret_data_attributes_kind(_kind) - def _parse_hashicorp_vault_mount(data: object) -> None | Unset | str: + def _parse_hashicorp_vault_mount(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) hashicorp_vault_mount = _parse_hashicorp_vault_mount(d.pop("hashicorp_vault_mount", UNSET)) - def _parse_hashicorp_vault_path(data: object) -> None | Unset | str: + def _parse_hashicorp_vault_path(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) hashicorp_vault_path = _parse_hashicorp_vault_path(d.pop("hashicorp_vault_path", UNSET)) - def _parse_hashicorp_vault_version(data: object) -> None | Unset | str: + def _parse_hashicorp_vault_version(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) hashicorp_vault_version = _parse_hashicorp_vault_version(d.pop("hashicorp_vault_version", UNSET)) + def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + owner_group_ids_type_0 = cast(list[str], data) + + return owner_group_ids_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[str] | None | Unset, data) + + owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) + new_secret_data_attributes = cls( name=name, secret=secret, @@ -122,6 +156,7 @@ def _parse_hashicorp_vault_version(data: object) -> None | Unset | str: hashicorp_vault_mount=hashicorp_vault_mount, hashicorp_vault_path=hashicorp_vault_path, hashicorp_vault_version=hashicorp_vault_version, + owner_group_ids=owner_group_ids, ) return new_secret_data_attributes diff --git a/rootly_sdk/models/new_secret_data_attributes_kind.py b/rootly_sdk/models/new_secret_data_attributes_kind.py index b08b1c21..eb7cd263 100644 --- a/rootly_sdk/models/new_secret_data_attributes_kind.py +++ b/rootly_sdk/models/new_secret_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewSecretDataAttributesKind = Literal["built_in", "hashicorp_vault"] @@ -12,5 +12,5 @@ def check_new_secret_data_attributes_kind(value: str | None) -> NewSecretDataAtt if value is None: return None if value in NEW_SECRET_DATA_ATTRIBUTES_KIND_VALUES: - return cast(NewSecretDataAttributesKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_SECRET_DATA_ATTRIBUTES_KIND_VALUES!r}") diff --git a/rootly_sdk/models/new_secret_data_type.py b/rootly_sdk/models/new_secret_data_type.py index 3f2030dc..69eb2320 100644 --- a/rootly_sdk/models/new_secret_data_type.py +++ b/rootly_sdk/models/new_secret_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewSecretDataType = Literal["secrets"] @@ -11,5 +11,5 @@ def check_new_secret_data_type(value: str | None) -> NewSecretDataType | None: if value is None: return None if value in NEW_SECRET_DATA_TYPE_VALUES: - return cast(NewSecretDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_SECRET_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_service.py b/rootly_sdk/models/new_service.py index 6f97932c..354df9ea 100644 --- a/rootly_sdk/models/new_service.py +++ b/rootly_sdk/models/new_service.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_service_data import NewServiceData @@ -18,14 +19,13 @@ class NewService: data (NewServiceData): """ - data: "NewServiceData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewServiceData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_service.additional_properties = d return new_service - - @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_service_data.py b/rootly_sdk/models/new_service_data.py index 2e7856bd..6e38d45a 100644 --- a/rootly_sdk/models/new_service_data.py +++ b/rootly_sdk/models/new_service_data.py @@ -1,8 +1,9 @@ +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_service_data_type import NewServiceDataType, check_new_service_data_type @@ -22,8 +23,7 @@ class NewServiceData: """ type_: NewServiceDataType - attributes: "NewServiceDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewServiceDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_service_data.additional_properties = d return new_service_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_service_data_attributes.py b/rootly_sdk/models/new_service_data_attributes.py index 6dda8535..70d4dbac 100644 --- a/rootly_sdk/models/new_service_data_attributes.py +++ b/rootly_sdk/models/new_service_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -33,90 +35,86 @@ class NewServiceDataAttributes: """ Attributes: name (str): The name of the service - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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: + description (None | str | Unset): The description of the service + public_description (None | str | Unset): The status page 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: :namespace/:kind/:entity_name - 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: + 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: rootlyhq/my-service - 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: + 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: rootlyhq/my-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. + 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. """ name: str - 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 + slug: None | 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 + 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 def to_dict(self) -> dict[str, Any]: from ..models.new_service_data_attributes_alert_broadcast_channel_type_0 import ( @@ -128,25 +126,25 @@ def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -155,95 +153,95 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - show_uptime: None | Unset | bool + show_uptime: bool | None | Unset if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: Unset | int = UNSET + show_uptime_last_days: int | Unset = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - backstage_id: None | Unset | str + backstage_id: None | str | Unset if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - pagerduty_id: None | Unset | str + pagerduty_id: None | str | Unset if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - opsgenie_id: None | Unset | str + opsgenie_id: None | str | Unset if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | Unset | str + opsgenie_team_id: None | str | Unset if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: None | Unset | str + cortex_id: None | str | Unset if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | Unset | str + service_now_ci_sys_id: None | str | Unset 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 | Unset | str + github_repository_name: None | str | Unset if isinstance(self.github_repository_name, Unset): github_repository_name = UNSET else: github_repository_name = self.github_repository_name - github_repository_branch: None | Unset | str + github_repository_branch: None | str | Unset if isinstance(self.github_repository_branch, Unset): github_repository_branch = UNSET else: github_repository_branch = self.github_repository_branch - gitlab_repository_name: None | Unset | str + gitlab_repository_name: None | str | Unset if isinstance(self.gitlab_repository_name, Unset): gitlab_repository_name = UNSET else: gitlab_repository_name = self.gitlab_repository_name - gitlab_repository_branch: None | Unset | str + gitlab_repository_branch: None | str | Unset if isinstance(self.gitlab_repository_branch, Unset): gitlab_repository_branch = UNSET else: gitlab_repository_branch = self.gitlab_repository_branch - environment_ids: None | Unset | list[str] + environment_ids: list[str] | None | Unset if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -252,7 +250,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -261,7 +259,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: None | Unset | list[str] + owner_group_ids: list[str] | None | Unset if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -270,7 +268,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: None | Unset | list[int] + owner_user_ids: list[int] | None | Unset if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -279,31 +277,31 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - kubernetes_deployment_name: None | Unset | str + kubernetes_deployment_name: None | str | Unset if isinstance(self.kubernetes_deployment_name, Unset): kubernetes_deployment_name = UNSET else: kubernetes_deployment_name = self.kubernetes_deployment_name - alerts_email_enabled: None | Unset | bool + alerts_email_enabled: bool | None | Unset if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alert_urgency_id: None | Unset | str + alert_urgency_id: None | str | Unset if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - escalation_policy_id: None | Unset | str + escalation_policy_id: None | str | Unset if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - slack_channels: None | Unset | list[dict[str, Any]] + slack_channels: list[dict[str, Any]] | None | Unset if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -315,7 +313,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: None | Unset | list[dict[str, Any]] + slack_aliases: list[dict[str, Any]] | None | Unset if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -327,13 +325,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: None | Unset | bool + alert_broadcast_enabled: bool | None | Unset if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: None | Unset | dict[str, Any] + alert_broadcast_channel: dict[str, Any] | None | Unset if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, NewServiceDataAttributesAlertBroadcastChannelType0): @@ -341,13 +339,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: None | Unset | bool + incident_broadcast_enabled: bool | None | Unset if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: None | Unset | dict[str, Any] + incident_broadcast_channel: dict[str, Any] | None | Unset if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, NewServiceDataAttributesIncidentBroadcastChannelType0): @@ -355,7 +353,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - properties: Unset | list[dict[str, Any]] = UNSET + properties: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -459,34 +457,34 @@ 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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -497,146 +495,146 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_show_uptime(data: object) -> None | Unset | bool: + def _parse_show_uptime(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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: Unset | NewServiceDataAttributesShowUptimeLastDays + show_uptime_last_days: NewServiceDataAttributesShowUptimeLastDays | Unset 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 | Unset | str: + def _parse_backstage_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | Unset | str: + def _parse_pagerduty_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | Unset | str: + def _parse_opsgenie_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | Unset | str: + def _parse_opsgenie_team_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> None | Unset | str: + def _parse_cortex_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: + def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_github_repository_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) github_repository_name = _parse_github_repository_name(d.pop("github_repository_name", UNSET)) - def _parse_github_repository_branch(data: object) -> None | Unset | str: + def _parse_github_repository_branch(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) github_repository_branch = _parse_github_repository_branch(d.pop("github_repository_branch", UNSET)) - def _parse_gitlab_repository_name(data: object) -> None | Unset | str: + def _parse_gitlab_repository_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) gitlab_repository_name = _parse_gitlab_repository_name(d.pop("gitlab_repository_name", UNSET)) - def _parse_gitlab_repository_branch(data: object) -> None | Unset | str: + def _parse_gitlab_repository_branch(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) gitlab_repository_branch = _parse_gitlab_repository_branch(d.pop("gitlab_repository_branch", UNSET)) - def _parse_environment_ids(data: object) -> None | Unset | list[str]: + def _parse_environment_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -647,13 +645,13 @@ def _parse_environment_ids(data: object) -> None | Unset | list[str]: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -664,13 +662,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: + def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -681,13 +679,13 @@ def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: owner_group_ids_type_0 = cast(list[str], data) return owner_group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: + def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -698,51 +696,49 @@ def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: owner_user_ids_type_0 = cast(list[int], data) return owner_user_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[int], data) + return cast(list[int] | None | Unset, data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_kubernetes_deployment_name(data: object) -> None | Unset | str: + def _parse_kubernetes_deployment_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) kubernetes_deployment_name = _parse_kubernetes_deployment_name(d.pop("kubernetes_deployment_name", UNSET)) - def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: + def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | Unset | str: + def _parse_alert_urgency_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_escalation_policy_id(data: object) -> None | Unset | str: + def _parse_escalation_policy_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) - def _parse_slack_channels( - data: object, - ) -> None | Unset | list["NewServiceDataAttributesSlackChannelsType0Item"]: + def _parse_slack_channels(data: object) -> list[NewServiceDataAttributesSlackChannelsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -760,15 +756,13 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["NewServiceDataAttributesSlackChannelsType0Item"], data) + return cast(list[NewServiceDataAttributesSlackChannelsType0Item] | None | Unset, data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases( - data: object, - ) -> None | Unset | list["NewServiceDataAttributesSlackAliasesType0Item"]: + def _parse_slack_aliases(data: object) -> list[NewServiceDataAttributesSlackAliasesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -786,24 +780,24 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["NewServiceDataAttributesSlackAliasesType0Item"], data) + return cast(list[NewServiceDataAttributesSlackAliasesType0Item] | None | Unset, data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> None | Unset | bool: + def _parse_alert_broadcast_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) def _parse_alert_broadcast_channel( data: object, - ) -> Union["NewServiceDataAttributesAlertBroadcastChannelType0", None, Unset]: + ) -> NewServiceDataAttributesAlertBroadcastChannelType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -814,24 +808,24 @@ def _parse_alert_broadcast_channel( alert_broadcast_channel_type_0 = NewServiceDataAttributesAlertBroadcastChannelType0.from_dict(data) return alert_broadcast_channel_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["NewServiceDataAttributesAlertBroadcastChannelType0", None, Unset], data) + return cast(NewServiceDataAttributesAlertBroadcastChannelType0 | None | Unset, data) alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> None | Unset | bool: + def _parse_incident_broadcast_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) def _parse_incident_broadcast_channel( data: object, - ) -> Union["NewServiceDataAttributesIncidentBroadcastChannelType0", None, Unset]: + ) -> NewServiceDataAttributesIncidentBroadcastChannelType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -844,18 +838,20 @@ def _parse_incident_broadcast_channel( ) return incident_broadcast_channel_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["NewServiceDataAttributesIncidentBroadcastChannelType0", None, Unset], data) + return cast(NewServiceDataAttributesIncidentBroadcastChannelType0 | None | Unset, data) incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) - properties = [] _properties = d.pop("properties", UNSET) - for properties_item_data in _properties or []: - properties_item = NewServiceDataAttributesPropertiesItem.from_dict(properties_item_data) + 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) - properties.append(properties_item) + properties.append(properties_item) new_service_data_attributes = cls( name=name, 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 f7eeb8cc..2cda597d 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,8 +1,9 @@ +from __future__ import annotations + 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 @@ -15,12 +16,11 @@ class NewServiceDataAttributesAlertBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (Union[Unset, str]): Slack channel name + name (str | Unset): Slack channel name """ id: str - name: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + name: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: id = self.id @@ -28,7 +28,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -51,21 +51,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - new_service_data_attributes_alert_broadcast_channel_type_0.additional_properties = d return new_service_data_attributes_alert_broadcast_channel_type_0 - - @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_service_data_attributes_incident_broadcast_channel_type_0.py b/rootly_sdk/models/new_service_data_attributes_incident_broadcast_channel_type_0.py index e28f2d61..14b565f3 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,8 +1,9 @@ +from __future__ import annotations + 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 @@ -15,12 +16,11 @@ class NewServiceDataAttributesIncidentBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (Union[Unset, str]): Slack channel name + name (str | Unset): Slack channel name """ id: str - name: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + name: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: id = self.id @@ -28,7 +28,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -51,21 +51,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - new_service_data_attributes_incident_broadcast_channel_type_0.additional_properties = d return new_service_data_attributes_incident_broadcast_channel_type_0 - - @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_service_data_attributes_properties_item.py b/rootly_sdk/models/new_service_data_attributes_properties_item.py index 571f9034..3110be0d 100644 --- a/rootly_sdk/models/new_service_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_service_data_attributes_properties_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_service_data_attributes_show_uptime_last_days.py b/rootly_sdk/models/new_service_data_attributes_show_uptime_last_days.py index 5dc7d8b2..556543a0 100644 --- a/rootly_sdk/models/new_service_data_attributes_show_uptime_last_days.py +++ b/rootly_sdk/models/new_service_data_attributes_show_uptime_last_days.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewServiceDataAttributesShowUptimeLastDays = Literal[30, 60, 90] @@ -11,7 +11,7 @@ def check_new_service_data_attributes_show_uptime_last_days(value: int) -> NewServiceDataAttributesShowUptimeLastDays: if value in NEW_SERVICE_DATA_ATTRIBUTES_SHOW_UPTIME_LAST_DAYS_VALUES: - return cast(NewServiceDataAttributesShowUptimeLastDays, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SERVICE_DATA_ATTRIBUTES_SHOW_UPTIME_LAST_DAYS_VALUES!r}" ) 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 02f2f04f..56cda25f 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="NewServiceDataAttributesSlackAliasesType0Item") @@ -17,7 +18,6 @@ class NewServiceDataAttributesSlackAliasesType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - new_service_data_attributes_slack_aliases_type_0_item.additional_properties = d return new_service_data_attributes_slack_aliases_type_0_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_service_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/new_service_data_attributes_slack_channels_type_0_item.py index b5522a5b..7a707afe 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="NewServiceDataAttributesSlackChannelsType0Item") @@ -17,7 +18,6 @@ class NewServiceDataAttributesSlackChannelsType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - new_service_data_attributes_slack_channels_type_0_item.additional_properties = d return new_service_data_attributes_slack_channels_type_0_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_service_data_type.py b/rootly_sdk/models/new_service_data_type.py index 39831989..fab04399 100644 --- a/rootly_sdk/models/new_service_data_type.py +++ b/rootly_sdk/models/new_service_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewServiceDataType = Literal["services"] @@ -11,5 +11,5 @@ def check_new_service_data_type(value: str | None) -> NewServiceDataType | None: if value is None: return None if value in NEW_SERVICE_DATA_TYPE_VALUES: - return cast(NewServiceDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_SERVICE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_severity.py b/rootly_sdk/models/new_severity.py index 8d22df8c..92092ab6 100644 --- a/rootly_sdk/models/new_severity.py +++ b/rootly_sdk/models/new_severity.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_severity_data import NewSeverityData @@ -18,14 +19,13 @@ class NewSeverity: data (NewSeverityData): """ - data: "NewSeverityData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewSeverityData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_severity.additional_properties = d return new_severity - - @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_severity_data.py b/rootly_sdk/models/new_severity_data.py index 6e2b73b3..e7e28152 100644 --- a/rootly_sdk/models/new_severity_data.py +++ b/rootly_sdk/models/new_severity_data.py @@ -1,8 +1,9 @@ +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_severity_data_type import NewSeverityDataType, check_new_severity_data_type @@ -22,8 +23,7 @@ class NewSeverityData: """ type_: NewSeverityDataType - attributes: "NewSeverityDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewSeverityDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_severity_data.additional_properties = d return new_severity_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_severity_data_attributes.py b/rootly_sdk/models/new_severity_data_attributes.py index 5a95537e..6e13ef33 100644 --- a/rootly_sdk/models/new_severity_data_attributes.py +++ b/rootly_sdk/models/new_severity_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -26,61 +28,61 @@ class NewSeverityDataAttributes: """ Attributes: name (str): The name of the severity - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + 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 """ name: str - 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 + slug: None | str | Unset = UNSET + 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 def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - severity: Unset | str = UNSET + severity: str | Unset = UNSET if not isinstance(self.severity, Unset): severity = self.severity - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -89,7 +91,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: None | Unset | list[dict[str, Any]] + slack_channels: list[dict[str, Any]] | None | Unset if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -101,7 +103,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: None | Unset | list[dict[str, Any]] + slack_aliases: list[dict[str, Any]] | None | Unset if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -151,50 +153,50 @@ 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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) _severity = d.pop("severity", UNSET) - severity: Unset | NewSeverityDataAttributesSeverity + severity: NewSeverityDataAttributesSeverity | Unset if isinstance(_severity, Unset): severity = UNSET else: severity = check_new_severity_data_attributes_severity(_severity) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -205,15 +207,13 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_slack_channels( - data: object, - ) -> None | Unset | list["NewSeverityDataAttributesSlackChannelsType0Item"]: + def _parse_slack_channels(data: object) -> list[NewSeverityDataAttributesSlackChannelsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -231,15 +231,13 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["NewSeverityDataAttributesSlackChannelsType0Item"], data) + return cast(list[NewSeverityDataAttributesSlackChannelsType0Item] | None | Unset, data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases( - data: object, - ) -> None | Unset | list["NewSeverityDataAttributesSlackAliasesType0Item"]: + def _parse_slack_aliases(data: object) -> list[NewSeverityDataAttributesSlackAliasesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -257,9 +255,9 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["NewSeverityDataAttributesSlackAliasesType0Item"], data) + return cast(list[NewSeverityDataAttributesSlackAliasesType0Item] | None | Unset, data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) diff --git a/rootly_sdk/models/new_severity_data_attributes_severity.py b/rootly_sdk/models/new_severity_data_attributes_severity.py index 46ec59ef..12c9ba40 100644 --- a/rootly_sdk/models/new_severity_data_attributes_severity.py +++ b/rootly_sdk/models/new_severity_data_attributes_severity.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewSeverityDataAttributesSeverity = Literal["critical", "high", "low", "medium"] @@ -14,5 +14,5 @@ def check_new_severity_data_attributes_severity(value: str | None) -> NewSeverit if value is None: return None if value in NEW_SEVERITY_DATA_ATTRIBUTES_SEVERITY_VALUES: - return cast(NewSeverityDataAttributesSeverity, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_SEVERITY_DATA_ATTRIBUTES_SEVERITY_VALUES!r}") 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 67bd7916..04166677 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="NewSeverityDataAttributesSlackAliasesType0Item") @@ -17,7 +18,6 @@ class NewSeverityDataAttributesSlackAliasesType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - new_severity_data_attributes_slack_aliases_type_0_item.additional_properties = d return new_severity_data_attributes_slack_aliases_type_0_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_severity_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/new_severity_data_attributes_slack_channels_type_0_item.py index 430f8c3e..c0683c70 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="NewSeverityDataAttributesSlackChannelsType0Item") @@ -17,7 +18,6 @@ class NewSeverityDataAttributesSlackChannelsType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - new_severity_data_attributes_slack_channels_type_0_item.additional_properties = d return new_severity_data_attributes_slack_channels_type_0_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_severity_data_type.py b/rootly_sdk/models/new_severity_data_type.py index 9d8235b6..c629fb13 100644 --- a/rootly_sdk/models/new_severity_data_type.py +++ b/rootly_sdk/models/new_severity_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewSeverityDataType = Literal["severities"] @@ -11,5 +11,5 @@ def check_new_severity_data_type(value: str | None) -> NewSeverityDataType | Non if value is None: return None if value in NEW_SEVERITY_DATA_TYPE_VALUES: - return cast(NewSeverityDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_SEVERITY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_shift_coverage_request.py b/rootly_sdk/models/new_shift_coverage_request.py index ce18a9a2..86c08555 100644 --- a/rootly_sdk/models/new_shift_coverage_request.py +++ b/rootly_sdk/models/new_shift_coverage_request.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_shift_coverage_request_data import NewShiftCoverageRequestData @@ -18,14 +19,13 @@ class NewShiftCoverageRequest: data (NewShiftCoverageRequestData): """ - data: "NewShiftCoverageRequestData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewShiftCoverageRequestData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_shift_coverage_request.additional_properties = d return new_shift_coverage_request - - @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_shift_coverage_request_data.py b/rootly_sdk/models/new_shift_coverage_request_data.py index 7ddbed15..15701068 100644 --- a/rootly_sdk/models/new_shift_coverage_request_data.py +++ b/rootly_sdk/models/new_shift_coverage_request_data.py @@ -1,8 +1,9 @@ +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_shift_coverage_request_data_type import ( NewShiftCoverageRequestDataType, @@ -25,8 +26,7 @@ class NewShiftCoverageRequestData: """ type_: NewShiftCoverageRequestDataType - attributes: "NewShiftCoverageRequestDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewShiftCoverageRequestDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_shift_coverage_request_data.additional_properties = d return new_shift_coverage_request_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_shift_coverage_request_data_attributes.py b/rootly_sdk/models/new_shift_coverage_request_data_attributes.py index ecaedf6f..9652f492 100644 --- a/rootly_sdk/models/new_shift_coverage_request_data_attributes.py +++ b/rootly_sdk/models/new_shift_coverage_request_data_attributes.py @@ -1,9 +1,10 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import Any, TypeVar +from typing import Any, TypeVar, cast from attrs import define as _attrs_define -from dateutil.parser import isoparse from ..types import UNSET, Unset @@ -16,13 +17,17 @@ 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 (Union[Unset, int]): Optional. Restrict coverage to shifts assigned to this user. When omitted, every - shift overlapping the time range is covered. + user_id (int | Unset): Optional. Restrict coverage to shifts assigned to this user. When omitted, every shift + overlapping the time range is covered. + recipient_user_ids (list[int] | Unset): Optional. Notify selected active schedule members for every covered + shift when targeted-shift-coverage is enabled. Recipients must be eligible for each shift. Omitted, empty, or + flag-disabled selections broadcast. """ starts_at: datetime.datetime ends_at: datetime.datetime - user_id: Unset | int = UNSET + user_id: int | Unset = UNSET + recipient_user_ids: list[int] | Unset = UNSET def to_dict(self) -> dict[str, Any]: starts_at = self.starts_at.isoformat() @@ -31,6 +36,10 @@ def to_dict(self) -> dict[str, Any]: user_id = self.user_id + recipient_user_ids: list[int] | Unset = UNSET + if not isinstance(self.recipient_user_ids, Unset): + recipient_user_ids = self.recipient_user_ids + field_dict: dict[str, Any] = {} field_dict.update( @@ -41,22 +50,27 @@ def to_dict(self) -> dict[str, Any]: ) if user_id is not UNSET: field_dict["user_id"] = user_id + if recipient_user_ids is not UNSET: + field_dict["recipient_user_ids"] = recipient_user_ids return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - starts_at = isoparse(d.pop("starts_at")) + starts_at = datetime.datetime.fromisoformat(d.pop("starts_at")) - ends_at = isoparse(d.pop("ends_at")) + ends_at = datetime.datetime.fromisoformat(d.pop("ends_at")) user_id = d.pop("user_id", UNSET) + recipient_user_ids = cast(list[int], d.pop("recipient_user_ids", UNSET)) + new_shift_coverage_request_data_attributes = cls( starts_at=starts_at, ends_at=ends_at, user_id=user_id, + recipient_user_ids=recipient_user_ids, ) return new_shift_coverage_request_data_attributes diff --git a/rootly_sdk/models/new_shift_coverage_request_data_type.py b/rootly_sdk/models/new_shift_coverage_request_data_type.py index 3880a968..3fb67842 100644 --- a/rootly_sdk/models/new_shift_coverage_request_data_type.py +++ b/rootly_sdk/models/new_shift_coverage_request_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewShiftCoverageRequestDataType = Literal["shift_coverage_requests"] @@ -11,5 +11,5 @@ def check_new_shift_coverage_request_data_type(value: str | None) -> NewShiftCov if value is None: return None if value in NEW_SHIFT_COVERAGE_REQUEST_DATA_TYPE_VALUES: - return cast(NewShiftCoverageRequestDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_SHIFT_COVERAGE_REQUEST_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_sla.py b/rootly_sdk/models/new_sla.py index acdabbdb..66aba195 100644 --- a/rootly_sdk/models/new_sla.py +++ b/rootly_sdk/models/new_sla.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_sla_data import NewSlaData @@ -18,14 +19,13 @@ class NewSla: data (NewSlaData): """ - data: "NewSlaData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewSlaData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_sla.additional_properties = d return new_sla - - @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_sla_data.py b/rootly_sdk/models/new_sla_data.py index 7b338eed..a209ed07 100644 --- a/rootly_sdk/models/new_sla_data.py +++ b/rootly_sdk/models/new_sla_data.py @@ -1,8 +1,9 @@ +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_sla_data_type import NewSlaDataType, check_new_sla_data_type @@ -22,8 +23,7 @@ class NewSlaData: """ type_: NewSlaDataType - attributes: "NewSlaDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewSlaDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_sla_data.additional_properties = d return new_sla_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_sla_data_attributes.py b/rootly_sdk/models/new_sla_data_attributes.py index 75e8ca2d..a9c0fa3c 100644 --- a/rootly_sdk/models/new_sla_data_attributes.py +++ b/rootly_sdk/models/new_sla_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast from uuid import UUID @@ -49,26 +51,25 @@ class NewSlaDataAttributes: deadline completion_deadline_parent_status (NewSlaDataAttributesCompletionDeadlineParentStatus): The incident parent status that triggers the completion deadline - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + 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 manager_role_id or manager_user_id. - 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. + 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. """ name: str @@ -76,18 +77,18 @@ class NewSlaDataAttributes: assignment_deadline_parent_status: NewSlaDataAttributesAssignmentDeadlineParentStatus completion_deadline_days: NewSlaDataAttributesCompletionDeadlineDays completion_deadline_parent_status: NewSlaDataAttributesCompletionDeadlineParentStatus - 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 + slug: None | str | Unset = UNSET + 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 def to_dict(self) -> dict[str, Any]: name = self.name @@ -100,29 +101,29 @@ def to_dict(self) -> dict[str, Any]: completion_deadline_parent_status: str = self.completion_deadline_parent_status - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - condition_match_type: Unset | str = UNSET + condition_match_type: str | Unset = UNSET if not isinstance(self.condition_match_type, Unset): condition_match_type = self.condition_match_type - manager_role_id: None | Unset | str + manager_role_id: None | str | Unset if isinstance(self.manager_role_id, Unset): manager_role_id = UNSET elif isinstance(self.manager_role_id, UUID): @@ -130,13 +131,13 @@ def to_dict(self) -> dict[str, Any]: else: manager_role_id = self.manager_role_id - manager_user_id: None | Unset | int + manager_user_id: int | None | Unset 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 | Unset | str + assignment_deadline_sub_status_id: None | str | Unset if isinstance(self.assignment_deadline_sub_status_id, Unset): assignment_deadline_sub_status_id = UNSET elif isinstance(self.assignment_deadline_sub_status_id, UUID): @@ -146,7 +147,7 @@ def to_dict(self) -> dict[str, Any]: assignment_skip_weekends = self.assignment_skip_weekends - completion_deadline_sub_status_id: None | Unset | str + completion_deadline_sub_status_id: None | str | Unset if isinstance(self.completion_deadline_sub_status_id, Unset): completion_deadline_sub_status_id = UNSET elif isinstance(self.completion_deadline_sub_status_id, UUID): @@ -156,14 +157,14 @@ def to_dict(self) -> dict[str, Any]: completion_skip_weekends = self.completion_skip_weekends - conditions: Unset | list[dict[str, Any]] = UNSET + conditions: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + notification_configurations: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.notification_configurations, Unset): notification_configurations = [] for notification_configurations_item_data in self.notification_configurations: @@ -234,41 +235,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d.pop("completion_deadline_parent_status") ) - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) _condition_match_type = d.pop("condition_match_type", UNSET) - condition_match_type: Unset | NewSlaDataAttributesConditionMatchType + condition_match_type: NewSlaDataAttributesConditionMatchType | Unset 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 | UUID | Unset: + def _parse_manager_role_id(data: object) -> None | Unset | UUID: if data is None: return data if isinstance(data, Unset): @@ -279,22 +280,22 @@ def _parse_manager_role_id(data: object) -> None | UUID | Unset: manager_role_id_type_0 = UUID(data) return manager_role_id_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | UUID | Unset, data) + return cast(None | Unset | UUID, data) manager_role_id = _parse_manager_role_id(d.pop("manager_role_id", UNSET)) - def _parse_manager_user_id(data: object) -> None | Unset | int: + def _parse_manager_user_id(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) manager_user_id = _parse_manager_user_id(d.pop("manager_user_id", UNSET)) - def _parse_assignment_deadline_sub_status_id(data: object) -> None | UUID | Unset: + def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUID: if data is None: return data if isinstance(data, Unset): @@ -305,9 +306,9 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | UUID | Unse assignment_deadline_sub_status_id_type_0 = UUID(data) return assignment_deadline_sub_status_id_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | UUID | Unset, data) + return cast(None | Unset | UUID, data) assignment_deadline_sub_status_id = _parse_assignment_deadline_sub_status_id( d.pop("assignment_deadline_sub_status_id", UNSET) @@ -315,7 +316,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | UUID | Unse assignment_skip_weekends = d.pop("assignment_skip_weekends", UNSET) - def _parse_completion_deadline_sub_status_id(data: object) -> None | UUID | Unset: + def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUID: if data is None: return data if isinstance(data, Unset): @@ -326,9 +327,9 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | UUID | Unse completion_deadline_sub_status_id_type_0 = UUID(data) return completion_deadline_sub_status_id_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | UUID | Unset, data) + return cast(None | Unset | UUID, data) completion_deadline_sub_status_id = _parse_completion_deadline_sub_status_id( d.pop("completion_deadline_sub_status_id", UNSET) @@ -336,21 +337,25 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | UUID | Unse completion_skip_weekends = d.pop("completion_skip_weekends", UNSET) - conditions = [] _conditions = d.pop("conditions", UNSET) - for conditions_item_data in _conditions or []: - conditions_item = NewSlaDataAttributesConditionsItem.from_dict(conditions_item_data) + 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) - conditions.append(conditions_item) + conditions.append(conditions_item) - notification_configurations = [] _notification_configurations = d.pop("notification_configurations", UNSET) - for notification_configurations_item_data in _notification_configurations or []: - notification_configurations_item = NewSlaDataAttributesNotificationConfigurationsItem.from_dict( - notification_configurations_item_data - ) + 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 + ) - notification_configurations.append(notification_configurations_item) + notification_configurations.append(notification_configurations_item) new_sla_data_attributes = cls( name=name, diff --git a/rootly_sdk/models/new_sla_data_attributes_assignment_deadline_days.py b/rootly_sdk/models/new_sla_data_attributes_assignment_deadline_days.py index 327bd6a1..462f27c7 100644 --- a/rootly_sdk/models/new_sla_data_attributes_assignment_deadline_days.py +++ b/rootly_sdk/models/new_sla_data_attributes_assignment_deadline_days.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewSlaDataAttributesAssignmentDeadlineDays = Literal[1, 2, 3, 4, 5, 6, 7, 14, 21, 30] @@ -18,7 +18,7 @@ def check_new_sla_data_attributes_assignment_deadline_days(value: int) -> NewSlaDataAttributesAssignmentDeadlineDays: if value in NEW_SLA_DATA_ATTRIBUTES_ASSIGNMENT_DEADLINE_DAYS_VALUES: - return cast(NewSlaDataAttributesAssignmentDeadlineDays, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SLA_DATA_ATTRIBUTES_ASSIGNMENT_DEADLINE_DAYS_VALUES!r}" ) diff --git a/rootly_sdk/models/new_sla_data_attributes_assignment_deadline_parent_status.py b/rootly_sdk/models/new_sla_data_attributes_assignment_deadline_parent_status.py index 3ee4a251..bc8fb478 100644 --- a/rootly_sdk/models/new_sla_data_attributes_assignment_deadline_parent_status.py +++ b/rootly_sdk/models/new_sla_data_attributes_assignment_deadline_parent_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewSlaDataAttributesAssignmentDeadlineParentStatus = Literal[ "cancelled", "closed", "in_triage", "mitigated", "resolved", "started" @@ -22,7 +22,7 @@ def check_new_sla_data_attributes_assignment_deadline_parent_status( if value is None: return None if value in NEW_SLA_DATA_ATTRIBUTES_ASSIGNMENT_DEADLINE_PARENT_STATUS_VALUES: - return cast(NewSlaDataAttributesAssignmentDeadlineParentStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SLA_DATA_ATTRIBUTES_ASSIGNMENT_DEADLINE_PARENT_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/new_sla_data_attributes_completion_deadline_days.py b/rootly_sdk/models/new_sla_data_attributes_completion_deadline_days.py index e569a8aa..73c38900 100644 --- a/rootly_sdk/models/new_sla_data_attributes_completion_deadline_days.py +++ b/rootly_sdk/models/new_sla_data_attributes_completion_deadline_days.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewSlaDataAttributesCompletionDeadlineDays = Literal[1, 2, 3, 4, 5, 6, 7, 14, 21, 30] @@ -18,7 +18,7 @@ def check_new_sla_data_attributes_completion_deadline_days(value: int) -> NewSlaDataAttributesCompletionDeadlineDays: if value in NEW_SLA_DATA_ATTRIBUTES_COMPLETION_DEADLINE_DAYS_VALUES: - return cast(NewSlaDataAttributesCompletionDeadlineDays, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SLA_DATA_ATTRIBUTES_COMPLETION_DEADLINE_DAYS_VALUES!r}" ) diff --git a/rootly_sdk/models/new_sla_data_attributes_completion_deadline_parent_status.py b/rootly_sdk/models/new_sla_data_attributes_completion_deadline_parent_status.py index aaeabd2b..f4d931ca 100644 --- a/rootly_sdk/models/new_sla_data_attributes_completion_deadline_parent_status.py +++ b/rootly_sdk/models/new_sla_data_attributes_completion_deadline_parent_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewSlaDataAttributesCompletionDeadlineParentStatus = Literal[ "cancelled", "closed", "in_triage", "mitigated", "resolved", "started" @@ -22,7 +22,7 @@ def check_new_sla_data_attributes_completion_deadline_parent_status( if value is None: return None if value in NEW_SLA_DATA_ATTRIBUTES_COMPLETION_DEADLINE_PARENT_STATUS_VALUES: - return cast(NewSlaDataAttributesCompletionDeadlineParentStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SLA_DATA_ATTRIBUTES_COMPLETION_DEADLINE_PARENT_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/new_sla_data_attributes_condition_match_type.py b/rootly_sdk/models/new_sla_data_attributes_condition_match_type.py index 14611058..307c71ae 100644 --- a/rootly_sdk/models/new_sla_data_attributes_condition_match_type.py +++ b/rootly_sdk/models/new_sla_data_attributes_condition_match_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewSlaDataAttributesConditionMatchType = Literal["ALL", "ANY"] @@ -14,7 +14,7 @@ def check_new_sla_data_attributes_condition_match_type( if value is None: return None if value in NEW_SLA_DATA_ATTRIBUTES_CONDITION_MATCH_TYPE_VALUES: - return cast(NewSlaDataAttributesConditionMatchType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SLA_DATA_ATTRIBUTES_CONDITION_MATCH_TYPE_VALUES!r}" ) 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 25e9f894..c4c46fc6 100644 --- a/rootly_sdk/models/new_sla_data_attributes_conditions_item.py +++ b/rootly_sdk/models/new_sla_data_attributes_conditions_item.py @@ -1,9 +1,10 @@ +from __future__ import annotations + 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_sla_data_attributes_conditions_item_conditionable_type import ( NewSlaDataAttributesConditionsItemConditionableType, @@ -24,33 +25,32 @@ class NewSlaDataAttributesConditionsItem: Attributes: conditionable_type (NewSlaDataAttributesConditionsItemConditionableType): The type of condition operator (str): The comparison operator - 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 + 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 values); otherwise use 'status' (with parent status names). Sending the wrong one will return a validation error. - 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 + 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 """ conditionable_type: NewSlaDataAttributesConditionsItemConditionableType operator: str - 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) + property_: NewSlaDataAttributesConditionsItemProperty | Unset = UNSET + values: list[str] | None | Unset = UNSET + form_field_id: None | Unset | UUID = UNSET + position: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: conditionable_type: str = self.conditionable_type operator = self.operator - property_: Unset | str = UNSET + property_: str | Unset = UNSET if not isinstance(self.property_, Unset): property_ = self.property_ - values: None | Unset | list[str] + values: list[str] | None | Unset if isinstance(self.values, Unset): values = UNSET elif isinstance(self.values, list): @@ -59,7 +59,7 @@ def to_dict(self) -> dict[str, Any]: else: values = self.values - form_field_id: None | Unset | str + form_field_id: None | str | Unset if isinstance(self.form_field_id, Unset): form_field_id = UNSET elif isinstance(self.form_field_id, UUID): @@ -70,7 +70,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "conditionable_type": conditionable_type, @@ -98,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_: Unset | NewSlaDataAttributesConditionsItemProperty + property_: NewSlaDataAttributesConditionsItemProperty | Unset if isinstance(_property_, Unset): property_ = UNSET else: property_ = check_new_sla_data_attributes_conditions_item_property(_property_) - def _parse_values(data: object) -> None | Unset | list[str]: + def _parse_values(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -115,13 +115,13 @@ def _parse_values(data: object) -> None | Unset | list[str]: values_type_0 = cast(list[str], data) return values_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) values = _parse_values(d.pop("values", UNSET)) - def _parse_form_field_id(data: object) -> None | UUID | Unset: + def _parse_form_field_id(data: object) -> None | Unset | UUID: if data is None: return data if isinstance(data, Unset): @@ -132,9 +132,9 @@ def _parse_form_field_id(data: object) -> None | UUID | Unset: form_field_id_type_0 = UUID(data) return form_field_id_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | UUID | Unset, data) + return cast(None | Unset | UUID, data) form_field_id = _parse_form_field_id(d.pop("form_field_id", UNSET)) @@ -149,21 +149,4 @@ def _parse_form_field_id(data: object) -> None | UUID | Unset: position=position, ) - new_sla_data_attributes_conditions_item.additional_properties = d return new_sla_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_sla_data_attributes_conditions_item_conditionable_type.py b/rootly_sdk/models/new_sla_data_attributes_conditions_item_conditionable_type.py index 9e6f37db..5c7d972f 100644 --- a/rootly_sdk/models/new_sla_data_attributes_conditions_item_conditionable_type.py +++ b/rootly_sdk/models/new_sla_data_attributes_conditions_item_conditionable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewSlaDataAttributesConditionsItemConditionableType = Literal[ "SLAs::BuiltInFieldCondition", "SLAs::CustomFieldCondition" @@ -18,7 +18,7 @@ def check_new_sla_data_attributes_conditions_item_conditionable_type( if value is None: return None if value in NEW_SLA_DATA_ATTRIBUTES_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES: - return cast(NewSlaDataAttributesConditionsItemConditionableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SLA_DATA_ATTRIBUTES_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_sla_data_attributes_conditions_item_property.py b/rootly_sdk/models/new_sla_data_attributes_conditions_item_property.py index 2842aefd..a35c6c35 100644 --- a/rootly_sdk/models/new_sla_data_attributes_conditions_item_property.py +++ b/rootly_sdk/models/new_sla_data_attributes_conditions_item_property.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewSlaDataAttributesConditionsItemProperty = Literal[ "acknowledged_at", @@ -49,7 +49,7 @@ def check_new_sla_data_attributes_conditions_item_property( if value is None: return None if value in NEW_SLA_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_VALUES: - return cast(NewSlaDataAttributesConditionsItemProperty, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SLA_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_VALUES!r}" ) 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 9a632e5d..4dc328b2 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,8 +1,9 @@ +from __future__ import annotations + 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.new_sla_data_attributes_notification_configurations_item_offset_type import ( NewSlaDataAttributesNotificationConfigurationsItemOffsetType, @@ -23,7 +24,6 @@ class NewSlaDataAttributesNotificationConfigurationsItem: offset_type: NewSlaDataAttributesNotificationConfigurationsItemOffsetType offset_days: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: offset_type: str = self.offset_type @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: offset_days = self.offset_days field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "offset_type": offset_type, @@ -53,21 +53,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: offset_days=offset_days, ) - new_sla_data_attributes_notification_configurations_item.additional_properties = d return new_sla_data_attributes_notification_configurations_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_sla_data_attributes_notification_configurations_item_offset_type.py b/rootly_sdk/models/new_sla_data_attributes_notification_configurations_item_offset_type.py index 189c5d57..be4c0d00 100644 --- a/rootly_sdk/models/new_sla_data_attributes_notification_configurations_item_offset_type.py +++ b/rootly_sdk/models/new_sla_data_attributes_notification_configurations_item_offset_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewSlaDataAttributesNotificationConfigurationsItemOffsetType = Literal["after_due", "before_due", "when_due"] @@ -17,7 +17,7 @@ def check_new_sla_data_attributes_notification_configurations_item_offset_type( if value is None: return None if value in NEW_SLA_DATA_ATTRIBUTES_NOTIFICATION_CONFIGURATIONS_ITEM_OFFSET_TYPE_VALUES: - return cast(NewSlaDataAttributesNotificationConfigurationsItemOffsetType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SLA_DATA_ATTRIBUTES_NOTIFICATION_CONFIGURATIONS_ITEM_OFFSET_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_sla_data_type.py b/rootly_sdk/models/new_sla_data_type.py index dc3ce83d..ddae7591 100644 --- a/rootly_sdk/models/new_sla_data_type.py +++ b/rootly_sdk/models/new_sla_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewSlaDataType = Literal["slas"] @@ -11,5 +11,5 @@ def check_new_sla_data_type(value: str | None) -> NewSlaDataType | None: if value is None: return None if value in NEW_SLA_DATA_TYPE_VALUES: - return cast(NewSlaDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_SLA_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_status_page.py b/rootly_sdk/models/new_status_page.py index 330e306b..ce946bb8 100644 --- a/rootly_sdk/models/new_status_page.py +++ b/rootly_sdk/models/new_status_page.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_status_page_data import NewStatusPageData @@ -18,14 +19,13 @@ class NewStatusPage: data (NewStatusPageData): """ - data: "NewStatusPageData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewStatusPageData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_status_page.additional_properties = d return new_status_page - - @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.py b/rootly_sdk/models/new_status_page_announcement.py index 18bf2235..3baac27a 100644 --- a/rootly_sdk/models/new_status_page_announcement.py +++ b/rootly_sdk/models/new_status_page_announcement.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_status_page_announcement_data import NewStatusPageAnnouncementData @@ -18,14 +19,13 @@ class NewStatusPageAnnouncement: data (NewStatusPageAnnouncementData): """ - data: "NewStatusPageAnnouncementData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewStatusPageAnnouncementData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 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 index 643c78f1..5403c917 100644 --- a/rootly_sdk/models/new_status_page_announcement_data.py +++ b/rootly_sdk/models/new_status_page_announcement_data.py @@ -1,8 +1,9 @@ +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_status_page_announcement_data_type import ( NewStatusPageAnnouncementDataType, @@ -25,8 +26,7 @@ class NewStatusPageAnnouncementData: """ type_: NewStatusPageAnnouncementDataType - attributes: "NewStatusPageAnnouncementDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewStatusPageAnnouncementDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 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 index 424a5690..aae594b6 100644 --- a/rootly_sdk/models/new_status_page_announcement_data_attributes.py +++ b/rootly_sdk/models/new_status_page_announcement_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,13 +16,12 @@ 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 + notify_subscribers (bool | Unset): Controls if status page subscribers should be notified. Defaults to true """ title: str body: str - notify_subscribers: Unset | bool = UNSET + notify_subscribers: bool | Unset = UNSET def to_dict(self) -> dict[str, Any]: title = self.title diff --git a/rootly_sdk/models/new_status_page_announcement_data_type.py b/rootly_sdk/models/new_status_page_announcement_data_type.py index 224ad0ca..e0948807 100644 --- a/rootly_sdk/models/new_status_page_announcement_data_type.py +++ b/rootly_sdk/models/new_status_page_announcement_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewStatusPageAnnouncementDataType = Literal["status_page_announcements"] @@ -11,5 +11,5 @@ def check_new_status_page_announcement_data_type(value: str | None) -> NewStatus if value is None: return None if value in NEW_STATUS_PAGE_ANNOUNCEMENT_DATA_TYPE_VALUES: - return cast(NewStatusPageAnnouncementDataType, value) + return 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 index f2b146f0..7e756e07 100644 --- a/rootly_sdk/models/new_status_page_component.py +++ b/rootly_sdk/models/new_status_page_component.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_status_page_component_data import NewStatusPageComponentData @@ -18,14 +19,13 @@ class NewStatusPageComponent: data (NewStatusPageComponentData): """ - data: "NewStatusPageComponentData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewStatusPageComponentData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 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 index 6729f0b0..55044061 100644 --- a/rootly_sdk/models/new_status_page_component_data.py +++ b/rootly_sdk/models/new_status_page_component_data.py @@ -1,8 +1,9 @@ +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_status_page_component_data_type import ( NewStatusPageComponentDataType, @@ -25,8 +26,7 @@ class NewStatusPageComponentData: """ type_: NewStatusPageComponentDataType - attributes: "NewStatusPageComponentDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewStatusPageComponentDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 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 index 858cf79b..6f090246 100644 --- a/rootly_sdk/models/new_status_page_component_data_attributes.py +++ b/rootly_sdk/models/new_status_page_component_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,38 +18,37 @@ 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 + name (None | str | Unset): Name of the component (required for ad-hoc components; derived from the source for + catalog-backed ones) + description (None | str | Unset): Description of the component (ad-hoc components only) + status_page_component_group_id (None | str | Unset): ID of the component group on the same status page + position (int | Unset): 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 + source_type (NewStatusPageComponentDataAttributesSourceType | Unset): Catalog source type backing the component + source_id (None | str | Unset): 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 + name: None | str | Unset = UNSET + description: None | str | Unset = UNSET + status_page_component_group_id: None | str | Unset = UNSET + position: int | Unset = UNSET + source_type: NewStatusPageComponentDataAttributesSourceType | Unset = UNSET + source_id: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: - name: None | Unset | str + name: None | str | Unset if isinstance(self.name, Unset): name = UNSET else: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - status_page_component_group_id: None | Unset | str + status_page_component_group_id: None | str | Unset if isinstance(self.status_page_component_group_id, Unset): status_page_component_group_id = UNSET else: @@ -55,11 +56,11 @@ def to_dict(self) -> dict[str, Any]: position = self.position - source_type: Unset | str = UNSET + source_type: str | Unset = UNSET if not isinstance(self.source_type, Unset): source_type = self.source_type - source_id: None | Unset | str + source_id: None | str | Unset if isinstance(self.source_id, Unset): source_id = UNSET else: @@ -87,30 +88,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_name(data: object) -> None | Unset | str: + def _parse_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) name = _parse_name(d.pop("name", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_status_page_component_group_id(data: object) -> None | Unset | str: + def _parse_status_page_component_group_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) status_page_component_group_id = _parse_status_page_component_group_id( d.pop("status_page_component_group_id", UNSET) @@ -119,18 +120,18 @@ def _parse_status_page_component_group_id(data: object) -> None | Unset | str: position = d.pop("position", UNSET) _source_type = d.pop("source_type", UNSET) - source_type: Unset | NewStatusPageComponentDataAttributesSourceType + source_type: NewStatusPageComponentDataAttributesSourceType | Unset 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: + def _parse_source_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) source_id = _parse_source_id(d.pop("source_id", UNSET)) 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 index fbe2cc82..6dc623ab 100644 --- 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 @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewStatusPageComponentDataAttributesSourceType = Literal["Functionality", "Service"] @@ -14,7 +14,7 @@ def check_new_status_page_component_data_attributes_source_type( if value is None: return None if value in NEW_STATUS_PAGE_COMPONENT_DATA_ATTRIBUTES_SOURCE_TYPE_VALUES: - return cast(NewStatusPageComponentDataAttributesSourceType, value) + return 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 index ce92419e..9e3fcb32 100644 --- a/rootly_sdk/models/new_status_page_component_data_type.py +++ b/rootly_sdk/models/new_status_page_component_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewStatusPageComponentDataType = Literal["status_page_components"] @@ -11,5 +11,5 @@ def check_new_status_page_component_data_type(value: str | None) -> NewStatusPag if value is None: return None if value in NEW_STATUS_PAGE_COMPONENT_DATA_TYPE_VALUES: - return cast(NewStatusPageComponentDataType, value) + return 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 index a5e094f5..5293e537 100644 --- a/rootly_sdk/models/new_status_page_component_group.py +++ b/rootly_sdk/models/new_status_page_component_group.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_status_page_component_group_data import NewStatusPageComponentGroupData @@ -18,14 +19,13 @@ class NewStatusPageComponentGroup: data (NewStatusPageComponentGroupData): """ - data: "NewStatusPageComponentGroupData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewStatusPageComponentGroupData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 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 index 75a9d81a..5d6dd721 100644 --- a/rootly_sdk/models/new_status_page_component_group_data.py +++ b/rootly_sdk/models/new_status_page_component_group_data.py @@ -1,8 +1,9 @@ +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_status_page_component_group_data_type import ( NewStatusPageComponentGroupDataType, @@ -25,8 +26,7 @@ class NewStatusPageComponentGroupData: """ type_: NewStatusPageComponentGroupDataType - attributes: "NewStatusPageComponentGroupDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewStatusPageComponentGroupDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 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 index e5bb5855..033e1280 100644 --- a/rootly_sdk/models/new_status_page_component_group_data_attributes.py +++ b/rootly_sdk/models/new_status_page_component_group_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,21 +15,21 @@ 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 + description (None | str | Unset): Description of the component group + position (int | Unset): 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 + collapsed_by_default (bool | None | Unset): 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 + description: None | str | Unset = UNSET + position: int | Unset = UNSET + collapsed_by_default: bool | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -35,7 +37,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position - collapsed_by_default: None | Unset | bool + collapsed_by_default: bool | None | Unset if isinstance(self.collapsed_by_default, Unset): collapsed_by_default = UNSET else: @@ -62,23 +64,23 @@ 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: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) position = d.pop("position", UNSET) - def _parse_collapsed_by_default(data: object) -> None | Unset | bool: + def _parse_collapsed_by_default(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) collapsed_by_default = _parse_collapsed_by_default(d.pop("collapsed_by_default", UNSET)) 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 index 08c006f1..7aaa2b86 100644 --- a/rootly_sdk/models/new_status_page_component_group_data_type.py +++ b/rootly_sdk/models/new_status_page_component_group_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewStatusPageComponentGroupDataType = Literal["status_page_component_groups"] @@ -11,5 +11,5 @@ def check_new_status_page_component_group_data_type(value: str | None) -> NewSta if value is None: return None if value in NEW_STATUS_PAGE_COMPONENT_GROUP_DATA_TYPE_VALUES: - return cast(NewStatusPageComponentGroupDataType, value) + return 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 42e919f0..dc4b2296 100644 --- a/rootly_sdk/models/new_status_page_data.py +++ b/rootly_sdk/models/new_status_page_data.py @@ -1,8 +1,9 @@ +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_status_page_data_type import NewStatusPageDataType, check_new_status_page_data_type @@ -22,8 +23,7 @@ class NewStatusPageData: """ type_: NewStatusPageDataType - attributes: "NewStatusPageDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewStatusPageDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_status_page_data.additional_properties = d return new_status_page_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_data_attributes.py b/rootly_sdk/models/new_status_page_data_attributes.py index 079589e8..6fcbae04 100644 --- a/rootly_sdk/models/new_status_page_data_attributes.py +++ b/rootly_sdk/models/new_status_page_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -29,180 +31,180 @@ class NewStatusPageDataAttributes: """ Attributes: title (str): The title of the status page - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `title`; any submitted value is ignored. This + slug (None | str | Unset): 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 + 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 search results - 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 + 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 instead) Default: False. - 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 + 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 """ title: str - 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 + slug: None | 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: 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 def to_dict(self) -> dict[str, Any]: title = self.title - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - public_title: None | Unset | str + public_title: None | str | Unset if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - header_color: None | Unset | str + header_color: None | str | Unset if isinstance(self.header_color, Unset): header_color = UNSET else: header_color = self.header_color - footer_color: None | Unset | str + footer_color: None | str | Unset if isinstance(self.footer_color, Unset): footer_color = UNSET else: footer_color = self.footer_color - allow_search_engine_index: None | Unset | bool + allow_search_engine_index: bool | None | Unset 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: None | Unset | bool + show_uptime: bool | None | Unset if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: Unset | int = UNSET + show_uptime_last_days: int | Unset = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - success_message: None | Unset | str + success_message: None | str | Unset if isinstance(self.success_message, Unset): success_message = UNSET else: success_message = self.success_message - failure_message: None | Unset | str + failure_message: None | str | Unset if isinstance(self.failure_message, Unset): failure_message = UNSET else: failure_message = self.failure_message - authentication_method: Unset | str = UNSET + authentication_method: str | Unset = UNSET if not isinstance(self.authentication_method, Unset): authentication_method = self.authentication_method - authentication_enabled: None | Unset | bool + authentication_enabled: bool | None | Unset if isinstance(self.authentication_enabled, Unset): authentication_enabled = UNSET else: authentication_enabled = self.authentication_enabled - authentication_password: None | Unset | str + authentication_password: None | str | Unset if isinstance(self.authentication_password, Unset): authentication_password = UNSET else: authentication_password = self.authentication_password - saml_idp_sso_service_url: None | Unset | str + saml_idp_sso_service_url: None | str | Unset 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 | Unset | str + saml_idp_slo_service_url: None | str | Unset 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 | Unset | str + saml_idp_cert: None | str | Unset if isinstance(self.saml_idp_cert, Unset): saml_idp_cert = UNSET else: saml_idp_cert = self.saml_idp_cert - saml_name_identifier_format: Unset | str = UNSET + saml_name_identifier_format: str | Unset = UNSET if not isinstance(self.saml_name_identifier_format, Unset): saml_name_identifier_format = self.saml_name_identifier_format - section_order: None | Unset | list[str] + section_order: list[str] | None | Unset if isinstance(self.section_order, Unset): section_order = UNSET elif isinstance(self.section_order, list): @@ -214,7 +216,7 @@ def to_dict(self) -> dict[str, Any]: else: section_order = self.section_order - external_domain_names: None | Unset | list[str] + external_domain_names: list[str] | None | Unset if isinstance(self.external_domain_names, Unset): external_domain_names = UNSET elif isinstance(self.external_domain_names, list): @@ -223,51 +225,51 @@ def to_dict(self) -> dict[str, Any]: else: external_domain_names = self.external_domain_names - website_url: None | Unset | str + website_url: None | str | Unset if isinstance(self.website_url, Unset): website_url = UNSET else: website_url = self.website_url - website_privacy_url: None | Unset | str + website_privacy_url: None | str | Unset if isinstance(self.website_privacy_url, Unset): website_privacy_url = UNSET else: website_privacy_url = self.website_privacy_url - website_support_url: None | Unset | str + website_support_url: None | str | Unset if isinstance(self.website_support_url, Unset): website_support_url = UNSET else: website_support_url = self.website_support_url - ga_tracking_id: None | Unset | str + ga_tracking_id: None | str | Unset if isinstance(self.ga_tracking_id, Unset): ga_tracking_id = UNSET else: ga_tracking_id = self.ga_tracking_id - time_zone: None | Unset | str + time_zone: None | str | Unset if isinstance(self.time_zone, Unset): time_zone = UNSET else: time_zone = self.time_zone - public: None | Unset | bool + public: bool | None | Unset if isinstance(self.public, Unset): public = UNSET else: public = self.public - service_ids: Unset | list[str] = UNSET + service_ids: list[str] | Unset = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: Unset | list[str] = UNSET + functionality_ids: list[str] | Unset = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - enabled: None | Unset | bool + enabled: bool | None | Unset if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -346,157 +348,157 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) title = d.pop("title") - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_public_title(data: object) -> None | Unset | str: + def _parse_public_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_header_color(data: object) -> None | Unset | str: + def _parse_header_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) header_color = _parse_header_color(d.pop("header_color", UNSET)) - def _parse_footer_color(data: object) -> None | Unset | str: + def _parse_footer_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) footer_color = _parse_footer_color(d.pop("footer_color", UNSET)) - def _parse_allow_search_engine_index(data: object) -> None | Unset | bool: + def _parse_allow_search_engine_index(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) allow_search_engine_index = _parse_allow_search_engine_index(d.pop("allow_search_engine_index", UNSET)) - def _parse_show_uptime(data: object) -> None | Unset | bool: + def _parse_show_uptime(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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: Unset | NewStatusPageDataAttributesShowUptimeLastDays + show_uptime_last_days: NewStatusPageDataAttributesShowUptimeLastDays | Unset 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 | Unset | str: + def _parse_success_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) success_message = _parse_success_message(d.pop("success_message", UNSET)) - def _parse_failure_message(data: object) -> None | Unset | str: + def _parse_failure_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) failure_message = _parse_failure_message(d.pop("failure_message", UNSET)) _authentication_method = d.pop("authentication_method", UNSET) - authentication_method: Unset | NewStatusPageDataAttributesAuthenticationMethod + authentication_method: NewStatusPageDataAttributesAuthenticationMethod | Unset 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) -> None | Unset | bool: + def _parse_authentication_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) authentication_enabled = _parse_authentication_enabled(d.pop("authentication_enabled", UNSET)) - def _parse_authentication_password(data: object) -> None | Unset | str: + def _parse_authentication_password(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) authentication_password = _parse_authentication_password(d.pop("authentication_password", UNSET)) - def _parse_saml_idp_sso_service_url(data: object) -> None | Unset | str: + def _parse_saml_idp_sso_service_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_saml_idp_slo_service_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_saml_idp_cert(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: Unset | NewStatusPageDataAttributesSamlNameIdentifierFormat + saml_name_identifier_format: NewStatusPageDataAttributesSamlNameIdentifierFormat | Unset if isinstance(_saml_name_identifier_format, Unset): saml_name_identifier_format = UNSET else: @@ -504,9 +506,7 @@ def _parse_saml_idp_cert(data: object) -> None | Unset | str: _saml_name_identifier_format ) - def _parse_section_order( - data: object, - ) -> None | Unset | list[NewStatusPageDataAttributesSectionOrderType0Item]: + def _parse_section_order(data: object) -> list[NewStatusPageDataAttributesSectionOrderType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -524,13 +524,13 @@ def _parse_section_order( section_order_type_0.append(section_order_type_0_item) return section_order_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[NewStatusPageDataAttributesSectionOrderType0Item], data) + return cast(list[NewStatusPageDataAttributesSectionOrderType0Item] | None | Unset, data) section_order = _parse_section_order(d.pop("section_order", UNSET)) - def _parse_external_domain_names(data: object) -> None | Unset | list[str]: + def _parse_external_domain_names(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -541,63 +541,63 @@ def _parse_external_domain_names(data: object) -> None | Unset | list[str]: external_domain_names_type_0 = cast(list[str], data) return external_domain_names_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) external_domain_names = _parse_external_domain_names(d.pop("external_domain_names", UNSET)) - def _parse_website_url(data: object) -> None | Unset | str: + def _parse_website_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) website_url = _parse_website_url(d.pop("website_url", UNSET)) - def _parse_website_privacy_url(data: object) -> None | Unset | str: + def _parse_website_privacy_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) website_privacy_url = _parse_website_privacy_url(d.pop("website_privacy_url", UNSET)) - def _parse_website_support_url(data: object) -> None | Unset | str: + def _parse_website_support_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) website_support_url = _parse_website_support_url(d.pop("website_support_url", UNSET)) - def _parse_ga_tracking_id(data: object) -> None | Unset | str: + def _parse_ga_tracking_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) ga_tracking_id = _parse_ga_tracking_id(d.pop("ga_tracking_id", UNSET)) - def _parse_time_zone(data: object) -> None | Unset | str: + def _parse_time_zone(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) - def _parse_public(data: object) -> None | Unset | bool: + def _parse_public(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) public = _parse_public(d.pop("public", UNSET)) @@ -605,12 +605,12 @@ def _parse_public(data: object) -> None | Unset | bool: functionality_ids = cast(list[str], d.pop("functionality_ids", UNSET)) - def _parse_enabled(data: object) -> None | Unset | bool: + def _parse_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/new_status_page_data_attributes_authentication_method.py b/rootly_sdk/models/new_status_page_data_attributes_authentication_method.py index 4bbb3e79..361410e0 100644 --- a/rootly_sdk/models/new_status_page_data_attributes_authentication_method.py +++ b/rootly_sdk/models/new_status_page_data_attributes_authentication_method.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewStatusPageDataAttributesAuthenticationMethod = Literal["none", "password", "saml"] @@ -15,7 +15,7 @@ def check_new_status_page_data_attributes_authentication_method( if value is None: return None if value in NEW_STATUS_PAGE_DATA_ATTRIBUTES_AUTHENTICATION_METHOD_VALUES: - return cast(NewStatusPageDataAttributesAuthenticationMethod, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_STATUS_PAGE_DATA_ATTRIBUTES_AUTHENTICATION_METHOD_VALUES!r}" ) diff --git a/rootly_sdk/models/new_status_page_data_attributes_saml_name_identifier_format.py b/rootly_sdk/models/new_status_page_data_attributes_saml_name_identifier_format.py index dba89619..5d0d5717 100644 --- a/rootly_sdk/models/new_status_page_data_attributes_saml_name_identifier_format.py +++ b/rootly_sdk/models/new_status_page_data_attributes_saml_name_identifier_format.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewStatusPageDataAttributesSamlNameIdentifierFormat = Literal[ "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", @@ -23,7 +23,7 @@ def check_new_status_page_data_attributes_saml_name_identifier_format( if value is None: return None if value in NEW_STATUS_PAGE_DATA_ATTRIBUTES_SAML_NAME_IDENTIFIER_FORMAT_VALUES: - return cast(NewStatusPageDataAttributesSamlNameIdentifierFormat, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_STATUS_PAGE_DATA_ATTRIBUTES_SAML_NAME_IDENTIFIER_FORMAT_VALUES!r}" ) diff --git a/rootly_sdk/models/new_status_page_data_attributes_section_order_type_0_item.py b/rootly_sdk/models/new_status_page_data_attributes_section_order_type_0_item.py index a7caa5df..c0b52139 100644 --- a/rootly_sdk/models/new_status_page_data_attributes_section_order_type_0_item.py +++ b/rootly_sdk/models/new_status_page_data_attributes_section_order_type_0_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewStatusPageDataAttributesSectionOrderType0Item = Literal["incidents", "maintenance", "system_status"] @@ -17,7 +17,7 @@ def check_new_status_page_data_attributes_section_order_type_0_item( if value is None: return None if value in NEW_STATUS_PAGE_DATA_ATTRIBUTES_SECTION_ORDER_TYPE_0_ITEM_VALUES: - return cast(NewStatusPageDataAttributesSectionOrderType0Item, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_STATUS_PAGE_DATA_ATTRIBUTES_SECTION_ORDER_TYPE_0_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_status_page_data_attributes_show_uptime_last_days.py b/rootly_sdk/models/new_status_page_data_attributes_show_uptime_last_days.py index e137b0bd..1a3178d0 100644 --- a/rootly_sdk/models/new_status_page_data_attributes_show_uptime_last_days.py +++ b/rootly_sdk/models/new_status_page_data_attributes_show_uptime_last_days.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewStatusPageDataAttributesShowUptimeLastDays = Literal[30, 60, 90] @@ -13,7 +13,7 @@ def check_new_status_page_data_attributes_show_uptime_last_days( value: int, ) -> NewStatusPageDataAttributesShowUptimeLastDays: if value in NEW_STATUS_PAGE_DATA_ATTRIBUTES_SHOW_UPTIME_LAST_DAYS_VALUES: - return cast(NewStatusPageDataAttributesShowUptimeLastDays, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_STATUS_PAGE_DATA_ATTRIBUTES_SHOW_UPTIME_LAST_DAYS_VALUES!r}" ) diff --git a/rootly_sdk/models/new_status_page_data_type.py b/rootly_sdk/models/new_status_page_data_type.py index d1ea7120..51aad8dd 100644 --- a/rootly_sdk/models/new_status_page_data_type.py +++ b/rootly_sdk/models/new_status_page_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewStatusPageDataType = Literal["status_pages"] @@ -11,5 +11,5 @@ def check_new_status_page_data_type(value: str | None) -> NewStatusPageDataType if value is None: return None if value in NEW_STATUS_PAGE_DATA_TYPE_VALUES: - return cast(NewStatusPageDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_STATUS_PAGE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_status_page_team.py b/rootly_sdk/models/new_status_page_team.py new file mode 100644 index 00000000..2b438cb9 --- /dev/null +++ b/rootly_sdk/models/new_status_page_team.py @@ -0,0 +1,48 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.new_status_page_team_data import NewStatusPageTeamData + + +T = TypeVar("T", bound="NewStatusPageTeam") + + +@_attrs_define +class NewStatusPageTeam: + """ + Attributes: + data (NewStatusPageTeamData): + """ + + data: NewStatusPageTeamData + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + + 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_team_data import NewStatusPageTeamData + + d = dict(src_dict) + data = NewStatusPageTeamData.from_dict(d.pop("data")) + + new_status_page_team = cls( + data=data, + ) + + return new_status_page_team diff --git a/rootly_sdk/models/new_status_page_team_data.py b/rootly_sdk/models/new_status_page_team_data.py new file mode 100644 index 00000000..d865e89e --- /dev/null +++ b/rootly_sdk/models/new_status_page_team_data.py @@ -0,0 +1,58 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.new_status_page_team_data_type import NewStatusPageTeamDataType, check_new_status_page_team_data_type + +if TYPE_CHECKING: + from ..models.new_status_page_team_data_attributes import NewStatusPageTeamDataAttributes + + +T = TypeVar("T", bound="NewStatusPageTeamData") + + +@_attrs_define +class NewStatusPageTeamData: + """ + Attributes: + type_ (NewStatusPageTeamDataType): + attributes (NewStatusPageTeamDataAttributes): + """ + + type_: NewStatusPageTeamDataType + attributes: NewStatusPageTeamDataAttributes + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + + 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_team_data_attributes import NewStatusPageTeamDataAttributes + + d = dict(src_dict) + type_ = check_new_status_page_team_data_type(d.pop("type")) + + attributes = NewStatusPageTeamDataAttributes.from_dict(d.pop("attributes")) + + new_status_page_team_data = cls( + type_=type_, + attributes=attributes, + ) + + return new_status_page_team_data diff --git a/rootly_sdk/models/new_status_page_team_data_attributes.py b/rootly_sdk/models/new_status_page_team_data_attributes.py new file mode 100644 index 00000000..01ba15d3 --- /dev/null +++ b/rootly_sdk/models/new_status_page_team_data_attributes.py @@ -0,0 +1,68 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar +from uuid import UUID + +from attrs import define as _attrs_define + +from ..models.new_status_page_team_data_attributes_permission_level import ( + NewStatusPageTeamDataAttributesPermissionLevel, + check_new_status_page_team_data_attributes_permission_level, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="NewStatusPageTeamDataAttributes") + + +@_attrs_define +class NewStatusPageTeamDataAttributes: + """ + Attributes: + group_id (UUID): ID of the team granted access to the status page. Teams are listed by GET /v1/teams. A status + page accepts at most 50 teams + permission_level (NewStatusPageTeamDataAttributesPermissionLevel | Unset): publish_only lets team members post + status page updates and announcements. edit_and_publish also lets them edit the page, its components, templates, + and subscribers. Defaults to edit_and_publish + """ + + group_id: UUID + permission_level: NewStatusPageTeamDataAttributesPermissionLevel | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + group_id = str(self.group_id) + + permission_level: str | Unset = UNSET + if not isinstance(self.permission_level, Unset): + permission_level = self.permission_level + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "group_id": group_id, + } + ) + if permission_level is not UNSET: + field_dict["permission_level"] = permission_level + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + group_id = UUID(d.pop("group_id")) + + _permission_level = d.pop("permission_level", UNSET) + permission_level: NewStatusPageTeamDataAttributesPermissionLevel | Unset + if isinstance(_permission_level, Unset): + permission_level = UNSET + else: + permission_level = check_new_status_page_team_data_attributes_permission_level(_permission_level) + + new_status_page_team_data_attributes = cls( + group_id=group_id, + permission_level=permission_level, + ) + + return new_status_page_team_data_attributes diff --git a/rootly_sdk/models/new_status_page_team_data_attributes_permission_level.py b/rootly_sdk/models/new_status_page_team_data_attributes_permission_level.py new file mode 100644 index 00000000..38bf2835 --- /dev/null +++ b/rootly_sdk/models/new_status_page_team_data_attributes_permission_level.py @@ -0,0 +1,20 @@ +from typing import Literal + +NewStatusPageTeamDataAttributesPermissionLevel = Literal["edit_and_publish", "publish_only"] + +NEW_STATUS_PAGE_TEAM_DATA_ATTRIBUTES_PERMISSION_LEVEL_VALUES: set[NewStatusPageTeamDataAttributesPermissionLevel] = { + "edit_and_publish", + "publish_only", +} + + +def check_new_status_page_team_data_attributes_permission_level( + value: str | None, +) -> NewStatusPageTeamDataAttributesPermissionLevel | None: + if value is None: + return None + if value in NEW_STATUS_PAGE_TEAM_DATA_ATTRIBUTES_PERMISSION_LEVEL_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_STATUS_PAGE_TEAM_DATA_ATTRIBUTES_PERMISSION_LEVEL_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_status_page_team_data_type.py b/rootly_sdk/models/new_status_page_team_data_type.py new file mode 100644 index 00000000..fdd465c5 --- /dev/null +++ b/rootly_sdk/models/new_status_page_team_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +NewStatusPageTeamDataType = Literal["status_page_groups"] + +NEW_STATUS_PAGE_TEAM_DATA_TYPE_VALUES: set[NewStatusPageTeamDataType] = { + "status_page_groups", +} + + +def check_new_status_page_team_data_type(value: str | None) -> NewStatusPageTeamDataType | None: + if value is None: + return None + if value in NEW_STATUS_PAGE_TEAM_DATA_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_STATUS_PAGE_TEAM_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_status_page_template.py b/rootly_sdk/models/new_status_page_template.py index 2a888f80..c2ed2b55 100644 --- a/rootly_sdk/models/new_status_page_template.py +++ b/rootly_sdk/models/new_status_page_template.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_status_page_template_data import NewStatusPageTemplateData @@ -18,14 +19,13 @@ class NewStatusPageTemplate: data (NewStatusPageTemplateData): """ - data: "NewStatusPageTemplateData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewStatusPageTemplateData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_status_page_template.additional_properties = d return new_status_page_template - - @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_template_data.py b/rootly_sdk/models/new_status_page_template_data.py index fc999006..dcdaf2f5 100644 --- a/rootly_sdk/models/new_status_page_template_data.py +++ b/rootly_sdk/models/new_status_page_template_data.py @@ -1,8 +1,9 @@ +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_status_page_template_data_type import ( NewStatusPageTemplateDataType, @@ -25,8 +26,7 @@ class NewStatusPageTemplateData: """ type_: NewStatusPageTemplateDataType - attributes: "NewStatusPageTemplateDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewStatusPageTemplateDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_status_page_template_data.additional_properties = d return new_status_page_template_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_template_data_attributes.py b/rootly_sdk/models/new_status_page_template_data_attributes.py index b1927d4e..c6d188d0 100644 --- a/rootly_sdk/models/new_status_page_template_data_attributes.py +++ b/rootly_sdk/models/new_status_page_template_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -22,25 +24,25 @@ class NewStatusPageTemplateDataAttributes: Attributes: title (str): Title of the template body (str): Description of the event the template will populate - 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 + 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 """ title: str body: str - 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 + 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 def to_dict(self) -> dict[str, Any]: title = self.title @@ -49,21 +51,21 @@ def to_dict(self) -> dict[str, Any]: status_page_id = self.status_page_id - update_title: None | Unset | str + update_title: None | str | Unset if isinstance(self.update_title, Unset): update_title = UNSET else: update_title = self.update_title - update_status: Unset | str = UNSET + update_status: str | Unset = UNSET if not isinstance(self.update_status, Unset): update_status = self.update_status - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind - should_notify_subscribers: None | Unset | bool + should_notify_subscribers: bool | None | Unset if isinstance(self.should_notify_subscribers, Unset): should_notify_subscribers = UNSET else: @@ -71,7 +73,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position - enabled: None | Unset | bool + enabled: bool | None | Unset if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -111,46 +113,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 | Unset | str: + def _parse_update_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) update_title = _parse_update_title(d.pop("update_title", UNSET)) _update_status = d.pop("update_status", UNSET) - update_status: Unset | NewStatusPageTemplateDataAttributesUpdateStatus + update_status: NewStatusPageTemplateDataAttributesUpdateStatus | Unset 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: Unset | NewStatusPageTemplateDataAttributesKind + kind: NewStatusPageTemplateDataAttributesKind | Unset if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_status_page_template_data_attributes_kind(_kind) - def _parse_should_notify_subscribers(data: object) -> None | Unset | bool: + def _parse_should_notify_subscribers(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) should_notify_subscribers = _parse_should_notify_subscribers(d.pop("should_notify_subscribers", UNSET)) position = d.pop("position", UNSET) - def _parse_enabled(data: object) -> None | Unset | bool: + def _parse_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/new_status_page_template_data_attributes_kind.py b/rootly_sdk/models/new_status_page_template_data_attributes_kind.py index 94ae3d49..8add800a 100644 --- a/rootly_sdk/models/new_status_page_template_data_attributes_kind.py +++ b/rootly_sdk/models/new_status_page_template_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewStatusPageTemplateDataAttributesKind = Literal["normal", "scheduled"] @@ -14,7 +14,7 @@ def check_new_status_page_template_data_attributes_kind( if value is None: return None if value in NEW_STATUS_PAGE_TEMPLATE_DATA_ATTRIBUTES_KIND_VALUES: - return cast(NewStatusPageTemplateDataAttributesKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_STATUS_PAGE_TEMPLATE_DATA_ATTRIBUTES_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/new_status_page_template_data_attributes_update_status.py b/rootly_sdk/models/new_status_page_template_data_attributes_update_status.py index 33106ea1..355b1166 100644 --- a/rootly_sdk/models/new_status_page_template_data_attributes_update_status.py +++ b/rootly_sdk/models/new_status_page_template_data_attributes_update_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewStatusPageTemplateDataAttributesUpdateStatus = Literal[ "completed", "identified", "in_progress", "investigating", "monitoring", "resolved", "scheduled" @@ -21,7 +21,7 @@ def check_new_status_page_template_data_attributes_update_status( if value is None: return None if value in NEW_STATUS_PAGE_TEMPLATE_DATA_ATTRIBUTES_UPDATE_STATUS_VALUES: - return cast(NewStatusPageTemplateDataAttributesUpdateStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_STATUS_PAGE_TEMPLATE_DATA_ATTRIBUTES_UPDATE_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/new_status_page_template_data_type.py b/rootly_sdk/models/new_status_page_template_data_type.py index dceea575..53d1031d 100644 --- a/rootly_sdk/models/new_status_page_template_data_type.py +++ b/rootly_sdk/models/new_status_page_template_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewStatusPageTemplateDataType = Literal["status_page_templates"] @@ -11,5 +11,5 @@ def check_new_status_page_template_data_type(value: str | None) -> NewStatusPage if value is None: return None if value in NEW_STATUS_PAGE_TEMPLATE_DATA_TYPE_VALUES: - return cast(NewStatusPageTemplateDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_STATUS_PAGE_TEMPLATE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_sub_status.py b/rootly_sdk/models/new_sub_status.py index 6baa6d72..9925e8ef 100644 --- a/rootly_sdk/models/new_sub_status.py +++ b/rootly_sdk/models/new_sub_status.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_sub_status_data import NewSubStatusData @@ -18,14 +19,13 @@ class NewSubStatus: data (NewSubStatusData): """ - data: "NewSubStatusData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewSubStatusData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_sub_status.additional_properties = d return new_sub_status - - @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_sub_status_data.py b/rootly_sdk/models/new_sub_status_data.py index b987a434..89fcf536 100644 --- a/rootly_sdk/models/new_sub_status_data.py +++ b/rootly_sdk/models/new_sub_status_data.py @@ -1,8 +1,9 @@ +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_sub_status_data_type import NewSubStatusDataType, check_new_sub_status_data_type @@ -22,8 +23,7 @@ class NewSubStatusData: """ type_: NewSubStatusDataType - attributes: "NewSubStatusDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewSubStatusDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_sub_status_data.additional_properties = d return new_sub_status_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_sub_status_data_attributes.py b/rootly_sdk/models/new_sub_status_data_attributes.py index 08b4e3bb..abf08c78 100644 --- a/rootly_sdk/models/new_sub_status_data_attributes.py +++ b/rootly_sdk/models/new_sub_status_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,36 +20,36 @@ class NewSubStatusDataAttributes: Attributes: name (str): parent_status (NewSubStatusDataAttributesParentStatus): - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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]): + description (None | str | Unset): + position (int | None | Unset): """ name: str parent_status: NewSubStatusDataAttributesParentStatus - slug: None | Unset | str = UNSET - description: None | Unset | str = UNSET - position: None | Unset | int = UNSET + slug: None | str | Unset = UNSET + description: None | str | Unset = UNSET + position: int | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name parent_status: str = self.parent_status - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -77,30 +79,30 @@ 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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/new_sub_status_data_attributes_parent_status.py b/rootly_sdk/models/new_sub_status_data_attributes_parent_status.py index c006ad0a..b2b784c6 100644 --- a/rootly_sdk/models/new_sub_status_data_attributes_parent_status.py +++ b/rootly_sdk/models/new_sub_status_data_attributes_parent_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewSubStatusDataAttributesParentStatus = Literal["retrospective", "started"] @@ -14,7 +14,7 @@ def check_new_sub_status_data_attributes_parent_status( if value is None: return None if value in NEW_SUB_STATUS_DATA_ATTRIBUTES_PARENT_STATUS_VALUES: - return cast(NewSubStatusDataAttributesParentStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_SUB_STATUS_DATA_ATTRIBUTES_PARENT_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/new_sub_status_data_type.py b/rootly_sdk/models/new_sub_status_data_type.py index 2d59feaa..c0193949 100644 --- a/rootly_sdk/models/new_sub_status_data_type.py +++ b/rootly_sdk/models/new_sub_status_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewSubStatusDataType = Literal["sub_statuses"] @@ -11,5 +11,5 @@ def check_new_sub_status_data_type(value: str | None) -> NewSubStatusDataType | if value is None: return None if value in NEW_SUB_STATUS_DATA_TYPE_VALUES: - return cast(NewSubStatusDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_SUB_STATUS_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_team.py b/rootly_sdk/models/new_team.py index 5035166c..482a75d3 100644 --- a/rootly_sdk/models/new_team.py +++ b/rootly_sdk/models/new_team.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_team_data import NewTeamData @@ -18,14 +19,13 @@ class NewTeam: data (NewTeamData): """ - data: "NewTeamData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewTeamData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_team.additional_properties = d return new_team - - @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_team_data.py b/rootly_sdk/models/new_team_data.py index 1d6c1900..4c3a6422 100644 --- a/rootly_sdk/models/new_team_data.py +++ b/rootly_sdk/models/new_team_data.py @@ -1,8 +1,9 @@ +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_team_data_type import NewTeamDataType, check_new_team_data_type @@ -22,8 +23,7 @@ class NewTeamData: """ type_: NewTeamDataType - attributes: "NewTeamDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewTeamDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_team_data.additional_properties = d return new_team_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_team_data_attributes.py b/rootly_sdk/models/new_team_data_attributes.py index 19f2852b..f7dc82a7 100644 --- a/rootly_sdk/models/new_team_data_attributes.py +++ b/rootly_sdk/models/new_team_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -7,6 +9,10 @@ NewTeamDataAttributesAutoAddMembersScope, check_new_team_data_attributes_auto_add_members_scope, ) +from ..models.new_team_data_attributes_schedule_override_policy import ( + NewTeamDataAttributesScheduleOverridePolicy, + check_new_team_data_attributes_schedule_override_policy, +) from ..types import UNSET, Unset if TYPE_CHECKING: @@ -29,77 +35,88 @@ class NewTeamDataAttributes: """ Attributes: name (str): The name of the team - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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: + description (None | str | Unset): The description of the team + public_description (None | str | Unset): The status page 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: :namespace/:kind/:entity_name - 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 + 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 + scim_group_id (None | str | Unset): The SCIM group id linked to this team. Membership syncs from the SCIM group + while the team keeps its own name. + scim_group_external_id (None | str | Unset): Link by the SCIM group's externalId from your identity provider + instead of scim_group_id. Write-only. Rejected when it names a different SCIM group than scim_group_id. + 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 with 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. + 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`. + schedule_override_policy (NewTeamDataAttributesScheduleOverridePolicy | Unset): Who can create and update + overrides for schedules owned by this team: `everyone` in the organization, only team `members`, or only team + `admins`. Users still need override permission from their on-call role. Only available when the team-level + schedule override policy feature is enabled for the organization. Requests that set it while that feature is + disabled are rejected. + properties (list[NewTeamDataAttributesPropertiesItem] | Unset): Array of property values for this team. """ name: str - 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 + slug: None | 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 + 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 + scim_group_id: None | str | Unset = UNSET + scim_group_external_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 + schedule_override_policy: NewTeamDataAttributesScheduleOverridePolicy | Unset = UNSET + properties: list[NewTeamDataAttributesPropertiesItem] | Unset = UNSET def to_dict(self) -> dict[str, Any]: from ..models.new_team_data_attributes_alert_broadcast_channel_type_0 import ( @@ -111,25 +128,25 @@ def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -138,79 +155,91 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | Unset | str + backstage_id: None | str | Unset if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | Unset | str + pagerduty_id: None | str | Unset if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - pagerduty_service_id: None | Unset | str + pagerduty_service_id: None | str | Unset if isinstance(self.pagerduty_service_id, Unset): pagerduty_service_id = UNSET else: pagerduty_service_id = self.pagerduty_service_id - opsgenie_id: None | Unset | str + opsgenie_id: None | str | Unset if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | Unset | str + opsgenie_team_id: None | str | Unset if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - victor_ops_id: None | Unset | str + victor_ops_id: None | str | Unset if isinstance(self.victor_ops_id, Unset): victor_ops_id = UNSET else: victor_ops_id = self.victor_ops_id - pagertree_id: None | Unset | str + pagertree_id: None | str | Unset if isinstance(self.pagertree_id, Unset): pagertree_id = UNSET else: pagertree_id = self.pagertree_id - cortex_id: None | Unset | str + cortex_id: None | str | Unset if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | Unset | str + service_now_ci_sys_id: None | str | Unset 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: None | Unset | list[int] + scim_group_id: None | str | Unset + if isinstance(self.scim_group_id, Unset): + scim_group_id = UNSET + else: + scim_group_id = self.scim_group_id + + scim_group_external_id: None | str | Unset + if isinstance(self.scim_group_external_id, Unset): + scim_group_external_id = UNSET + else: + scim_group_external_id = self.scim_group_external_id + + user_ids: list[int] | None | Unset if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -219,7 +248,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - admin_ids: None | Unset | list[int] + admin_ids: list[int] | None | Unset if isinstance(self.admin_ids, Unset): admin_ids = UNSET elif isinstance(self.admin_ids, list): @@ -228,19 +257,19 @@ def to_dict(self) -> dict[str, Any]: else: admin_ids = self.admin_ids - alerts_email_enabled: None | Unset | bool + alerts_email_enabled: bool | None | Unset if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alert_urgency_id: None | Unset | str + alert_urgency_id: None | str | Unset if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - slack_channels: None | Unset | list[dict[str, Any]] + slack_channels: list[dict[str, Any]] | None | Unset if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -252,7 +281,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: None | Unset | list[dict[str, Any]] + slack_aliases: list[dict[str, Any]] | None | Unset if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -264,13 +293,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: None | Unset | bool + alert_broadcast_enabled: bool | None | Unset if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: None | Unset | dict[str, Any] + alert_broadcast_channel: dict[str, Any] | None | Unset if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, NewTeamDataAttributesAlertBroadcastChannelType0): @@ -278,13 +307,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: None | Unset | bool + incident_broadcast_enabled: bool | None | Unset if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: None | Unset | dict[str, Any] + incident_broadcast_channel: dict[str, Any] | None | Unset if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, NewTeamDataAttributesIncidentBroadcastChannelType0): @@ -292,17 +321,21 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - auto_add_members_when_attached: None | Unset | bool + auto_add_members_when_attached: bool | None | Unset 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: Unset | str = UNSET + auto_add_members_scope: str | Unset = UNSET if not isinstance(self.auto_add_members_scope, Unset): auto_add_members_scope = self.auto_add_members_scope - properties: Unset | list[dict[str, Any]] = UNSET + schedule_override_policy: str | Unset = UNSET + if not isinstance(self.schedule_override_policy, Unset): + schedule_override_policy = self.schedule_override_policy + + properties: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -348,6 +381,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["cortex_id"] = cortex_id if service_now_ci_sys_id is not UNSET: field_dict["service_now_ci_sys_id"] = service_now_ci_sys_id + if scim_group_id is not UNSET: + field_dict["scim_group_id"] = scim_group_id + if scim_group_external_id is not UNSET: + field_dict["scim_group_external_id"] = scim_group_external_id if user_ids is not UNSET: field_dict["user_ids"] = user_ids if admin_ids is not UNSET: @@ -372,6 +409,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["auto_add_members_when_attached"] = auto_add_members_when_attached if auto_add_members_scope is not UNSET: field_dict["auto_add_members_scope"] = auto_add_members_scope + if schedule_override_policy is not UNSET: + field_dict["schedule_override_policy"] = schedule_override_policy if properties is not UNSET: field_dict["properties"] = properties @@ -396,34 +435,34 @@ 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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -434,121 +473,139 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | Unset | str: + def _parse_backstage_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | Unset | str: + def _parse_pagerduty_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_pagerduty_service_id(data: object) -> None | Unset | str: + def _parse_pagerduty_service_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_service_id = _parse_pagerduty_service_id(d.pop("pagerduty_service_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | Unset | str: + def _parse_opsgenie_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | Unset | str: + def _parse_opsgenie_team_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_victor_ops_id(data: object) -> None | Unset | str: + def _parse_victor_ops_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) victor_ops_id = _parse_victor_ops_id(d.pop("victor_ops_id", UNSET)) - def _parse_pagertree_id(data: object) -> None | Unset | str: + def _parse_pagertree_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagertree_id = _parse_pagertree_id(d.pop("pagertree_id", UNSET)) - def _parse_cortex_id(data: object) -> None | Unset | str: + def _parse_cortex_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: + def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) -> None | Unset | list[int]: + def _parse_scim_group_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + scim_group_id = _parse_scim_group_id(d.pop("scim_group_id", UNSET)) + + def _parse_scim_group_external_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + scim_group_external_id = _parse_scim_group_external_id(d.pop("scim_group_external_id", UNSET)) + + def _parse_user_ids(data: object) -> list[int] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -559,13 +616,13 @@ def _parse_user_ids(data: object) -> None | Unset | list[int]: user_ids_type_0 = cast(list[int], data) return user_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[int], data) + return cast(list[int] | None | Unset, data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_admin_ids(data: object) -> None | Unset | list[int]: + def _parse_admin_ids(data: object) -> list[int] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -576,33 +633,31 @@ def _parse_admin_ids(data: object) -> None | Unset | list[int]: admin_ids_type_0 = cast(list[int], data) return admin_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[int], data) + return cast(list[int] | None | Unset, data) admin_ids = _parse_admin_ids(d.pop("admin_ids", UNSET)) - def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: + def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | Unset | str: + def _parse_alert_urgency_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_slack_channels( - data: object, - ) -> None | Unset | list["NewTeamDataAttributesSlackChannelsType0Item"]: + def _parse_slack_channels(data: object) -> list[NewTeamDataAttributesSlackChannelsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -620,15 +675,13 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["NewTeamDataAttributesSlackChannelsType0Item"], data) + return cast(list[NewTeamDataAttributesSlackChannelsType0Item] | None | Unset, data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases( - data: object, - ) -> None | Unset | list["NewTeamDataAttributesSlackAliasesType0Item"]: + def _parse_slack_aliases(data: object) -> list[NewTeamDataAttributesSlackAliasesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -646,24 +699,24 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["NewTeamDataAttributesSlackAliasesType0Item"], data) + return cast(list[NewTeamDataAttributesSlackAliasesType0Item] | None | Unset, data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> None | Unset | bool: + def _parse_alert_broadcast_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) def _parse_alert_broadcast_channel( data: object, - ) -> Union["NewTeamDataAttributesAlertBroadcastChannelType0", None, Unset]: + ) -> NewTeamDataAttributesAlertBroadcastChannelType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -674,24 +727,24 @@ def _parse_alert_broadcast_channel( alert_broadcast_channel_type_0 = NewTeamDataAttributesAlertBroadcastChannelType0.from_dict(data) return alert_broadcast_channel_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["NewTeamDataAttributesAlertBroadcastChannelType0", None, Unset], data) + return cast(NewTeamDataAttributesAlertBroadcastChannelType0 | None | Unset, data) alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> None | Unset | bool: + def _parse_incident_broadcast_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) def _parse_incident_broadcast_channel( data: object, - ) -> Union["NewTeamDataAttributesIncidentBroadcastChannelType0", None, Unset]: + ) -> NewTeamDataAttributesIncidentBroadcastChannelType0 | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -702,36 +755,47 @@ def _parse_incident_broadcast_channel( incident_broadcast_channel_type_0 = NewTeamDataAttributesIncidentBroadcastChannelType0.from_dict(data) return incident_broadcast_channel_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["NewTeamDataAttributesIncidentBroadcastChannelType0", None, Unset], data) + return cast(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) -> None | Unset | bool: + def _parse_auto_add_members_when_attached(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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: Unset | NewTeamDataAttributesAutoAddMembersScope + auto_add_members_scope: NewTeamDataAttributesAutoAddMembersScope | Unset 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 = [] + _schedule_override_policy = d.pop("schedule_override_policy", UNSET) + schedule_override_policy: NewTeamDataAttributesScheduleOverridePolicy | Unset + if isinstance(_schedule_override_policy, Unset): + schedule_override_policy = UNSET + else: + schedule_override_policy = check_new_team_data_attributes_schedule_override_policy( + _schedule_override_policy + ) + _properties = d.pop("properties", UNSET) - for properties_item_data in _properties or []: - properties_item = NewTeamDataAttributesPropertiesItem.from_dict(properties_item_data) + 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) - properties.append(properties_item) + properties.append(properties_item) new_team_data_attributes = cls( name=name, @@ -751,6 +815,8 @@ def _parse_auto_add_members_when_attached(data: object) -> None | Unset | bool: pagertree_id=pagertree_id, cortex_id=cortex_id, service_now_ci_sys_id=service_now_ci_sys_id, + scim_group_id=scim_group_id, + scim_group_external_id=scim_group_external_id, user_ids=user_ids, admin_ids=admin_ids, alerts_email_enabled=alerts_email_enabled, @@ -763,6 +829,7 @@ def _parse_auto_add_members_when_attached(data: object) -> None | Unset | bool: incident_broadcast_channel=incident_broadcast_channel, auto_add_members_when_attached=auto_add_members_when_attached, auto_add_members_scope=auto_add_members_scope, + schedule_override_policy=schedule_override_policy, properties=properties, ) 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 d896ddc6..5e5c2c55 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,8 +1,9 @@ +from __future__ import annotations + 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 @@ -15,12 +16,11 @@ class NewTeamDataAttributesAlertBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (Union[Unset, str]): Slack channel name + name (str | Unset): Slack channel name """ id: str - name: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + name: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: id = self.id @@ -28,7 +28,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -51,21 +51,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - new_team_data_attributes_alert_broadcast_channel_type_0.additional_properties = d return new_team_data_attributes_alert_broadcast_channel_type_0 - - @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_team_data_attributes_auto_add_members_scope.py b/rootly_sdk/models/new_team_data_attributes_auto_add_members_scope.py index 86b962c6..34c26a1d 100644 --- a/rootly_sdk/models/new_team_data_attributes_auto_add_members_scope.py +++ b/rootly_sdk/models/new_team_data_attributes_auto_add_members_scope.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewTeamDataAttributesAutoAddMembersScope = Literal["all", "off", "public_and_test", "public_only"] @@ -16,7 +16,7 @@ def check_new_team_data_attributes_auto_add_members_scope( if value is None: return None if value in NEW_TEAM_DATA_ATTRIBUTES_AUTO_ADD_MEMBERS_SCOPE_VALUES: - return cast(NewTeamDataAttributesAutoAddMembersScope, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_TEAM_DATA_ATTRIBUTES_AUTO_ADD_MEMBERS_SCOPE_VALUES!r}" ) 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 5ed832f1..2b223b08 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,8 +1,9 @@ +from __future__ import annotations + 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 @@ -15,12 +16,11 @@ class NewTeamDataAttributesIncidentBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (Union[Unset, str]): Slack channel name + name (str | Unset): Slack channel name """ id: str - name: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + name: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: id = self.id @@ -28,7 +28,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -51,21 +51,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - new_team_data_attributes_incident_broadcast_channel_type_0.additional_properties = d return new_team_data_attributes_incident_broadcast_channel_type_0 - - @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_team_data_attributes_properties_item.py b/rootly_sdk/models/new_team_data_attributes_properties_item.py index 65b76439..ec6700ba 100644 --- a/rootly_sdk/models/new_team_data_attributes_properties_item.py +++ b/rootly_sdk/models/new_team_data_attributes_properties_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_team_data_attributes_schedule_override_policy.py b/rootly_sdk/models/new_team_data_attributes_schedule_override_policy.py new file mode 100644 index 00000000..db982f69 --- /dev/null +++ b/rootly_sdk/models/new_team_data_attributes_schedule_override_policy.py @@ -0,0 +1,21 @@ +from typing import Literal + +NewTeamDataAttributesScheduleOverridePolicy = Literal["admins", "everyone", "members"] + +NEW_TEAM_DATA_ATTRIBUTES_SCHEDULE_OVERRIDE_POLICY_VALUES: set[NewTeamDataAttributesScheduleOverridePolicy] = { + "admins", + "everyone", + "members", +} + + +def check_new_team_data_attributes_schedule_override_policy( + value: str | None, +) -> NewTeamDataAttributesScheduleOverridePolicy | None: + if value is None: + return None + if value in NEW_TEAM_DATA_ATTRIBUTES_SCHEDULE_OVERRIDE_POLICY_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_TEAM_DATA_ATTRIBUTES_SCHEDULE_OVERRIDE_POLICY_VALUES!r}" + ) 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 7ed25ecd..0867b0f4 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="NewTeamDataAttributesSlackAliasesType0Item") @@ -17,7 +18,6 @@ class NewTeamDataAttributesSlackAliasesType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - new_team_data_attributes_slack_aliases_type_0_item.additional_properties = d return new_team_data_attributes_slack_aliases_type_0_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_team_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/new_team_data_attributes_slack_channels_type_0_item.py index 0560b467..a981ca12 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="NewTeamDataAttributesSlackChannelsType0Item") @@ -17,7 +18,6 @@ class NewTeamDataAttributesSlackChannelsType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - new_team_data_attributes_slack_channels_type_0_item.additional_properties = d return new_team_data_attributes_slack_channels_type_0_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_team_data_type.py b/rootly_sdk/models/new_team_data_type.py index ffac0574..d35a3b78 100644 --- a/rootly_sdk/models/new_team_data_type.py +++ b/rootly_sdk/models/new_team_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewTeamDataType = Literal["groups"] @@ -11,5 +11,5 @@ def check_new_team_data_type(value: str | None) -> NewTeamDataType | None: if value is None: return None if value in NEW_TEAM_DATA_TYPE_VALUES: - return cast(NewTeamDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_TEAM_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_user_email_address.py b/rootly_sdk/models/new_user_email_address.py index 4b1dfcd4..1f9096a8 100644 --- a/rootly_sdk/models/new_user_email_address.py +++ b/rootly_sdk/models/new_user_email_address.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_user_email_address_data import NewUserEmailAddressData @@ -18,14 +19,13 @@ class NewUserEmailAddress: data (NewUserEmailAddressData): """ - data: "NewUserEmailAddressData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewUserEmailAddressData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_user_email_address.additional_properties = d return new_user_email_address - - @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_user_email_address_data.py b/rootly_sdk/models/new_user_email_address_data.py index a05d8ba5..71f8780f 100644 --- a/rootly_sdk/models/new_user_email_address_data.py +++ b/rootly_sdk/models/new_user_email_address_data.py @@ -1,8 +1,9 @@ +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_user_email_address_data_type import ( NewUserEmailAddressDataType, @@ -25,8 +26,7 @@ class NewUserEmailAddressData: """ type_: NewUserEmailAddressDataType - attributes: "NewUserEmailAddressDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewUserEmailAddressDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_user_email_address_data.additional_properties = d return new_user_email_address_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_user_email_address_data_attributes.py b/rootly_sdk/models/new_user_email_address_data_attributes.py index 7e191759..8ff3d016 100644 --- a/rootly_sdk/models/new_user_email_address_data_attributes.py +++ b/rootly_sdk/models/new_user_email_address_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_user_email_address_data_type.py b/rootly_sdk/models/new_user_email_address_data_type.py index 05c74d70..a8dac160 100644 --- a/rootly_sdk/models/new_user_email_address_data_type.py +++ b/rootly_sdk/models/new_user_email_address_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewUserEmailAddressDataType = Literal["user_email_addresses"] @@ -11,5 +11,5 @@ def check_new_user_email_address_data_type(value: str | None) -> NewUserEmailAdd if value is None: return None if value in NEW_USER_EMAIL_ADDRESS_DATA_TYPE_VALUES: - return cast(NewUserEmailAddressDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_USER_EMAIL_ADDRESS_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_user_notification_rule.py b/rootly_sdk/models/new_user_notification_rule.py index 4e14b5ae..6408fd2e 100644 --- a/rootly_sdk/models/new_user_notification_rule.py +++ b/rootly_sdk/models/new_user_notification_rule.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_user_notification_rule_data import NewUserNotificationRuleData @@ -18,14 +19,13 @@ class NewUserNotificationRule: data (NewUserNotificationRuleData): """ - data: "NewUserNotificationRuleData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewUserNotificationRuleData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_user_notification_rule.additional_properties = d return new_user_notification_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_user_notification_rule_data.py b/rootly_sdk/models/new_user_notification_rule_data.py index 67502591..fcfe317a 100644 --- a/rootly_sdk/models/new_user_notification_rule_data.py +++ b/rootly_sdk/models/new_user_notification_rule_data.py @@ -1,8 +1,9 @@ +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_user_notification_rule_data_type import ( NewUserNotificationRuleDataType, @@ -25,8 +26,7 @@ class NewUserNotificationRuleData: """ type_: NewUserNotificationRuleDataType - attributes: "NewUserNotificationRuleDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewUserNotificationRuleDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_user_notification_rule_data.additional_properties = d return new_user_notification_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_user_notification_rule_data_attributes.py b/rootly_sdk/models/new_user_notification_rule_data_attributes.py index b5846f02..1139cb20 100644 --- a/rootly_sdk/models/new_user_notification_rule_data_attributes.py +++ b/rootly_sdk/models/new_user_notification_rule_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,21 +20,21 @@ class NewUserNotificationRuleDataAttributes: Attributes: enabled_contact_types (list[NewUserNotificationRuleDataAttributesEnabledContactTypesItem]): 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 + 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[NewUserNotificationRuleDataAttributesEnabledContactTypesItem] - 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 + 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 def to_dict(self) -> dict[str, Any]: enabled_contact_types = [] @@ -40,37 +42,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: None | Unset | int + delay: int | None | Unset if isinstance(self.delay, Unset): delay = UNSET else: delay = self.delay - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - user_email_address_id: None | Unset | str + user_email_address_id: None | str | Unset 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 | Unset | str + user_call_number_id: None | str | Unset 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 | Unset | str + user_sms_number_id: None | str | Unset 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 | Unset | str + user_device_id: None | str | Unset if isinstance(self.user_device_id, Unset): user_device_id = UNSET else: @@ -110,57 +112,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) -> None | Unset | int: + def _parse_delay(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) delay = _parse_delay(d.pop("delay", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_user_email_address_id(data: object) -> None | Unset | str: + def _parse_user_email_address_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_user_call_number_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_user_sms_number_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_user_device_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 2083cdae..afd8e959 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,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewUserNotificationRuleDataAttributesEnabledContactTypesItem = Literal[ "call", "device", "email", "google_chat", "microsoft_teams", "non_critical_device", "slack", "sms" @@ -24,7 +24,7 @@ def check_new_user_notification_rule_data_attributes_enabled_contact_types_item( if value is None: return None if value in NEW_USER_NOTIFICATION_RULE_DATA_ATTRIBUTES_ENABLED_CONTACT_TYPES_ITEM_VALUES: - return cast(NewUserNotificationRuleDataAttributesEnabledContactTypesItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_USER_NOTIFICATION_RULE_DATA_ATTRIBUTES_ENABLED_CONTACT_TYPES_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_user_notification_rule_data_type.py b/rootly_sdk/models/new_user_notification_rule_data_type.py index 9bd5a270..5700eeae 100644 --- a/rootly_sdk/models/new_user_notification_rule_data_type.py +++ b/rootly_sdk/models/new_user_notification_rule_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewUserNotificationRuleDataType = Literal["user_notification_rules"] @@ -11,5 +11,5 @@ def check_new_user_notification_rule_data_type(value: str | None) -> NewUserNoti if value is None: return None if value in NEW_USER_NOTIFICATION_RULE_DATA_TYPE_VALUES: - return cast(NewUserNotificationRuleDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_USER_NOTIFICATION_RULE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_user_phone_number.py b/rootly_sdk/models/new_user_phone_number.py index 807f540a..e923604b 100644 --- a/rootly_sdk/models/new_user_phone_number.py +++ b/rootly_sdk/models/new_user_phone_number.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_user_phone_number_data import NewUserPhoneNumberData @@ -18,14 +19,13 @@ class NewUserPhoneNumber: data (NewUserPhoneNumberData): """ - data: "NewUserPhoneNumberData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewUserPhoneNumberData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_user_phone_number.additional_properties = d return new_user_phone_number - - @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_user_phone_number_data.py b/rootly_sdk/models/new_user_phone_number_data.py index 84f944ed..25d4602f 100644 --- a/rootly_sdk/models/new_user_phone_number_data.py +++ b/rootly_sdk/models/new_user_phone_number_data.py @@ -1,8 +1,9 @@ +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_user_phone_number_data_type import NewUserPhoneNumberDataType, check_new_user_phone_number_data_type @@ -22,8 +23,7 @@ class NewUserPhoneNumberData: """ type_: NewUserPhoneNumberDataType - attributes: "NewUserPhoneNumberDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewUserPhoneNumberDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_user_phone_number_data.additional_properties = d return new_user_phone_number_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_user_phone_number_data_attributes.py b/rootly_sdk/models/new_user_phone_number_data_attributes.py index b2c4f4c0..6e977204 100644 --- a/rootly_sdk/models/new_user_phone_number_data_attributes.py +++ b/rootly_sdk/models/new_user_phone_number_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_user_phone_number_data_type.py b/rootly_sdk/models/new_user_phone_number_data_type.py index 2d6f3961..04c1617c 100644 --- a/rootly_sdk/models/new_user_phone_number_data_type.py +++ b/rootly_sdk/models/new_user_phone_number_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewUserPhoneNumberDataType = Literal["user_phone_numbers"] @@ -11,5 +11,5 @@ def check_new_user_phone_number_data_type(value: str | None) -> NewUserPhoneNumb if value is None: return None if value in NEW_USER_PHONE_NUMBER_DATA_TYPE_VALUES: - return cast(NewUserPhoneNumberDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_USER_PHONE_NUMBER_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_verified_domain.py b/rootly_sdk/models/new_verified_domain.py index a3a224e7..6adbb2c2 100644 --- a/rootly_sdk/models/new_verified_domain.py +++ b/rootly_sdk/models/new_verified_domain.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_verified_domain_data import NewVerifiedDomainData @@ -18,14 +19,13 @@ class NewVerifiedDomain: data (NewVerifiedDomainData): """ - data: "NewVerifiedDomainData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewVerifiedDomainData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 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 index 13bcf456..03e19fe0 100644 --- a/rootly_sdk/models/new_verified_domain_data.py +++ b/rootly_sdk/models/new_verified_domain_data.py @@ -1,8 +1,9 @@ +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_verified_domain_data_type import NewVerifiedDomainDataType, check_new_verified_domain_data_type @@ -22,8 +23,7 @@ class NewVerifiedDomainData: """ type_: NewVerifiedDomainDataType - attributes: "NewVerifiedDomainDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewVerifiedDomainDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 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 index f5432ffa..1ac166ad 100644 --- a/rootly_sdk/models/new_verified_domain_data_attributes.py +++ b/rootly_sdk/models/new_verified_domain_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/new_verified_domain_data_type.py b/rootly_sdk/models/new_verified_domain_data_type.py index 9e43541d..7c0cc09b 100644 --- a/rootly_sdk/models/new_verified_domain_data_type.py +++ b/rootly_sdk/models/new_verified_domain_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewVerifiedDomainDataType = Literal["verified_domains"] @@ -11,5 +11,5 @@ def check_new_verified_domain_data_type(value: str | None) -> NewVerifiedDomainD if value is None: return None if value in NEW_VERIFIED_DOMAIN_DATA_TYPE_VALUES: - return cast(NewVerifiedDomainDataType, value) + return 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 8be7c839..9c6c0c12 100644 --- a/rootly_sdk/models/new_webhooks_endpoint.py +++ b/rootly_sdk/models/new_webhooks_endpoint.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_webhooks_endpoint_data import NewWebhooksEndpointData @@ -18,14 +19,13 @@ class NewWebhooksEndpoint: data (NewWebhooksEndpointData): """ - data: "NewWebhooksEndpointData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewWebhooksEndpointData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_webhooks_endpoint.additional_properties = d return new_webhooks_endpoint - - @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_webhooks_endpoint_data.py b/rootly_sdk/models/new_webhooks_endpoint_data.py index 8022924d..ad178c52 100644 --- a/rootly_sdk/models/new_webhooks_endpoint_data.py +++ b/rootly_sdk/models/new_webhooks_endpoint_data.py @@ -1,8 +1,9 @@ +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_webhooks_endpoint_data_type import NewWebhooksEndpointDataType, check_new_webhooks_endpoint_data_type @@ -22,8 +23,7 @@ class NewWebhooksEndpointData: """ type_: NewWebhooksEndpointDataType - attributes: "NewWebhooksEndpointDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewWebhooksEndpointDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_webhooks_endpoint_data.additional_properties = d return new_webhooks_endpoint_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_webhooks_endpoint_data_attributes.py b/rootly_sdk/models/new_webhooks_endpoint_data_attributes.py index f67b14a6..0cff793f 100644 --- a/rootly_sdk/models/new_webhooks_endpoint_data_attributes.py +++ b/rootly_sdk/models/new_webhooks_endpoint_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -24,29 +26,29 @@ class NewWebhooksEndpointDataAttributes: Attributes: name (str): The name of the endpoint url (str): The URL of the endpoint. - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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. + 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. """ name: str url: str - 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 + slug: None | str | Unset = UNSET + secret: str | Unset = UNSET + event_types: list[NewWebhooksEndpointDataAttributesEventTypesItem] | Unset = UNSET + enabled: bool | Unset = UNSET + custom_headers: list[NewWebhooksEndpointDataAttributesCustomHeadersItem] | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name url = self.url - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -54,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: secret = self.secret - event_types: Unset | list[str] = UNSET + event_types: list[str] | Unset = UNSET if not isinstance(self.event_types, Unset): event_types = [] for event_types_item_data in self.event_types: @@ -63,7 +65,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - custom_headers: Unset | list[dict[str, Any]] = UNSET + custom_headers: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.custom_headers, Unset): custom_headers = [] for custom_headers_item_data in self.custom_headers: @@ -102,32 +104,38 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: url = d.pop("url") - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) secret = d.pop("secret", UNSET) - event_types = [] _event_types = d.pop("event_types", UNSET) - 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: 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) - 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) - for custom_headers_item_data in _custom_headers or []: - custom_headers_item = NewWebhooksEndpointDataAttributesCustomHeadersItem.from_dict(custom_headers_item_data) + 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 + ) - custom_headers.append(custom_headers_item) + custom_headers.append(custom_headers_item) new_webhooks_endpoint_data_attributes = cls( name=name, 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 cd0fc746..3ffe6bda 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,3 +1,5 @@ +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 a0833ca6..c57e8d96 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 @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewWebhooksEndpointDataAttributesEventTypesItem = Literal[ "alert.created", @@ -32,6 +32,7 @@ "incident_status_page_event.deleted", "incident_status_page_event.updated", "pulse.created", + "shift.ended", "shift.started", ] @@ -67,6 +68,7 @@ "incident_status_page_event.deleted", "incident_status_page_event.updated", "pulse.created", + "shift.ended", "shift.started", } @@ -77,7 +79,7 @@ def check_new_webhooks_endpoint_data_attributes_event_types_item( if value is None: return None if value in NEW_WEBHOOKS_ENDPOINT_DATA_ATTRIBUTES_EVENT_TYPES_ITEM_VALUES: - return cast(NewWebhooksEndpointDataAttributesEventTypesItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_WEBHOOKS_ENDPOINT_DATA_ATTRIBUTES_EVENT_TYPES_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_webhooks_endpoint_data_type.py b/rootly_sdk/models/new_webhooks_endpoint_data_type.py index 05c3b0d8..56266a0e 100644 --- a/rootly_sdk/models/new_webhooks_endpoint_data_type.py +++ b/rootly_sdk/models/new_webhooks_endpoint_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewWebhooksEndpointDataType = Literal["webhooks_endpoints"] @@ -11,5 +11,5 @@ def check_new_webhooks_endpoint_data_type(value: str | None) -> NewWebhooksEndpo if value is None: return None if value in NEW_WEBHOOKS_ENDPOINT_DATA_TYPE_VALUES: - return cast(NewWebhooksEndpointDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_WEBHOOKS_ENDPOINT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_workflow.py b/rootly_sdk/models/new_workflow.py index a81bad47..e4610bee 100644 --- a/rootly_sdk/models/new_workflow.py +++ b/rootly_sdk/models/new_workflow.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_workflow_data import NewWorkflowData @@ -18,14 +19,13 @@ class NewWorkflow: data (NewWorkflowData): """ - data: "NewWorkflowData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewWorkflowData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_workflow.additional_properties = d return new_workflow - - @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_action_item_form_field_condition.py b/rootly_sdk/models/new_workflow_action_item_form_field_condition.py index a7923dba..072a021e 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,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_workflow_action_item_form_field_condition_data import NewWorkflowActionItemFormFieldConditionData @@ -18,14 +19,13 @@ class NewWorkflowActionItemFormFieldCondition: data (NewWorkflowActionItemFormFieldConditionData): """ - data: "NewWorkflowActionItemFormFieldConditionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewWorkflowActionItemFormFieldConditionData 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, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_workflow_action_item_form_field_condition.additional_properties = d return new_workflow_action_item_form_field_condition - - @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_action_item_form_field_condition_data.py b/rootly_sdk/models/new_workflow_action_item_form_field_condition_data.py index 22ae4c1a..c1861df0 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,8 +1,9 @@ +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_action_item_form_field_condition_data_type import ( NewWorkflowActionItemFormFieldConditionDataType, @@ -27,8 +28,7 @@ class NewWorkflowActionItemFormFieldConditionData: """ type_: NewWorkflowActionItemFormFieldConditionDataType - attributes: "NewWorkflowActionItemFormFieldConditionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewWorkflowActionItemFormFieldConditionDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -62,21 +62,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_workflow_action_item_form_field_condition_data.additional_properties = d return new_workflow_action_item_form_field_condition_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_action_item_form_field_condition_data_attributes.py b/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_attributes.py index fa2a2968..9e6b01df 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,73 +21,73 @@ class NewWorkflowActionItemFormFieldConditionDataAttributes: form_field_id (str): The custom field for this condition action_item_condition (NewWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition): 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]]): + 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): """ form_field_id: str action_item_condition: NewWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition = "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 + 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 def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id action_item_condition: str = self.action_item_condition - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values - selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_catalog_entity_ids: list[str] | Unset = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_functionality_ids: Unset | list[str] = UNSET + selected_functionality_ids: list[str] | Unset = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: Unset | list[str] = UNSET + selected_group_ids: list[str] | Unset = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: Unset | list[str] = UNSET + selected_option_ids: list[str] | Unset = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: Unset | list[str] = UNSET + selected_service_ids: list[str] | Unset = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_user_ids: Unset | list[int] = UNSET + selected_user_ids: list[int] | Unset = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_cause_ids: Unset | list[str] = UNSET + selected_cause_ids: list[str] | Unset = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: Unset | list[str] = UNSET + selected_environment_ids: list[str] | Unset = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: Unset | list[str] = UNSET + selected_incident_type_ids: list[str] | Unset = 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_action_item_form_field_condition_data_attributes_action_item_condition.py b/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_attributes_action_item_condition.py index 074b8b71..541e65cd 100644 --- a/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_attributes_action_item_condition.py +++ b/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_attributes_action_item_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_new_workflow_action_item_form_field_condition_data_attributes_action_i if value is None: return None if value in NEW_WORKFLOW_ACTION_ITEM_FORM_FIELD_CONDITION_DATA_ATTRIBUTES_ACTION_ITEM_CONDITION_VALUES: - return cast(NewWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_WORKFLOW_ACTION_ITEM_FORM_FIELD_CONDITION_DATA_ATTRIBUTES_ACTION_ITEM_CONDITION_VALUES!r}" ) diff --git a/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_type.py b/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_type.py index ed3349fe..a8a8a0b9 100644 --- a/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_type.py +++ b/rootly_sdk/models/new_workflow_action_item_form_field_condition_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewWorkflowActionItemFormFieldConditionDataType = Literal["workflow_action_item_form_field_conditions"] @@ -13,7 +13,7 @@ def check_new_workflow_action_item_form_field_condition_data_type( if value is None: return None if value in NEW_WORKFLOW_ACTION_ITEM_FORM_FIELD_CONDITION_DATA_TYPE_VALUES: - return cast(NewWorkflowActionItemFormFieldConditionDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_WORKFLOW_ACTION_ITEM_FORM_FIELD_CONDITION_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_workflow_custom_field_selection.py b/rootly_sdk/models/new_workflow_custom_field_selection.py index cd9250c3..116d8e4d 100644 --- a/rootly_sdk/models/new_workflow_custom_field_selection.py +++ b/rootly_sdk/models/new_workflow_custom_field_selection.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_workflow_custom_field_selection_data import NewWorkflowCustomFieldSelectionData @@ -18,14 +19,13 @@ class NewWorkflowCustomFieldSelection: data (NewWorkflowCustomFieldSelectionData): """ - data: "NewWorkflowCustomFieldSelectionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewWorkflowCustomFieldSelectionData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_workflow_custom_field_selection.additional_properties = d return new_workflow_custom_field_selection - - @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_custom_field_selection_data.py b/rootly_sdk/models/new_workflow_custom_field_selection_data.py index 6c4e4d0b..7ce75648 100644 --- a/rootly_sdk/models/new_workflow_custom_field_selection_data.py +++ b/rootly_sdk/models/new_workflow_custom_field_selection_data.py @@ -1,8 +1,9 @@ +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_custom_field_selection_data_type import ( NewWorkflowCustomFieldSelectionDataType, @@ -27,8 +28,7 @@ class NewWorkflowCustomFieldSelectionData: """ type_: NewWorkflowCustomFieldSelectionDataType - attributes: "NewWorkflowCustomFieldSelectionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewWorkflowCustomFieldSelectionDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -62,21 +62,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_workflow_custom_field_selection_data.additional_properties = d return new_workflow_custom_field_selection_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_custom_field_selection_data_attributes.py b/rootly_sdk/models/new_workflow_custom_field_selection_data_attributes.py index 00110ee1..fecb492e 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,16 +21,16 @@ class NewWorkflowCustomFieldSelectionDataAttributes: custom_field_id (int): The custom field for this selection incident_condition (NewWorkflowCustomFieldSelectionDataAttributesIncidentCondition): The trigger condition Default: 'ANY'. - workflow_id (Union[Unset, str]): The workflow for this selection - values (Union[Unset, list[str]]): - selected_option_ids (Union[Unset, list[int]]): + workflow_id (str | Unset): The workflow for this selection + values (list[str] | Unset): + selected_option_ids (list[int] | Unset): """ custom_field_id: int incident_condition: NewWorkflowCustomFieldSelectionDataAttributesIncidentCondition = "ANY" - workflow_id: Unset | str = UNSET - values: Unset | list[str] = UNSET - selected_option_ids: Unset | list[int] = UNSET + workflow_id: str | Unset = UNSET + values: list[str] | Unset = UNSET + selected_option_ids: list[int] | Unset = UNSET def to_dict(self) -> dict[str, Any]: custom_field_id = self.custom_field_id @@ -37,11 +39,11 @@ def to_dict(self) -> dict[str, Any]: workflow_id = self.workflow_id - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values - selected_option_ids: Unset | list[int] = UNSET + selected_option_ids: list[int] | Unset = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids diff --git a/rootly_sdk/models/new_workflow_custom_field_selection_data_attributes_incident_condition.py b/rootly_sdk/models/new_workflow_custom_field_selection_data_attributes_incident_condition.py index 7a0aff40..75689fe2 100644 --- a/rootly_sdk/models/new_workflow_custom_field_selection_data_attributes_incident_condition.py +++ b/rootly_sdk/models/new_workflow_custom_field_selection_data_attributes_incident_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewWorkflowCustomFieldSelectionDataAttributesIncidentCondition = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_new_workflow_custom_field_selection_data_attributes_incident_condition if value is None: return None if value in NEW_WORKFLOW_CUSTOM_FIELD_SELECTION_DATA_ATTRIBUTES_INCIDENT_CONDITION_VALUES: - return cast(NewWorkflowCustomFieldSelectionDataAttributesIncidentCondition, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_WORKFLOW_CUSTOM_FIELD_SELECTION_DATA_ATTRIBUTES_INCIDENT_CONDITION_VALUES!r}" ) diff --git a/rootly_sdk/models/new_workflow_custom_field_selection_data_type.py b/rootly_sdk/models/new_workflow_custom_field_selection_data_type.py index 5cded566..84ea9f91 100644 --- a/rootly_sdk/models/new_workflow_custom_field_selection_data_type.py +++ b/rootly_sdk/models/new_workflow_custom_field_selection_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewWorkflowCustomFieldSelectionDataType = Literal["workflow_custom_field_selections"] @@ -13,7 +13,7 @@ def check_new_workflow_custom_field_selection_data_type( if value is None: return None if value in NEW_WORKFLOW_CUSTOM_FIELD_SELECTION_DATA_TYPE_VALUES: - return cast(NewWorkflowCustomFieldSelectionDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_WORKFLOW_CUSTOM_FIELD_SELECTION_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_workflow_data.py b/rootly_sdk/models/new_workflow_data.py index e3514997..df868c66 100644 --- a/rootly_sdk/models/new_workflow_data.py +++ b/rootly_sdk/models/new_workflow_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,7 +23,7 @@ class NewWorkflowData: """ type_: NewWorkflowDataType - attributes: "NewWorkflowDataAttributes" + attributes: NewWorkflowDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ diff --git a/rootly_sdk/models/new_workflow_data_attributes.py b/rootly_sdk/models/new_workflow_data_attributes.py index 9224ab83..211aa684 100644 --- a/rootly_sdk/models/new_workflow_data_attributes.py +++ b/rootly_sdk/models/new_workflow_data_attributes.py @@ -1,8 +1,14 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define +from ..models.new_workflow_data_attributes_failure_notification_mode import ( + NewWorkflowDataAttributesFailureNotificationMode, + check_new_workflow_data_attributes_failure_notification_mode, +) from ..models.new_workflow_data_attributes_priority import ( NewWorkflowDataAttributesPriority, check_new_workflow_data_attributes_priority, @@ -17,6 +23,9 @@ from ..models.action_item_trigger_params import ActionItemTriggerParams from ..models.alert_trigger_params import AlertTriggerParams from ..models.incident_trigger_params import IncidentTriggerParams + from ..models.new_workflow_data_attributes_failure_notification_channels_item import ( + NewWorkflowDataAttributesFailureNotificationChannelsItem, + ) from ..models.pulse_trigger_params import PulseTriggerParams from ..models.simple_trigger_params import SimpleTriggerParams @@ -29,72 +38,85 @@ class NewWorkflowDataAttributes: """ Attributes: name (str): The title of the workflow - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + 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 repeat_condition_duration_since_first_run and repeat_condition_number_of_repeats parameters. - 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]]): + run_once_per_resource (bool | Unset): When true, the workflow runs at most once per incident. Later triggers on + the same incident create a canceled run instead. Manual runs and repeats are not affected. Only applies to + incident workflows. + 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): + group_assignment_ids (list[str] | Unset): Owning team IDs. Requires team-scoped workflows. + cause_ids (list[str] | Unset): + sub_status_ids (list[str] | Unset): + failure_notification_mode (NewWorkflowDataAttributesFailureNotificationMode | Unset): Where failure + notifications for this workflow are sent. `inherit` uses the account default channel, `custom` uses + `failure_notification_channels`, `off` suppresses them. + failure_notification_channels (list[NewWorkflowDataAttributesFailureNotificationChannelsItem] | Unset): Slack + channels notified when a run of this workflow fails. Used when `failure_notification_mode` is `custom`. """ name: str - 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 + slug: None | 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 + 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 + run_once_per_resource: 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 + group_assignment_ids: list[str] | Unset = UNSET + cause_ids: list[str] | Unset = UNSET + sub_status_ids: list[str] | Unset = UNSET + failure_notification_mode: NewWorkflowDataAttributesFailureNotificationMode | Unset = UNSET + failure_notification_channels: list[NewWorkflowDataAttributesFailureNotificationChannelsItem] | Unset = UNSET def to_dict(self) -> dict[str, Any]: from ..models.action_item_trigger_params import ActionItemTriggerParams @@ -104,47 +126,47 @@ def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - command: None | Unset | str + command: None | str | Unset if isinstance(self.command, Unset): command = UNSET else: command = self.command - command_feedback_enabled: None | Unset | bool + command_feedback_enabled: bool | None | Unset if isinstance(self.command_feedback_enabled, Unset): command_feedback_enabled = UNSET else: command_feedback_enabled = self.command_feedback_enabled - wait: None | Unset | str + wait: None | str | Unset if isinstance(self.wait, Unset): wait = UNSET else: wait = self.wait - priority: Unset | str = UNSET + priority: str | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority - repeat_every_duration: None | Unset | str + repeat_every_duration: None | str | Unset 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 | Unset | str + repeat_condition_duration_since_first_run: None | str | Unset if isinstance(self.repeat_condition_duration_since_first_run, Unset): repeat_condition_duration_since_first_run = UNSET else: @@ -154,7 +176,9 @@ def to_dict(self) -> dict[str, Any]: continuously_repeat = self.continuously_repeat - repeat_on: Unset | list[str] = UNSET + run_once_per_resource = self.run_once_per_resource + + repeat_on: list[str] | Unset = UNSET if not isinstance(self.repeat_on, Unset): repeat_on = [] for repeat_on_item_data in self.repeat_on: @@ -167,13 +191,13 @@ def to_dict(self) -> dict[str, Any]: position = self.position - workflow_group_id: None | Unset | str + workflow_group_id: None | str | Unset if isinstance(self.workflow_group_id, Unset): workflow_group_id = UNSET else: workflow_group_id = self.workflow_group_id - trigger_params: Unset | dict[str, Any] + trigger_params: dict[str, Any] | Unset if isinstance(self.trigger_params, Unset): trigger_params = UNSET elif isinstance(self.trigger_params, IncidentTriggerParams): @@ -187,42 +211,57 @@ def to_dict(self) -> dict[str, Any]: else: trigger_params = self.trigger_params.to_dict() - environment_ids: Unset | list[str] = UNSET + environment_ids: list[str] | Unset = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - severity_ids: Unset | list[str] = UNSET + severity_ids: list[str] | Unset = UNSET if not isinstance(self.severity_ids, Unset): severity_ids = self.severity_ids - incident_type_ids: Unset | list[str] = UNSET + incident_type_ids: list[str] | Unset = UNSET if not isinstance(self.incident_type_ids, Unset): incident_type_ids = self.incident_type_ids - incident_role_ids: Unset | list[str] = UNSET + incident_role_ids: list[str] | Unset = UNSET if not isinstance(self.incident_role_ids, Unset): incident_role_ids = self.incident_role_ids - service_ids: Unset | list[str] = UNSET + service_ids: list[str] | Unset = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: Unset | list[str] = UNSET + functionality_ids: list[str] | Unset = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - group_ids: Unset | list[str] = UNSET + group_ids: list[str] | Unset = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - cause_ids: Unset | list[str] = UNSET + group_assignment_ids: list[str] | Unset = UNSET + if not isinstance(self.group_assignment_ids, Unset): + group_assignment_ids = self.group_assignment_ids + + cause_ids: list[str] | Unset = UNSET if not isinstance(self.cause_ids, Unset): cause_ids = self.cause_ids - sub_status_ids: Unset | list[str] = UNSET + sub_status_ids: list[str] | Unset = UNSET if not isinstance(self.sub_status_ids, Unset): sub_status_ids = self.sub_status_ids + failure_notification_mode: str | Unset = UNSET + if not isinstance(self.failure_notification_mode, Unset): + failure_notification_mode = self.failure_notification_mode + + failure_notification_channels: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.failure_notification_channels, Unset): + failure_notification_channels = [] + for failure_notification_channels_item_data in self.failure_notification_channels: + failure_notification_channels_item = failure_notification_channels_item_data.to_dict() + failure_notification_channels.append(failure_notification_channels_item) + field_dict: dict[str, Any] = {} field_dict.update( @@ -250,6 +289,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["repeat_condition_number_of_repeats"] = repeat_condition_number_of_repeats if continuously_repeat is not UNSET: field_dict["continuously_repeat"] = continuously_repeat + if run_once_per_resource is not UNSET: + field_dict["run_once_per_resource"] = run_once_per_resource if repeat_on is not UNSET: field_dict["repeat_on"] = repeat_on if enabled is not UNSET: @@ -276,10 +317,16 @@ def to_dict(self) -> dict[str, Any]: field_dict["functionality_ids"] = functionality_ids if group_ids is not UNSET: field_dict["group_ids"] = group_ids + if group_assignment_ids is not UNSET: + field_dict["group_assignment_ids"] = group_assignment_ids if cause_ids is not UNSET: field_dict["cause_ids"] = cause_ids if sub_status_ids is not UNSET: field_dict["sub_status_ids"] = sub_status_ids + if failure_notification_mode is not UNSET: + field_dict["failure_notification_mode"] = failure_notification_mode + if failure_notification_channels is not UNSET: + field_dict["failure_notification_channels"] = failure_notification_channels return field_dict @@ -288,79 +335,82 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.action_item_trigger_params import ActionItemTriggerParams from ..models.alert_trigger_params import AlertTriggerParams from ..models.incident_trigger_params import IncidentTriggerParams + from ..models.new_workflow_data_attributes_failure_notification_channels_item import ( + NewWorkflowDataAttributesFailureNotificationChannelsItem, + ) from ..models.pulse_trigger_params import PulseTriggerParams from ..models.simple_trigger_params import SimpleTriggerParams d = dict(src_dict) name = d.pop("name") - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_command(data: object) -> None | Unset | str: + def _parse_command(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) command = _parse_command(d.pop("command", UNSET)) - def _parse_command_feedback_enabled(data: object) -> None | Unset | bool: + def _parse_command_feedback_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) command_feedback_enabled = _parse_command_feedback_enabled(d.pop("command_feedback_enabled", UNSET)) - def _parse_wait(data: object) -> None | Unset | str: + def _parse_wait(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) wait = _parse_wait(d.pop("wait", UNSET)) _priority = d.pop("priority", UNSET) - priority: Unset | NewWorkflowDataAttributesPriority + priority: NewWorkflowDataAttributesPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: priority = check_new_workflow_data_attributes_priority(_priority) - def _parse_repeat_every_duration(data: object) -> None | Unset | str: + def _parse_repeat_every_duration(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_repeat_condition_duration_since_first_run(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) repeat_condition_duration_since_first_run = _parse_repeat_condition_duration_since_first_run( d.pop("repeat_condition_duration_since_first_run", UNSET) @@ -370,12 +420,16 @@ def _parse_repeat_condition_duration_since_first_run(data: object) -> None | Uns continuously_repeat = d.pop("continuously_repeat", UNSET) - repeat_on = [] + run_once_per_resource = d.pop("run_once_per_resource", UNSET) + _repeat_on = d.pop("repeat_on", UNSET) - 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: 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) - repeat_on.append(repeat_on_item) + repeat_on.append(repeat_on_item) enabled = d.pop("enabled", UNSET) @@ -383,25 +437,25 @@ def _parse_repeat_condition_duration_since_first_run(data: object) -> None | Uns position = d.pop("position", UNSET) - def _parse_workflow_group_id(data: object) -> None | Unset | str: + def _parse_workflow_group_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) workflow_group_id = _parse_workflow_group_id(d.pop("workflow_group_id", UNSET)) def _parse_trigger_params( data: object, - ) -> Union[ - "ActionItemTriggerParams", - "AlertTriggerParams", - "IncidentTriggerParams", - "PulseTriggerParams", - "SimpleTriggerParams", - Unset, - ]: + ) -> ( + ActionItemTriggerParams + | AlertTriggerParams + | IncidentTriggerParams + | PulseTriggerParams + | SimpleTriggerParams + | Unset + ): if isinstance(data, Unset): return data try: @@ -410,7 +464,7 @@ def _parse_trigger_params( trigger_params_type_0 = IncidentTriggerParams.from_dict(data) return trigger_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -418,7 +472,7 @@ def _parse_trigger_params( trigger_params_type_1 = ActionItemTriggerParams.from_dict(data) return trigger_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -426,7 +480,7 @@ def _parse_trigger_params( trigger_params_type_2 = AlertTriggerParams.from_dict(data) return trigger_params_type_2 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -434,7 +488,7 @@ def _parse_trigger_params( trigger_params_type_3 = PulseTriggerParams.from_dict(data) return trigger_params_type_3 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -458,10 +512,32 @@ def _parse_trigger_params( group_ids = cast(list[str], d.pop("group_ids", UNSET)) + group_assignment_ids = cast(list[str], d.pop("group_assignment_ids", UNSET)) + cause_ids = cast(list[str], d.pop("cause_ids", UNSET)) sub_status_ids = cast(list[str], d.pop("sub_status_ids", UNSET)) + _failure_notification_mode = d.pop("failure_notification_mode", UNSET) + failure_notification_mode: NewWorkflowDataAttributesFailureNotificationMode | Unset + if isinstance(_failure_notification_mode, Unset): + failure_notification_mode = UNSET + else: + failure_notification_mode = check_new_workflow_data_attributes_failure_notification_mode( + _failure_notification_mode + ) + + _failure_notification_channels = d.pop("failure_notification_channels", UNSET) + failure_notification_channels: list[NewWorkflowDataAttributesFailureNotificationChannelsItem] | Unset = UNSET + if _failure_notification_channels is not UNSET: + failure_notification_channels = [] + for failure_notification_channels_item_data in _failure_notification_channels: + failure_notification_channels_item = NewWorkflowDataAttributesFailureNotificationChannelsItem.from_dict( + failure_notification_channels_item_data + ) + + failure_notification_channels.append(failure_notification_channels_item) + new_workflow_data_attributes = cls( name=name, slug=slug, @@ -474,6 +550,7 @@ def _parse_trigger_params( repeat_condition_duration_since_first_run=repeat_condition_duration_since_first_run, repeat_condition_number_of_repeats=repeat_condition_number_of_repeats, continuously_repeat=continuously_repeat, + run_once_per_resource=run_once_per_resource, repeat_on=repeat_on, enabled=enabled, locked=locked, @@ -487,8 +564,11 @@ def _parse_trigger_params( service_ids=service_ids, functionality_ids=functionality_ids, group_ids=group_ids, + group_assignment_ids=group_assignment_ids, cause_ids=cause_ids, sub_status_ids=sub_status_ids, + failure_notification_mode=failure_notification_mode, + failure_notification_channels=failure_notification_channels, ) return new_workflow_data_attributes diff --git a/rootly_sdk/models/new_workflow_data_attributes_failure_notification_channels_item.py b/rootly_sdk/models/new_workflow_data_attributes_failure_notification_channels_item.py new file mode 100644 index 00000000..a5925194 --- /dev/null +++ b/rootly_sdk/models/new_workflow_data_attributes_failure_notification_channels_item.py @@ -0,0 +1,51 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="NewWorkflowDataAttributesFailureNotificationChannelsItem") + + +@_attrs_define +class NewWorkflowDataAttributesFailureNotificationChannelsItem: + """ + Attributes: + id (str): Slack channel ID. Liquid is allowed, for example `{{ incident.slack_channel_id }}` for the incident + channel. + name (str): Slack channel name + """ + + id: str + name: str + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "id": id, + "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") + + name = d.pop("name") + + new_workflow_data_attributes_failure_notification_channels_item = cls( + id=id, + name=name, + ) + + return new_workflow_data_attributes_failure_notification_channels_item diff --git a/rootly_sdk/models/new_workflow_data_attributes_failure_notification_mode.py b/rootly_sdk/models/new_workflow_data_attributes_failure_notification_mode.py new file mode 100644 index 00000000..d4d43a93 --- /dev/null +++ b/rootly_sdk/models/new_workflow_data_attributes_failure_notification_mode.py @@ -0,0 +1,21 @@ +from typing import Literal + +NewWorkflowDataAttributesFailureNotificationMode = Literal["custom", "inherit", "off"] + +NEW_WORKFLOW_DATA_ATTRIBUTES_FAILURE_NOTIFICATION_MODE_VALUES: set[NewWorkflowDataAttributesFailureNotificationMode] = { + "custom", + "inherit", + "off", +} + + +def check_new_workflow_data_attributes_failure_notification_mode( + value: str | None, +) -> NewWorkflowDataAttributesFailureNotificationMode | None: + if value is None: + return None + if value in NEW_WORKFLOW_DATA_ATTRIBUTES_FAILURE_NOTIFICATION_MODE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {NEW_WORKFLOW_DATA_ATTRIBUTES_FAILURE_NOTIFICATION_MODE_VALUES!r}" + ) diff --git a/rootly_sdk/models/new_workflow_data_attributes_priority.py b/rootly_sdk/models/new_workflow_data_attributes_priority.py index 28c838e4..96d2b1e6 100644 --- a/rootly_sdk/models/new_workflow_data_attributes_priority.py +++ b/rootly_sdk/models/new_workflow_data_attributes_priority.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewWorkflowDataAttributesPriority = Literal["high", "low", "normal"] @@ -13,5 +13,5 @@ def check_new_workflow_data_attributes_priority(value: str | None) -> NewWorkflo if value is None: return None if value in NEW_WORKFLOW_DATA_ATTRIBUTES_PRIORITY_VALUES: - return cast(NewWorkflowDataAttributesPriority, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_WORKFLOW_DATA_ATTRIBUTES_PRIORITY_VALUES!r}") diff --git a/rootly_sdk/models/new_workflow_data_attributes_repeat_on_item.py b/rootly_sdk/models/new_workflow_data_attributes_repeat_on_item.py index afbaf670..c98f9aa1 100644 --- a/rootly_sdk/models/new_workflow_data_attributes_repeat_on_item.py +++ b/rootly_sdk/models/new_workflow_data_attributes_repeat_on_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewWorkflowDataAttributesRepeatOnItem = Literal["F", "M", "R", "S", "T", "U", "W"] @@ -19,7 +19,7 @@ def check_new_workflow_data_attributes_repeat_on_item( if value is None: return None if value in NEW_WORKFLOW_DATA_ATTRIBUTES_REPEAT_ON_ITEM_VALUES: - return cast(NewWorkflowDataAttributesRepeatOnItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_WORKFLOW_DATA_ATTRIBUTES_REPEAT_ON_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/new_workflow_data_type.py b/rootly_sdk/models/new_workflow_data_type.py index c3bf2fd7..5923c009 100644 --- a/rootly_sdk/models/new_workflow_data_type.py +++ b/rootly_sdk/models/new_workflow_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewWorkflowDataType = Literal["workflows"] @@ -11,5 +11,5 @@ def check_new_workflow_data_type(value: str | None) -> NewWorkflowDataType | Non if value is None: return None if value in NEW_WORKFLOW_DATA_TYPE_VALUES: - return cast(NewWorkflowDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_WORKFLOW_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_workflow_form_field_condition.py b/rootly_sdk/models/new_workflow_form_field_condition.py index 37f162dc..36f5a9db 100644 --- a/rootly_sdk/models/new_workflow_form_field_condition.py +++ b/rootly_sdk/models/new_workflow_form_field_condition.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_workflow_form_field_condition_data import NewWorkflowFormFieldConditionData @@ -18,14 +19,13 @@ class NewWorkflowFormFieldCondition: data (NewWorkflowFormFieldConditionData): """ - data: "NewWorkflowFormFieldConditionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewWorkflowFormFieldConditionData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_workflow_form_field_condition.additional_properties = d return new_workflow_form_field_condition - - @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_form_field_condition_data.py b/rootly_sdk/models/new_workflow_form_field_condition_data.py index f5fef4a1..47a99c9f 100644 --- a/rootly_sdk/models/new_workflow_form_field_condition_data.py +++ b/rootly_sdk/models/new_workflow_form_field_condition_data.py @@ -1,8 +1,9 @@ +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_form_field_condition_data_type import ( NewWorkflowFormFieldConditionDataType, @@ -25,8 +26,7 @@ class NewWorkflowFormFieldConditionData: """ type_: NewWorkflowFormFieldConditionDataType - attributes: "NewWorkflowFormFieldConditionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewWorkflowFormFieldConditionDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -60,21 +60,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_workflow_form_field_condition_data.additional_properties = d return new_workflow_form_field_condition_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_form_field_condition_data_attributes.py b/rootly_sdk/models/new_workflow_form_field_condition_data_attributes.py index b07a145f..5c662698 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,32 +21,32 @@ class NewWorkflowFormFieldConditionDataAttributes: form_field_id (str): The custom field for this condition incident_condition (NewWorkflowFormFieldConditionDataAttributesIncidentCondition): The trigger condition Default: 'ANY'. - 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]]): + 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): """ form_field_id: str incident_condition: NewWorkflowFormFieldConditionDataAttributesIncidentCondition = "ANY" - 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 + 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 def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id @@ -53,43 +55,43 @@ def to_dict(self) -> dict[str, Any]: workflow_id = self.workflow_id - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values - selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_catalog_entity_ids: list[str] | Unset = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_functionality_ids: Unset | list[str] = UNSET + selected_functionality_ids: list[str] | Unset = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: Unset | list[str] = UNSET + selected_group_ids: list[str] | Unset = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: Unset | list[str] = UNSET + selected_option_ids: list[str] | Unset = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: Unset | list[str] = UNSET + selected_service_ids: list[str] | Unset = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_user_ids: Unset | list[int] = UNSET + selected_user_ids: list[int] | Unset = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_cause_ids: Unset | list[str] = UNSET + selected_cause_ids: list[str] | Unset = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: Unset | list[str] = UNSET + selected_environment_ids: list[str] | Unset = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: Unset | list[str] = UNSET + selected_incident_type_ids: list[str] | Unset = 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_form_field_condition_data_attributes_incident_condition.py b/rootly_sdk/models/new_workflow_form_field_condition_data_attributes_incident_condition.py index d7cb2056..d0ef1ef2 100644 --- a/rootly_sdk/models/new_workflow_form_field_condition_data_attributes_incident_condition.py +++ b/rootly_sdk/models/new_workflow_form_field_condition_data_attributes_incident_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewWorkflowFormFieldConditionDataAttributesIncidentCondition = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_new_workflow_form_field_condition_data_attributes_incident_condition( if value is None: return None if value in NEW_WORKFLOW_FORM_FIELD_CONDITION_DATA_ATTRIBUTES_INCIDENT_CONDITION_VALUES: - return cast(NewWorkflowFormFieldConditionDataAttributesIncidentCondition, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_WORKFLOW_FORM_FIELD_CONDITION_DATA_ATTRIBUTES_INCIDENT_CONDITION_VALUES!r}" ) diff --git a/rootly_sdk/models/new_workflow_form_field_condition_data_type.py b/rootly_sdk/models/new_workflow_form_field_condition_data_type.py index 24d5d5b2..3a31cff4 100644 --- a/rootly_sdk/models/new_workflow_form_field_condition_data_type.py +++ b/rootly_sdk/models/new_workflow_form_field_condition_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewWorkflowFormFieldConditionDataType = Literal["workflow_form_field_conditions"] @@ -13,7 +13,7 @@ def check_new_workflow_form_field_condition_data_type( if value is None: return None if value in NEW_WORKFLOW_FORM_FIELD_CONDITION_DATA_TYPE_VALUES: - return cast(NewWorkflowFormFieldConditionDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {NEW_WORKFLOW_FORM_FIELD_CONDITION_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/new_workflow_group.py b/rootly_sdk/models/new_workflow_group.py index bbfbb047..8e825c4f 100644 --- a/rootly_sdk/models/new_workflow_group.py +++ b/rootly_sdk/models/new_workflow_group.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_workflow_group_data import NewWorkflowGroupData @@ -18,14 +19,13 @@ class NewWorkflowGroup: data (NewWorkflowGroupData): """ - data: "NewWorkflowGroupData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewWorkflowGroupData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_workflow_group.additional_properties = d return new_workflow_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_workflow_group_data.py b/rootly_sdk/models/new_workflow_group_data.py index 5f6b9600..48fb02dd 100644 --- a/rootly_sdk/models/new_workflow_group_data.py +++ b/rootly_sdk/models/new_workflow_group_data.py @@ -1,8 +1,9 @@ +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_group_data_type import NewWorkflowGroupDataType, check_new_workflow_group_data_type @@ -22,8 +23,7 @@ class NewWorkflowGroupData: """ type_: NewWorkflowGroupDataType - attributes: "NewWorkflowGroupDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewWorkflowGroupDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_workflow_group_data.additional_properties = d return new_workflow_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_workflow_group_data_attributes.py b/rootly_sdk/models/new_workflow_group_data_attributes.py index 2ca72540..7aeaea92 100644 --- a/rootly_sdk/models/new_workflow_group_data_attributes.py +++ b/rootly_sdk/models/new_workflow_group_data_attributes.py @@ -1,8 +1,9 @@ +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.new_workflow_group_data_attributes_kind import ( NewWorkflowGroupDataAttributesKind, @@ -18,38 +19,37 @@ class NewWorkflowGroupDataAttributes: """ Attributes: name (str): The name 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 + slug (None | str | Unset): 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 (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 """ name: str - 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) + slug: None | str | Unset = UNSET + kind: NewWorkflowGroupDataAttributesKind | Unset = UNSET + description: None | str | Unset = UNSET + icon: str | Unset = UNSET + expanded: bool | Unset = UNSET + position: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -62,7 +62,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "name": name, @@ -88,28 +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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) _kind = d.pop("kind", UNSET) - kind: Unset | NewWorkflowGroupDataAttributesKind + kind: NewWorkflowGroupDataAttributesKind | Unset if isinstance(_kind, Unset): kind = UNSET else: kind = check_new_workflow_group_data_attributes_kind(_kind) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) @@ -129,21 +129,4 @@ def _parse_description(data: object) -> None | Unset | str: position=position, ) - new_workflow_group_data_attributes.additional_properties = d return new_workflow_group_data_attributes - - @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_group_data_attributes_kind.py b/rootly_sdk/models/new_workflow_group_data_attributes_kind.py index 7cf21a2f..89d6dea1 100644 --- a/rootly_sdk/models/new_workflow_group_data_attributes_kind.py +++ b/rootly_sdk/models/new_workflow_group_data_attributes_kind.py @@ -1,12 +1,15 @@ -from typing import Literal, cast +from typing import Literal -NewWorkflowGroupDataAttributesKind = Literal["action_item", "alert", "incident", "post_mortem", "pulse", "simple"] +NewWorkflowGroupDataAttributesKind = Literal[ + "action_item", "alert", "incident", "post_mortem", "problem", "pulse", "simple" +] NEW_WORKFLOW_GROUP_DATA_ATTRIBUTES_KIND_VALUES: set[NewWorkflowGroupDataAttributesKind] = { "action_item", "alert", "incident", "post_mortem", + "problem", "pulse", "simple", } @@ -16,5 +19,5 @@ def check_new_workflow_group_data_attributes_kind(value: str | None) -> NewWorkf if value is None: return None if value in NEW_WORKFLOW_GROUP_DATA_ATTRIBUTES_KIND_VALUES: - return cast(NewWorkflowGroupDataAttributesKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_WORKFLOW_GROUP_DATA_ATTRIBUTES_KIND_VALUES!r}") diff --git a/rootly_sdk/models/new_workflow_group_data_type.py b/rootly_sdk/models/new_workflow_group_data_type.py index f4c32e4f..59f08ad8 100644 --- a/rootly_sdk/models/new_workflow_group_data_type.py +++ b/rootly_sdk/models/new_workflow_group_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewWorkflowGroupDataType = Literal["workflow_groups"] @@ -11,5 +11,5 @@ def check_new_workflow_group_data_type(value: str | None) -> NewWorkflowGroupDat if value is None: return None if value in NEW_WORKFLOW_GROUP_DATA_TYPE_VALUES: - return cast(NewWorkflowGroupDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_WORKFLOW_GROUP_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_workflow_run.py b/rootly_sdk/models/new_workflow_run.py index 877a070c..c95113cf 100644 --- a/rootly_sdk/models/new_workflow_run.py +++ b/rootly_sdk/models/new_workflow_run.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_workflow_run_data import NewWorkflowRunData @@ -18,14 +19,13 @@ class NewWorkflowRun: data (NewWorkflowRunData): """ - data: "NewWorkflowRunData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewWorkflowRunData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_workflow_run.additional_properties = d return new_workflow_run - - @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_run_data.py b/rootly_sdk/models/new_workflow_run_data.py index 3d35b9ab..1b7b15aa 100644 --- a/rootly_sdk/models/new_workflow_run_data.py +++ b/rootly_sdk/models/new_workflow_run_data.py @@ -1,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.new_workflow_run_data_type import NewWorkflowRunDataType, check_new_workflow_run_data_type @@ -23,21 +24,20 @@ class NewWorkflowRunData: """ Attributes: type_ (NewWorkflowRunDataType): - attributes (Union['NewWorkflowRunDataAttributesType0', 'NewWorkflowRunDataAttributesType1', - 'NewWorkflowRunDataAttributesType2', 'NewWorkflowRunDataAttributesType3', 'NewWorkflowRunDataAttributesType4', - 'NewWorkflowRunDataAttributesType5']): + attributes (NewWorkflowRunDataAttributesType0 | NewWorkflowRunDataAttributesType1 | + NewWorkflowRunDataAttributesType2 | NewWorkflowRunDataAttributesType3 | NewWorkflowRunDataAttributesType4 | + NewWorkflowRunDataAttributesType5): """ type_: NewWorkflowRunDataType - attributes: Union[ - "NewWorkflowRunDataAttributesType0", - "NewWorkflowRunDataAttributesType1", - "NewWorkflowRunDataAttributesType2", - "NewWorkflowRunDataAttributesType3", - "NewWorkflowRunDataAttributesType4", - "NewWorkflowRunDataAttributesType5", - ] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: ( + NewWorkflowRunDataAttributesType0 + | NewWorkflowRunDataAttributesType1 + | NewWorkflowRunDataAttributesType2 + | NewWorkflowRunDataAttributesType3 + | NewWorkflowRunDataAttributesType4 + | NewWorkflowRunDataAttributesType5 + ) def to_dict(self) -> dict[str, Any]: from ..models.new_workflow_run_data_attributes_type_0 import NewWorkflowRunDataAttributesType0 @@ -63,7 +63,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -87,21 +87,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_attributes( data: object, - ) -> Union[ - "NewWorkflowRunDataAttributesType0", - "NewWorkflowRunDataAttributesType1", - "NewWorkflowRunDataAttributesType2", - "NewWorkflowRunDataAttributesType3", - "NewWorkflowRunDataAttributesType4", - "NewWorkflowRunDataAttributesType5", - ]: + ) -> ( + 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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -109,7 +109,7 @@ def _parse_attributes( attributes_type_1 = NewWorkflowRunDataAttributesType1.from_dict(data) return attributes_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -117,7 +117,7 @@ def _parse_attributes( attributes_type_2 = NewWorkflowRunDataAttributesType2.from_dict(data) return attributes_type_2 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -125,7 +125,7 @@ def _parse_attributes( attributes_type_3 = NewWorkflowRunDataAttributesType3.from_dict(data) return attributes_type_3 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -133,7 +133,7 @@ def _parse_attributes( attributes_type_4 = NewWorkflowRunDataAttributesType4.from_dict(data) return attributes_type_4 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -148,21 +148,4 @@ def _parse_attributes( attributes=attributes, ) - new_workflow_run_data.additional_properties = d return new_workflow_run_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_run_data_attributes_type_0.py b/rootly_sdk/models/new_workflow_run_data_attributes_type_0.py index ae4f183a..08d05bd7 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,32 +19,32 @@ class NewWorkflowRunDataAttributesType0: """ Attributes: - immediate (Union[None, Unset, bool]): If false, this will respect wait time configured on the workflow. Default: + immediate (bool | None | Unset): 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, NewWorkflowRunDataAttributesType0Context]): + 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): """ - immediate: None | Unset | bool = True - check_conditions: None | Unset | bool = False - context: Union[Unset, "NewWorkflowRunDataAttributesType0Context"] = UNSET + immediate: bool | None | Unset = True + check_conditions: bool | None | Unset = False + context: NewWorkflowRunDataAttributesType0Context | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - immediate: None | Unset | bool + immediate: bool | None | Unset if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: None | Unset | bool + check_conditions: bool | None | Unset if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: Unset | dict[str, Any] = UNSET + context: dict[str, Any] | Unset = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -64,26 +66,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_immediate(data: object) -> None | Unset | bool: + def _parse_immediate(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> None | Unset | bool: + def _parse_check_conditions(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: Unset | NewWorkflowRunDataAttributesType0Context + context: NewWorkflowRunDataAttributesType0Context | Unset 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 14da9532..9bce16b4 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 6c0a8724..6111792e 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,35 +20,34 @@ class NewWorkflowRunDataAttributesType1: """ Attributes: incident_id (str): - 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]): + 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): """ incident_id: str - immediate: None | Unset | bool = True - check_conditions: None | Unset | bool = False - context: Union[Unset, "NewWorkflowRunDataAttributesType1Context"] = UNSET + immediate: bool | None | Unset = True + check_conditions: bool | None | Unset = False + context: NewWorkflowRunDataAttributesType1Context | Unset = 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: None | Unset | bool + immediate: bool | None | Unset if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: None | Unset | bool + check_conditions: bool | None | Unset if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: Unset | dict[str, Any] = UNSET + context: dict[str, Any] | Unset = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -73,26 +74,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) -> None | Unset | bool: + def _parse_immediate(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> None | Unset | bool: + def _parse_check_conditions(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: Unset | NewWorkflowRunDataAttributesType1Context + context: NewWorkflowRunDataAttributesType1Context | Unset 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 eaaac054..20304b26 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 eaefbd9c..7344a64d 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,35 +20,34 @@ class NewWorkflowRunDataAttributesType2: """ Attributes: post_mortem_id (str): - 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]): + 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): """ post_mortem_id: str - immediate: None | Unset | bool = True - check_conditions: None | Unset | bool = False - context: Union[Unset, "NewWorkflowRunDataAttributesType2Context"] = UNSET + immediate: bool | None | Unset = True + check_conditions: bool | None | Unset = False + context: NewWorkflowRunDataAttributesType2Context | Unset = 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: None | Unset | bool + immediate: bool | None | Unset if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: None | Unset | bool + check_conditions: bool | None | Unset if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: Unset | dict[str, Any] = UNSET + context: dict[str, Any] | Unset = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -73,26 +74,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) -> None | Unset | bool: + def _parse_immediate(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> None | Unset | bool: + def _parse_check_conditions(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: Unset | NewWorkflowRunDataAttributesType2Context + context: NewWorkflowRunDataAttributesType2Context | Unset 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 70834bdd..739fa7bc 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 42aa6168..9b25708a 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,35 +20,34 @@ class NewWorkflowRunDataAttributesType3: """ Attributes: action_item_id (str): - 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]): + 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): """ action_item_id: str - immediate: None | Unset | bool = True - check_conditions: None | Unset | bool = False - context: Union[Unset, "NewWorkflowRunDataAttributesType3Context"] = UNSET + immediate: bool | None | Unset = True + check_conditions: bool | None | Unset = False + context: NewWorkflowRunDataAttributesType3Context | Unset = 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: None | Unset | bool + immediate: bool | None | Unset if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: None | Unset | bool + check_conditions: bool | None | Unset if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: Unset | dict[str, Any] = UNSET + context: dict[str, Any] | Unset = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -73,26 +74,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) -> None | Unset | bool: + def _parse_immediate(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> None | Unset | bool: + def _parse_check_conditions(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: Unset | NewWorkflowRunDataAttributesType3Context + context: NewWorkflowRunDataAttributesType3Context | Unset 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 dd12425a..25eabc0f 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 7fecfc0a..a01ead3d 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,35 +20,34 @@ class NewWorkflowRunDataAttributesType4: """ Attributes: alert_id (str): - 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]): + 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): """ alert_id: str - immediate: None | Unset | bool = True - check_conditions: None | Unset | bool = False - context: Union[Unset, "NewWorkflowRunDataAttributesType4Context"] = UNSET + immediate: bool | None | Unset = True + check_conditions: bool | None | Unset = False + context: NewWorkflowRunDataAttributesType4Context | Unset = 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: None | Unset | bool + immediate: bool | None | Unset if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: None | Unset | bool + check_conditions: bool | None | Unset if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: Unset | dict[str, Any] = UNSET + context: dict[str, Any] | Unset = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -73,26 +74,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) -> None | Unset | bool: + def _parse_immediate(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> None | Unset | bool: + def _parse_check_conditions(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: Unset | NewWorkflowRunDataAttributesType4Context + context: NewWorkflowRunDataAttributesType4Context | Unset 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 c29a13ef..8c969b82 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 047f5885..678f16da 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,35 +20,34 @@ class NewWorkflowRunDataAttributesType5: """ Attributes: pulse_id (str): - 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]): + 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): """ pulse_id: str - immediate: None | Unset | bool = True - check_conditions: None | Unset | bool = False - context: Union[Unset, "NewWorkflowRunDataAttributesType5Context"] = UNSET + immediate: bool | None | Unset = True + check_conditions: bool | None | Unset = False + context: NewWorkflowRunDataAttributesType5Context | Unset = 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: None | Unset | bool + immediate: bool | None | Unset if isinstance(self.immediate, Unset): immediate = UNSET else: immediate = self.immediate - check_conditions: None | Unset | bool + check_conditions: bool | None | Unset if isinstance(self.check_conditions, Unset): check_conditions = UNSET else: check_conditions = self.check_conditions - context: Unset | dict[str, Any] = UNSET + context: dict[str, Any] | Unset = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -73,26 +74,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) -> None | Unset | bool: + def _parse_immediate(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) immediate = _parse_immediate(d.pop("immediate", UNSET)) - def _parse_check_conditions(data: object) -> None | Unset | bool: + def _parse_check_conditions(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) check_conditions = _parse_check_conditions(d.pop("check_conditions", UNSET)) _context = d.pop("context", UNSET) - context: Unset | NewWorkflowRunDataAttributesType5Context + context: NewWorkflowRunDataAttributesType5Context | Unset 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 d0be7a1e..02e65077 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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_run_data_type.py b/rootly_sdk/models/new_workflow_run_data_type.py index a3a42e95..5b2c3eed 100644 --- a/rootly_sdk/models/new_workflow_run_data_type.py +++ b/rootly_sdk/models/new_workflow_run_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewWorkflowRunDataType = Literal["workflow_runs"] @@ -11,5 +11,5 @@ def check_new_workflow_run_data_type(value: str | None) -> NewWorkflowRunDataTyp if value is None: return None if value in NEW_WORKFLOW_RUN_DATA_TYPE_VALUES: - return cast(NewWorkflowRunDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_WORKFLOW_RUN_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/new_workflow_task.py b/rootly_sdk/models/new_workflow_task.py index 0d7f4bf9..98d26946 100644 --- a/rootly_sdk/models/new_workflow_task.py +++ b/rootly_sdk/models/new_workflow_task.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.new_workflow_task_data import NewWorkflowTaskData @@ -18,14 +19,13 @@ class NewWorkflowTask: data (NewWorkflowTaskData): """ - data: "NewWorkflowTaskData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: NewWorkflowTaskData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - new_workflow_task.additional_properties = d return new_workflow_task - - @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_task_data.py b/rootly_sdk/models/new_workflow_task_data.py index ac4a7123..93ca2545 100644 --- a/rootly_sdk/models/new_workflow_task_data.py +++ b/rootly_sdk/models/new_workflow_task_data.py @@ -1,8 +1,9 @@ +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_task_data_type import NewWorkflowTaskDataType, check_new_workflow_task_data_type @@ -22,8 +23,7 @@ class NewWorkflowTaskData: """ type_: NewWorkflowTaskDataType - attributes: "NewWorkflowTaskDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: NewWorkflowTaskDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - new_workflow_task_data.additional_properties = d return new_workflow_task_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_task_data_attributes.py b/rootly_sdk/models/new_workflow_task_data_attributes.py index 9e7fb4b3..bdfd4529 100644 --- a/rootly_sdk/models/new_workflow_task_data_attributes.py +++ b/rootly_sdk/models/new_workflow_task_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -78,6 +80,7 @@ from ..models.create_shortcut_story_task_params_type_0 import CreateShortcutStoryTaskParamsType0 from ..models.create_shortcut_story_task_params_type_1 import CreateShortcutStoryTaskParamsType1 from ..models.create_shortcut_task_task_params import CreateShortcutTaskTaskParams + from ..models.create_slack_canvas_task_params import CreateSlackCanvasTaskParams from ..models.create_slack_channel_task_params import CreateSlackChannelTaskParams from ..models.create_sub_incident_task_params import CreateSubIncidentTaskParams from ..models.create_trello_card_task_params import CreateTrelloCardTaskParams @@ -123,6 +126,7 @@ from ..models.print_task_params import PrintTaskParams from ..models.publish_incident_task_params import PublishIncidentTaskParams from ..models.redis_client_task_params import RedisClientTaskParams + from ..models.remove_from_slack_channel_task_params import RemoveFromSlackChannelTaskParams from ..models.remove_google_docs_permissions_task_params import RemoveGoogleDocsPermissionsTaskParams from ..models.rename_google_chat_space_task_params import RenameGoogleChatSpaceTaskParams from ..models.rename_microsoft_teams_channel_task_params import RenameMicrosoftTeamsChannelTaskParams @@ -179,6 +183,7 @@ from ..models.update_sharepoint_page_task_params import UpdateSharepointPageTaskParams from ..models.update_shortcut_story_task_params import UpdateShortcutStoryTaskParams from ..models.update_shortcut_task_task_params import UpdateShortcutTaskTaskParams + from ..models.update_slack_canvas_task_params import UpdateSlackCanvasTaskParams from ..models.update_slack_channel_topic_task_params import UpdateSlackChannelTopicTaskParams from ..models.update_status_task_params import UpdateStatusTaskParams from ..models.update_trello_card_task_params import UpdateTrelloCardTaskParams @@ -193,247 +198,247 @@ class NewWorkflowTaskDataAttributes: """ Attributes: - 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 | 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 | 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 | CreateSlackCanvasTaskParams | + 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 | RemoveFromSlackChannelTaskParams | 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 | UpdateSlackCanvasTaskParams | 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: Unset | str = UNSET - position: Unset | int = UNSET - skip_on_failure: Unset | bool = UNSET - enabled: Unset | bool = True + task_params: ( + 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 + | 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 + | CreateSlackCanvasTaskParams + | 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 + | RemoveFromSlackChannelTaskParams + | 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 + | UpdateSlackCanvasTaskParams + | UpdateSlackChannelTopicTaskParams + | UpdateStatusTaskParams + | UpdateTrelloCardTaskParams + | UpdateVictorOpsIncidentTaskParams + | UpdateZendeskTicketTaskParams + ) + name: str | Unset = UNSET + position: int | Unset = UNSET + skip_on_failure: bool | Unset = UNSET + enabled: bool | Unset = True def to_dict(self) -> dict[str, Any]: from ..models.add_action_item_task_params import AddActionItemTaskParams @@ -509,6 +514,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.create_shortcut_story_task_params_type_0 import CreateShortcutStoryTaskParamsType0 from ..models.create_shortcut_story_task_params_type_1 import CreateShortcutStoryTaskParamsType1 from ..models.create_shortcut_task_task_params import CreateShortcutTaskTaskParams + from ..models.create_slack_canvas_task_params import CreateSlackCanvasTaskParams from ..models.create_slack_channel_task_params import CreateSlackChannelTaskParams from ..models.create_sub_incident_task_params import CreateSubIncidentTaskParams from ..models.create_trello_card_task_params import CreateTrelloCardTaskParams @@ -554,6 +560,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.print_task_params import PrintTaskParams from ..models.publish_incident_task_params import PublishIncidentTaskParams from ..models.redis_client_task_params import RedisClientTaskParams + from ..models.remove_from_slack_channel_task_params import RemoveFromSlackChannelTaskParams from ..models.remove_google_docs_permissions_task_params import RemoveGoogleDocsPermissionsTaskParams from ..models.rename_google_chat_space_task_params import RenameGoogleChatSpaceTaskParams from ..models.rename_microsoft_teams_channel_task_params import RenameMicrosoftTeamsChannelTaskParams @@ -610,6 +617,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.update_sharepoint_page_task_params import UpdateSharepointPageTaskParams from ..models.update_shortcut_story_task_params import UpdateShortcutStoryTaskParams from ..models.update_shortcut_task_task_params import UpdateShortcutTaskTaskParams + from ..models.update_slack_canvas_task_params import UpdateSlackCanvasTaskParams from ..models.update_slack_channel_topic_task_params import UpdateSlackChannelTopicTaskParams from ..models.update_status_task_params import UpdateStatusTaskParams from ..models.update_trello_card_task_params import UpdateTrelloCardTaskParams @@ -863,6 +871,8 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, RenameSlackChannelTaskParams): task_params = self.task_params.to_dict() + elif isinstance(self.task_params, RemoveFromSlackChannelTaskParams): + task_params = self.task_params.to_dict() elif isinstance(self.task_params, ChangeSlackChannelPrivacyTaskParams): task_params = self.task_params.to_dict() elif isinstance(self.task_params, RunCommandHerokuTaskParams): @@ -873,6 +883,8 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, CreateSlackChannelTaskParams): task_params = self.task_params.to_dict() + elif isinstance(self.task_params, CreateSlackCanvasTaskParams): + task_params = self.task_params.to_dict() elif isinstance(self.task_params, SendSlackMessageTaskParamsType0): task_params = self.task_params.to_dict() elif isinstance(self.task_params, SendSlackMessageTaskParamsType1): @@ -917,6 +929,8 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, UpdateSlackChannelTopicTaskParams): task_params = self.task_params.to_dict() + elif isinstance(self.task_params, UpdateSlackCanvasTaskParams): + task_params = self.task_params.to_dict() elif isinstance(self.task_params, UpdateStatusTaskParams): task_params = self.task_params.to_dict() elif isinstance(self.task_params, UpdateIncidentStatusTimestampTaskParams): @@ -1052,6 +1066,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.create_shortcut_story_task_params_type_0 import CreateShortcutStoryTaskParamsType0 from ..models.create_shortcut_story_task_params_type_1 import CreateShortcutStoryTaskParamsType1 from ..models.create_shortcut_task_task_params import CreateShortcutTaskTaskParams + from ..models.create_slack_canvas_task_params import CreateSlackCanvasTaskParams from ..models.create_slack_channel_task_params import CreateSlackChannelTaskParams from ..models.create_sub_incident_task_params import CreateSubIncidentTaskParams from ..models.create_trello_card_task_params import CreateTrelloCardTaskParams @@ -1097,6 +1112,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.print_task_params import PrintTaskParams from ..models.publish_incident_task_params import PublishIncidentTaskParams from ..models.redis_client_task_params import RedisClientTaskParams + from ..models.remove_from_slack_channel_task_params import RemoveFromSlackChannelTaskParams from ..models.remove_google_docs_permissions_task_params import RemoveGoogleDocsPermissionsTaskParams from ..models.rename_google_chat_space_task_params import RenameGoogleChatSpaceTaskParams from ..models.rename_microsoft_teams_channel_task_params import RenameMicrosoftTeamsChannelTaskParams @@ -1153,6 +1169,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.update_sharepoint_page_task_params import UpdateSharepointPageTaskParams from ..models.update_shortcut_story_task_params import UpdateShortcutStoryTaskParams from ..models.update_shortcut_task_task_params import UpdateShortcutTaskTaskParams + from ..models.update_slack_canvas_task_params import UpdateSlackCanvasTaskParams from ..models.update_slack_channel_topic_task_params import UpdateSlackChannelTopicTaskParams from ..models.update_status_task_params import UpdateStatusTaskParams from ..models.update_trello_card_task_params import UpdateTrelloCardTaskParams @@ -1163,181 +1180,184 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_task_params( data: object, - ) -> 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", - ]: + ) -> ( + 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 + | 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 + | CreateSlackCanvasTaskParams + | 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 + | RemoveFromSlackChannelTaskParams + | 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 + | UpdateSlackCanvasTaskParams + | 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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1345,7 +1365,7 @@ def _parse_task_params( task_params_type_1 = UpdateActionItemTaskParams.from_dict(data) return task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1353,7 +1373,7 @@ def _parse_task_params( task_params_type_2 = AddRoleTaskParams.from_dict(data) return task_params_type_2 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1361,7 +1381,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1369,7 +1389,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1377,7 +1397,7 @@ def _parse_task_params( task_params_type_4 = AddTeamTaskParams.from_dict(data) return task_params_type_4 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1385,7 +1405,7 @@ def _parse_task_params( task_params_type_5 = AddToTimelineTaskParams.from_dict(data) return task_params_type_5 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1393,7 +1413,7 @@ def _parse_task_params( task_params_type_6 = ArchiveSlackChannelsTaskParams.from_dict(data) return task_params_type_6 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1401,7 +1421,7 @@ def _parse_task_params( task_params_type_7 = AttachDatadogDashboardsTaskParams.from_dict(data) return task_params_type_7 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1409,7 +1429,7 @@ def _parse_task_params( task_params_type_8 = AutoAssignRoleOpsgenieTaskParams.from_dict(data) return task_params_type_8 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1419,7 +1439,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_rootly_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1429,7 +1449,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_rootly_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1439,7 +1459,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_rootly_task_params_type_2 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1449,7 +1469,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_rootly_task_params_type_3 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1459,7 +1479,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_rootly_task_params_type_4 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1469,7 +1489,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_pagerduty_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1479,7 +1499,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_pagerduty_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1487,7 +1507,7 @@ def _parse_task_params( task_params_type_11 = UpdatePagerdutyIncidentTaskParams.from_dict(data) return task_params_type_11 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1495,7 +1515,7 @@ def _parse_task_params( task_params_type_12 = CreatePagerdutyStatusUpdateTaskParams.from_dict(data) return task_params_type_12 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1503,7 +1523,7 @@ def _parse_task_params( task_params_type_13 = CreatePagertreeAlertTaskParams.from_dict(data) return task_params_type_13 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1511,7 +1531,7 @@ def _parse_task_params( task_params_type_14 = UpdatePagertreeAlertTaskParams.from_dict(data) return task_params_type_14 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1519,7 +1539,7 @@ def _parse_task_params( task_params_type_15 = AutoAssignRoleVictorOpsTaskParams.from_dict(data) return task_params_type_15 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1527,7 +1547,7 @@ def _parse_task_params( task_params_type_16 = CallPeopleTaskParams.from_dict(data) return task_params_type_16 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1535,7 +1555,7 @@ def _parse_task_params( task_params_type_17 = CreateAirtableTableRecordTaskParams.from_dict(data) return task_params_type_17 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1543,7 +1563,7 @@ def _parse_task_params( task_params_type_18 = CreateAsanaSubtaskTaskParams.from_dict(data) return task_params_type_18 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1551,7 +1571,7 @@ def _parse_task_params( task_params_type_19 = CreateAsanaTaskTaskParams.from_dict(data) return task_params_type_19 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1559,7 +1579,7 @@ def _parse_task_params( task_params_type_20 = CreateConfluencePageTaskParams.from_dict(data) return task_params_type_20 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1567,7 +1587,7 @@ def _parse_task_params( task_params_type_21 = CreateDatadogNotebookTaskParams.from_dict(data) return task_params_type_21 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1575,7 +1595,7 @@ def _parse_task_params( task_params_type_22 = CreateCodaPageTaskParams.from_dict(data) return task_params_type_22 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1583,7 +1603,7 @@ def _parse_task_params( task_params_type_23 = CreateDropboxPaperPageTaskParams.from_dict(data) return task_params_type_23 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1591,7 +1611,7 @@ def _parse_task_params( task_params_type_24 = CreateGithubIssueTaskParams.from_dict(data) return task_params_type_24 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1599,7 +1619,7 @@ def _parse_task_params( task_params_type_25 = CreateGitlabIssueTaskParams.from_dict(data) return task_params_type_25 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1607,7 +1627,7 @@ def _parse_task_params( task_params_type_26 = CreateOutlookEventTaskParams.from_dict(data) return task_params_type_26 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1615,7 +1635,7 @@ def _parse_task_params( task_params_type_27 = CreateGoogleCalendarEventTaskParams.from_dict(data) return task_params_type_27 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1623,7 +1643,7 @@ def _parse_task_params( task_params_type_28 = UpdateGoogleDocsPageTaskParams.from_dict(data) return task_params_type_28 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1631,7 +1651,7 @@ def _parse_task_params( task_params_type_29 = UpdateCodaPageTaskParams.from_dict(data) return task_params_type_29 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1639,7 +1659,7 @@ def _parse_task_params( task_params_type_30 = UpdateGoogleCalendarEventTaskParams.from_dict(data) return task_params_type_30 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1647,7 +1667,7 @@ def _parse_task_params( task_params_type_31 = CreateSharepointPageTaskParams.from_dict(data) return task_params_type_31 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1655,7 +1675,7 @@ def _parse_task_params( task_params_type_32 = CreateGoogleDocsPageTaskParams.from_dict(data) return task_params_type_32 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1663,7 +1683,7 @@ def _parse_task_params( task_params_type_33 = CreateGoogleDocsPermissionsTaskParams.from_dict(data) return task_params_type_33 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1671,7 +1691,7 @@ def _parse_task_params( task_params_type_34 = RemoveGoogleDocsPermissionsTaskParams.from_dict(data) return task_params_type_34 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1679,7 +1699,7 @@ def _parse_task_params( task_params_type_35 = CreateQuipPageTaskParams.from_dict(data) return task_params_type_35 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1687,7 +1707,7 @@ def _parse_task_params( task_params_type_36 = CreateGoogleMeetingTaskParams.from_dict(data) return task_params_type_36 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1695,7 +1715,7 @@ def _parse_task_params( task_params_type_37 = CreateGoToMeetingTaskParams.from_dict(data) return task_params_type_37 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1703,7 +1723,7 @@ def _parse_task_params( task_params_type_38 = CreateIncidentTaskParams.from_dict(data) return task_params_type_38 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1711,7 +1731,7 @@ def _parse_task_params( task_params_type_39 = CreateSubIncidentTaskParams.from_dict(data) return task_params_type_39 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1719,7 +1739,7 @@ def _parse_task_params( task_params_type_40 = CreateIncidentPostmortemTaskParams.from_dict(data) return task_params_type_40 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1727,7 +1747,7 @@ def _parse_task_params( task_params_type_41 = CreateJiraIssueTaskParams.from_dict(data) return task_params_type_41 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1735,7 +1755,7 @@ def _parse_task_params( task_params_type_42 = CreateJiraSubtaskTaskParams.from_dict(data) return task_params_type_42 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1743,7 +1763,7 @@ def _parse_task_params( task_params_type_43 = AttachRetrospectivePdfToJiraIssueTaskParams.from_dict(data) return task_params_type_43 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1751,7 +1771,7 @@ def _parse_task_params( task_params_type_44 = AttachRetrospectivePdfToFreshserviceTicketTaskParams.from_dict(data) return task_params_type_44 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1759,7 +1779,7 @@ def _parse_task_params( task_params_type_45 = CreateLinearIssueTaskParams.from_dict(data) return task_params_type_45 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1767,7 +1787,7 @@ def _parse_task_params( task_params_type_46 = CreateLinearSubtaskIssueTaskParams.from_dict(data) return task_params_type_46 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1775,7 +1795,7 @@ def _parse_task_params( task_params_type_47 = CreateLinearIssueCommentTaskParams.from_dict(data) return task_params_type_47 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1783,7 +1803,7 @@ def _parse_task_params( task_params_type_48 = CreateMicrosoftTeamsMeetingTaskParams.from_dict(data) return task_params_type_48 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1791,7 +1811,7 @@ def _parse_task_params( task_params_type_49 = CreateMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_49 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1799,7 +1819,7 @@ def _parse_task_params( task_params_type_50 = CreateMicrosoftTeamsChatTaskParams.from_dict(data) return task_params_type_50 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1809,7 +1829,7 @@ def _parse_task_params( ) return componentsschemasadd_microsoft_teams_tab_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1819,7 +1839,7 @@ def _parse_task_params( ) return componentsschemasadd_microsoft_teams_tab_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1827,7 +1847,7 @@ def _parse_task_params( task_params_type_52 = AddMicrosoftTeamsChatTabTaskParams.from_dict(data) return task_params_type_52 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1835,7 +1855,7 @@ def _parse_task_params( task_params_type_53 = CreateGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_53 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1843,7 +1863,7 @@ def _parse_task_params( task_params_type_54 = SendGoogleChatMessageTaskParams.from_dict(data) return task_params_type_54 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1851,7 +1871,7 @@ def _parse_task_params( task_params_type_55 = SendGoogleChatAttachmentsTaskParams.from_dict(data) return task_params_type_55 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1859,7 +1879,7 @@ def _parse_task_params( task_params_type_56 = InviteToGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_56 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1867,7 +1887,7 @@ def _parse_task_params( task_params_type_57 = ArchiveGoogleChatSpacesTaskParams.from_dict(data) return task_params_type_57 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1875,7 +1895,7 @@ def _parse_task_params( task_params_type_58 = RenameGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_58 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1883,7 +1903,7 @@ def _parse_task_params( task_params_type_59 = UpdateGoogleChatSpaceDescriptionTaskParams.from_dict(data) return task_params_type_59 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1891,7 +1911,7 @@ def _parse_task_params( task_params_type_60 = ChangeGoogleChatSpacePrivacyTaskParams.from_dict(data) return task_params_type_60 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1899,7 +1919,7 @@ def _parse_task_params( task_params_type_61 = ArchiveMicrosoftTeamsChannelsTaskParams.from_dict(data) return task_params_type_61 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1907,7 +1927,7 @@ def _parse_task_params( task_params_type_62 = RenameMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_62 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1915,7 +1935,7 @@ def _parse_task_params( task_params_type_63 = InviteToMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_63 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1923,7 +1943,7 @@ def _parse_task_params( task_params_type_64 = CreateNotionPageTaskParams.from_dict(data) return task_params_type_64 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1933,7 +1953,7 @@ def _parse_task_params( ) return componentsschemassend_microsoft_teams_message_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1941,7 +1961,7 @@ def _parse_task_params( task_params_type_66 = SendMicrosoftTeamsChatMessageTaskParams.from_dict(data) return task_params_type_66 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1951,7 +1971,7 @@ def _parse_task_params( ) return componentsschemassend_microsoft_teams_blocks_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1959,7 +1979,7 @@ def _parse_task_params( task_params_type_68 = UpdateNotionPageTaskParams.from_dict(data) return task_params_type_68 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1967,7 +1987,7 @@ def _parse_task_params( task_params_type_69 = UpdateQuipPageTaskParams.from_dict(data) return task_params_type_69 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1975,7 +1995,7 @@ def _parse_task_params( task_params_type_70 = UpdateConfluencePageTaskParams.from_dict(data) return task_params_type_70 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1983,7 +2003,7 @@ def _parse_task_params( task_params_type_71 = UpdateSharepointPageTaskParams.from_dict(data) return task_params_type_71 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1991,7 +2011,7 @@ def _parse_task_params( task_params_type_72 = UpdateDropboxPaperPageTaskParams.from_dict(data) return task_params_type_72 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1999,7 +2019,7 @@ def _parse_task_params( task_params_type_73 = UpdateDatadogNotebookTaskParams.from_dict(data) return task_params_type_73 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2007,7 +2027,7 @@ def _parse_task_params( task_params_type_74 = CreateServiceNowIncidentTaskParams.from_dict(data) return task_params_type_74 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2017,7 +2037,7 @@ def _parse_task_params( ) return componentsschemascreate_shortcut_story_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2027,7 +2047,7 @@ def _parse_task_params( ) return componentsschemascreate_shortcut_story_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2035,7 +2055,7 @@ def _parse_task_params( task_params_type_76 = CreateShortcutTaskTaskParams.from_dict(data) return task_params_type_76 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2043,7 +2063,7 @@ def _parse_task_params( task_params_type_77 = CreateTrelloCardTaskParams.from_dict(data) return task_params_type_77 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2051,7 +2071,7 @@ def _parse_task_params( task_params_type_78 = CreateWebexMeetingTaskParams.from_dict(data) return task_params_type_78 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2059,7 +2079,7 @@ def _parse_task_params( task_params_type_79 = CreateZendeskTicketTaskParams.from_dict(data) return task_params_type_79 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2067,7 +2087,7 @@ def _parse_task_params( task_params_type_80 = CreateZendeskJiraLinkTaskParams.from_dict(data) return task_params_type_80 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2075,7 +2095,7 @@ def _parse_task_params( task_params_type_81 = CreateClickupTaskTaskParams.from_dict(data) return task_params_type_81 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2083,7 +2103,7 @@ def _parse_task_params( task_params_type_82 = CreateMotionTaskTaskParams.from_dict(data) return task_params_type_82 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2091,7 +2111,7 @@ def _parse_task_params( task_params_type_83 = CreateZoomMeetingTaskParams.from_dict(data) return task_params_type_83 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2099,7 +2119,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2107,7 +2127,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2115,7 +2135,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2123,7 +2143,7 @@ def _parse_task_params( componentsschemasget_gitlab_commits_task_params_type_1 = GetGitlabCommitsTaskParamsType1.from_dict(data) return componentsschemasget_gitlab_commits_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2131,7 +2151,7 @@ def _parse_task_params( task_params_type_86 = GetPulsesTaskParams.from_dict(data) return task_params_type_86 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2139,7 +2159,7 @@ def _parse_task_params( task_params_type_87 = GetAlertsTaskParams.from_dict(data) return task_params_type_87 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2147,7 +2167,7 @@ def _parse_task_params( task_params_type_88 = HttpClientTaskParams.from_dict(data) return task_params_type_88 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2155,7 +2175,7 @@ def _parse_task_params( task_params_type_89 = InviteToSlackChannelOpsgenieTaskParams.from_dict(data) return task_params_type_89 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2163,7 +2183,7 @@ def _parse_task_params( task_params_type_90 = InviteToSlackChannelRootlyTaskParams.from_dict(data) return task_params_type_90 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2171,7 +2191,7 @@ def _parse_task_params( task_params_type_91 = InviteToMicrosoftTeamsChannelRootlyTaskParams.from_dict(data) return task_params_type_91 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2181,7 +2201,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_pagerduty_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2191,7 +2211,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_pagerduty_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2201,7 +2221,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2211,7 +2231,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2221,7 +2241,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_2 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2229,7 +2249,7 @@ def _parse_task_params( task_params_type_94 = InviteToSlackChannelVictorOpsTaskParams.from_dict(data) return task_params_type_94 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2237,7 +2257,7 @@ def _parse_task_params( task_params_type_95 = PageOpsgenieOnCallRespondersTaskParams.from_dict(data) return task_params_type_95 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2245,7 +2265,7 @@ def _parse_task_params( task_params_type_96 = CreateOpsgenieAlertTaskParams.from_dict(data) return task_params_type_96 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2253,7 +2273,7 @@ def _parse_task_params( task_params_type_97 = CreateJsmopsAlertTaskParams.from_dict(data) return task_params_type_97 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2261,7 +2281,7 @@ def _parse_task_params( task_params_type_98 = PageJsmopsOnCallRespondersTaskParams.from_dict(data) return task_params_type_98 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2269,7 +2289,7 @@ def _parse_task_params( task_params_type_99 = UpdateOpsgenieAlertTaskParams.from_dict(data) return task_params_type_99 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2277,7 +2297,7 @@ def _parse_task_params( task_params_type_100 = UpdateOpsgenieIncidentTaskParams.from_dict(data) return task_params_type_100 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2285,7 +2305,7 @@ def _parse_task_params( task_params_type_101 = PageRootlyOnCallRespondersTaskParams.from_dict(data) return task_params_type_101 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2293,7 +2313,7 @@ def _parse_task_params( task_params_type_102 = PagePagerdutyOnCallRespondersTaskParams.from_dict(data) return task_params_type_102 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2303,7 +2323,7 @@ def _parse_task_params( ) return componentsschemaspage_victor_ops_on_call_responders_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2313,7 +2333,7 @@ def _parse_task_params( ) return componentsschemaspage_victor_ops_on_call_responders_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2321,7 +2341,7 @@ def _parse_task_params( task_params_type_104 = UpdateVictorOpsIncidentTaskParams.from_dict(data) return task_params_type_104 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2329,7 +2349,7 @@ def _parse_task_params( task_params_type_105 = PrintTaskParams.from_dict(data) return task_params_type_105 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2337,7 +2357,7 @@ def _parse_task_params( task_params_type_106 = PublishIncidentTaskParams.from_dict(data) return task_params_type_106 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2345,7 +2365,7 @@ def _parse_task_params( task_params_type_107 = RedisClientTaskParams.from_dict(data) return task_params_type_107 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2353,287 +2373,311 @@ def _parse_task_params( task_params_type_108 = RenameSlackChannelTaskParams.from_dict(data) return task_params_type_108 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_109 = ChangeSlackChannelPrivacyTaskParams.from_dict(data) + task_params_type_109 = RemoveFromSlackChannelTaskParams.from_dict(data) return task_params_type_109 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_110 = RunCommandHerokuTaskParams.from_dict(data) + task_params_type_110 = ChangeSlackChannelPrivacyTaskParams.from_dict(data) return task_params_type_110 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_111 = SendEmailTaskParams.from_dict(data) + task_params_type_111 = RunCommandHerokuTaskParams.from_dict(data) return task_params_type_111 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_112 = SendDashboardReportTaskParams.from_dict(data) + task_params_type_112 = SendEmailTaskParams.from_dict(data) return task_params_type_112 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_113 = CreateSlackChannelTaskParams.from_dict(data) + task_params_type_113 = SendDashboardReportTaskParams.from_dict(data) return task_params_type_113 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - componentsschemassend_slack_message_task_params_type_0 = SendSlackMessageTaskParamsType0.from_dict(data) + task_params_type_114 = CreateSlackChannelTaskParams.from_dict(data) - return componentsschemassend_slack_message_task_params_type_0 - except: # noqa: E722 + return task_params_type_114 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - componentsschemassend_slack_message_task_params_type_1 = SendSlackMessageTaskParamsType1.from_dict(data) + task_params_type_115 = CreateSlackCanvasTaskParams.from_dict(data) - return componentsschemassend_slack_message_task_params_type_1 - except: # noqa: E722 + return task_params_type_115 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - componentsschemassend_slack_message_task_params_type_2 = SendSlackMessageTaskParamsType2.from_dict(data) + componentsschemassend_slack_message_task_params_type_0 = SendSlackMessageTaskParamsType0.from_dict(data) - return componentsschemassend_slack_message_task_params_type_2 - except: # noqa: E722 + return componentsschemassend_slack_message_task_params_type_0 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_115 = SendSmsTaskParams.from_dict(data) + componentsschemassend_slack_message_task_params_type_1 = SendSlackMessageTaskParamsType1.from_dict(data) - return task_params_type_115 - except: # noqa: E722 + return componentsschemassend_slack_message_task_params_type_1 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_116 = SendWhatsappMessageTaskParams.from_dict(data) + componentsschemassend_slack_message_task_params_type_2 = SendSlackMessageTaskParamsType2.from_dict(data) - return task_params_type_116 - except: # noqa: E722 + 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_117 = SnapshotDatadogGraphTaskParams.from_dict(data) + task_params_type_117 = SendSmsTaskParams.from_dict(data) return task_params_type_117 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_118 = SnapshotGrafanaDashboardTaskParams.from_dict(data) + task_params_type_118 = SendWhatsappMessageTaskParams.from_dict(data) return task_params_type_118 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_119 = SnapshotLookerLookTaskParams.from_dict(data) + task_params_type_119 = SnapshotDatadogGraphTaskParams.from_dict(data) return task_params_type_119 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_120 = SnapshotNewRelicGraphTaskParams.from_dict(data) + task_params_type_120 = SnapshotGrafanaDashboardTaskParams.from_dict(data) return task_params_type_120 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_121 = TweetTwitterMessageTaskParams.from_dict(data) + task_params_type_121 = SnapshotLookerLookTaskParams.from_dict(data) return task_params_type_121 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_122 = UpdateAirtableTableRecordTaskParams.from_dict(data) + task_params_type_122 = SnapshotNewRelicGraphTaskParams.from_dict(data) return task_params_type_122 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_123 = UpdateAsanaTaskTaskParams.from_dict(data) + task_params_type_123 = TweetTwitterMessageTaskParams.from_dict(data) return task_params_type_123 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_124 = UpdateGithubIssueTaskParams.from_dict(data) + task_params_type_124 = UpdateAirtableTableRecordTaskParams.from_dict(data) return task_params_type_124 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_125 = UpdateGitlabIssueTaskParams.from_dict(data) + task_params_type_125 = UpdateAsanaTaskTaskParams.from_dict(data) return task_params_type_125 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_126 = UpdateIncidentTaskParams.from_dict(data) + task_params_type_126 = UpdateGithubIssueTaskParams.from_dict(data) return task_params_type_126 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_127 = UpdateIncidentPostmortemTaskParams.from_dict(data) + task_params_type_127 = UpdateGitlabIssueTaskParams.from_dict(data) return task_params_type_127 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_128 = UpdateJiraIssueTaskParams.from_dict(data) + task_params_type_128 = UpdateIncidentTaskParams.from_dict(data) return task_params_type_128 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_129 = UpdateLinearIssueTaskParams.from_dict(data) + task_params_type_129 = UpdateIncidentPostmortemTaskParams.from_dict(data) return task_params_type_129 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_130 = UpdateServiceNowIncidentTaskParams.from_dict(data) + task_params_type_130 = UpdateJiraIssueTaskParams.from_dict(data) return task_params_type_130 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_131 = UpdateShortcutStoryTaskParams.from_dict(data) + task_params_type_131 = UpdateLinearIssueTaskParams.from_dict(data) return task_params_type_131 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_132 = UpdateShortcutTaskTaskParams.from_dict(data) + task_params_type_132 = UpdateServiceNowIncidentTaskParams.from_dict(data) return task_params_type_132 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_133 = UpdateSlackChannelTopicTaskParams.from_dict(data) + task_params_type_133 = UpdateShortcutStoryTaskParams.from_dict(data) return task_params_type_133 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_134 = UpdateStatusTaskParams.from_dict(data) + task_params_type_134 = UpdateShortcutTaskTaskParams.from_dict(data) return task_params_type_134 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_135 = UpdateIncidentStatusTimestampTaskParams.from_dict(data) + task_params_type_135 = UpdateSlackChannelTopicTaskParams.from_dict(data) return task_params_type_135 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_136 = UpdateTrelloCardTaskParams.from_dict(data) + task_params_type_136 = UpdateSlackCanvasTaskParams.from_dict(data) return task_params_type_136 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_137 = UpdateClickupTaskTaskParams.from_dict(data) + task_params_type_137 = UpdateStatusTaskParams.from_dict(data) return task_params_type_137 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_138 = UpdateMotionTaskTaskParams.from_dict(data) + task_params_type_138 = UpdateIncidentStatusTimestampTaskParams.from_dict(data) return task_params_type_138 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_139 = UpdateZendeskTicketTaskParams.from_dict(data) + task_params_type_139 = UpdateTrelloCardTaskParams.from_dict(data) return task_params_type_139 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_140 = UpdateAttachedAlertsTaskParams.from_dict(data) + task_params_type_140 = UpdateClickupTaskTaskParams.from_dict(data) return task_params_type_140 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_141 = TriggerWorkflowTaskParams.from_dict(data) + task_params_type_141 = UpdateMotionTaskTaskParams.from_dict(data) return task_params_type_141 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_142 = UpdateZendeskTicketTaskParams.from_dict(data) + + return task_params_type_142 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_143 = UpdateAttachedAlertsTaskParams.from_dict(data) + + return task_params_type_143 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_144 = TriggerWorkflowTaskParams.from_dict(data) + + return task_params_type_144 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2641,7 +2685,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2649,7 +2693,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2657,45 +2701,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_143 = CreateOpenaiChatCompletionTaskParams.from_dict(data) + task_params_type_146 = CreateOpenaiChatCompletionTaskParams.from_dict(data) - return task_params_type_143 - except: # noqa: E722 + return task_params_type_146 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_144 = CreateWatsonxChatCompletionTaskParams.from_dict(data) + task_params_type_147 = CreateWatsonxChatCompletionTaskParams.from_dict(data) - return task_params_type_144 - except: # noqa: E722 + return task_params_type_147 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_145 = CreateGoogleGeminiChatCompletionTaskParams.from_dict(data) + task_params_type_148 = CreateGoogleGeminiChatCompletionTaskParams.from_dict(data) - return task_params_type_145 - except: # noqa: E722 + return task_params_type_148 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_146 = CreateMistralChatCompletionTaskParams.from_dict(data) + task_params_type_149 = CreateMistralChatCompletionTaskParams.from_dict(data) - return task_params_type_146 - except: # noqa: E722 + return task_params_type_149 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() - task_params_type_147 = CreateAnthropicChatCompletionTaskParams.from_dict(data) + task_params_type_150 = CreateAnthropicChatCompletionTaskParams.from_dict(data) - return task_params_type_147 + return task_params_type_150 task_params = _parse_task_params(d.pop("task_params")) diff --git a/rootly_sdk/models/new_workflow_task_data_type.py b/rootly_sdk/models/new_workflow_task_data_type.py index 76f001ab..8a271a2b 100644 --- a/rootly_sdk/models/new_workflow_task_data_type.py +++ b/rootly_sdk/models/new_workflow_task_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal NewWorkflowTaskDataType = Literal["workflow_tasks"] @@ -11,5 +11,5 @@ def check_new_workflow_task_data_type(value: str | None) -> NewWorkflowTaskDataT if value is None: return None if value in NEW_WORKFLOW_TASK_DATA_TYPE_VALUES: - return cast(NewWorkflowTaskDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {NEW_WORKFLOW_TASK_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/alert_retrigger_rule_list_data_item.py b/rootly_sdk/models/nullable_severity_response_data.py similarity index 61% rename from rootly_sdk/models/alert_retrigger_rule_list_data_item.py rename to rootly_sdk/models/nullable_severity_response_data.py index b20f69d9..cbd5e4ee 100644 --- a/rootly_sdk/models/alert_retrigger_rule_list_data_item.py +++ b/rootly_sdk/models/nullable_severity_response_data.py @@ -1,33 +1,35 @@ +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.alert_retrigger_rule_list_data_item_type import ( - AlertRetriggerRuleListDataItemType, - check_alert_retrigger_rule_list_data_item_type, +from ..models.nullable_severity_response_data_type import ( + NullableSeverityResponseDataType, + check_nullable_severity_response_data_type, ) if TYPE_CHECKING: - from ..models.alert_retrigger_rule import AlertRetriggerRule + from ..models.severity import Severity -T = TypeVar("T", bound="AlertRetriggerRuleListDataItem") +T = TypeVar("T", bound="NullableSeverityResponseData") @_attrs_define -class AlertRetriggerRuleListDataItem: +class NullableSeverityResponseData: """ Attributes: - id (str): Unique ID of the alert_retrigger_rule - type_ (AlertRetriggerRuleListDataItemType): - attributes (AlertRetriggerRule): + id (str): Unique ID of the severity + type_ (NullableSeverityResponseDataType): + attributes (Severity): """ id: str - type_: AlertRetriggerRuleListDataItemType - attributes: "AlertRetriggerRule" + type_: NullableSeverityResponseDataType + attributes: Severity additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,23 +53,23 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.alert_retrigger_rule import AlertRetriggerRule + from ..models.severity import Severity d = dict(src_dict) id = d.pop("id") - type_ = check_alert_retrigger_rule_list_data_item_type(d.pop("type")) + type_ = check_nullable_severity_response_data_type(d.pop("type")) - attributes = AlertRetriggerRule.from_dict(d.pop("attributes")) + attributes = Severity.from_dict(d.pop("attributes")) - alert_retrigger_rule_list_data_item = cls( + nullable_severity_response_data = cls( id=id, type_=type_, attributes=attributes, ) - alert_retrigger_rule_list_data_item.additional_properties = d - return alert_retrigger_rule_list_data_item + nullable_severity_response_data.additional_properties = d + return nullable_severity_response_data @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/nullable_severity_response_data_type.py b/rootly_sdk/models/nullable_severity_response_data_type.py new file mode 100644 index 00000000..b1e24ed7 --- /dev/null +++ b/rootly_sdk/models/nullable_severity_response_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +NullableSeverityResponseDataType = Literal["severities"] + +NULLABLE_SEVERITY_RESPONSE_DATA_TYPE_VALUES: set[NullableSeverityResponseDataType] = { + "severities", +} + + +def check_nullable_severity_response_data_type(value: str | None) -> NullableSeverityResponseDataType | None: + if value is None: + return None + if value in NULLABLE_SEVERITY_RESPONSE_DATA_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {NULLABLE_SEVERITY_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/nullable_severity_response_type_0.py b/rootly_sdk/models/nullable_severity_response_type_0.py new file mode 100644 index 00000000..6a196d0e --- /dev/null +++ b/rootly_sdk/models/nullable_severity_response_type_0.py @@ -0,0 +1,93 @@ +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 ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.nullable_severity_response_data import NullableSeverityResponseData + + +T = TypeVar("T", bound="NullableSeverityResponseType0") + + +@_attrs_define +class NullableSeverityResponseType0: + """The severity assigned to an incident, or null when no severity is assigned + + Attributes: + data (NullableSeverityResponseData): + included (list[JsonapiIncludedResource] | Unset): + """ + + data: NullableSeverityResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + included: list[dict[str, Any]] | Unset = 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.nullable_severity_response_data import NullableSeverityResponseData + + d = dict(src_dict) + data = NullableSeverityResponseData.from_dict(d.pop("data")) + + _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) + + included.append(included_item) + + nullable_severity_response_type_0 = cls( + data=data, + included=included, + ) + + nullable_severity_response_type_0.additional_properties = d + return nullable_severity_response_type_0 + + @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/on_call_pay_report.py b/rootly_sdk/models/on_call_pay_report.py index f3c8c775..45f3085d 100644 --- a/rootly_sdk/models/on_call_pay_report.py +++ b/rootly_sdk/models/on_call_pay_report.py @@ -1,10 +1,11 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field -from dateutil.parser import isoparse from ..models.on_call_pay_report_pay_type import OnCallPayReportPayType, check_on_call_pay_report_pay_type from ..models.on_call_pay_report_status import OnCallPayReportStatus, check_on_call_pay_report_status @@ -22,26 +23,26 @@ class OnCallPayReport: end_date (datetime.date): The end date of the report period. created_at (datetime.datetime): updated_at (datetime.datetime): - 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 (Union[None, Unset, str]): Download URL for the generated XLSX report. Null until the report is - generated. + 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): Short-lived, presigned download URL for the generated CSV report. Fetch the + report again if the URL expires. Null until the report is generated. + xlsx_file_url (None | str | Unset): Short-lived, presigned download URL for the generated XLSX report. Fetch the + report again if the URL expires. Null until the report is generated. """ status: OnCallPayReportStatus @@ -49,22 +50,22 @@ class OnCallPayReport: end_date: datetime.date created_at: datetime.datetime updated_at: datetime.datetime - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -84,7 +85,7 @@ def to_dict(self) -> dict[str, Any]: currency = self.currency - pay_type: Unset | str = UNSET + pay_type: str | Unset = UNSET if not isinstance(self.pay_type, Unset): pay_type = self.pay_type @@ -102,7 +103,7 @@ def to_dict(self) -> dict[str, Any]: enabled_granular_time_breakdown = self.enabled_granular_time_breakdown - last_generated_at: None | Unset | str + last_generated_at: None | str | Unset if isinstance(self.last_generated_at, Unset): last_generated_at = UNSET elif isinstance(self.last_generated_at, datetime.datetime): @@ -110,7 +111,7 @@ def to_dict(self) -> dict[str, Any]: else: last_generated_at = self.last_generated_at - time_zone: None | Unset | str + time_zone: None | str | Unset if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -118,13 +119,13 @@ def to_dict(self) -> dict[str, Any]: use_responders_time_zone = self.use_responders_time_zone - csv_file_url: None | Unset | str + csv_file_url: None | str | Unset if isinstance(self.csv_file_url, Unset): csv_file_url = UNSET else: csv_file_url = self.csv_file_url - xlsx_file_url: None | Unset | str + xlsx_file_url: None | str | Unset if isinstance(self.xlsx_file_url, Unset): xlsx_file_url = UNSET else: @@ -181,13 +182,13 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) status = check_on_call_pay_report_status(d.pop("status")) - start_date = isoparse(d.pop("start_date")).date() + start_date = datetime.date.fromisoformat(d.pop("start_date")) - end_date = isoparse(d.pop("end_date")).date() + end_date = datetime.date.fromisoformat(d.pop("end_date")) - created_at = isoparse(d.pop("created_at")) + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) - updated_at = isoparse(d.pop("updated_at")) + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) total_duration = d.pop("total_duration", UNSET) @@ -196,7 +197,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: Unset | OnCallPayReportPayType + pay_type: OnCallPayReportPayType | Unset if isinstance(_pay_type, Unset): pay_type = UNSET else: @@ -216,7 +217,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) -> None | Unset | datetime.datetime: + def _parse_last_generated_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -224,41 +225,41 @@ def _parse_last_generated_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - last_generated_at_type_0 = isoparse(data) + last_generated_at_type_0 = datetime.datetime.fromisoformat(data) return last_generated_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) last_generated_at = _parse_last_generated_at(d.pop("last_generated_at", UNSET)) - def _parse_time_zone(data: object) -> None | Unset | str: + def _parse_time_zone(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_csv_file_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) csv_file_url = _parse_csv_file_url(d.pop("csv_file_url", UNSET)) - def _parse_xlsx_file_url(data: object) -> None | Unset | str: + def _parse_xlsx_file_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 352a865d..9e446e66 100644 --- a/rootly_sdk/models/on_call_pay_report_list.py +++ b/rootly_sdk/models/on_call_pay_report_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class OnCallPayReportList: """ Attributes: - data (list['OnCallPayReportListDataItem']): + data (list[OnCallPayReportListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["OnCallPayReportListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[OnCallPayReportListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 69a34c09..19d63be2 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/on_call_pay_report_list_data_item_type.py b/rootly_sdk/models/on_call_pay_report_list_data_item_type.py index b2de1003..0f177073 100644 --- a/rootly_sdk/models/on_call_pay_report_list_data_item_type.py +++ b/rootly_sdk/models/on_call_pay_report_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallPayReportListDataItemType = Literal["on_call_pay_reports"] @@ -11,5 +11,5 @@ def check_on_call_pay_report_list_data_item_type(value: str | None) -> OnCallPay if value is None: return None if value in ON_CALL_PAY_REPORT_LIST_DATA_ITEM_TYPE_VALUES: - return cast(OnCallPayReportListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_PAY_REPORT_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/on_call_pay_report_pay_type.py b/rootly_sdk/models/on_call_pay_report_pay_type.py index 1133a438..668b17b9 100644 --- a/rootly_sdk/models/on_call_pay_report_pay_type.py +++ b/rootly_sdk/models/on_call_pay_report_pay_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallPayReportPayType = Literal["daily", "hourly"] @@ -12,5 +12,5 @@ def check_on_call_pay_report_pay_type(value: str | None) -> OnCallPayReportPayTy if value is None: return None if value in ON_CALL_PAY_REPORT_PAY_TYPE_VALUES: - return cast(OnCallPayReportPayType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_PAY_REPORT_PAY_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/on_call_pay_report_response.py b/rootly_sdk/models/on_call_pay_report_response.py index 31a0f1f0..f555ba76 100644 --- a/rootly_sdk/models/on_call_pay_report_response.py +++ b/rootly_sdk/models/on_call_pay_report_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class OnCallPayReportResponse: """ Attributes: data (OnCallPayReportResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "OnCallPayReportResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: OnCallPayReportResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 292fb0ab..b783bdaa 100644 --- a/rootly_sdk/models/on_call_pay_report_response_data.py +++ b/rootly_sdk/models/on_call_pay_report_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/on_call_pay_report_response_data_type.py b/rootly_sdk/models/on_call_pay_report_response_data_type.py index acf812f6..ea9de86b 100644 --- a/rootly_sdk/models/on_call_pay_report_response_data_type.py +++ b/rootly_sdk/models/on_call_pay_report_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallPayReportResponseDataType = Literal["on_call_pay_reports"] @@ -11,5 +11,5 @@ def check_on_call_pay_report_response_data_type(value: str | None) -> OnCallPayR if value is None: return None if value in ON_CALL_PAY_REPORT_RESPONSE_DATA_TYPE_VALUES: - return cast(OnCallPayReportResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_PAY_REPORT_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/on_call_pay_report_status.py b/rootly_sdk/models/on_call_pay_report_status.py index 52f27e1f..6b0a0209 100644 --- a/rootly_sdk/models/on_call_pay_report_status.py +++ b/rootly_sdk/models/on_call_pay_report_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallPayReportStatus = Literal["downloaded", "generated", "processing"] @@ -13,5 +13,5 @@ def check_on_call_pay_report_status(value: str | None) -> OnCallPayReportStatus if value is None: return None if value in ON_CALL_PAY_REPORT_STATUS_VALUES: - return cast(OnCallPayReportStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_PAY_REPORT_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/on_call_role.py b/rootly_sdk/models/on_call_role.py index b5117f44..1dd14361 100644 --- a/rootly_sdk/models/on_call_role.py +++ b/rootly_sdk/models/on_call_role.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -72,6 +74,10 @@ OnCallRoleLiveCallRoutingPermissionsItem, check_on_call_role_live_call_routing_permissions_item, ) +from ..models.on_call_role_members_permissions_item import ( + OnCallRoleMembersPermissionsItem, + check_on_call_role_members_permissions_item, +) from ..models.on_call_role_on_call_readiness_report_permissions_item import ( OnCallRoleOnCallReadinessReportPermissionsItem, check_on_call_role_on_call_readiness_report_permissions_item, @@ -112,63 +118,65 @@ class OnCallRole: name (str): The role name. created_at (str): updated_at (str): - 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]]): + 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): + members_permissions (list[OnCallRoleMembersPermissionsItem] | 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): """ name: str created_at: str updated_at: str - 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 + 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 + members_permissions: list[OnCallRoleMembersPermissionsItem] | 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -182,168 +190,175 @@ def to_dict(self) -> dict[str, Any]: system_role = self.system_role - alert_sources_permissions: Unset | list[str] = UNSET + alert_sources_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + alert_urgency_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + alert_fields_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + alert_groups_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + alert_routing_rules_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + on_call_readiness_report_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + on_call_roles_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + alerts_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + api_keys_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + audits_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + contacts_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + escalation_policies_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + groups_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + heartbeats_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + integrations_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + invitations_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + live_call_routing_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + members_permissions: list[str] | Unset = UNSET + if not isinstance(self.members_permissions, Unset): + members_permissions = [] + for members_permissions_item_data in self.members_permissions: + members_permissions_item: str = members_permissions_item_data + members_permissions.append(members_permissions_item) + + schedule_override_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + schedules_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + services_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + functionalities_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + webhooks_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + workflows_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + catalogs_permissions: list[str] | Unset = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: @@ -397,6 +412,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["invitations_permissions"] = invitations_permissions if live_call_routing_permissions is not UNSET: field_dict["live_call_routing_permissions"] = live_call_routing_permissions + if members_permissions is not UNSET: + field_dict["members_permissions"] = members_permissions if schedule_override_permissions is not UNSET: field_dict["schedule_override_permissions"] = schedule_override_permissions if schedules_permissions is not UNSET: @@ -427,201 +444,264 @@ 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) - 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: 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 + ) - 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) - 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: 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 + ) - 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) - 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: 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 + ) - 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) - 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: 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 + ) - 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) - 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: 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 + ) - 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) - 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: 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 + ) + ) - 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) - 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: 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 + ) - 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) - 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: 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) - alerts_permissions.append(alerts_permissions_item) + alerts_permissions.append(alerts_permissions_item) - api_keys_permissions = [] _api_keys_permissions = d.pop("api_keys_permissions", UNSET) - 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: 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) - 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) - 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: 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) - audits_permissions.append(audits_permissions_item) + audits_permissions.append(audits_permissions_item) - contacts_permissions = [] _contacts_permissions = d.pop("contacts_permissions", UNSET) - 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: 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) - contacts_permissions.append(contacts_permissions_item) + contacts_permissions.append(contacts_permissions_item) - escalation_policies_permissions = [] _escalation_policies_permissions = d.pop("escalation_policies_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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) - groups_permissions.append(groups_permissions_item) + groups_permissions.append(groups_permissions_item) - heartbeats_permissions = [] _heartbeats_permissions = d.pop("heartbeats_permissions", UNSET) - 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: 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 + ) - heartbeats_permissions.append(heartbeats_permissions_item) + heartbeats_permissions.append(heartbeats_permissions_item) - integrations_permissions = [] _integrations_permissions = d.pop("integrations_permissions", UNSET) - 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: 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 + ) - integrations_permissions.append(integrations_permissions_item) + integrations_permissions.append(integrations_permissions_item) - invitations_permissions = [] _invitations_permissions = d.pop("invitations_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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 + ) + + live_call_routing_permissions.append(live_call_routing_permissions_item) + + _members_permissions = d.pop("members_permissions", UNSET) + members_permissions: list[OnCallRoleMembersPermissionsItem] | Unset = UNSET + if _members_permissions is not UNSET: + members_permissions = [] + for members_permissions_item_data in _members_permissions: + members_permissions_item = check_on_call_role_members_permissions_item(members_permissions_item_data) - live_call_routing_permissions.append(live_call_routing_permissions_item) + members_permissions.append(members_permissions_item) - schedule_override_permissions = [] _schedule_override_permissions = d.pop("schedule_override_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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 + ) - schedules_permissions.append(schedules_permissions_item) + schedules_permissions.append(schedules_permissions_item) - services_permissions = [] _services_permissions = d.pop("services_permissions", UNSET) - 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: 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) - services_permissions.append(services_permissions_item) + services_permissions.append(services_permissions_item) - functionalities_permissions = [] _functionalities_permissions = d.pop("functionalities_permissions", UNSET) - 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: 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 + ) - functionalities_permissions.append(functionalities_permissions_item) + functionalities_permissions.append(functionalities_permissions_item) - webhooks_permissions = [] _webhooks_permissions = d.pop("webhooks_permissions", UNSET) - 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: 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) - webhooks_permissions.append(webhooks_permissions_item) + webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions = [] _workflows_permissions = d.pop("workflows_permissions", UNSET) - 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: 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 + ) - workflows_permissions.append(workflows_permissions_item) + workflows_permissions.append(workflows_permissions_item) - catalogs_permissions = [] _catalogs_permissions = d.pop("catalogs_permissions", UNSET) - 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: 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) - catalogs_permissions.append(catalogs_permissions_item) + catalogs_permissions.append(catalogs_permissions_item) on_call_role = cls( name=name, @@ -646,6 +726,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: integrations_permissions=integrations_permissions, invitations_permissions=invitations_permissions, live_call_routing_permissions=live_call_routing_permissions, + members_permissions=members_permissions, schedule_override_permissions=schedule_override_permissions, schedules_permissions=schedules_permissions, services_permissions=services_permissions, diff --git a/rootly_sdk/models/on_call_role_alert_fields_permissions_item.py b/rootly_sdk/models/on_call_role_alert_fields_permissions_item.py index 937225bd..26f73b90 100644 --- a/rootly_sdk/models/on_call_role_alert_fields_permissions_item.py +++ b/rootly_sdk/models/on_call_role_alert_fields_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleAlertFieldsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,7 +14,7 @@ def check_on_call_role_alert_fields_permissions_item(value: str | None) -> OnCal if value is None: return None if value in ON_CALL_ROLE_ALERT_FIELDS_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleAlertFieldsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_ALERT_FIELDS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/on_call_role_alert_groups_permissions_item.py b/rootly_sdk/models/on_call_role_alert_groups_permissions_item.py index 9e199947..69bba351 100644 --- a/rootly_sdk/models/on_call_role_alert_groups_permissions_item.py +++ b/rootly_sdk/models/on_call_role_alert_groups_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleAlertGroupsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,7 +14,7 @@ def check_on_call_role_alert_groups_permissions_item(value: str | None) -> OnCal if value is None: return None if value in ON_CALL_ROLE_ALERT_GROUPS_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleAlertGroupsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_ALERT_GROUPS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/on_call_role_alert_routing_rules_permissions_item.py b/rootly_sdk/models/on_call_role_alert_routing_rules_permissions_item.py index 5cf3c36e..8f0452c2 100644 --- a/rootly_sdk/models/on_call_role_alert_routing_rules_permissions_item.py +++ b/rootly_sdk/models/on_call_role_alert_routing_rules_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleAlertRoutingRulesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_on_call_role_alert_routing_rules_permissions_item( if value is None: return None if value in ON_CALL_ROLE_ALERT_ROUTING_RULES_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleAlertRoutingRulesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_ALERT_ROUTING_RULES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/on_call_role_alert_sources_permissions_item.py b/rootly_sdk/models/on_call_role_alert_sources_permissions_item.py index a558c4fa..a8521d49 100644 --- a/rootly_sdk/models/on_call_role_alert_sources_permissions_item.py +++ b/rootly_sdk/models/on_call_role_alert_sources_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleAlertSourcesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_on_call_role_alert_sources_permissions_item( if value is None: return None if value in ON_CALL_ROLE_ALERT_SOURCES_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleAlertSourcesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_ALERT_SOURCES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/on_call_role_alert_urgency_permissions_item.py b/rootly_sdk/models/on_call_role_alert_urgency_permissions_item.py index 1993625d..33b75359 100644 --- a/rootly_sdk/models/on_call_role_alert_urgency_permissions_item.py +++ b/rootly_sdk/models/on_call_role_alert_urgency_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleAlertUrgencyPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_on_call_role_alert_urgency_permissions_item( if value is None: return None if value in ON_CALL_ROLE_ALERT_URGENCY_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleAlertUrgencyPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_ALERT_URGENCY_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/on_call_role_alerts_permissions_item.py b/rootly_sdk/models/on_call_role_alerts_permissions_item.py index b28bde60..c5ce3f40 100644 --- a/rootly_sdk/models/on_call_role_alerts_permissions_item.py +++ b/rootly_sdk/models/on_call_role_alerts_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleAlertsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_on_call_role_alerts_permissions_item(value: str | None) -> OnCallRoleA if value is None: return None if value in ON_CALL_ROLE_ALERTS_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleAlertsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_ALERTS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/on_call_role_api_keys_permissions_item.py b/rootly_sdk/models/on_call_role_api_keys_permissions_item.py index bddb6fc2..6a9e9340 100644 --- a/rootly_sdk/models/on_call_role_api_keys_permissions_item.py +++ b/rootly_sdk/models/on_call_role_api_keys_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleApiKeysPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_on_call_role_api_keys_permissions_item(value: str | None) -> OnCallRol if value is None: return None if value in ON_CALL_ROLE_API_KEYS_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleApiKeysPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_API_KEYS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/on_call_role_audits_permissions_item.py b/rootly_sdk/models/on_call_role_audits_permissions_item.py index 107cb4f5..95a2f9c1 100644 --- a/rootly_sdk/models/on_call_role_audits_permissions_item.py +++ b/rootly_sdk/models/on_call_role_audits_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleAuditsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_on_call_role_audits_permissions_item(value: str | None) -> OnCallRoleA if value is None: return None if value in ON_CALL_ROLE_AUDITS_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleAuditsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_AUDITS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/on_call_role_catalogs_permissions_item.py b/rootly_sdk/models/on_call_role_catalogs_permissions_item.py index bf74a60e..32ce2769 100644 --- a/rootly_sdk/models/on_call_role_catalogs_permissions_item.py +++ b/rootly_sdk/models/on_call_role_catalogs_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleCatalogsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_on_call_role_catalogs_permissions_item(value: str | None) -> OnCallRol if value is None: return None if value in ON_CALL_ROLE_CATALOGS_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleCatalogsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_CATALOGS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/on_call_role_contacts_permissions_item.py b/rootly_sdk/models/on_call_role_contacts_permissions_item.py index d45161f2..3c3c8e17 100644 --- a/rootly_sdk/models/on_call_role_contacts_permissions_item.py +++ b/rootly_sdk/models/on_call_role_contacts_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleContactsPermissionsItem = Literal["read"] @@ -11,5 +11,5 @@ def check_on_call_role_contacts_permissions_item(value: str | None) -> OnCallRol if value is None: return None if value in ON_CALL_ROLE_CONTACTS_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleContactsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_CONTACTS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/on_call_role_escalation_policies_permissions_item.py b/rootly_sdk/models/on_call_role_escalation_policies_permissions_item.py index c3204fed..5a01d7d5 100644 --- a/rootly_sdk/models/on_call_role_escalation_policies_permissions_item.py +++ b/rootly_sdk/models/on_call_role_escalation_policies_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleEscalationPoliciesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_on_call_role_escalation_policies_permissions_item( if value is None: return None if value in ON_CALL_ROLE_ESCALATION_POLICIES_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleEscalationPoliciesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_ESCALATION_POLICIES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/on_call_role_functionalities_permissions_item.py b/rootly_sdk/models/on_call_role_functionalities_permissions_item.py index 851ab807..fd6e3ac6 100644 --- a/rootly_sdk/models/on_call_role_functionalities_permissions_item.py +++ b/rootly_sdk/models/on_call_role_functionalities_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleFunctionalitiesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_on_call_role_functionalities_permissions_item( if value is None: return None if value in ON_CALL_ROLE_FUNCTIONALITIES_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleFunctionalitiesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_FUNCTIONALITIES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/on_call_role_groups_permissions_item.py b/rootly_sdk/models/on_call_role_groups_permissions_item.py index 81fc4f54..f4ec6163 100644 --- a/rootly_sdk/models/on_call_role_groups_permissions_item.py +++ b/rootly_sdk/models/on_call_role_groups_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleGroupsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_on_call_role_groups_permissions_item(value: str | None) -> OnCallRoleG if value is None: return None if value in ON_CALL_ROLE_GROUPS_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleGroupsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_GROUPS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/on_call_role_heartbeats_permissions_item.py b/rootly_sdk/models/on_call_role_heartbeats_permissions_item.py index 9c7ba0cc..fb2ded6f 100644 --- a/rootly_sdk/models/on_call_role_heartbeats_permissions_item.py +++ b/rootly_sdk/models/on_call_role_heartbeats_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleHeartbeatsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_on_call_role_heartbeats_permissions_item(value: str | None) -> OnCallR if value is None: return None if value in ON_CALL_ROLE_HEARTBEATS_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleHeartbeatsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_HEARTBEATS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/on_call_role_integrations_permissions_item.py b/rootly_sdk/models/on_call_role_integrations_permissions_item.py index 1daacfed..1b36b93c 100644 --- a/rootly_sdk/models/on_call_role_integrations_permissions_item.py +++ b/rootly_sdk/models/on_call_role_integrations_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleIntegrationsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,7 +14,7 @@ def check_on_call_role_integrations_permissions_item(value: str | None) -> OnCal if value is None: return None if value in ON_CALL_ROLE_INTEGRATIONS_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleIntegrationsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_INTEGRATIONS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/on_call_role_invitations_permissions_item.py b/rootly_sdk/models/on_call_role_invitations_permissions_item.py index 83de7441..e3249773 100644 --- a/rootly_sdk/models/on_call_role_invitations_permissions_item.py +++ b/rootly_sdk/models/on_call_role_invitations_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleInvitationsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_on_call_role_invitations_permissions_item(value: str | None) -> OnCall if value is None: return None if value in ON_CALL_ROLE_INVITATIONS_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleInvitationsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_INVITATIONS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/on_call_role_list.py b/rootly_sdk/models/on_call_role_list.py index 87c265c3..e3304c92 100644 --- a/rootly_sdk/models/on_call_role_list.py +++ b/rootly_sdk/models/on_call_role_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class OnCallRoleList: """ Attributes: - data (list['OnCallRoleListDataItem']): + data (list[OnCallRoleListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["OnCallRoleListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[OnCallRoleListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 615a062e..bd50500c 100644 --- a/rootly_sdk/models/on_call_role_list_data_item.py +++ b/rootly_sdk/models/on_call_role_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/on_call_role_list_data_item_type.py b/rootly_sdk/models/on_call_role_list_data_item_type.py index a60494a9..e13e7a8c 100644 --- a/rootly_sdk/models/on_call_role_list_data_item_type.py +++ b/rootly_sdk/models/on_call_role_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleListDataItemType = Literal["on_call_roles"] @@ -11,5 +11,5 @@ def check_on_call_role_list_data_item_type(value: str | None) -> OnCallRoleListD if value is None: return None if value in ON_CALL_ROLE_LIST_DATA_ITEM_TYPE_VALUES: - return cast(OnCallRoleListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/on_call_role_live_call_routing_permissions_item.py b/rootly_sdk/models/on_call_role_live_call_routing_permissions_item.py index 57dce3b6..acbaa0a8 100644 --- a/rootly_sdk/models/on_call_role_live_call_routing_permissions_item.py +++ b/rootly_sdk/models/on_call_role_live_call_routing_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleLiveCallRoutingPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_on_call_role_live_call_routing_permissions_item( if value is None: return None if value in ON_CALL_ROLE_LIVE_CALL_ROUTING_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleLiveCallRoutingPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_LIVE_CALL_ROUTING_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/on_call_role_members_permissions_item.py b/rootly_sdk/models/on_call_role_members_permissions_item.py new file mode 100644 index 00000000..d4e827cb --- /dev/null +++ b/rootly_sdk/models/on_call_role_members_permissions_item.py @@ -0,0 +1,17 @@ +from typing import Literal + +OnCallRoleMembersPermissionsItem = Literal["delete", "read", "update"] + +ON_CALL_ROLE_MEMBERS_PERMISSIONS_ITEM_VALUES: set[OnCallRoleMembersPermissionsItem] = { + "delete", + "read", + "update", +} + + +def check_on_call_role_members_permissions_item(value: str | None) -> OnCallRoleMembersPermissionsItem | None: + if value is None: + return None + if value in ON_CALL_ROLE_MEMBERS_PERMISSIONS_ITEM_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_MEMBERS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/on_call_role_on_call_readiness_report_permissions_item.py b/rootly_sdk/models/on_call_role_on_call_readiness_report_permissions_item.py index 8143e58c..0b48ec5b 100644 --- a/rootly_sdk/models/on_call_role_on_call_readiness_report_permissions_item.py +++ b/rootly_sdk/models/on_call_role_on_call_readiness_report_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleOnCallReadinessReportPermissionsItem = Literal["read"] @@ -13,7 +13,7 @@ def check_on_call_role_on_call_readiness_report_permissions_item( if value is None: return None if value in ON_CALL_ROLE_ON_CALL_READINESS_REPORT_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleOnCallReadinessReportPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_ON_CALL_READINESS_REPORT_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/on_call_role_on_call_roles_permissions_item.py b/rootly_sdk/models/on_call_role_on_call_roles_permissions_item.py index f773c152..1dffb108 100644 --- a/rootly_sdk/models/on_call_role_on_call_roles_permissions_item.py +++ b/rootly_sdk/models/on_call_role_on_call_roles_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleOnCallRolesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,7 +14,7 @@ def check_on_call_role_on_call_roles_permissions_item(value: str | None) -> OnCa if value is None: return None if value in ON_CALL_ROLE_ON_CALL_ROLES_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleOnCallRolesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_ON_CALL_ROLES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/on_call_role_relationship.py b/rootly_sdk/models/on_call_role_relationship.py index 8e9f610d..b1385f6f 100644 --- a/rootly_sdk/models/on_call_role_relationship.py +++ b/rootly_sdk/models/on_call_role_relationship.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,16 +19,16 @@ class OnCallRoleRelationship: """ Attributes: - data (Union['OnCallRoleRelationshipDataType0', None, Unset]): + data (None | OnCallRoleRelationshipDataType0 | Unset): """ - data: Union["OnCallRoleRelationshipDataType0", None, Unset] = UNSET + data: None | OnCallRoleRelationshipDataType0 | 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: None | Unset | dict[str, Any] + data: dict[str, Any] | None | Unset if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, OnCallRoleRelationshipDataType0): @@ -48,7 +50,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> Union["OnCallRoleRelationshipDataType0", None, Unset]: + def _parse_data(data: object) -> None | OnCallRoleRelationshipDataType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -59,9 +61,9 @@ def _parse_data(data: object) -> Union["OnCallRoleRelationshipDataType0", None, data_type_0 = OnCallRoleRelationshipDataType0.from_dict(data) return data_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["OnCallRoleRelationshipDataType0", None, Unset], data) + return cast(None | OnCallRoleRelationshipDataType0 | 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 16815aea..20a1e8a6 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -17,18 +19,18 @@ class OnCallRoleRelationshipDataType0: """ Attributes: - id (Union[Unset, str]): - type_ (Union[Unset, OnCallRoleRelationshipDataType0Type]): + id (str | Unset): + type_ (OnCallRoleRelationshipDataType0Type | Unset): """ - id: Unset | str = UNSET - type_: Unset | OnCallRoleRelationshipDataType0Type = UNSET + id: str | Unset = UNSET + type_: OnCallRoleRelationshipDataType0Type | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -48,7 +50,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | OnCallRoleRelationshipDataType0Type + type_: OnCallRoleRelationshipDataType0Type | Unset if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/on_call_role_relationship_data_type_0_type.py b/rootly_sdk/models/on_call_role_relationship_data_type_0_type.py index 597b54ce..f065b11b 100644 --- a/rootly_sdk/models/on_call_role_relationship_data_type_0_type.py +++ b/rootly_sdk/models/on_call_role_relationship_data_type_0_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleRelationshipDataType0Type = Literal["on_call_roles"] @@ -11,7 +11,7 @@ def check_on_call_role_relationship_data_type_0_type(value: str | None) -> OnCal if value is None: return None if value in ON_CALL_ROLE_RELATIONSHIP_DATA_TYPE_0_TYPE_VALUES: - return cast(OnCallRoleRelationshipDataType0Type, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_RELATIONSHIP_DATA_TYPE_0_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/on_call_role_response.py b/rootly_sdk/models/on_call_role_response.py index ddca24ce..26722c2a 100644 --- a/rootly_sdk/models/on_call_role_response.py +++ b/rootly_sdk/models/on_call_role_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class OnCallRoleResponse: """ Attributes: data (OnCallRoleResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "OnCallRoleResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: OnCallRoleResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 805a5a45..2a33ab10 100644 --- a/rootly_sdk/models/on_call_role_response_data.py +++ b/rootly_sdk/models/on_call_role_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/on_call_role_response_data_type.py b/rootly_sdk/models/on_call_role_response_data_type.py index 7a423c1c..d18fff59 100644 --- a/rootly_sdk/models/on_call_role_response_data_type.py +++ b/rootly_sdk/models/on_call_role_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleResponseDataType = Literal["on_call_roles"] @@ -11,5 +11,5 @@ def check_on_call_role_response_data_type(value: str | None) -> OnCallRoleRespon if value is None: return None if value in ON_CALL_ROLE_RESPONSE_DATA_TYPE_VALUES: - return cast(OnCallRoleResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/on_call_role_schedule_override_permissions_item.py b/rootly_sdk/models/on_call_role_schedule_override_permissions_item.py index a1c92c67..e8a483f3 100644 --- a/rootly_sdk/models/on_call_role_schedule_override_permissions_item.py +++ b/rootly_sdk/models/on_call_role_schedule_override_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleScheduleOverridePermissionsItem = Literal["create", "update"] @@ -14,7 +14,7 @@ def check_on_call_role_schedule_override_permissions_item( if value is None: return None if value in ON_CALL_ROLE_SCHEDULE_OVERRIDE_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleScheduleOverridePermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_SCHEDULE_OVERRIDE_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/on_call_role_schedules_permissions_item.py b/rootly_sdk/models/on_call_role_schedules_permissions_item.py index f0f4d4e9..77f9b318 100644 --- a/rootly_sdk/models/on_call_role_schedules_permissions_item.py +++ b/rootly_sdk/models/on_call_role_schedules_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleSchedulesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_on_call_role_schedules_permissions_item(value: str | None) -> OnCallRo if value is None: return None if value in ON_CALL_ROLE_SCHEDULES_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleSchedulesPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_SCHEDULES_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/on_call_role_services_permissions_item.py b/rootly_sdk/models/on_call_role_services_permissions_item.py index 99e42f5e..fcdb2ce8 100644 --- a/rootly_sdk/models/on_call_role_services_permissions_item.py +++ b/rootly_sdk/models/on_call_role_services_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleServicesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_on_call_role_services_permissions_item(value: str | None) -> OnCallRol if value is None: return None if value in ON_CALL_ROLE_SERVICES_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleServicesPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_SERVICES_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/on_call_role_webhooks_permissions_item.py b/rootly_sdk/models/on_call_role_webhooks_permissions_item.py index b604529d..ad388675 100644 --- a/rootly_sdk/models/on_call_role_webhooks_permissions_item.py +++ b/rootly_sdk/models/on_call_role_webhooks_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleWebhooksPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_on_call_role_webhooks_permissions_item(value: str | None) -> OnCallRol if value is None: return None if value in ON_CALL_ROLE_WEBHOOKS_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleWebhooksPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_WEBHOOKS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/on_call_role_workflows_permissions_item.py b/rootly_sdk/models/on_call_role_workflows_permissions_item.py index ee74f7cc..78695ef4 100644 --- a/rootly_sdk/models/on_call_role_workflows_permissions_item.py +++ b/rootly_sdk/models/on_call_role_workflows_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallRoleWorkflowsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_on_call_role_workflows_permissions_item(value: str | None) -> OnCallRo if value is None: return None if value in ON_CALL_ROLE_WORKFLOWS_PERMISSIONS_ITEM_VALUES: - return cast(OnCallRoleWorkflowsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_ROLE_WORKFLOWS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/on_call_shadow.py b/rootly_sdk/models/on_call_shadow.py index 372d29f8..3e37d3b9 100644 --- a/rootly_sdk/models/on_call_shadow.py +++ b/rootly_sdk/models/on_call_shadow.py @@ -1,10 +1,11 @@ +from __future__ import annotations + import datetime 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 dateutil.parser import isoparse from ..models.on_call_shadow_shadowable_type import OnCallShadowShadowableType, check_on_call_shadow_shadowable_type from ..types import UNSET, Unset @@ -22,8 +23,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 (Union[Unset, str]): Date of creation - updated_at (Union[Unset, str]): Date of last update + created_at (str | Unset): Date of creation + updated_at (str | Unset): Date of last update """ schedule_id: str @@ -32,8 +33,8 @@ class OnCallShadow: shadow_user_id: int starts_at: datetime.datetime ends_at: datetime.datetime - created_at: Unset | str = UNSET - updated_at: Unset | str = UNSET + created_at: str | Unset = UNSET + updated_at: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -83,9 +84,9 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: shadow_user_id = d.pop("shadow_user_id") - starts_at = isoparse(d.pop("starts_at")) + starts_at = datetime.datetime.fromisoformat(d.pop("starts_at")) - ends_at = isoparse(d.pop("ends_at")) + ends_at = datetime.datetime.fromisoformat(d.pop("ends_at")) created_at = d.pop("created_at", UNSET) diff --git a/rootly_sdk/models/on_call_shadow_response.py b/rootly_sdk/models/on_call_shadow_response.py index 021e0251..aadb2fa1 100644 --- a/rootly_sdk/models/on_call_shadow_response.py +++ b/rootly_sdk/models/on_call_shadow_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class OnCallShadowResponse: """ Attributes: data (OnCallShadowResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "OnCallShadowResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: OnCallShadowResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 8306a936..021f310f 100644 --- a/rootly_sdk/models/on_call_shadow_response_data.py +++ b/rootly_sdk/models/on_call_shadow_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/on_call_shadow_response_data_type.py b/rootly_sdk/models/on_call_shadow_response_data_type.py index a8fe5845..5b4ec6f3 100644 --- a/rootly_sdk/models/on_call_shadow_response_data_type.py +++ b/rootly_sdk/models/on_call_shadow_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallShadowResponseDataType = Literal["on_call_shadows"] @@ -11,5 +11,5 @@ def check_on_call_shadow_response_data_type(value: str | None) -> OnCallShadowRe if value is None: return None if value in ON_CALL_SHADOW_RESPONSE_DATA_TYPE_VALUES: - return cast(OnCallShadowResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_SHADOW_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/on_call_shadow_shadowable_type.py b/rootly_sdk/models/on_call_shadow_shadowable_type.py index 660b3a8b..dc475c8a 100644 --- a/rootly_sdk/models/on_call_shadow_shadowable_type.py +++ b/rootly_sdk/models/on_call_shadow_shadowable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallShadowShadowableType = Literal["Schedule", "User"] @@ -12,5 +12,5 @@ def check_on_call_shadow_shadowable_type(value: str | None) -> OnCallShadowShado if value is None: return None if value in ON_CALL_SHADOW_SHADOWABLE_TYPE_VALUES: - return cast(OnCallShadowShadowableType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_SHADOW_SHADOWABLE_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/on_call_shadows_list.py b/rootly_sdk/models/on_call_shadows_list.py index 936dc57b..e15d4815 100644 --- a/rootly_sdk/models/on_call_shadows_list.py +++ b/rootly_sdk/models/on_call_shadows_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class OnCallShadowsList: """ Attributes: - data (list['OnCallShadowsListDataItem']): + data (list[OnCallShadowsListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["OnCallShadowsListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[OnCallShadowsListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 57322935..5709fc25 100644 --- a/rootly_sdk/models/on_call_shadows_list_data_item.py +++ b/rootly_sdk/models/on_call_shadows_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/on_call_shadows_list_data_item_type.py b/rootly_sdk/models/on_call_shadows_list_data_item_type.py index 163c0c9e..3580e5a4 100644 --- a/rootly_sdk/models/on_call_shadows_list_data_item_type.py +++ b/rootly_sdk/models/on_call_shadows_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OnCallShadowsListDataItemType = Literal["on_call_shadows"] @@ -11,5 +11,5 @@ def check_on_call_shadows_list_data_item_type(value: str | None) -> OnCallShadow if value is None: return None if value in ON_CALL_SHADOWS_LIST_DATA_ITEM_TYPE_VALUES: - return cast(OnCallShadowsListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ON_CALL_SHADOWS_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/oncall.py b/rootly_sdk/models/oncall.py index 15574aea..03323469 100644 --- a/rootly_sdk/models/oncall.py +++ b/rootly_sdk/models/oncall.py @@ -1,10 +1,11 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field -from dateutil.parser import isoparse from ..models.oncall_notification_type import OncallNotificationType, check_oncall_notification_type from ..types import UNSET, Unset @@ -21,14 +22,13 @@ 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 (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_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_id: str @@ -36,13 +36,13 @@ class Oncall: user_id: int starts_at: datetime.datetime ends_at: datetime.datetime - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,23 +56,23 @@ def to_dict(self) -> dict[str, Any]: ends_at = self.ends_at.isoformat() - escalation_policy_path_id: None | Unset | str + escalation_policy_path_id: None | str | Unset 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 | Unset | str + escalation_policy_path_name: None | str | Unset 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: Unset | str = UNSET + notification_type: str | Unset = UNSET if not isinstance(self.notification_type, Unset): notification_type = self.notification_type - is_default_path: None | Unset | bool + is_default_path: bool | None | Unset if isinstance(self.is_default_path, Unset): is_default_path = UNSET else: @@ -80,13 +80,13 @@ def to_dict(self) -> dict[str, Any]: escalation_level = self.escalation_level - schedule_id: None | Unset | str + schedule_id: None | str | Unset if isinstance(self.schedule_id, Unset): schedule_id = UNSET else: schedule_id = self.schedule_id - schedule_name: None | Unset | str + schedule_name: None | str | Unset if isinstance(self.schedule_name, Unset): schedule_name = UNSET else: @@ -129,61 +129,61 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: user_id = d.pop("user_id") - starts_at = isoparse(d.pop("starts_at")) + starts_at = datetime.datetime.fromisoformat(d.pop("starts_at")) - ends_at = isoparse(d.pop("ends_at")) + ends_at = datetime.datetime.fromisoformat(d.pop("ends_at")) - def _parse_escalation_policy_path_id(data: object) -> None | Unset | str: + def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_escalation_policy_path_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: Unset | OncallNotificationType + notification_type: OncallNotificationType | Unset if isinstance(_notification_type, Unset): notification_type = UNSET else: notification_type = check_oncall_notification_type(_notification_type) - def _parse_is_default_path(data: object) -> None | Unset | bool: + def _parse_is_default_path(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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 | Unset | str: + def _parse_schedule_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) schedule_id = _parse_schedule_id(d.pop("schedule_id", UNSET)) - def _parse_schedule_name(data: object) -> None | Unset | str: + def _parse_schedule_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 1263f2c9..bf2baeda 100644 --- a/rootly_sdk/models/oncall_list.py +++ b/rootly_sdk/models/oncall_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,12 +20,12 @@ class OncallList: """ Attributes: - data (list['OncallListDataItem']): - included (Union[Unset, list['JsonapiIncludedResource']]): + data (list[OncallListDataItem]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["OncallListDataItem"] - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[OncallListDataItem] + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -64,12 +66,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) - included = [] _included = d.pop("included", UNSET) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 2ebdd767..49746356 100644 --- a/rootly_sdk/models/oncall_list_data_item.py +++ b/rootly_sdk/models/oncall_list_data_item.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,13 +24,13 @@ class OncallListDataItem: id (str): Unique ID of the on-call entry type_ (OncallListDataItemType): attributes (Oncall): - relationships (Union[Unset, OncallRelationships]): + relationships (OncallRelationships | Unset): """ id: str type_: OncallListDataItemType - attributes: "Oncall" - relationships: Union[Unset, "OncallRelationships"] = UNSET + attributes: Oncall + relationships: OncallRelationships | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() - relationships: Unset | dict[str, Any] = UNSET + relationships: dict[str, Any] | Unset = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -69,7 +71,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: Unset | OncallRelationships + relationships: OncallRelationships | Unset if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/oncall_list_data_item_type.py b/rootly_sdk/models/oncall_list_data_item_type.py index f95be48a..95f80e56 100644 --- a/rootly_sdk/models/oncall_list_data_item_type.py +++ b/rootly_sdk/models/oncall_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OncallListDataItemType = Literal["on_call_resources"] @@ -11,5 +11,5 @@ def check_oncall_list_data_item_type(value: str | None) -> OncallListDataItemTyp if value is None: return None if value in ONCALL_LIST_DATA_ITEM_TYPE_VALUES: - return cast(OncallListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ONCALL_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/oncall_notification_type.py b/rootly_sdk/models/oncall_notification_type.py index 7795813b..abed87e1 100644 --- a/rootly_sdk/models/oncall_notification_type.py +++ b/rootly_sdk/models/oncall_notification_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OncallNotificationType = Literal["audible", "quiet"] @@ -12,5 +12,5 @@ def check_oncall_notification_type(value: str | None) -> OncallNotificationType if value is None: return None if value in ONCALL_NOTIFICATION_TYPE_VALUES: - return cast(OncallNotificationType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ONCALL_NOTIFICATION_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/oncall_relationships.py b/rootly_sdk/models/oncall_relationships.py index 3566df31..7b536d5d 100644 --- a/rootly_sdk/models/oncall_relationships.py +++ b/rootly_sdk/models/oncall_relationships.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,26 +21,26 @@ class OncallRelationships: """ Attributes: - user (Union[Unset, OncallRelationshipsUser]): - schedule (Union[Unset, OncallRelationshipsSchedule]): - escalation_policy (Union[Unset, OncallRelationshipsEscalationPolicy]): + user (OncallRelationshipsUser | Unset): + schedule (OncallRelationshipsSchedule | Unset): + escalation_policy (OncallRelationshipsEscalationPolicy | Unset): """ - user: Union[Unset, "OncallRelationshipsUser"] = UNSET - schedule: Union[Unset, "OncallRelationshipsSchedule"] = UNSET - escalation_policy: Union[Unset, "OncallRelationshipsEscalationPolicy"] = UNSET + user: OncallRelationshipsUser | Unset = UNSET + schedule: OncallRelationshipsSchedule | Unset = UNSET + escalation_policy: OncallRelationshipsEscalationPolicy | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - user: Unset | dict[str, Any] = UNSET + user: dict[str, Any] | Unset = UNSET if not isinstance(self.user, Unset): user = self.user.to_dict() - schedule: Unset | dict[str, Any] = UNSET + schedule: dict[str, Any] | Unset = UNSET if not isinstance(self.schedule, Unset): schedule = self.schedule.to_dict() - escalation_policy: Unset | dict[str, Any] = UNSET + escalation_policy: dict[str, Any] | Unset = UNSET if not isinstance(self.escalation_policy, Unset): escalation_policy = self.escalation_policy.to_dict() @@ -62,21 +64,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _user = d.pop("user", UNSET) - user: Unset | OncallRelationshipsUser + user: OncallRelationshipsUser | Unset if isinstance(_user, Unset): user = UNSET else: user = OncallRelationshipsUser.from_dict(_user) _schedule = d.pop("schedule", UNSET) - schedule: Unset | OncallRelationshipsSchedule + schedule: OncallRelationshipsSchedule | Unset if isinstance(_schedule, Unset): schedule = UNSET else: schedule = OncallRelationshipsSchedule.from_dict(_schedule) _escalation_policy = d.pop("escalation_policy", UNSET) - escalation_policy: Unset | OncallRelationshipsEscalationPolicy + escalation_policy: OncallRelationshipsEscalationPolicy | Unset 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 e69ff1cb..6d5b37df 100644 --- a/rootly_sdk/models/oncall_relationships_escalation_policy.py +++ b/rootly_sdk/models/oncall_relationships_escalation_policy.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,10 +19,10 @@ class OncallRelationshipsEscalationPolicy: """ Attributes: - data (Union['OncallRelationshipsEscalationPolicyDataType0', None, Unset]): + data (None | OncallRelationshipsEscalationPolicyDataType0 | Unset): """ - data: Union["OncallRelationshipsEscalationPolicyDataType0", None, Unset] = UNSET + data: None | OncallRelationshipsEscalationPolicyDataType0 | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -28,7 +30,7 @@ def to_dict(self) -> dict[str, Any]: OncallRelationshipsEscalationPolicyDataType0, ) - data: None | Unset | dict[str, Any] + data: dict[str, Any] | None | Unset if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, OncallRelationshipsEscalationPolicyDataType0): @@ -52,7 +54,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> Union["OncallRelationshipsEscalationPolicyDataType0", None, Unset]: + def _parse_data(data: object) -> None | OncallRelationshipsEscalationPolicyDataType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -63,9 +65,9 @@ def _parse_data(data: object) -> Union["OncallRelationshipsEscalationPolicyDataT data_type_0 = OncallRelationshipsEscalationPolicyDataType0.from_dict(data) return data_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["OncallRelationshipsEscalationPolicyDataType0", None, Unset], data) + return cast(None | OncallRelationshipsEscalationPolicyDataType0 | 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 8fd70eac..5f4db389 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -17,18 +19,18 @@ class OncallRelationshipsEscalationPolicyDataType0: """ Attributes: - id (Union[Unset, str]): - type_ (Union[Unset, OncallRelationshipsEscalationPolicyDataType0Type]): + id (str | Unset): + type_ (OncallRelationshipsEscalationPolicyDataType0Type | Unset): """ - id: Unset | str = UNSET - type_: Unset | OncallRelationshipsEscalationPolicyDataType0Type = UNSET + id: str | Unset = UNSET + type_: OncallRelationshipsEscalationPolicyDataType0Type | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -48,7 +50,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | OncallRelationshipsEscalationPolicyDataType0Type + type_: OncallRelationshipsEscalationPolicyDataType0Type | Unset if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/oncall_relationships_escalation_policy_data_type_0_type.py b/rootly_sdk/models/oncall_relationships_escalation_policy_data_type_0_type.py index 1ccacf6c..7c3cdb5d 100644 --- a/rootly_sdk/models/oncall_relationships_escalation_policy_data_type_0_type.py +++ b/rootly_sdk/models/oncall_relationships_escalation_policy_data_type_0_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OncallRelationshipsEscalationPolicyDataType0Type = Literal["escalation_policies"] @@ -15,7 +15,7 @@ def check_oncall_relationships_escalation_policy_data_type_0_type( if value is None: return None if value in ONCALL_RELATIONSHIPS_ESCALATION_POLICY_DATA_TYPE_0_TYPE_VALUES: - return cast(OncallRelationshipsEscalationPolicyDataType0Type, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ONCALL_RELATIONSHIPS_ESCALATION_POLICY_DATA_TYPE_0_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/oncall_relationships_schedule.py b/rootly_sdk/models/oncall_relationships_schedule.py index bc122047..e09c49b7 100644 --- a/rootly_sdk/models/oncall_relationships_schedule.py +++ b/rootly_sdk/models/oncall_relationships_schedule.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,16 +19,16 @@ class OncallRelationshipsSchedule: """ Attributes: - data (Union['OncallRelationshipsScheduleDataType0', None, Unset]): + data (None | OncallRelationshipsScheduleDataType0 | Unset): """ - data: Union["OncallRelationshipsScheduleDataType0", None, Unset] = UNSET + data: None | OncallRelationshipsScheduleDataType0 | 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: None | Unset | dict[str, Any] + data: dict[str, Any] | None | Unset if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, OncallRelationshipsScheduleDataType0): @@ -48,7 +50,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> Union["OncallRelationshipsScheduleDataType0", None, Unset]: + def _parse_data(data: object) -> None | OncallRelationshipsScheduleDataType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -59,9 +61,9 @@ def _parse_data(data: object) -> Union["OncallRelationshipsScheduleDataType0", N data_type_0 = OncallRelationshipsScheduleDataType0.from_dict(data) return data_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["OncallRelationshipsScheduleDataType0", None, Unset], data) + return cast(None | OncallRelationshipsScheduleDataType0 | 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 5cfe8fbc..c9919c8a 100644 --- a/rootly_sdk/models/oncall_relationships_schedule_data_type_0.py +++ b/rootly_sdk/models/oncall_relationships_schedule_data_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -17,18 +19,18 @@ class OncallRelationshipsScheduleDataType0: """ Attributes: - id (Union[Unset, str]): - type_ (Union[Unset, OncallRelationshipsScheduleDataType0Type]): + id (str | Unset): + type_ (OncallRelationshipsScheduleDataType0Type | Unset): """ - id: Unset | str = UNSET - type_: Unset | OncallRelationshipsScheduleDataType0Type = UNSET + id: str | Unset = UNSET + type_: OncallRelationshipsScheduleDataType0Type | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -48,7 +50,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | OncallRelationshipsScheduleDataType0Type + type_: OncallRelationshipsScheduleDataType0Type | Unset if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/oncall_relationships_schedule_data_type_0_type.py b/rootly_sdk/models/oncall_relationships_schedule_data_type_0_type.py index 16aec7b8..0b0209de 100644 --- a/rootly_sdk/models/oncall_relationships_schedule_data_type_0_type.py +++ b/rootly_sdk/models/oncall_relationships_schedule_data_type_0_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OncallRelationshipsScheduleDataType0Type = Literal["schedules"] @@ -13,7 +13,7 @@ def check_oncall_relationships_schedule_data_type_0_type( if value is None: return None if value in ONCALL_RELATIONSHIPS_SCHEDULE_DATA_TYPE_0_TYPE_VALUES: - return cast(OncallRelationshipsScheduleDataType0Type, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ONCALL_RELATIONSHIPS_SCHEDULE_DATA_TYPE_0_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/oncall_relationships_user.py b/rootly_sdk/models/oncall_relationships_user.py index 9d1f9b5d..6c35d047 100644 --- a/rootly_sdk/models/oncall_relationships_user.py +++ b/rootly_sdk/models/oncall_relationships_user.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,16 +19,16 @@ class OncallRelationshipsUser: """ Attributes: - data (Union['OncallRelationshipsUserDataType0', None, Unset]): + data (None | OncallRelationshipsUserDataType0 | Unset): """ - data: Union["OncallRelationshipsUserDataType0", None, Unset] = UNSET + data: None | OncallRelationshipsUserDataType0 | 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: None | Unset | dict[str, Any] + data: dict[str, Any] | None | Unset if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, OncallRelationshipsUserDataType0): @@ -48,7 +50,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> Union["OncallRelationshipsUserDataType0", None, Unset]: + def _parse_data(data: object) -> None | OncallRelationshipsUserDataType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -59,9 +61,9 @@ def _parse_data(data: object) -> Union["OncallRelationshipsUserDataType0", None, data_type_0 = OncallRelationshipsUserDataType0.from_dict(data) return data_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["OncallRelationshipsUserDataType0", None, Unset], data) + return cast(None | OncallRelationshipsUserDataType0 | 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 3771fba7..0554b0fc 100644 --- a/rootly_sdk/models/oncall_relationships_user_data_type_0.py +++ b/rootly_sdk/models/oncall_relationships_user_data_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -17,18 +19,18 @@ class OncallRelationshipsUserDataType0: """ Attributes: - id (Union[Unset, str]): - type_ (Union[Unset, OncallRelationshipsUserDataType0Type]): + id (str | Unset): + type_ (OncallRelationshipsUserDataType0Type | Unset): """ - id: Unset | str = UNSET - type_: Unset | OncallRelationshipsUserDataType0Type = UNSET + id: str | Unset = UNSET + type_: OncallRelationshipsUserDataType0Type | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -48,7 +50,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | OncallRelationshipsUserDataType0Type + type_: OncallRelationshipsUserDataType0Type | Unset if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/oncall_relationships_user_data_type_0_type.py b/rootly_sdk/models/oncall_relationships_user_data_type_0_type.py index 12ea76ea..f6ff3a32 100644 --- a/rootly_sdk/models/oncall_relationships_user_data_type_0_type.py +++ b/rootly_sdk/models/oncall_relationships_user_data_type_0_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OncallRelationshipsUserDataType0Type = Literal["users"] @@ -11,7 +11,7 @@ def check_oncall_relationships_user_data_type_0_type(value: str | None) -> Oncal if value is None: return None if value in ONCALL_RELATIONSHIPS_USER_DATA_TYPE_0_TYPE_VALUES: - return cast(OncallRelationshipsUserDataType0Type, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ONCALL_RELATIONSHIPS_USER_DATA_TYPE_0_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/overridden_shift.py b/rootly_sdk/models/overridden_shift.py new file mode 100644 index 00000000..de42bb6c --- /dev/null +++ b/rootly_sdk/models/overridden_shift.py @@ -0,0 +1,151 @@ +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 ..types import UNSET, Unset + +T = TypeVar("T", bound="OverriddenShift") + + +@_attrs_define +class OverriddenShift: + """ + Attributes: + starts_at (str): Start datetime of the overridden portion + ends_at (str): End datetime of the overridden portion + user_id (int | None | Unset): ID of the user whose shift was overridden + rotation_id (None | str | Unset): ID of the rotation the overridden shift belongs to + assignee_type (None | str | Unset): Type of the overridden assignee (User or Schedule) + assignee_id (None | str | Unset): ID of the overridden assignee + """ + + starts_at: str + ends_at: str + user_id: int | None | Unset = UNSET + rotation_id: None | str | Unset = UNSET + assignee_type: None | str | Unset = UNSET + assignee_id: None | str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + starts_at = self.starts_at + + ends_at = self.ends_at + + user_id: int | None | Unset + if isinstance(self.user_id, Unset): + user_id = UNSET + else: + user_id = self.user_id + + rotation_id: None | str | Unset + if isinstance(self.rotation_id, Unset): + rotation_id = UNSET + else: + rotation_id = self.rotation_id + + assignee_type: None | str | Unset + if isinstance(self.assignee_type, Unset): + assignee_type = UNSET + else: + assignee_type = self.assignee_type + + assignee_id: None | str | Unset + if isinstance(self.assignee_id, Unset): + assignee_id = UNSET + else: + assignee_id = self.assignee_id + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "starts_at": starts_at, + "ends_at": ends_at, + } + ) + if user_id is not UNSET: + field_dict["user_id"] = user_id + if rotation_id is not UNSET: + field_dict["rotation_id"] = rotation_id + if assignee_type is not UNSET: + field_dict["assignee_type"] = assignee_type + if assignee_id is not UNSET: + field_dict["assignee_id"] = assignee_id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + starts_at = d.pop("starts_at") + + ends_at = d.pop("ends_at") + + def _parse_user_id(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + user_id = _parse_user_id(d.pop("user_id", UNSET)) + + def _parse_rotation_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + rotation_id = _parse_rotation_id(d.pop("rotation_id", UNSET)) + + def _parse_assignee_type(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + assignee_type = _parse_assignee_type(d.pop("assignee_type", UNSET)) + + def _parse_assignee_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + assignee_id = _parse_assignee_id(d.pop("assignee_id", UNSET)) + + overridden_shift = cls( + starts_at=starts_at, + ends_at=ends_at, + user_id=user_id, + rotation_id=rotation_id, + assignee_type=assignee_type, + assignee_id=assignee_id, + ) + + overridden_shift.additional_properties = d + return overridden_shift + + @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/override_shift.py b/rootly_sdk/models/override_shift.py index b37efd61..5e3e9dd1 100644 --- a/rootly_sdk/models/override_shift.py +++ b/rootly_sdk/models/override_shift.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,15 +21,15 @@ class OverrideShift: """ Attributes: schedule_id (str): ID of schedule - rotation_id (Union[None, str]): ID of rotation + rotation_id (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 (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]): + 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): """ schedule_id: str @@ -35,11 +37,11 @@ class OverrideShift: starts_at: str ends_at: str is_override: bool - 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 + created_at: str | Unset = UNSET + updated_at: str | Unset = UNSET + shift_override: ShiftOverrideResponse | Unset = UNSET + user_id: int | Unset = UNSET + user: UserResponse | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -58,13 +60,13 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - shift_override: Unset | dict[str, Any] = UNSET + shift_override: dict[str, Any] | Unset = UNSET if not isinstance(self.shift_override, Unset): shift_override = self.shift_override.to_dict() user_id = self.user_id - user: Unset | dict[str, Any] = UNSET + user: dict[str, Any] | Unset = UNSET if not isinstance(self.user, Unset): user = self.user.to_dict() @@ -118,7 +120,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: Unset | ShiftOverrideResponse + shift_override: ShiftOverrideResponse | Unset if isinstance(_shift_override, Unset): shift_override = UNSET else: @@ -127,7 +129,7 @@ def _parse_rotation_id(data: object) -> None | str: user_id = d.pop("user_id", UNSET) _user = d.pop("user", UNSET) - user: Unset | UserResponse + user: UserResponse | Unset 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 62db7a61..db8fda62 100644 --- a/rootly_sdk/models/override_shift_list.py +++ b/rootly_sdk/models/override_shift_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class OverrideShiftList: """ Attributes: - data (list['OverrideShiftListDataItem']): + data (list[OverrideShiftListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["OverrideShiftListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[OverrideShiftListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 6549f203..512ffce1 100644 --- a/rootly_sdk/models/override_shift_list_data_item.py +++ b/rootly_sdk/models/override_shift_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/override_shift_list_data_item_type.py b/rootly_sdk/models/override_shift_list_data_item_type.py index b2bef715..63203111 100644 --- a/rootly_sdk/models/override_shift_list_data_item_type.py +++ b/rootly_sdk/models/override_shift_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OverrideShiftListDataItemType = Literal["shifts"] @@ -11,5 +11,5 @@ def check_override_shift_list_data_item_type(value: str | None) -> OverrideShift if value is None: return None if value in OVERRIDE_SHIFT_LIST_DATA_ITEM_TYPE_VALUES: - return cast(OverrideShiftListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {OVERRIDE_SHIFT_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/override_shift_response.py b/rootly_sdk/models/override_shift_response.py index 9b082260..688732cc 100644 --- a/rootly_sdk/models/override_shift_response.py +++ b/rootly_sdk/models/override_shift_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class OverrideShiftResponse: """ Attributes: data (OverrideShiftResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "OverrideShiftResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: OverrideShiftResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 751fe8ca..ee954420 100644 --- a/rootly_sdk/models/override_shift_response_data.py +++ b/rootly_sdk/models/override_shift_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/override_shift_response_data_type.py b/rootly_sdk/models/override_shift_response_data_type.py index 4934a3c8..50f2f065 100644 --- a/rootly_sdk/models/override_shift_response_data_type.py +++ b/rootly_sdk/models/override_shift_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal OverrideShiftResponseDataType = Literal["shifts"] @@ -11,5 +11,5 @@ def check_override_shift_response_data_type(value: str | None) -> OverrideShiftR if value is None: return None if value in OVERRIDE_SHIFT_RESPONSE_DATA_TYPE_VALUES: - return cast(OverrideShiftResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {OVERRIDE_SHIFT_RESPONSE_DATA_TYPE_VALUES!r}") 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 9079ba31..23fc21d3 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -30,31 +32,31 @@ class PageJsmopsOnCallRespondersTaskParams: """ Attributes: - 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 + 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 information about the incident - teams (Union[Unset, list['PageJsmopsOnCallRespondersTaskParamsTeamsItem']]): - users (Union[Unset, list['PageJsmopsOnCallRespondersTaskParamsUsersItem']]): - priority (Union[Unset, PageJsmopsOnCallRespondersTaskParamsPriority]): Default: 'P3'. + teams (list[PageJsmopsOnCallRespondersTaskParamsTeamsItem] | Unset): + users (list[PageJsmopsOnCallRespondersTaskParamsUsersItem] | Unset): + priority (PageJsmopsOnCallRespondersTaskParamsPriority | Unset): Default: '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" + 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" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - title: None | Unset | str + title: None | str | Unset if isinstance(self.title, Unset): title = UNSET else: @@ -64,21 +66,21 @@ def to_dict(self) -> dict[str, Any]: description = self.description - teams: Unset | list[dict[str, Any]] = UNSET + teams: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + users: list[dict[str, Any]] | Unset = 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: Unset | str = UNSET + priority: str | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -113,18 +115,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: Unset | PageJsmopsOnCallRespondersTaskParamsTaskType + task_type: PageJsmopsOnCallRespondersTaskParamsTaskType | Unset 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 | Unset | str: + def _parse_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) title = _parse_title(d.pop("title", UNSET)) @@ -132,22 +134,26 @@ def _parse_title(data: object) -> None | Unset | str: description = d.pop("description", UNSET) - teams = [] _teams = d.pop("teams", UNSET) - for teams_item_data in _teams or []: - teams_item = PageJsmopsOnCallRespondersTaskParamsTeamsItem.from_dict(teams_item_data) + 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) - teams.append(teams_item) + teams.append(teams_item) - users = [] _users = d.pop("users", UNSET) - for users_item_data in _users or []: - users_item = PageJsmopsOnCallRespondersTaskParamsUsersItem.from_dict(users_item_data) + 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) - users.append(users_item) + users.append(users_item) _priority = d.pop("priority", UNSET) - priority: Unset | PageJsmopsOnCallRespondersTaskParamsPriority + priority: PageJsmopsOnCallRespondersTaskParamsPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/page_jsmops_on_call_responders_task_params_priority.py b/rootly_sdk/models/page_jsmops_on_call_responders_task_params_priority.py index ad4a610d..b393f16c 100644 --- a/rootly_sdk/models/page_jsmops_on_call_responders_task_params_priority.py +++ b/rootly_sdk/models/page_jsmops_on_call_responders_task_params_priority.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PageJsmopsOnCallRespondersTaskParamsPriority = Literal["auto", "P1", "P2", "P3", "P4", "P5"] @@ -18,7 +18,7 @@ def check_page_jsmops_on_call_responders_task_params_priority( if value is None: return None if value in PAGE_JSMOPS_ON_CALL_RESPONDERS_TASK_PARAMS_PRIORITY_VALUES: - return cast(PageJsmopsOnCallRespondersTaskParamsPriority, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {PAGE_JSMOPS_ON_CALL_RESPONDERS_TASK_PARAMS_PRIORITY_VALUES!r}" ) diff --git a/rootly_sdk/models/page_jsmops_on_call_responders_task_params_task_type.py b/rootly_sdk/models/page_jsmops_on_call_responders_task_params_task_type.py index a5d5ef6c..9c6105cb 100644 --- a/rootly_sdk/models/page_jsmops_on_call_responders_task_params_task_type.py +++ b/rootly_sdk/models/page_jsmops_on_call_responders_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PageJsmopsOnCallRespondersTaskParamsTaskType = Literal["page_jsmops_on_call_responders"] @@ -13,7 +13,7 @@ def check_page_jsmops_on_call_responders_task_params_task_type( if value is None: return None if value in PAGE_JSMOPS_ON_CALL_RESPONDERS_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(PageJsmopsOnCallRespondersTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {PAGE_JSMOPS_ON_CALL_RESPONDERS_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 913616a2..9dee4774 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class PageJsmopsOnCallRespondersTaskParamsTeamsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 7b755781..24aa7ba3 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class PageJsmopsOnCallRespondersTaskParamsUsersItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 ad72c711..635e4069 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -30,31 +32,31 @@ class PageOpsgenieOnCallRespondersTaskParams: """ Attributes: - 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 + 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 information about the incident - teams (Union[Unset, list['PageOpsgenieOnCallRespondersTaskParamsTeamsItem']]): - users (Union[Unset, list['PageOpsgenieOnCallRespondersTaskParamsUsersItem']]): - priority (Union[Unset, PageOpsgenieOnCallRespondersTaskParamsPriority]): Default: 'P1'. + teams (list[PageOpsgenieOnCallRespondersTaskParamsTeamsItem] | Unset): + users (list[PageOpsgenieOnCallRespondersTaskParamsUsersItem] | Unset): + priority (PageOpsgenieOnCallRespondersTaskParamsPriority | Unset): Default: '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" + 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" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - title: None | Unset | str + title: None | str | Unset if isinstance(self.title, Unset): title = UNSET else: @@ -64,21 +66,21 @@ def to_dict(self) -> dict[str, Any]: description = self.description - teams: Unset | list[dict[str, Any]] = UNSET + teams: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + users: list[dict[str, Any]] | Unset = 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: Unset | str = UNSET + priority: str | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -113,18 +115,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: Unset | PageOpsgenieOnCallRespondersTaskParamsTaskType + task_type: PageOpsgenieOnCallRespondersTaskParamsTaskType | Unset 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 | Unset | str: + def _parse_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) title = _parse_title(d.pop("title", UNSET)) @@ -132,22 +134,26 @@ def _parse_title(data: object) -> None | Unset | str: description = d.pop("description", UNSET) - teams = [] _teams = d.pop("teams", UNSET) - for teams_item_data in _teams or []: - teams_item = PageOpsgenieOnCallRespondersTaskParamsTeamsItem.from_dict(teams_item_data) + 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) - teams.append(teams_item) + teams.append(teams_item) - users = [] _users = d.pop("users", UNSET) - for users_item_data in _users or []: - users_item = PageOpsgenieOnCallRespondersTaskParamsUsersItem.from_dict(users_item_data) + 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) - users.append(users_item) + users.append(users_item) _priority = d.pop("priority", UNSET) - priority: Unset | PageOpsgenieOnCallRespondersTaskParamsPriority + priority: PageOpsgenieOnCallRespondersTaskParamsPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_priority.py b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_priority.py index b89124af..328cadd7 100644 --- a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_priority.py +++ b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_priority.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PageOpsgenieOnCallRespondersTaskParamsPriority = Literal["auto", "P1", "P2", "P3", "P4", "P5"] @@ -18,7 +18,7 @@ def check_page_opsgenie_on_call_responders_task_params_priority( if value is None: return None if value in PAGE_OPSGENIE_ON_CALL_RESPONDERS_TASK_PARAMS_PRIORITY_VALUES: - return cast(PageOpsgenieOnCallRespondersTaskParamsPriority, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {PAGE_OPSGENIE_ON_CALL_RESPONDERS_TASK_PARAMS_PRIORITY_VALUES!r}" ) diff --git a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_task_type.py b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_task_type.py index e5cc2c31..a4e32f12 100644 --- a/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_task_type.py +++ b/rootly_sdk/models/page_opsgenie_on_call_responders_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PageOpsgenieOnCallRespondersTaskParamsTaskType = Literal["page_opsgenie_on_call_responders"] @@ -13,7 +13,7 @@ def check_page_opsgenie_on_call_responders_task_params_task_type( if value is None: return None if value in PAGE_OPSGENIE_ON_CALL_RESPONDERS_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(PageOpsgenieOnCallRespondersTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {PAGE_OPSGENIE_ON_CALL_RESPONDERS_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 d60d0421..50c3593a 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class PageOpsgenieOnCallRespondersTaskParamsTeamsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 7eeaf177..9c55df3e 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class PageOpsgenieOnCallRespondersTaskParamsUsersItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 69db5e99..07ecfd04 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -34,53 +36,53 @@ class PagePagerdutyOnCallRespondersTaskParams: """ Attributes: service (PagePagerdutyOnCallRespondersTaskParamsService): - 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 + 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 severity - 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. + 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. """ - 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 + 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 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - escalation_policies: Unset | list[dict[str, Any]] = UNSET + escalation_policies: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + users: list[dict[str, Any]] | Unset = 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 | Unset | str + title: None | str | Unset if isinstance(self.title, Unset): title = UNSET else: @@ -88,7 +90,7 @@ def to_dict(self) -> dict[str, Any]: message = self.message - urgency: Unset | str = UNSET + urgency: str | Unset = UNSET if not isinstance(self.urgency, Unset): urgency = self.urgency @@ -138,41 +140,45 @@ 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: Unset | PagePagerdutyOnCallRespondersTaskParamsTaskType + task_type: PagePagerdutyOnCallRespondersTaskParamsTaskType | Unset 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) - for escalation_policies_item_data in _escalation_policies or []: - escalation_policies_item = PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem.from_dict( - escalation_policies_item_data - ) + 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 + ) - escalation_policies.append(escalation_policies_item) + escalation_policies.append(escalation_policies_item) - users = [] _users = d.pop("users", UNSET) - for users_item_data in _users or []: - users_item = PagePagerdutyOnCallRespondersTaskParamsUsersItem.from_dict(users_item_data) + 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) - users.append(users_item) + users.append(users_item) - def _parse_title(data: object) -> None | Unset | str: + def _parse_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) title = _parse_title(d.pop("title", UNSET)) message = d.pop("message", UNSET) _urgency = d.pop("urgency", UNSET) - urgency: Unset | PagePagerdutyOnCallRespondersTaskParamsUrgency + urgency: PagePagerdutyOnCallRespondersTaskParamsUrgency | Unset 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 4384233c..2d743482 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class PagePagerdutyOnCallRespondersTaskParamsEscalationPoliciesItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 2e52e7c6..5d7c2c8e 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class PagePagerdutyOnCallRespondersTaskParamsService: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_task_type.py index 76a57056..65c3d9ce 100644 --- a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_task_type.py +++ b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PagePagerdutyOnCallRespondersTaskParamsTaskType = Literal["page_pagerduty_on_call_responders"] @@ -13,7 +13,7 @@ def check_page_pagerduty_on_call_responders_task_params_task_type( if value is None: return None if value in PAGE_PAGERDUTY_ON_CALL_RESPONDERS_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(PagePagerdutyOnCallRespondersTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {PAGE_PAGERDUTY_ON_CALL_RESPONDERS_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_urgency.py b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_urgency.py index e9a1b686..6396be45 100644 --- a/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_urgency.py +++ b/rootly_sdk/models/page_pagerduty_on_call_responders_task_params_urgency.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PagePagerdutyOnCallRespondersTaskParamsUrgency = Literal["auto", "high", "low"] @@ -15,7 +15,7 @@ def check_page_pagerduty_on_call_responders_task_params_urgency( if value is None: return None if value in PAGE_PAGERDUTY_ON_CALL_RESPONDERS_TASK_PARAMS_URGENCY_VALUES: - return cast(PagePagerdutyOnCallRespondersTaskParamsUrgency, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {PAGE_PAGERDUTY_ON_CALL_RESPONDERS_TASK_PARAMS_URGENCY_VALUES!r}" ) 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 1ce3b023..bd0237ac 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class PagePagerdutyOnCallRespondersTaskParamsUsersItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 0a67bd82..d458348d 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -37,29 +39,29 @@ class PageRootlyOnCallRespondersTaskParams: Attributes: alert_urgency_id (str): Alert urgency ID summary (str): Alert title - 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 + 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 triggered the workflow Default: False. """ alert_urgency_id: str summary: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -67,27 +69,27 @@ def to_dict(self) -> dict[str, Any]: summary = self.summary - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - escalation_policy_target: Unset | dict[str, Any] = UNSET + 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: Unset | dict[str, Any] = UNSET + service_target: dict[str, Any] | Unset = UNSET if not isinstance(self.service_target, Unset): service_target = self.service_target.to_dict() - user_target: Unset | dict[str, Any] = UNSET + user_target: dict[str, Any] | Unset = UNSET if not isinstance(self.user_target, Unset): user_target = self.user_target.to_dict() - group_target: Unset | dict[str, Any] = UNSET + group_target: dict[str, Any] | Unset = UNSET if not isinstance(self.group_target, Unset): group_target = self.group_target.to_dict() - functionality_target: Unset | dict[str, Any] = UNSET + functionality_target: dict[str, Any] | Unset = UNSET if not isinstance(self.functionality_target, Unset): functionality_target = self.functionality_target.to_dict() @@ -150,14 +152,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: Unset | PageRootlyOnCallRespondersTaskParamsTaskType + task_type: PageRootlyOnCallRespondersTaskParamsTaskType | Unset 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: Unset | PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget + escalation_policy_target: PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget | Unset if isinstance(_escalation_policy_target, Unset): escalation_policy_target = UNSET else: @@ -166,28 +168,28 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _service_target = d.pop("service_target", UNSET) - service_target: Unset | PageRootlyOnCallRespondersTaskParamsServiceTarget + service_target: PageRootlyOnCallRespondersTaskParamsServiceTarget | Unset 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: Unset | PageRootlyOnCallRespondersTaskParamsUserTarget + user_target: PageRootlyOnCallRespondersTaskParamsUserTarget | Unset 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: Unset | PageRootlyOnCallRespondersTaskParamsGroupTarget + group_target: PageRootlyOnCallRespondersTaskParamsGroupTarget | Unset 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: Unset | PageRootlyOnCallRespondersTaskParamsFunctionalityTarget + functionality_target: PageRootlyOnCallRespondersTaskParamsFunctionalityTarget | Unset 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 8eb10f74..3120e18c 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class PageRootlyOnCallRespondersTaskParamsEscalationPolicyTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 f57ba69b..9d0b0fcf 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class PageRootlyOnCallRespondersTaskParamsFunctionalityTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 491fc701..e66c01e4 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class PageRootlyOnCallRespondersTaskParamsGroupTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 c7f7fdc3..8bdb97c4 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class PageRootlyOnCallRespondersTaskParamsServiceTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/page_rootly_on_call_responders_task_params_task_type.py index 17ba8e48..958dda39 100644 --- a/rootly_sdk/models/page_rootly_on_call_responders_task_params_task_type.py +++ b/rootly_sdk/models/page_rootly_on_call_responders_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PageRootlyOnCallRespondersTaskParamsTaskType = Literal["page_rootly_on_call_responders"] @@ -13,7 +13,7 @@ def check_page_rootly_on_call_responders_task_params_task_type( if value is None: return None if value in PAGE_ROOTLY_ON_CALL_RESPONDERS_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(PageRootlyOnCallRespondersTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {PAGE_ROOTLY_ON_CALL_RESPONDERS_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 e66fae34..5dd0f4fe 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class PageRootlyOnCallRespondersTaskParamsUserTarget: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 d87c9af5..941d2835 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class PageVictorOpsOnCallRespondersTaskParamsType0UsersItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 575d7525..5848af71 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class PageVictorOpsOnCallRespondersTaskParamsType1EscalationPoliciesItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 2c80e136..ff534329 100644 --- a/rootly_sdk/models/patch_alert_route.py +++ b/rootly_sdk/models/patch_alert_route.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.patch_alert_route_data import PatchAlertRouteData @@ -18,14 +19,13 @@ class PatchAlertRoute: data (PatchAlertRouteData): """ - data: "PatchAlertRouteData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: PatchAlertRouteData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - patch_alert_route.additional_properties = d return patch_alert_route - - @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/patch_alert_route_data.py b/rootly_sdk/models/patch_alert_route_data.py index 78df219c..9af0b1a3 100644 --- a/rootly_sdk/models/patch_alert_route_data.py +++ b/rootly_sdk/models/patch_alert_route_data.py @@ -1,10 +1,12 @@ +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.patch_alert_route_data_type import PatchAlertRouteDataType, check_patch_alert_route_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.patch_alert_route_data_attributes import PatchAlertRouteDataAttributes @@ -19,25 +21,31 @@ class PatchAlertRouteData: Attributes: type_ (PatchAlertRouteDataType): attributes (PatchAlertRouteDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: PatchAlertRouteDataType - attributes: "PatchAlertRouteDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: PatchAlertRouteDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = PatchAlertRouteDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + patch_alert_route_data = cls( type_=type_, attributes=attributes, + id=id, ) - patch_alert_route_data.additional_properties = d return patch_alert_route_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/patch_alert_route_data_attributes.py b/rootly_sdk/models/patch_alert_route_data_attributes.py index 7ce0b72e..b6dde929 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -17,39 +19,39 @@ class PatchAlertRouteDataAttributes: """ Attributes: - 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): 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: 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 + 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 def to_dict(self) -> dict[str, Any]: name = self.name enabled = self.enabled - alerts_source_ids: Unset | list[str] = UNSET + alerts_source_ids: list[str] | Unset = 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: Unset | list[str] = UNSET + owning_team_ids: list[str] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + rules: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -81,26 +83,32 @@ 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) - for alerts_source_ids_item_data in _alerts_source_ids or []: - alerts_source_ids_item = UUID(alerts_source_ids_item_data) + 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) - 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) - for owning_team_ids_item_data in _owning_team_ids or []: - owning_team_ids_item = UUID(owning_team_ids_item_data) + 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) - owning_team_ids.append(owning_team_ids_item) + owning_team_ids.append(owning_team_ids_item) - rules = [] _rules = d.pop("rules", UNSET) - for rules_item_data in _rules or []: - rules_item = PatchAlertRouteDataAttributesRulesItem.from_dict(rules_item_data) + 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) - 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 0a3db1c0..bb7e615e 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,9 +1,10 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -23,26 +24,25 @@ class PatchAlertRouteDataAttributesRulesItem: """ Attributes: - 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): 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: 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) + 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 def to_dict(self) -> dict[str, Any]: - id: Unset | str = UNSET + id: str | Unset = UNSET if not isinstance(self.id, Unset): id = str(self.id) @@ -54,14 +54,14 @@ def to_dict(self) -> dict[str, Any]: fallback_rule = self.fallback_rule - destinations: Unset | list[dict[str, Any]] = UNSET + destinations: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + condition_groups: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.condition_groups, Unset): condition_groups = [] for condition_groups_item_data in self.condition_groups: @@ -69,7 +69,7 @@ def to_dict(self) -> dict[str, Any]: condition_groups.append(condition_groups_item) field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if id is not UNSET: field_dict["id"] = id @@ -99,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: Unset | UUID + id: UUID | Unset if isinstance(_id, Unset): id = UNSET else: @@ -113,21 +113,27 @@ 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) - for destinations_item_data in _destinations or []: - destinations_item = PatchAlertRouteDataAttributesRulesItemDestinationsItem.from_dict(destinations_item_data) + 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 + ) - destinations.append(destinations_item) + destinations.append(destinations_item) - condition_groups = [] _condition_groups = d.pop("condition_groups", UNSET) - for condition_groups_item_data in _condition_groups or []: - condition_groups_item = PatchAlertRouteDataAttributesRulesItemConditionGroupsItem.from_dict( - condition_groups_item_data - ) + 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 + ) - condition_groups.append(condition_groups_item) + condition_groups.append(condition_groups_item) patch_alert_route_data_attributes_rules_item = cls( id=id, @@ -139,21 +145,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: condition_groups=condition_groups, ) - patch_alert_route_data_attributes_rules_item.additional_properties = d return patch_alert_route_data_attributes_rules_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/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 e7c6bfbb..613ad250 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,9 +1,10 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -20,21 +21,19 @@ class PatchAlertRouteDataAttributesRulesItemConditionGroupsItem: """ Attributes: - 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): 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: 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) + id: UUID | Unset = UNSET + field_destroy: bool | Unset = UNSET + position: int | Unset = UNSET + conditions: list[PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem] | Unset = UNSET def to_dict(self) -> dict[str, Any]: - id: Unset | str = UNSET + id: str | Unset = UNSET if not isinstance(self.id, Unset): id = str(self.id) @@ -42,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position - conditions: Unset | list[dict[str, Any]] = UNSET + conditions: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -50,7 +49,7 @@ def to_dict(self) -> dict[str, Any]: conditions.append(conditions_item) field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if id is not UNSET: field_dict["id"] = id @@ -71,7 +70,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _id = d.pop("id", UNSET) - id: Unset | UUID + id: UUID | Unset if isinstance(_id, Unset): id = UNSET else: @@ -81,14 +80,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position", UNSET) - conditions = [] _conditions = d.pop("conditions", UNSET) - for conditions_item_data in _conditions or []: - conditions_item = PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem.from_dict( - conditions_item_data - ) + 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 + ) - conditions.append(conditions_item) + conditions.append(conditions_item) patch_alert_route_data_attributes_rules_item_condition_groups_item = cls( id=id, @@ -97,21 +98,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: conditions=conditions, ) - patch_alert_route_data_attributes_rules_item_condition_groups_item.additional_properties = d return patch_alert_route_data_attributes_rules_item_condition_groups_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/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 0c6a94c1..6484ef84 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,9 +1,10 @@ +from __future__ import annotations + 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.patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_conditionable_type import ( PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType, @@ -26,64 +27,62 @@ class PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem: """ Attributes: - 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): 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: Unset | UUID = UNSET - field_destroy: Unset | bool = UNSET + id: UUID | Unset = UNSET + field_destroy: bool | Unset = UNSET property_field_condition_type: ( - Unset | PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType + PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType | Unset ) = UNSET - property_field_name: Unset | str = UNSET + property_field_name: str | Unset = UNSET property_field_type: ( - Unset | PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType + PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType | 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 + 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: ( - Unset | PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType + PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | Unset ) = UNSET - conditionable_id: None | UUID | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + conditionable_id: None | Unset | UUID = UNSET def to_dict(self) -> dict[str, Any]: - id: Unset | str = UNSET + id: str | Unset = UNSET if not isinstance(self.id, Unset): id = str(self.id) field_destroy = self.field_destroy - property_field_condition_type: Unset | str = UNSET + property_field_condition_type: str | Unset = 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: Unset | str = UNSET + property_field_type: str | Unset = UNSET if not isinstance(self.property_field_type, Unset): property_field_type = self.property_field_type - property_field_value: None | Unset | str + property_field_value: None | str | Unset if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: None | Unset | list[str] + property_field_values: list[str] | None | Unset if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -92,7 +91,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - alert_urgency_ids: None | Unset | list[str] + alert_urgency_ids: list[str] | None | Unset if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -101,11 +100,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: Unset | str = UNSET + conditionable_type: str | Unset = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | Unset | str + conditionable_id: None | str | Unset if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -114,7 +113,7 @@ def to_dict(self) -> dict[str, Any]: conditionable_id = self.conditionable_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if id is not UNSET: field_dict["id"] = id @@ -143,7 +142,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: Unset | UUID + id: UUID | Unset if isinstance(_id, Unset): id = UNSET else: @@ -153,7 +152,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: ( - Unset | PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType + PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType | Unset ) if isinstance(_property_field_condition_type, Unset): property_field_condition_type = UNSET @@ -166,7 +165,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: ( - Unset | PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType + PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType | Unset ) if isinstance(_property_field_type, Unset): property_field_type = UNSET @@ -175,16 +174,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _property_field_type ) - def _parse_property_field_value(data: object) -> None | Unset | str: + def _parse_property_field_value(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> None | Unset | list[str]: + def _parse_property_field_values(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -195,13 +194,13 @@ def _parse_property_field_values(data: object) -> None | Unset | list[str]: property_field_values_type_0 = cast(list[str], data) return property_field_values_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: + def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -212,15 +211,15 @@ def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) conditionable_type: ( - Unset | PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType + PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | Unset ) if isinstance(_conditionable_type, Unset): conditionable_type = UNSET @@ -229,7 +228,7 @@ def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | UUID | Unset: + def _parse_conditionable_id(data: object) -> None | Unset | UUID: if data is None: return data if isinstance(data, Unset): @@ -240,9 +239,9 @@ def _parse_conditionable_id(data: object) -> None | UUID | Unset: conditionable_id_type_0 = UUID(data) return conditionable_id_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | UUID | Unset, data) + return cast(None | Unset | UUID, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) @@ -259,21 +258,4 @@ def _parse_conditionable_id(data: object) -> None | UUID | Unset: conditionable_id=conditionable_id, ) - patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.additional_properties = d return patch_alert_route_data_attributes_rules_item_condition_groups_item_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/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_conditionable_type.py b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_conditionable_type.py index 57510b98..ce00aa5c 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_conditionable_type.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_conditionable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType = Literal["AlertField"] @@ -18,7 +18,7 @@ def check_patch_alert_route_data_attributes_rules_item_condition_groups_item_con value in PATCH_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES ): - return cast(PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {PATCH_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_condition_type.py b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_condition_type.py index ef52b464..168f21e4 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_condition_type.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType = Literal[ "contains", @@ -34,9 +34,7 @@ def check_patch_alert_route_data_attributes_rules_item_condition_groups_item_con value in PATCH_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES ): - return cast( - PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType, value - ) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {PATCH_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_type.py b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_type.py index b5537b75..957e5621 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_type.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType = Literal[ "alert_field", "attribute", "payload" @@ -22,7 +22,7 @@ def check_patch_alert_route_data_attributes_rules_item_condition_groups_item_con value in PATCH_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES ): - return cast(PatchAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {PATCH_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES!r}" ) 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 f9641168..4631791d 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,9 +1,10 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.patch_alert_route_data_attributes_rules_item_destinations_item_target_type import ( PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType, @@ -18,36 +19,35 @@ class PatchAlertRouteDataAttributesRulesItemDestinationsItem: """ Attributes: - 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): 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: 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) + id: UUID | Unset = UNSET + field_destroy: bool | Unset = UNSET + target_type: PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType | Unset = UNSET + target_id: UUID | Unset = UNSET def to_dict(self) -> dict[str, Any]: - id: Unset | str = UNSET + id: str | Unset = UNSET if not isinstance(self.id, Unset): id = str(self.id) field_destroy = self.field_destroy - target_type: Unset | str = UNSET + target_type: str | Unset = UNSET if not isinstance(self.target_type, Unset): target_type = self.target_type - target_id: Unset | str = UNSET + target_id: str | Unset = UNSET if not isinstance(self.target_id, Unset): target_id = str(self.target_id) field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if id is not UNSET: field_dict["id"] = id @@ -64,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: Unset | UUID + id: UUID | Unset if isinstance(_id, Unset): id = UNSET else: @@ -73,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: Unset | PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType + target_type: PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType | Unset 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: Unset | UUID + target_id: UUID | Unset if isinstance(_target_id, Unset): target_id = UNSET else: @@ -93,21 +93,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: target_id=target_id, ) - patch_alert_route_data_attributes_rules_item_destinations_item.additional_properties = d return patch_alert_route_data_attributes_rules_item_destinations_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/patch_alert_route_data_attributes_rules_item_destinations_item_target_type.py b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_destinations_item_target_type.py index 92792abd..d322d0c9 100644 --- a/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_destinations_item_target_type.py +++ b/rootly_sdk/models/patch_alert_route_data_attributes_rules_item_destinations_item_target_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType = Literal[ "EscalationPolicy", "Functionality", "Group", "Service" @@ -20,7 +20,7 @@ def check_patch_alert_route_data_attributes_rules_item_destinations_item_target_ if value is None: return None if value in PATCH_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_DESTINATIONS_ITEM_TARGET_TYPE_VALUES: - return cast(PatchAlertRouteDataAttributesRulesItemDestinationsItemTargetType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {PATCH_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_DESTINATIONS_ITEM_TARGET_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/patch_alert_route_data_type.py b/rootly_sdk/models/patch_alert_route_data_type.py index 5f739b44..7118864d 100644 --- a/rootly_sdk/models/patch_alert_route_data_type.py +++ b/rootly_sdk/models/patch_alert_route_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PatchAlertRouteDataType = Literal["alert_routes"] @@ -11,5 +11,5 @@ def check_patch_alert_route_data_type(value: str | None) -> PatchAlertRouteDataT if value is None: return None if value in PATCH_ALERT_ROUTE_DATA_TYPE_VALUES: - return cast(PatchAlertRouteDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {PATCH_ALERT_ROUTE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/phone_verification_response.py b/rootly_sdk/models/phone_verification_response.py index f04e1cf3..636cfa5a 100644 --- a/rootly_sdk/models/phone_verification_response.py +++ b/rootly_sdk/models/phone_verification_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class PhoneVerificationResponse: """ Attributes: - message (Union[Unset, str]): Success message - error (Union[Unset, str]): Error message + message (str | Unset): Success message + error (str | Unset): Error message """ - message: Unset | str = UNSET - error: Unset | str = UNSET + message: str | Unset = UNSET + error: str | Unset = UNSET 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 a2d1dac4..570932a9 100644 --- a/rootly_sdk/models/playbook.py +++ b/rootly_sdk/models/playbook.py @@ -1,9 +1,12 @@ +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.playbook_kind import PlaybookKind, check_playbook_kind from ..types import UNSET, Unset T = TypeVar("T", bound="Playbook") @@ -16,27 +19,35 @@ class Playbook: title (str): The title of the playbook created_at (str): Date of creation updated_at (str): Date of last update - 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 + summary (None | str | Unset): The summary of the playbook + kind (PlaybookKind | Unset): Whether the playbook body lives in Rootly (`internal_document`) or at an external + link (`external_url`). + content (None | str | Unset): Sanitized HTML instructions. Still returned when `kind` is `external_url`, where + the body may be stale — branch on `kind`, not on `content` being present. + 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 + cause_ids (list[str] | None | Unset): The Cause IDs to attach to the incident """ title: str created_at: str updated_at: str - 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 + summary: None | str | Unset = UNSET + kind: PlaybookKind | Unset = UNSET + content: 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 + cause_ids: list[str] | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,19 +57,29 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - summary: None | Unset | str + summary: None | str | Unset if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - external_url: None | Unset | str + kind: str | Unset = UNSET + if not isinstance(self.kind, Unset): + kind = self.kind + + content: None | str | Unset + if isinstance(self.content, Unset): + content = UNSET + else: + content = self.content + + external_url: None | str | Unset if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - severity_ids: None | Unset | list[str] + severity_ids: list[str] | None | Unset if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -67,7 +88,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - environment_ids: None | Unset | list[str] + environment_ids: list[str] | None | Unset if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -76,7 +97,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - functionality_ids: None | Unset | list[str] + functionality_ids: list[str] | None | Unset if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -85,7 +106,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -94,7 +115,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - group_ids: None | Unset | list[str] + group_ids: list[str] | None | Unset if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -103,7 +124,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: None | Unset | list[str] + incident_type_ids: list[str] | None | Unset if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -112,6 +133,15 @@ def to_dict(self) -> dict[str, Any]: else: incident_type_ids = self.incident_type_ids + cause_ids: list[str] | None | Unset + if isinstance(self.cause_ids, Unset): + cause_ids = UNSET + elif isinstance(self.cause_ids, list): + cause_ids = self.cause_ids + + else: + cause_ids = self.cause_ids + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -123,6 +153,10 @@ def to_dict(self) -> dict[str, Any]: ) if summary is not UNSET: field_dict["summary"] = summary + if kind is not UNSET: + field_dict["kind"] = kind + if content is not UNSET: + field_dict["content"] = content if external_url is not UNSET: field_dict["external_url"] = external_url if severity_ids is not UNSET: @@ -137,6 +171,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["group_ids"] = group_ids if incident_type_ids is not UNSET: field_dict["incident_type_ids"] = incident_type_ids + if cause_ids is not UNSET: + field_dict["cause_ids"] = cause_ids return field_dict @@ -149,25 +185,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_summary(data: object) -> None | Unset | str: + def _parse_summary(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_external_url(data: object) -> None | Unset | str: + _kind = d.pop("kind", UNSET) + kind: PlaybookKind | Unset + if isinstance(_kind, Unset): + kind = UNSET + else: + kind = check_playbook_kind(_kind) + + def _parse_content(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + content = _parse_content(d.pop("content", UNSET)) + + def _parse_external_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_severity_ids(data: object) -> None | Unset | list[str]: + def _parse_severity_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -178,13 +230,13 @@ def _parse_severity_ids(data: object) -> None | Unset | list[str]: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_environment_ids(data: object) -> None | Unset | list[str]: + def _parse_environment_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -195,13 +247,13 @@ def _parse_environment_ids(data: object) -> None | Unset | list[str]: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_functionality_ids(data: object) -> None | Unset | list[str]: + def _parse_functionality_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -212,13 +264,13 @@ def _parse_functionality_ids(data: object) -> None | Unset | list[str]: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -229,13 +281,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_group_ids(data: object) -> None | Unset | list[str]: + def _parse_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -246,13 +298,13 @@ def _parse_group_ids(data: object) -> None | Unset | list[str]: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: + def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -263,17 +315,36 @@ def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) + def _parse_cause_ids(data: object) -> list[str] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + cause_ids_type_0 = cast(list[str], data) + + return cause_ids_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[str] | None | Unset, data) + + cause_ids = _parse_cause_ids(d.pop("cause_ids", UNSET)) + playbook = cls( title=title, created_at=created_at, updated_at=updated_at, summary=summary, + kind=kind, + content=content, external_url=external_url, severity_ids=severity_ids, environment_ids=environment_ids, @@ -281,6 +352,7 @@ def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: service_ids=service_ids, group_ids=group_ids, incident_type_ids=incident_type_ids, + cause_ids=cause_ids, ) playbook.additional_properties = d diff --git a/rootly_sdk/models/playbook_kind.py b/rootly_sdk/models/playbook_kind.py new file mode 100644 index 00000000..d70cf55c --- /dev/null +++ b/rootly_sdk/models/playbook_kind.py @@ -0,0 +1,16 @@ +from typing import Literal + +PlaybookKind = Literal["external_url", "internal_document"] + +PLAYBOOK_KIND_VALUES: set[PlaybookKind] = { + "external_url", + "internal_document", +} + + +def check_playbook_kind(value: str | None) -> PlaybookKind | None: + if value is None: + return None + if value in PLAYBOOK_KIND_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PLAYBOOK_KIND_VALUES!r}") diff --git a/rootly_sdk/models/playbook_list.py b/rootly_sdk/models/playbook_list.py index 9c4e42b7..bcb5fcf1 100644 --- a/rootly_sdk/models/playbook_list.py +++ b/rootly_sdk/models/playbook_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class PlaybookList: """ Attributes: - data (list['PlaybookListDataItem']): + data (list[PlaybookListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["PlaybookListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[PlaybookListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 049aef9b..598e3cdc 100644 --- a/rootly_sdk/models/playbook_list_data_item.py +++ b/rootly_sdk/models/playbook_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/playbook_list_data_item_type.py b/rootly_sdk/models/playbook_list_data_item_type.py index 0ea61959..974b3a41 100644 --- a/rootly_sdk/models/playbook_list_data_item_type.py +++ b/rootly_sdk/models/playbook_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PlaybookListDataItemType = Literal["playbooks"] @@ -11,5 +11,5 @@ def check_playbook_list_data_item_type(value: str | None) -> PlaybookListDataIte if value is None: return None if value in PLAYBOOK_LIST_DATA_ITEM_TYPE_VALUES: - return cast(PlaybookListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {PLAYBOOK_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/playbook_response.py b/rootly_sdk/models/playbook_response.py index 55dcfd53..59027cbb 100644 --- a/rootly_sdk/models/playbook_response.py +++ b/rootly_sdk/models/playbook_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class PlaybookResponse: """ Attributes: data (PlaybookResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "PlaybookResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: PlaybookResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 4ef6997f..b559f9f7 100644 --- a/rootly_sdk/models/playbook_response_data.py +++ b/rootly_sdk/models/playbook_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/playbook_response_data_type.py b/rootly_sdk/models/playbook_response_data_type.py index c7eae691..0f76b536 100644 --- a/rootly_sdk/models/playbook_response_data_type.py +++ b/rootly_sdk/models/playbook_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PlaybookResponseDataType = Literal["playbooks"] @@ -11,5 +11,5 @@ def check_playbook_response_data_type(value: str | None) -> PlaybookResponseData if value is None: return None if value in PLAYBOOK_RESPONSE_DATA_TYPE_VALUES: - return cast(PlaybookResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {PLAYBOOK_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/playbook_task.py b/rootly_sdk/models/playbook_task.py index 3aad84ad..401f39aa 100644 --- a/rootly_sdk/models/playbook_task.py +++ b/rootly_sdk/models/playbook_task.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,17 +18,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 (Union[Unset, str]): - description (Union[None, Unset, str]): The description of task - position (Union[None, Unset, int]): The position of the task + playbook_id (str | Unset): + description (None | str | Unset): The description of task + position (int | None | Unset): The position of the task """ task: str created_at: str updated_at: str - playbook_id: Unset | str = UNSET - description: None | Unset | str = UNSET - position: None | Unset | int = UNSET + playbook_id: str | Unset = UNSET + description: None | str | Unset = UNSET + position: int | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,13 +40,13 @@ def to_dict(self) -> dict[str, Any]: playbook_id = self.playbook_id - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -79,21 +81,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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 e93328d3..1ad8e817 100644 --- a/rootly_sdk/models/playbook_task_list.py +++ b/rootly_sdk/models/playbook_task_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class PlaybookTaskList: """ Attributes: - data (list['PlaybookTaskListDataItem']): + data (list[PlaybookTaskListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["PlaybookTaskListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[PlaybookTaskListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 8a7fac55..9c529ab0 100644 --- a/rootly_sdk/models/playbook_task_list_data_item.py +++ b/rootly_sdk/models/playbook_task_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/playbook_task_list_data_item_type.py b/rootly_sdk/models/playbook_task_list_data_item_type.py index c5e3b5c9..85702bdb 100644 --- a/rootly_sdk/models/playbook_task_list_data_item_type.py +++ b/rootly_sdk/models/playbook_task_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PlaybookTaskListDataItemType = Literal["playbook_tasks"] @@ -11,5 +11,5 @@ def check_playbook_task_list_data_item_type(value: str | None) -> PlaybookTaskLi if value is None: return None if value in PLAYBOOK_TASK_LIST_DATA_ITEM_TYPE_VALUES: - return cast(PlaybookTaskListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {PLAYBOOK_TASK_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/playbook_task_response.py b/rootly_sdk/models/playbook_task_response.py index 7ce3df22..c4163dbc 100644 --- a/rootly_sdk/models/playbook_task_response.py +++ b/rootly_sdk/models/playbook_task_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class PlaybookTaskResponse: """ Attributes: data (PlaybookTaskResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "PlaybookTaskResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: PlaybookTaskResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 7ec717a0..3cb5185c 100644 --- a/rootly_sdk/models/playbook_task_response_data.py +++ b/rootly_sdk/models/playbook_task_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/playbook_task_response_data_type.py b/rootly_sdk/models/playbook_task_response_data_type.py index 4a656cbe..d7bbf168 100644 --- a/rootly_sdk/models/playbook_task_response_data_type.py +++ b/rootly_sdk/models/playbook_task_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PlaybookTaskResponseDataType = Literal["playbook_tasks"] @@ -11,5 +11,5 @@ def check_playbook_task_response_data_type(value: str | None) -> PlaybookTaskRes if value is None: return None if value in PLAYBOOK_TASK_RESPONSE_DATA_TYPE_VALUES: - return cast(PlaybookTaskResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {PLAYBOOK_TASK_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/post_mortem_template.py b/rootly_sdk/models/post_mortem_template.py index 48bfd505..175b93d9 100644 --- a/rootly_sdk/models/post_mortem_template.py +++ b/rootly_sdk/models/post_mortem_template.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,25 +23,24 @@ class PostMortemTemplate: name (str): The name of the postmortem template created_at (str): Date of creation updated_at (str): Date of last update - 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 + 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 """ name: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -53,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - default: None | Unset | bool + default: bool | None | Unset if isinstance(self.default, Unset): default = UNSET else: @@ -61,13 +62,13 @@ def to_dict(self) -> dict[str, Any]: content = self.content - content_html: None | Unset | str + content_html: None | str | Unset if isinstance(self.content_html, Unset): content_html = UNSET else: content_html = self.content_html - content_json: None | Unset | dict[str, Any] + content_json: dict[str, Any] | None | Unset if isinstance(self.content_json, Unset): content_json = UNSET elif isinstance(self.content_json, PostMortemTemplateContentJsonType0): @@ -75,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: content_json = self.content_json - format_: Unset | str = UNSET + format_: str | Unset = UNSET if not isinstance(self.format_, Unset): format_ = self.format_ @@ -116,27 +117,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_default(data: object) -> None | Unset | bool: + def _parse_default(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) default = _parse_default(d.pop("default", UNSET)) content = d.pop("content", UNSET) - def _parse_content_html(data: object) -> None | Unset | str: + def _parse_content_html(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) content_html = _parse_content_html(d.pop("content_html", UNSET)) - def _parse_content_json(data: object) -> Union["PostMortemTemplateContentJsonType0", None, Unset]: + def _parse_content_json(data: object) -> None | PostMortemTemplateContentJsonType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -147,14 +148,14 @@ def _parse_content_json(data: object) -> Union["PostMortemTemplateContentJsonTyp content_json_type_0 = PostMortemTemplateContentJsonType0.from_dict(data) return content_json_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["PostMortemTemplateContentJsonType0", None, Unset], data) + return cast(None | PostMortemTemplateContentJsonType0 | Unset, data) content_json = _parse_content_json(d.pop("content_json", UNSET)) _format_ = d.pop("format", UNSET) - format_: Unset | PostMortemTemplateFormat + format_: PostMortemTemplateFormat | Unset 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 0670aad3..0375e77a 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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_format.py b/rootly_sdk/models/post_mortem_template_format.py index e6876a43..41297e36 100644 --- a/rootly_sdk/models/post_mortem_template_format.py +++ b/rootly_sdk/models/post_mortem_template_format.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTemplateFormat = Literal["html", "markdown"] @@ -12,5 +12,5 @@ def check_post_mortem_template_format(value: str | None) -> PostMortemTemplateFo if value is None: return None if value in POST_MORTEM_TEMPLATE_FORMAT_VALUES: - return cast(PostMortemTemplateFormat, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TEMPLATE_FORMAT_VALUES!r}") diff --git a/rootly_sdk/models/post_mortem_template_list.py b/rootly_sdk/models/post_mortem_template_list.py index d8515f04..f43bf72c 100644 --- a/rootly_sdk/models/post_mortem_template_list.py +++ b/rootly_sdk/models/post_mortem_template_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class PostMortemTemplateList: """ Attributes: - data (list['PostMortemTemplateListDataItem']): + data (list[PostMortemTemplateListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["PostMortemTemplateListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[PostMortemTemplateListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 7bd5a785..e3823d0d 100644 --- a/rootly_sdk/models/post_mortem_template_list_data_item.py +++ b/rootly_sdk/models/post_mortem_template_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/post_mortem_template_list_data_item_type.py b/rootly_sdk/models/post_mortem_template_list_data_item_type.py index 57555fc3..1ec8e98e 100644 --- a/rootly_sdk/models/post_mortem_template_list_data_item_type.py +++ b/rootly_sdk/models/post_mortem_template_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTemplateListDataItemType = Literal["post_mortem_templates"] @@ -11,5 +11,5 @@ def check_post_mortem_template_list_data_item_type(value: str | None) -> PostMor if value is None: return None if value in POST_MORTEM_TEMPLATE_LIST_DATA_ITEM_TYPE_VALUES: - return cast(PostMortemTemplateListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TEMPLATE_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/post_mortem_template_response.py b/rootly_sdk/models/post_mortem_template_response.py index fe5da9dd..c3eb402b 100644 --- a/rootly_sdk/models/post_mortem_template_response.py +++ b/rootly_sdk/models/post_mortem_template_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class PostMortemTemplateResponse: """ Attributes: data (PostMortemTemplateResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "PostMortemTemplateResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: PostMortemTemplateResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 c9c97e69..4e622ebb 100644 --- a/rootly_sdk/models/post_mortem_template_response_data.py +++ b/rootly_sdk/models/post_mortem_template_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/post_mortem_template_response_data_type.py b/rootly_sdk/models/post_mortem_template_response_data_type.py index a274d275..c66c1d44 100644 --- a/rootly_sdk/models/post_mortem_template_response_data_type.py +++ b/rootly_sdk/models/post_mortem_template_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTemplateResponseDataType = Literal["post_mortem_templates"] @@ -11,5 +11,5 @@ def check_post_mortem_template_response_data_type(value: str | None) -> PostMort if value is None: return None if value in POST_MORTEM_TEMPLATE_RESPONSE_DATA_TYPE_VALUES: - return cast(PostMortemTemplateResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TEMPLATE_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/post_mortem_trigger_params.py b/rootly_sdk/models/post_mortem_trigger_params.py index 0abd7368..c4a6a519 100644 --- a/rootly_sdk/models/post_mortem_trigger_params.py +++ b/rootly_sdk/models/post_mortem_trigger_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -56,6 +58,14 @@ PostMortemTriggerParamsIncidentConditionResolvedAt, check_post_mortem_trigger_params_incident_condition_resolved_at, ) +from ..models.post_mortem_trigger_params_incident_condition_scheduled_for import ( + PostMortemTriggerParamsIncidentConditionScheduledFor, + check_post_mortem_trigger_params_incident_condition_scheduled_for, +) +from ..models.post_mortem_trigger_params_incident_condition_scheduled_until import ( + PostMortemTriggerParamsIncidentConditionScheduledUntil, + check_post_mortem_trigger_params_incident_condition_scheduled_until, +) from ..models.post_mortem_trigger_params_incident_condition_service import ( PostMortemTriggerParamsIncidentConditionService, check_post_mortem_trigger_params_incident_condition_service, @@ -126,217 +136,226 @@ class PostMortemTriggerParams: """ Attributes: trigger_type (PostMortemTriggerParamsTriggerType): - 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: + 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: '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: + incident_condition_incident_roles (PostMortemTriggerParamsIncidentConditionIncidentRoles | Unset): Default: 'ANY'. - incident_condition_environment (Union[Unset, PostMortemTriggerParamsIncidentConditionEnvironment]): Default: + incident_condition_service (PostMortemTriggerParamsIncidentConditionService | Unset): Default: 'ANY'. + incident_condition_functionality (PostMortemTriggerParamsIncidentConditionFunctionality | Unset): Default: 'ANY'. - incident_condition_severity (Union[Unset, PostMortemTriggerParamsIncidentConditionSeverity]): Default: 'ANY'. - incident_condition_incident_type (Union[Unset, PostMortemTriggerParamsIncidentConditionIncidentType]): Default: - 'ANY'. - 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]): + 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): [DEPRECATED] Use incident_condition_cause instead Default: 'ANY'. - 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]): + 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_condition_scheduled_for (PostMortemTriggerParamsIncidentConditionScheduledFor | Unset): + incident_condition_scheduled_until (PostMortemTriggerParamsIncidentConditionScheduledUntil | Unset): + incident_conditional_inactivity (PostMortemTriggerParamsIncidentConditionalInactivity | Unset): + incident_post_mortem_condition (PostMortemTriggerParamsIncidentPostMortemCondition | Unset): + incident_post_mortem_condition_status (PostMortemTriggerParamsIncidentPostMortemConditionStatus | Unset): Default: 'ANY'. - incident_post_mortem_statuses (Union[Unset, list[PostMortemTriggerParamsIncidentPostMortemStatusesItem]]): + incident_post_mortem_statuses (list[PostMortemTriggerParamsIncidentPostMortemStatusesItem] | Unset): """ trigger_type: PostMortemTriggerParamsTriggerType - 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 + 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_condition_scheduled_for: PostMortemTriggerParamsIncidentConditionScheduledFor | Unset = UNSET + incident_condition_scheduled_until: PostMortemTriggerParamsIncidentConditionScheduledUntil | 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 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: Unset | list[str] = UNSET + triggers: list[str] | Unset = UNSET if not isinstance(self.triggers, Unset): triggers = self.triggers - incident_visibilities: Unset | list[bool] = UNSET + incident_visibilities: list[bool] | Unset = UNSET if not isinstance(self.incident_visibilities, Unset): incident_visibilities = self.incident_visibilities - incident_kinds: Unset | list[str] = UNSET + incident_kinds: list[str] | Unset = 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: Unset | list[str] = UNSET + incident_statuses: list[str] | Unset = 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 | Unset | str + incident_inactivity_duration: None | str | Unset if isinstance(self.incident_inactivity_duration, Unset): incident_inactivity_duration = UNSET else: incident_inactivity_duration = self.incident_inactivity_duration - incident_condition: Unset | str = UNSET + incident_condition: str | Unset = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - incident_condition_visibility: Unset | str = UNSET + incident_condition_visibility: str | Unset = UNSET if not isinstance(self.incident_condition_visibility, Unset): incident_condition_visibility = self.incident_condition_visibility - incident_condition_kind: Unset | str = UNSET + incident_condition_kind: str | Unset = UNSET if not isinstance(self.incident_condition_kind, Unset): incident_condition_kind = self.incident_condition_kind - incident_condition_status: Unset | str = UNSET + incident_condition_status: str | Unset = UNSET if not isinstance(self.incident_condition_status, Unset): incident_condition_status = self.incident_condition_status - incident_condition_sub_status: Unset | str = UNSET + incident_condition_sub_status: str | Unset = UNSET if not isinstance(self.incident_condition_sub_status, Unset): incident_condition_sub_status = self.incident_condition_sub_status - incident_condition_environment: Unset | str = UNSET + incident_condition_environment: str | Unset = UNSET if not isinstance(self.incident_condition_environment, Unset): incident_condition_environment = self.incident_condition_environment - incident_condition_severity: Unset | str = UNSET + incident_condition_severity: str | Unset = UNSET if not isinstance(self.incident_condition_severity, Unset): incident_condition_severity = self.incident_condition_severity - incident_condition_incident_type: Unset | str = UNSET + incident_condition_incident_type: str | Unset = UNSET if not isinstance(self.incident_condition_incident_type, Unset): incident_condition_incident_type = self.incident_condition_incident_type - incident_condition_incident_roles: Unset | str = UNSET + incident_condition_incident_roles: str | Unset = UNSET if not isinstance(self.incident_condition_incident_roles, Unset): incident_condition_incident_roles = self.incident_condition_incident_roles - incident_condition_service: Unset | str = UNSET + incident_condition_service: str | Unset = UNSET if not isinstance(self.incident_condition_service, Unset): incident_condition_service = self.incident_condition_service - incident_condition_functionality: Unset | str = UNSET + incident_condition_functionality: str | Unset = UNSET if not isinstance(self.incident_condition_functionality, Unset): incident_condition_functionality = self.incident_condition_functionality - incident_condition_group: Unset | str = UNSET + incident_condition_group: str | Unset = UNSET if not isinstance(self.incident_condition_group, Unset): incident_condition_group = self.incident_condition_group - incident_condition_cause: Unset | str = UNSET + incident_condition_cause: str | Unset = UNSET if not isinstance(self.incident_condition_cause, Unset): incident_condition_cause = self.incident_condition_cause - incident_condition_label: Unset | str = UNSET + incident_condition_label: str | Unset = 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: Unset | list[str] = UNSET + incident_labels: list[str] | Unset = UNSET if not isinstance(self.incident_labels, Unset): incident_labels = self.incident_labels - incident_post_mortem_condition_cause: Unset | str = UNSET + incident_post_mortem_condition_cause: str | Unset = 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: Unset | str = UNSET + incident_condition_summary: str | Unset = UNSET if not isinstance(self.incident_condition_summary, Unset): incident_condition_summary = self.incident_condition_summary - incident_condition_started_at: Unset | str = UNSET + incident_condition_started_at: str | Unset = UNSET if not isinstance(self.incident_condition_started_at, Unset): incident_condition_started_at = self.incident_condition_started_at - incident_condition_detected_at: Unset | str = UNSET + incident_condition_detected_at: str | Unset = UNSET if not isinstance(self.incident_condition_detected_at, Unset): incident_condition_detected_at = self.incident_condition_detected_at - incident_condition_acknowledged_at: Unset | str = UNSET + incident_condition_acknowledged_at: str | Unset = UNSET if not isinstance(self.incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = self.incident_condition_acknowledged_at - incident_condition_mitigated_at: Unset | str = UNSET + incident_condition_mitigated_at: str | Unset = UNSET if not isinstance(self.incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = self.incident_condition_mitigated_at - incident_condition_resolved_at: Unset | str = UNSET + incident_condition_resolved_at: str | Unset = UNSET if not isinstance(self.incident_condition_resolved_at, Unset): incident_condition_resolved_at = self.incident_condition_resolved_at - incident_conditional_inactivity: Unset | str = UNSET + incident_condition_scheduled_for: str | Unset = UNSET + if not isinstance(self.incident_condition_scheduled_for, Unset): + incident_condition_scheduled_for = self.incident_condition_scheduled_for + + incident_condition_scheduled_until: str | Unset = UNSET + if not isinstance(self.incident_condition_scheduled_until, Unset): + incident_condition_scheduled_until = self.incident_condition_scheduled_until + + incident_conditional_inactivity: str | Unset = UNSET if not isinstance(self.incident_conditional_inactivity, Unset): incident_conditional_inactivity = self.incident_conditional_inactivity - incident_post_mortem_condition: Unset | str = UNSET + incident_post_mortem_condition: str | Unset = UNSET if not isinstance(self.incident_post_mortem_condition, Unset): incident_post_mortem_condition = self.incident_post_mortem_condition - incident_post_mortem_condition_status: Unset | str = UNSET + incident_post_mortem_condition_status: str | Unset = 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: Unset | list[str] = UNSET + incident_post_mortem_statuses: list[str] | Unset = 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: @@ -406,6 +425,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["incident_condition_mitigated_at"] = incident_condition_mitigated_at if incident_condition_resolved_at is not UNSET: field_dict["incident_condition_resolved_at"] = incident_condition_resolved_at + if incident_condition_scheduled_for is not UNSET: + field_dict["incident_condition_scheduled_for"] = incident_condition_scheduled_for + if incident_condition_scheduled_until is not UNSET: + field_dict["incident_condition_scheduled_until"] = incident_condition_scheduled_until if incident_conditional_inactivity is not UNSET: field_dict["incident_conditional_inactivity"] = incident_conditional_inactivity if incident_post_mortem_condition is not UNSET: @@ -426,40 +449,44 @@ 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) - 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: 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) - incident_kinds.append(incident_kinds_item) + incident_kinds.append(incident_kinds_item) - incident_statuses = [] _incident_statuses = d.pop("incident_statuses", UNSET) - 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: 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 + ) - incident_statuses.append(incident_statuses_item) + incident_statuses.append(incident_statuses_item) - def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: + def _parse_incident_inactivity_duration(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) incident_inactivity_duration = _parse_incident_inactivity_duration(d.pop("incident_inactivity_duration", UNSET)) _incident_condition = d.pop("incident_condition", UNSET) - incident_condition: Unset | PostMortemTriggerParamsIncidentCondition + incident_condition: PostMortemTriggerParamsIncidentCondition | Unset 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: Unset | PostMortemTriggerParamsIncidentConditionVisibility + incident_condition_visibility: PostMortemTriggerParamsIncidentConditionVisibility | Unset if isinstance(_incident_condition_visibility, Unset): incident_condition_visibility = UNSET else: @@ -468,14 +495,14 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_kind = d.pop("incident_condition_kind", UNSET) - incident_condition_kind: Unset | PostMortemTriggerParamsIncidentConditionKind + incident_condition_kind: PostMortemTriggerParamsIncidentConditionKind | Unset 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: Unset | PostMortemTriggerParamsIncidentConditionStatus + incident_condition_status: PostMortemTriggerParamsIncidentConditionStatus | Unset if isinstance(_incident_condition_status, Unset): incident_condition_status = UNSET else: @@ -484,7 +511,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_sub_status = d.pop("incident_condition_sub_status", UNSET) - incident_condition_sub_status: Unset | PostMortemTriggerParamsIncidentConditionSubStatus + incident_condition_sub_status: PostMortemTriggerParamsIncidentConditionSubStatus | Unset if isinstance(_incident_condition_sub_status, Unset): incident_condition_sub_status = UNSET else: @@ -493,7 +520,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_environment = d.pop("incident_condition_environment", UNSET) - incident_condition_environment: Unset | PostMortemTriggerParamsIncidentConditionEnvironment + incident_condition_environment: PostMortemTriggerParamsIncidentConditionEnvironment | Unset if isinstance(_incident_condition_environment, Unset): incident_condition_environment = UNSET else: @@ -502,7 +529,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_severity = d.pop("incident_condition_severity", UNSET) - incident_condition_severity: Unset | PostMortemTriggerParamsIncidentConditionSeverity + incident_condition_severity: PostMortemTriggerParamsIncidentConditionSeverity | Unset if isinstance(_incident_condition_severity, Unset): incident_condition_severity = UNSET else: @@ -511,7 +538,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_incident_type = d.pop("incident_condition_incident_type", UNSET) - incident_condition_incident_type: Unset | PostMortemTriggerParamsIncidentConditionIncidentType + incident_condition_incident_type: PostMortemTriggerParamsIncidentConditionIncidentType | Unset if isinstance(_incident_condition_incident_type, Unset): incident_condition_incident_type = UNSET else: @@ -520,7 +547,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_incident_roles = d.pop("incident_condition_incident_roles", UNSET) - incident_condition_incident_roles: Unset | PostMortemTriggerParamsIncidentConditionIncidentRoles + incident_condition_incident_roles: PostMortemTriggerParamsIncidentConditionIncidentRoles | Unset if isinstance(_incident_condition_incident_roles, Unset): incident_condition_incident_roles = UNSET else: @@ -529,7 +556,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_service = d.pop("incident_condition_service", UNSET) - incident_condition_service: Unset | PostMortemTriggerParamsIncidentConditionService + incident_condition_service: PostMortemTriggerParamsIncidentConditionService | Unset if isinstance(_incident_condition_service, Unset): incident_condition_service = UNSET else: @@ -538,7 +565,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_functionality = d.pop("incident_condition_functionality", UNSET) - incident_condition_functionality: Unset | PostMortemTriggerParamsIncidentConditionFunctionality + incident_condition_functionality: PostMortemTriggerParamsIncidentConditionFunctionality | Unset if isinstance(_incident_condition_functionality, Unset): incident_condition_functionality = UNSET else: @@ -547,7 +574,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_group = d.pop("incident_condition_group", UNSET) - incident_condition_group: Unset | PostMortemTriggerParamsIncidentConditionGroup + incident_condition_group: PostMortemTriggerParamsIncidentConditionGroup | Unset if isinstance(_incident_condition_group, Unset): incident_condition_group = UNSET else: @@ -556,7 +583,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_cause = d.pop("incident_condition_cause", UNSET) - incident_condition_cause: Unset | PostMortemTriggerParamsIncidentConditionCause + incident_condition_cause: PostMortemTriggerParamsIncidentConditionCause | Unset if isinstance(_incident_condition_cause, Unset): incident_condition_cause = UNSET else: @@ -565,7 +592,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_label = d.pop("incident_condition_label", UNSET) - incident_condition_label: Unset | PostMortemTriggerParamsIncidentConditionLabel + incident_condition_label: PostMortemTriggerParamsIncidentConditionLabel | Unset if isinstance(_incident_condition_label, Unset): incident_condition_label = UNSET else: @@ -578,7 +605,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: 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: Unset | PostMortemTriggerParamsIncidentPostMortemConditionCause + incident_post_mortem_condition_cause: PostMortemTriggerParamsIncidentPostMortemConditionCause | Unset if isinstance(_incident_post_mortem_condition_cause, Unset): incident_post_mortem_condition_cause = UNSET else: @@ -589,7 +616,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_summary = d.pop("incident_condition_summary", UNSET) - incident_condition_summary: Unset | PostMortemTriggerParamsIncidentConditionSummary + incident_condition_summary: PostMortemTriggerParamsIncidentConditionSummary | Unset if isinstance(_incident_condition_summary, Unset): incident_condition_summary = UNSET else: @@ -598,7 +625,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_started_at = d.pop("incident_condition_started_at", UNSET) - incident_condition_started_at: Unset | PostMortemTriggerParamsIncidentConditionStartedAt + incident_condition_started_at: PostMortemTriggerParamsIncidentConditionStartedAt | Unset if isinstance(_incident_condition_started_at, Unset): incident_condition_started_at = UNSET else: @@ -607,7 +634,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_detected_at = d.pop("incident_condition_detected_at", UNSET) - incident_condition_detected_at: Unset | PostMortemTriggerParamsIncidentConditionDetectedAt + incident_condition_detected_at: PostMortemTriggerParamsIncidentConditionDetectedAt | Unset if isinstance(_incident_condition_detected_at, Unset): incident_condition_detected_at = UNSET else: @@ -616,7 +643,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_acknowledged_at = d.pop("incident_condition_acknowledged_at", UNSET) - incident_condition_acknowledged_at: Unset | PostMortemTriggerParamsIncidentConditionAcknowledgedAt + incident_condition_acknowledged_at: PostMortemTriggerParamsIncidentConditionAcknowledgedAt | Unset if isinstance(_incident_condition_acknowledged_at, Unset): incident_condition_acknowledged_at = UNSET else: @@ -625,7 +652,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_mitigated_at = d.pop("incident_condition_mitigated_at", UNSET) - incident_condition_mitigated_at: Unset | PostMortemTriggerParamsIncidentConditionMitigatedAt + incident_condition_mitigated_at: PostMortemTriggerParamsIncidentConditionMitigatedAt | Unset if isinstance(_incident_condition_mitigated_at, Unset): incident_condition_mitigated_at = UNSET else: @@ -634,7 +661,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_condition_resolved_at = d.pop("incident_condition_resolved_at", UNSET) - incident_condition_resolved_at: Unset | PostMortemTriggerParamsIncidentConditionResolvedAt + incident_condition_resolved_at: PostMortemTriggerParamsIncidentConditionResolvedAt | Unset if isinstance(_incident_condition_resolved_at, Unset): incident_condition_resolved_at = UNSET else: @@ -642,8 +669,26 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: _incident_condition_resolved_at ) + _incident_condition_scheduled_for = d.pop("incident_condition_scheduled_for", UNSET) + incident_condition_scheduled_for: PostMortemTriggerParamsIncidentConditionScheduledFor | Unset + if isinstance(_incident_condition_scheduled_for, Unset): + incident_condition_scheduled_for = UNSET + else: + incident_condition_scheduled_for = check_post_mortem_trigger_params_incident_condition_scheduled_for( + _incident_condition_scheduled_for + ) + + _incident_condition_scheduled_until = d.pop("incident_condition_scheduled_until", UNSET) + incident_condition_scheduled_until: PostMortemTriggerParamsIncidentConditionScheduledUntil | Unset + if isinstance(_incident_condition_scheduled_until, Unset): + incident_condition_scheduled_until = UNSET + else: + incident_condition_scheduled_until = check_post_mortem_trigger_params_incident_condition_scheduled_until( + _incident_condition_scheduled_until + ) + _incident_conditional_inactivity = d.pop("incident_conditional_inactivity", UNSET) - incident_conditional_inactivity: Unset | PostMortemTriggerParamsIncidentConditionalInactivity + incident_conditional_inactivity: PostMortemTriggerParamsIncidentConditionalInactivity | Unset if isinstance(_incident_conditional_inactivity, Unset): incident_conditional_inactivity = UNSET else: @@ -652,7 +697,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_post_mortem_condition = d.pop("incident_post_mortem_condition", UNSET) - incident_post_mortem_condition: Unset | PostMortemTriggerParamsIncidentPostMortemCondition + incident_post_mortem_condition: PostMortemTriggerParamsIncidentPostMortemCondition | Unset if isinstance(_incident_post_mortem_condition, Unset): incident_post_mortem_condition = UNSET else: @@ -661,7 +706,7 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) _incident_post_mortem_condition_status = d.pop("incident_post_mortem_condition_status", UNSET) - incident_post_mortem_condition_status: Unset | PostMortemTriggerParamsIncidentPostMortemConditionStatus + incident_post_mortem_condition_status: PostMortemTriggerParamsIncidentPostMortemConditionStatus | Unset if isinstance(_incident_post_mortem_condition_status, Unset): incident_post_mortem_condition_status = UNSET else: @@ -671,14 +716,18 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: ) ) - incident_post_mortem_statuses = [] _incident_post_mortem_statuses = d.pop("incident_post_mortem_statuses", UNSET) - 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: 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 + ) + ) - 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, @@ -710,6 +759,8 @@ def _parse_incident_inactivity_duration(data: object) -> None | Unset | str: incident_condition_acknowledged_at=incident_condition_acknowledged_at, incident_condition_mitigated_at=incident_condition_mitigated_at, incident_condition_resolved_at=incident_condition_resolved_at, + incident_condition_scheduled_for=incident_condition_scheduled_for, + incident_condition_scheduled_until=incident_condition_scheduled_until, incident_conditional_inactivity=incident_conditional_inactivity, incident_post_mortem_condition=incident_post_mortem_condition, incident_post_mortem_condition_status=incident_post_mortem_condition_status, diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition.py index a4eb5099..d70e3943 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentCondition = Literal["ALL", "ANY", "NONE"] @@ -15,7 +15,7 @@ def check_post_mortem_trigger_params_incident_condition( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_VALUES: - return cast(PostMortemTriggerParamsIncidentCondition, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_acknowledged_at.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_acknowledged_at.py index 8e2e6426..c63e0e5f 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_acknowledged_at.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_acknowledged_at.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionAcknowledgedAt = Literal["SET", "UNSET"] @@ -16,7 +16,7 @@ def check_post_mortem_trigger_params_incident_condition_acknowledged_at( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_ACKNOWLEDGED_AT_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionAcknowledgedAt, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_ACKNOWLEDGED_AT_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_cause.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_cause.py index bdd3bd29..f086bb06 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_cause.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_cause.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionCause = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_post_mortem_trigger_params_incident_condition_cause( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_CAUSE_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionCause, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_CAUSE_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_detected_at.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_detected_at.py index f1118d2b..21fd8109 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_detected_at.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_detected_at.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionDetectedAt = Literal["SET", "UNSET"] @@ -16,7 +16,7 @@ def check_post_mortem_trigger_params_incident_condition_detected_at( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_DETECTED_AT_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionDetectedAt, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_DETECTED_AT_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_environment.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_environment.py index 1d2eaf62..87965a03 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_environment.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_environment.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionEnvironment = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_post_mortem_trigger_params_incident_condition_environment( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_ENVIRONMENT_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionEnvironment, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_ENVIRONMENT_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_functionality.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_functionality.py index 1394fb28..fb737187 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_functionality.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_functionality.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionFunctionality = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_post_mortem_trigger_params_incident_condition_functionality( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_FUNCTIONALITY_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionFunctionality, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_FUNCTIONALITY_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_group.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_group.py index f8ac0a60..480a9069 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_group.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_group.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionGroup = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_post_mortem_trigger_params_incident_condition_group( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_GROUP_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionGroup, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_GROUP_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_incident_roles.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_incident_roles.py index c738a6f0..9c74ffbf 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_incident_roles.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_incident_roles.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionIncidentRoles = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_post_mortem_trigger_params_incident_condition_incident_roles( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_INCIDENT_ROLES_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionIncidentRoles, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_INCIDENT_ROLES_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_incident_type.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_incident_type.py index 23c52d2b..187320f0 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_incident_type.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_incident_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionIncidentType = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_post_mortem_trigger_params_incident_condition_incident_type( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_INCIDENT_TYPE_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionIncidentType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_INCIDENT_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_kind.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_kind.py index 6308d90a..d1a39005 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_kind.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionKind = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_post_mortem_trigger_params_incident_condition_kind( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_KIND_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_label.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_label.py index 20d5d0a7..4f4de6f0 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_label.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_label.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionLabel = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_post_mortem_trigger_params_incident_condition_label( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_LABEL_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionLabel, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_LABEL_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_mitigated_at.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_mitigated_at.py index 0c8665b0..3faee649 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_mitigated_at.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_mitigated_at.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionMitigatedAt = Literal["SET", "UNSET"] @@ -16,7 +16,7 @@ def check_post_mortem_trigger_params_incident_condition_mitigated_at( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_MITIGATED_AT_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionMitigatedAt, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_MITIGATED_AT_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_resolved_at.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_resolved_at.py index 844afdf3..87fe8bee 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_resolved_at.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_resolved_at.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionResolvedAt = Literal["SET", "UNSET"] @@ -16,7 +16,7 @@ def check_post_mortem_trigger_params_incident_condition_resolved_at( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_RESOLVED_AT_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionResolvedAt, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_RESOLVED_AT_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_scheduled_for.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_scheduled_for.py new file mode 100644 index 00000000..6fa4724a --- /dev/null +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_scheduled_for.py @@ -0,0 +1,22 @@ +from typing import Literal + +PostMortemTriggerParamsIncidentConditionScheduledFor = Literal["SET", "UNSET"] + +POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SCHEDULED_FOR_VALUES: set[ + PostMortemTriggerParamsIncidentConditionScheduledFor +] = { + "SET", + "UNSET", +} + + +def check_post_mortem_trigger_params_incident_condition_scheduled_for( + value: str | None, +) -> PostMortemTriggerParamsIncidentConditionScheduledFor | None: + if value is None: + return None + if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SCHEDULED_FOR_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SCHEDULED_FOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_scheduled_until.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_scheduled_until.py new file mode 100644 index 00000000..fc3f4f83 --- /dev/null +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_scheduled_until.py @@ -0,0 +1,22 @@ +from typing import Literal + +PostMortemTriggerParamsIncidentConditionScheduledUntil = Literal["SET", "UNSET"] + +POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SCHEDULED_UNTIL_VALUES: set[ + PostMortemTriggerParamsIncidentConditionScheduledUntil +] = { + "SET", + "UNSET", +} + + +def check_post_mortem_trigger_params_incident_condition_scheduled_until( + value: str | None, +) -> PostMortemTriggerParamsIncidentConditionScheduledUntil | None: + if value is None: + return None + if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SCHEDULED_UNTIL_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SCHEDULED_UNTIL_VALUES!r}" + ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_service.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_service.py index 8cb59e45..06b0e9ba 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_service.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_service.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionService = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_post_mortem_trigger_params_incident_condition_service( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SERVICE_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionService, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SERVICE_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_severity.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_severity.py index fa4495e0..df53d189 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_severity.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_severity.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionSeverity = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_post_mortem_trigger_params_incident_condition_severity( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SEVERITY_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionSeverity, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SEVERITY_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_started_at.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_started_at.py index 6e5ef9f7..0d54f38c 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_started_at.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_started_at.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionStartedAt = Literal["SET", "UNSET"] @@ -16,7 +16,7 @@ def check_post_mortem_trigger_params_incident_condition_started_at( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_STARTED_AT_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionStartedAt, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_STARTED_AT_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_status.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_status.py index 0df81687..67095776 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_status.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionStatus = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_post_mortem_trigger_params_incident_condition_status( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_STATUS_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_sub_status.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_sub_status.py index b09d48a9..304ce437 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_sub_status.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_sub_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionSubStatus = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_post_mortem_trigger_params_incident_condition_sub_status( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SUB_STATUS_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionSubStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SUB_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_summary.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_summary.py index d3ffa58a..ff089417 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_summary.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_summary.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionSummary = Literal["SET", "UNSET"] @@ -14,7 +14,7 @@ def check_post_mortem_trigger_params_incident_condition_summary( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SUMMARY_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionSummary, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_SUMMARY_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_visibility.py b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_visibility.py index 35f0974f..cbaea88b 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_condition_visibility.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_condition_visibility.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionVisibility = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_post_mortem_trigger_params_incident_condition_visibility( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_VISIBILITY_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionVisibility, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITION_VISIBILITY_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_conditional_inactivity.py b/rootly_sdk/models/post_mortem_trigger_params_incident_conditional_inactivity.py index 22520d48..80df5297 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_conditional_inactivity.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_conditional_inactivity.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentConditionalInactivity = Literal["IS"] @@ -15,7 +15,7 @@ def check_post_mortem_trigger_params_incident_conditional_inactivity( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITIONAL_INACTIVITY_VALUES: - return cast(PostMortemTriggerParamsIncidentConditionalInactivity, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_CONDITIONAL_INACTIVITY_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_kinds_item.py b/rootly_sdk/models/post_mortem_trigger_params_incident_kinds_item.py index 745eb071..9cc50ad2 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_kinds_item.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_kinds_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentKindsItem = Literal[ "backfilled", "example", "example_sub", "normal", "normal_sub", "scheduled", "scheduled_sub", "test", "test_sub" @@ -23,7 +23,7 @@ def check_post_mortem_trigger_params_incident_kinds_item( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_KINDS_ITEM_VALUES: - return cast(PostMortemTriggerParamsIncidentKindsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_KINDS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_post_mortem_condition.py b/rootly_sdk/models/post_mortem_trigger_params_incident_post_mortem_condition.py index 93dc18ef..28d99c3b 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_post_mortem_condition.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_post_mortem_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentPostMortemCondition = Literal["ALL", "ANY", "NONE"] @@ -17,7 +17,7 @@ def check_post_mortem_trigger_params_incident_post_mortem_condition( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_POST_MORTEM_CONDITION_VALUES: - return cast(PostMortemTriggerParamsIncidentPostMortemCondition, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_POST_MORTEM_CONDITION_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_post_mortem_condition_cause.py b/rootly_sdk/models/post_mortem_trigger_params_incident_post_mortem_condition_cause.py index 52ce841e..1cc145b9 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_post_mortem_condition_cause.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_post_mortem_condition_cause.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentPostMortemConditionCause = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_post_mortem_trigger_params_incident_post_mortem_condition_cause( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_POST_MORTEM_CONDITION_CAUSE_VALUES: - return cast(PostMortemTriggerParamsIncidentPostMortemConditionCause, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_POST_MORTEM_CONDITION_CAUSE_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_post_mortem_condition_status.py b/rootly_sdk/models/post_mortem_trigger_params_incident_post_mortem_condition_status.py index 1874dff9..50fabf00 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_post_mortem_condition_status.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_post_mortem_condition_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentPostMortemConditionStatus = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_post_mortem_trigger_params_incident_post_mortem_condition_status( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_POST_MORTEM_CONDITION_STATUS_VALUES: - return cast(PostMortemTriggerParamsIncidentPostMortemConditionStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_POST_MORTEM_CONDITION_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_post_mortem_statuses_item.py b/rootly_sdk/models/post_mortem_trigger_params_incident_post_mortem_statuses_item.py index ef2edea7..15888cbd 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_post_mortem_statuses_item.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_post_mortem_statuses_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentPostMortemStatusesItem = Literal["draft", "published"] @@ -16,7 +16,7 @@ def check_post_mortem_trigger_params_incident_post_mortem_statuses_item( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_POST_MORTEM_STATUSES_ITEM_VALUES: - return cast(PostMortemTriggerParamsIncidentPostMortemStatusesItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_POST_MORTEM_STATUSES_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_incident_statuses_item.py b/rootly_sdk/models/post_mortem_trigger_params_incident_statuses_item.py index 8b4d8602..bc6cf4ee 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_incident_statuses_item.py +++ b/rootly_sdk/models/post_mortem_trigger_params_incident_statuses_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsIncidentStatusesItem = Literal[ "acknowledged", @@ -35,7 +35,7 @@ def check_post_mortem_trigger_params_incident_statuses_item( if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_INCIDENT_STATUSES_ITEM_VALUES: - return cast(PostMortemTriggerParamsIncidentStatusesItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_INCIDENT_STATUSES_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/post_mortem_trigger_params_trigger_type.py b/rootly_sdk/models/post_mortem_trigger_params_trigger_type.py index 8d3f9335..74f3a0f1 100644 --- a/rootly_sdk/models/post_mortem_trigger_params_trigger_type.py +++ b/rootly_sdk/models/post_mortem_trigger_params_trigger_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PostMortemTriggerParamsTriggerType = Literal["post_mortem"] @@ -11,5 +11,5 @@ def check_post_mortem_trigger_params_trigger_type(value: str | None) -> PostMort if value is None: return None if value in POST_MORTEM_TRIGGER_PARAMS_TRIGGER_TYPE_VALUES: - return cast(PostMortemTriggerParamsTriggerType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {POST_MORTEM_TRIGGER_PARAMS_TRIGGER_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/print_task_params.py b/rootly_sdk/models/print_task_params.py index c781290e..caf8f707 100644 --- a/rootly_sdk/models/print_task_params.py +++ b/rootly_sdk/models/print_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -15,17 +17,17 @@ class PrintTaskParams: """ Attributes: message (str): The message to print - task_type (Union[Unset, PrintTaskParamsTaskType]): + task_type (PrintTaskParamsTaskType | Unset): """ message: str - task_type: Unset | PrintTaskParamsTaskType = UNSET + task_type: PrintTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: message = self.message - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -47,7 +49,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: Unset | PrintTaskParamsTaskType + task_type: PrintTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/print_task_params_task_type.py b/rootly_sdk/models/print_task_params_task_type.py index b0297bc0..ddd84ba7 100644 --- a/rootly_sdk/models/print_task_params_task_type.py +++ b/rootly_sdk/models/print_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PrintTaskParamsTaskType = Literal["print"] @@ -11,5 +11,5 @@ def check_print_task_params_task_type(value: str | None) -> PrintTaskParamsTaskT if value is None: return None if value in PRINT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(PrintTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {PRINT_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/private_agent.py b/rootly_sdk/models/private_agent.py new file mode 100644 index 00000000..a81d8351 --- /dev/null +++ b/rootly_sdk/models/private_agent.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar +from uuid import UUID + +from attrs import define as _attrs_define + +from ..models.private_agent_type import PrivateAgentType, check_private_agent_type + +if TYPE_CHECKING: + from ..models.private_agent_attributes import PrivateAgentAttributes + + +T = TypeVar("T", bound="PrivateAgent") + + +@_attrs_define +class PrivateAgent: + """ + Attributes: + id (UUID): + type_ (PrivateAgentType): + attributes (PrivateAgentAttributes): + """ + + id: UUID + type_: PrivateAgentType + attributes: PrivateAgentAttributes + + def to_dict(self) -> dict[str, Any]: + id = str(self.id) + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + + 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.private_agent_attributes import PrivateAgentAttributes + + d = dict(src_dict) + id = UUID(d.pop("id")) + + type_ = check_private_agent_type(d.pop("type")) + + attributes = PrivateAgentAttributes.from_dict(d.pop("attributes")) + + private_agent = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + return private_agent diff --git a/rootly_sdk/models/private_agent_attributes.py b/rootly_sdk/models/private_agent_attributes.py new file mode 100644 index 00000000..4cf01819 --- /dev/null +++ b/rootly_sdk/models/private_agent_attributes.py @@ -0,0 +1,180 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..models.private_agent_attributes_deployment_mode import ( + PrivateAgentAttributesDeploymentMode, + check_private_agent_attributes_deployment_mode, +) +from ..models.private_agent_attributes_status import PrivateAgentAttributesStatus, check_private_agent_attributes_status + +if TYPE_CHECKING: + from ..models.private_agent_attributes_providers_item import PrivateAgentAttributesProvidersItem + + +T = TypeVar("T", bound="PrivateAgentAttributes") + + +@_attrs_define +class PrivateAgentAttributes: + """ + Attributes: + name (str): + description (None | str): Non-sensitive routing metadata. Do not include secrets or personal data. + enabled (bool): For active agents, whether Rootly may advertise tools and assign new work. + status (PrivateAgentAttributesStatus): + online (bool): Active agent seen within two minutes; does not imply all providers are healthy. + deployment_mode (PrivateAgentAttributesDeploymentMode): + agent_version (str): + last_seen_at (datetime.datetime | None): + schema_digest (None | str): + created_at (datetime.datetime): + updated_at (datetime.datetime): + providers (list[PrivateAgentAttributesProvidersItem]): + """ + + name: str + description: None | str + enabled: bool + status: PrivateAgentAttributesStatus + online: bool + deployment_mode: PrivateAgentAttributesDeploymentMode + agent_version: str + last_seen_at: datetime.datetime | None + schema_digest: None | str + created_at: datetime.datetime + updated_at: datetime.datetime + providers: list[PrivateAgentAttributesProvidersItem] + + def to_dict(self) -> dict[str, Any]: + name = self.name + + description: None | str + description = self.description + + enabled = self.enabled + + status: str = self.status + + online = self.online + + deployment_mode: str = self.deployment_mode + + agent_version = self.agent_version + + last_seen_at: None | str + if isinstance(self.last_seen_at, datetime.datetime): + last_seen_at = self.last_seen_at.isoformat() + else: + last_seen_at = self.last_seen_at + + schema_digest: None | str + schema_digest = self.schema_digest + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + providers = [] + for providers_item_data in self.providers: + providers_item = providers_item_data.to_dict() + providers.append(providers_item) + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + "description": description, + "enabled": enabled, + "status": status, + "online": online, + "deployment_mode": deployment_mode, + "agent_version": agent_version, + "last_seen_at": last_seen_at, + "schema_digest": schema_digest, + "created_at": created_at, + "updated_at": updated_at, + "providers": providers, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.private_agent_attributes_providers_item import PrivateAgentAttributesProvidersItem + + d = dict(src_dict) + name = d.pop("name") + + def _parse_description(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + description = _parse_description(d.pop("description")) + + enabled = d.pop("enabled") + + status = check_private_agent_attributes_status(d.pop("status")) + + online = d.pop("online") + + deployment_mode = check_private_agent_attributes_deployment_mode(d.pop("deployment_mode")) + + agent_version = d.pop("agent_version") + + def _parse_last_seen_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + last_seen_at_type_0 = datetime.datetime.fromisoformat(data) + + return last_seen_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + last_seen_at = _parse_last_seen_at(d.pop("last_seen_at")) + + def _parse_schema_digest(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + schema_digest = _parse_schema_digest(d.pop("schema_digest")) + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) + + providers = [] + _providers = d.pop("providers") + for providers_item_data in _providers: + providers_item = PrivateAgentAttributesProvidersItem.from_dict(providers_item_data) + + providers.append(providers_item) + + private_agent_attributes = cls( + name=name, + description=description, + enabled=enabled, + status=status, + online=online, + deployment_mode=deployment_mode, + agent_version=agent_version, + last_seen_at=last_seen_at, + schema_digest=schema_digest, + created_at=created_at, + updated_at=updated_at, + providers=providers, + ) + + return private_agent_attributes diff --git a/rootly_sdk/models/private_agent_attributes_deployment_mode.py b/rootly_sdk/models/private_agent_attributes_deployment_mode.py new file mode 100644 index 00000000..b5b6a63e --- /dev/null +++ b/rootly_sdk/models/private_agent_attributes_deployment_mode.py @@ -0,0 +1,16 @@ +from typing import Literal + +PrivateAgentAttributesDeploymentMode = Literal["combined", "split-core"] + +PRIVATE_AGENT_ATTRIBUTES_DEPLOYMENT_MODE_VALUES: set[PrivateAgentAttributesDeploymentMode] = { + "combined", + "split-core", +} + + +def check_private_agent_attributes_deployment_mode(value: str | None) -> PrivateAgentAttributesDeploymentMode | None: + if value is None: + return None + if value in PRIVATE_AGENT_ATTRIBUTES_DEPLOYMENT_MODE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PRIVATE_AGENT_ATTRIBUTES_DEPLOYMENT_MODE_VALUES!r}") diff --git a/rootly_sdk/models/private_agent_attributes_providers_item.py b/rootly_sdk/models/private_agent_attributes_providers_item.py new file mode 100644 index 00000000..dbea958e --- /dev/null +++ b/rootly_sdk/models/private_agent_attributes_providers_item.py @@ -0,0 +1,167 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.private_agent_attributes_providers_item_capabilities_item import ( + PrivateAgentAttributesProvidersItemCapabilitiesItem, + ) + from ..models.private_agent_attributes_providers_item_health_type_0 import ( + PrivateAgentAttributesProvidersItemHealthType0, + ) + from ..models.private_agent_attributes_providers_item_policy_type_0 import ( + PrivateAgentAttributesProvidersItemPolicyType0, + ) + + +T = TypeVar("T", bound="PrivateAgentAttributesProvidersItem") + + +@_attrs_define +class PrivateAgentAttributesProvidersItem: + """ + Attributes: + id (str): + type_ (str): Provider adapter type, such as kubernetes, prometheus, loki, tempo, pyroscope, elasticsearch, + opensearch, postgresql, mysql, mcp, http, kafka, redis, or valkey. + version (None | str): + health (None | PrivateAgentAttributesProvidersItemHealthType0): Last reported provider health; may be stale when + the agent is offline. Invalid or absent fields are omitted. + policy (None | PrivateAgentAttributesProvidersItemPolicyType0): Reported local policy, not credentials or + provider connection configuration. Fields are provider-type specific: Kubernetes reports namespace scope; search + providers report index scope; databases report database/schema scope; HTTP reports method/path/header scope; + Kafka reports topic and message-read scope; Redis and Valkey report diagnostic limits; and each provider family + normally reports only its applicable numeric limits. Management responses may preserve legacy cross-family + fields for backwards compatibility; capability catalog and dispatch use provider-scoped execution metadata. + Invalid or absent fields are omitted. + capabilities (list[PrivateAgentAttributesProvidersItemCapabilitiesItem]): + """ + + id: str + type_: str + version: None | str + health: None | PrivateAgentAttributesProvidersItemHealthType0 + policy: None | PrivateAgentAttributesProvidersItemPolicyType0 + capabilities: list[PrivateAgentAttributesProvidersItemCapabilitiesItem] + + def to_dict(self) -> dict[str, Any]: + from ..models.private_agent_attributes_providers_item_health_type_0 import ( + PrivateAgentAttributesProvidersItemHealthType0, + ) + from ..models.private_agent_attributes_providers_item_policy_type_0 import ( + PrivateAgentAttributesProvidersItemPolicyType0, + ) + + id = self.id + + type_ = self.type_ + + version: None | str + version = self.version + + health: dict[str, Any] | None + if isinstance(self.health, PrivateAgentAttributesProvidersItemHealthType0): + health = self.health.to_dict() + else: + health = self.health + + policy: dict[str, Any] | None + if isinstance(self.policy, PrivateAgentAttributesProvidersItemPolicyType0): + policy = self.policy.to_dict() + else: + policy = self.policy + + capabilities = [] + for capabilities_item_data in self.capabilities: + capabilities_item = capabilities_item_data.to_dict() + capabilities.append(capabilities_item) + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "id": id, + "type": type_, + "version": version, + "health": health, + "policy": policy, + "capabilities": capabilities, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.private_agent_attributes_providers_item_capabilities_item import ( + PrivateAgentAttributesProvidersItemCapabilitiesItem, + ) + from ..models.private_agent_attributes_providers_item_health_type_0 import ( + PrivateAgentAttributesProvidersItemHealthType0, + ) + from ..models.private_agent_attributes_providers_item_policy_type_0 import ( + PrivateAgentAttributesProvidersItemPolicyType0, + ) + + d = dict(src_dict) + id = d.pop("id") + + type_ = d.pop("type") + + def _parse_version(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + version = _parse_version(d.pop("version")) + + def _parse_health(data: object) -> None | PrivateAgentAttributesProvidersItemHealthType0: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + health_type_0 = PrivateAgentAttributesProvidersItemHealthType0.from_dict(data) + + return health_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | PrivateAgentAttributesProvidersItemHealthType0, data) + + health = _parse_health(d.pop("health")) + + def _parse_policy(data: object) -> None | PrivateAgentAttributesProvidersItemPolicyType0: + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + policy_type_0 = PrivateAgentAttributesProvidersItemPolicyType0.from_dict(data) + + return policy_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | PrivateAgentAttributesProvidersItemPolicyType0, data) + + policy = _parse_policy(d.pop("policy")) + + capabilities = [] + _capabilities = d.pop("capabilities") + for capabilities_item_data in _capabilities: + capabilities_item = PrivateAgentAttributesProvidersItemCapabilitiesItem.from_dict(capabilities_item_data) + + capabilities.append(capabilities_item) + + private_agent_attributes_providers_item = cls( + id=id, + type_=type_, + version=version, + health=health, + policy=policy, + capabilities=capabilities, + ) + + return private_agent_attributes_providers_item diff --git a/rootly_sdk/models/private_agent_attributes_providers_item_capabilities_item.py b/rootly_sdk/models/private_agent_attributes_providers_item_capabilities_item.py new file mode 100644 index 00000000..b30fe0d1 --- /dev/null +++ b/rootly_sdk/models/private_agent_attributes_providers_item_capabilities_item.py @@ -0,0 +1,70 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PrivateAgentAttributesProvidersItemCapabilitiesItem") + + +@_attrs_define +class PrivateAgentAttributesProvidersItemCapabilitiesItem: + """ + Attributes: + name (str): + version (str): + description (str | Unset): + sensitivity (str | Unset): + """ + + name: str + version: str + description: str | Unset = UNSET + sensitivity: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + version = self.version + + description = self.description + + sensitivity = self.sensitivity + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + "version": version, + } + ) + if description is not UNSET: + field_dict["description"] = description + if sensitivity is not UNSET: + field_dict["sensitivity"] = sensitivity + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + name = d.pop("name") + + version = d.pop("version") + + description = d.pop("description", UNSET) + + sensitivity = d.pop("sensitivity", UNSET) + + private_agent_attributes_providers_item_capabilities_item = cls( + name=name, + version=version, + description=description, + sensitivity=sensitivity, + ) + + return private_agent_attributes_providers_item_capabilities_item diff --git a/rootly_sdk/models/private_agent_attributes_providers_item_health_type_0.py b/rootly_sdk/models/private_agent_attributes_providers_item_health_type_0.py new file mode 100644 index 00000000..1c4b1a45 --- /dev/null +++ b/rootly_sdk/models/private_agent_attributes_providers_item_health_type_0.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..types import UNSET, Unset + +T = TypeVar("T", bound="PrivateAgentAttributesProvidersItemHealthType0") + + +@_attrs_define +class PrivateAgentAttributesProvidersItemHealthType0: + """Last reported provider health; may be stale when the agent is offline. Invalid or absent fields are omitted. + + Attributes: + status (str | Unset): + observed_at (str | Unset): + message (str | Unset): + """ + + status: str | Unset = UNSET + observed_at: str | Unset = UNSET + message: str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + status = self.status + + observed_at = self.observed_at + + message = self.message + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if status is not UNSET: + field_dict["status"] = status + if observed_at is not UNSET: + field_dict["observed_at"] = observed_at + if message is not UNSET: + field_dict["message"] = message + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + status = d.pop("status", UNSET) + + observed_at = d.pop("observed_at", UNSET) + + message = d.pop("message", UNSET) + + private_agent_attributes_providers_item_health_type_0 = cls( + status=status, + observed_at=observed_at, + message=message, + ) + + return private_agent_attributes_providers_item_health_type_0 diff --git a/rootly_sdk/models/private_agent_attributes_providers_item_policy_type_0.py b/rootly_sdk/models/private_agent_attributes_providers_item_policy_type_0.py new file mode 100644 index 00000000..307532cd --- /dev/null +++ b/rootly_sdk/models/private_agent_attributes_providers_item_policy_type_0.py @@ -0,0 +1,480 @@ +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="PrivateAgentAttributesProvidersItemPolicyType0") + + +@_attrs_define +class PrivateAgentAttributesProvidersItemPolicyType0: + """Reported local policy, not credentials or provider connection configuration. Fields are provider-type specific: + Kubernetes reports namespace scope; search providers report index scope; databases report database/schema scope; + HTTP reports method/path/header scope; Kafka reports topic and message-read scope; Redis and Valkey report + diagnostic limits; and each provider family normally reports only its applicable numeric limits. Management + responses may preserve legacy cross-family fields for backwards compatibility; capability catalog and dispatch use + provider-scoped execution metadata. Invalid or absent fields are omitted. + + Attributes: + digest (str | Unset): + cluster_scoped (bool | Unset): + pod_logs (bool | Unset): + maximum_concurrency (int | Unset): + maximum_attribute_values (int | Unset): + maximum_documents (int | Unset): + maximum_entries (int | Unset): + maximum_exemplars (int | Unset): + maximum_indices (int | Unset): + maximum_label_values (int | Unset): + maximum_nodes (int | Unset): + maximum_pattern_points (int | Unset): + maximum_points_per_series (int | Unset): + maximum_profile_types (int | Unset): + maximum_query_bytes (int | Unset): + maximum_request_bytes (int | Unset): + maximum_response_bytes (int | Unset): + maximum_range_seconds (int | Unset): + maximum_rows (int | Unset): + maximum_result_bytes (int | Unset): + maximum_items (int | Unset): + maximum_messages (int | Unset): + maximum_message_bytes (int | Unset): + maximum_scan_records (int | Unset): + maximum_scan_bytes (int | Unset): + maximum_series (int | Unset): + maximum_shards (int | Unset): + maximum_slowlog_entries (int | Unset): + maximum_spans_per_span_set (int | Unset): + maximum_stale_values (int | Unset): + maximum_timeout_seconds (int | Unset): + maximum_traces (int | Unset): + stuck_transaction_seconds (int | Unset): + namespaces (list[str] | Unset): + allowed_indices (list[str] | Unset): + timestamp_field (str | Unset): + database (str | Unset): + allowed_schemas (list[str] | Unset): + allowed_methods (list[str] | Unset): + allowed_path_prefixes (list[str] | Unset): + allowed_request_headers (list[str] | Unset): + exposed_response_headers (list[str] | Unset): + allowed_topics (list[str] | Unset): + denied_topics (list[str] | Unset): + include_internal_topics (bool | Unset): + allow_message_reads (bool | Unset): + include_message_values (bool | Unset): + """ + + digest: str | Unset = UNSET + cluster_scoped: bool | Unset = UNSET + pod_logs: bool | Unset = UNSET + maximum_concurrency: int | Unset = UNSET + maximum_attribute_values: int | Unset = UNSET + maximum_documents: int | Unset = UNSET + maximum_entries: int | Unset = UNSET + maximum_exemplars: int | Unset = UNSET + maximum_indices: int | Unset = UNSET + maximum_label_values: int | Unset = UNSET + maximum_nodes: int | Unset = UNSET + maximum_pattern_points: int | Unset = UNSET + maximum_points_per_series: int | Unset = UNSET + maximum_profile_types: int | Unset = UNSET + maximum_query_bytes: int | Unset = UNSET + maximum_request_bytes: int | Unset = UNSET + maximum_response_bytes: int | Unset = UNSET + maximum_range_seconds: int | Unset = UNSET + maximum_rows: int | Unset = UNSET + maximum_result_bytes: int | Unset = UNSET + maximum_items: int | Unset = UNSET + maximum_messages: int | Unset = UNSET + maximum_message_bytes: int | Unset = UNSET + maximum_scan_records: int | Unset = UNSET + maximum_scan_bytes: int | Unset = UNSET + maximum_series: int | Unset = UNSET + maximum_shards: int | Unset = UNSET + maximum_slowlog_entries: int | Unset = UNSET + maximum_spans_per_span_set: int | Unset = UNSET + maximum_stale_values: int | Unset = UNSET + maximum_timeout_seconds: int | Unset = UNSET + maximum_traces: int | Unset = UNSET + stuck_transaction_seconds: int | Unset = UNSET + namespaces: list[str] | Unset = UNSET + allowed_indices: list[str] | Unset = UNSET + timestamp_field: str | Unset = UNSET + database: str | Unset = UNSET + allowed_schemas: list[str] | Unset = UNSET + allowed_methods: list[str] | Unset = UNSET + allowed_path_prefixes: list[str] | Unset = UNSET + allowed_request_headers: list[str] | Unset = UNSET + exposed_response_headers: list[str] | Unset = UNSET + allowed_topics: list[str] | Unset = UNSET + denied_topics: list[str] | Unset = UNSET + include_internal_topics: bool | Unset = UNSET + allow_message_reads: bool | Unset = UNSET + include_message_values: bool | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + digest = self.digest + + cluster_scoped = self.cluster_scoped + + pod_logs = self.pod_logs + + maximum_concurrency = self.maximum_concurrency + + maximum_attribute_values = self.maximum_attribute_values + + maximum_documents = self.maximum_documents + + maximum_entries = self.maximum_entries + + maximum_exemplars = self.maximum_exemplars + + maximum_indices = self.maximum_indices + + maximum_label_values = self.maximum_label_values + + maximum_nodes = self.maximum_nodes + + maximum_pattern_points = self.maximum_pattern_points + + maximum_points_per_series = self.maximum_points_per_series + + maximum_profile_types = self.maximum_profile_types + + maximum_query_bytes = self.maximum_query_bytes + + maximum_request_bytes = self.maximum_request_bytes + + maximum_response_bytes = self.maximum_response_bytes + + maximum_range_seconds = self.maximum_range_seconds + + maximum_rows = self.maximum_rows + + maximum_result_bytes = self.maximum_result_bytes + + maximum_items = self.maximum_items + + maximum_messages = self.maximum_messages + + maximum_message_bytes = self.maximum_message_bytes + + maximum_scan_records = self.maximum_scan_records + + maximum_scan_bytes = self.maximum_scan_bytes + + maximum_series = self.maximum_series + + maximum_shards = self.maximum_shards + + maximum_slowlog_entries = self.maximum_slowlog_entries + + maximum_spans_per_span_set = self.maximum_spans_per_span_set + + maximum_stale_values = self.maximum_stale_values + + maximum_timeout_seconds = self.maximum_timeout_seconds + + maximum_traces = self.maximum_traces + + stuck_transaction_seconds = self.stuck_transaction_seconds + + namespaces: list[str] | Unset = UNSET + if not isinstance(self.namespaces, Unset): + namespaces = self.namespaces + + allowed_indices: list[str] | Unset = UNSET + if not isinstance(self.allowed_indices, Unset): + allowed_indices = self.allowed_indices + + timestamp_field = self.timestamp_field + + database = self.database + + allowed_schemas: list[str] | Unset = UNSET + if not isinstance(self.allowed_schemas, Unset): + allowed_schemas = self.allowed_schemas + + allowed_methods: list[str] | Unset = UNSET + if not isinstance(self.allowed_methods, Unset): + allowed_methods = self.allowed_methods + + allowed_path_prefixes: list[str] | Unset = UNSET + if not isinstance(self.allowed_path_prefixes, Unset): + allowed_path_prefixes = self.allowed_path_prefixes + + allowed_request_headers: list[str] | Unset = UNSET + if not isinstance(self.allowed_request_headers, Unset): + allowed_request_headers = self.allowed_request_headers + + exposed_response_headers: list[str] | Unset = UNSET + if not isinstance(self.exposed_response_headers, Unset): + exposed_response_headers = self.exposed_response_headers + + allowed_topics: list[str] | Unset = UNSET + if not isinstance(self.allowed_topics, Unset): + allowed_topics = self.allowed_topics + + denied_topics: list[str] | Unset = UNSET + if not isinstance(self.denied_topics, Unset): + denied_topics = self.denied_topics + + include_internal_topics = self.include_internal_topics + + allow_message_reads = self.allow_message_reads + + include_message_values = self.include_message_values + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if digest is not UNSET: + field_dict["digest"] = digest + if cluster_scoped is not UNSET: + field_dict["cluster_scoped"] = cluster_scoped + if pod_logs is not UNSET: + field_dict["pod_logs"] = pod_logs + if maximum_concurrency is not UNSET: + field_dict["maximum_concurrency"] = maximum_concurrency + if maximum_attribute_values is not UNSET: + field_dict["maximum_attribute_values"] = maximum_attribute_values + if maximum_documents is not UNSET: + field_dict["maximum_documents"] = maximum_documents + if maximum_entries is not UNSET: + field_dict["maximum_entries"] = maximum_entries + if maximum_exemplars is not UNSET: + field_dict["maximum_exemplars"] = maximum_exemplars + if maximum_indices is not UNSET: + field_dict["maximum_indices"] = maximum_indices + if maximum_label_values is not UNSET: + field_dict["maximum_label_values"] = maximum_label_values + if maximum_nodes is not UNSET: + field_dict["maximum_nodes"] = maximum_nodes + if maximum_pattern_points is not UNSET: + field_dict["maximum_pattern_points"] = maximum_pattern_points + if maximum_points_per_series is not UNSET: + field_dict["maximum_points_per_series"] = maximum_points_per_series + if maximum_profile_types is not UNSET: + field_dict["maximum_profile_types"] = maximum_profile_types + if maximum_query_bytes is not UNSET: + field_dict["maximum_query_bytes"] = maximum_query_bytes + if maximum_request_bytes is not UNSET: + field_dict["maximum_request_bytes"] = maximum_request_bytes + if maximum_response_bytes is not UNSET: + field_dict["maximum_response_bytes"] = maximum_response_bytes + if maximum_range_seconds is not UNSET: + field_dict["maximum_range_seconds"] = maximum_range_seconds + if maximum_rows is not UNSET: + field_dict["maximum_rows"] = maximum_rows + if maximum_result_bytes is not UNSET: + field_dict["maximum_result_bytes"] = maximum_result_bytes + if maximum_items is not UNSET: + field_dict["maximum_items"] = maximum_items + if maximum_messages is not UNSET: + field_dict["maximum_messages"] = maximum_messages + if maximum_message_bytes is not UNSET: + field_dict["maximum_message_bytes"] = maximum_message_bytes + if maximum_scan_records is not UNSET: + field_dict["maximum_scan_records"] = maximum_scan_records + if maximum_scan_bytes is not UNSET: + field_dict["maximum_scan_bytes"] = maximum_scan_bytes + if maximum_series is not UNSET: + field_dict["maximum_series"] = maximum_series + if maximum_shards is not UNSET: + field_dict["maximum_shards"] = maximum_shards + if maximum_slowlog_entries is not UNSET: + field_dict["maximum_slowlog_entries"] = maximum_slowlog_entries + if maximum_spans_per_span_set is not UNSET: + field_dict["maximum_spans_per_span_set"] = maximum_spans_per_span_set + if maximum_stale_values is not UNSET: + field_dict["maximum_stale_values"] = maximum_stale_values + if maximum_timeout_seconds is not UNSET: + field_dict["maximum_timeout_seconds"] = maximum_timeout_seconds + if maximum_traces is not UNSET: + field_dict["maximum_traces"] = maximum_traces + if stuck_transaction_seconds is not UNSET: + field_dict["stuck_transaction_seconds"] = stuck_transaction_seconds + if namespaces is not UNSET: + field_dict["namespaces"] = namespaces + if allowed_indices is not UNSET: + field_dict["allowed_indices"] = allowed_indices + if timestamp_field is not UNSET: + field_dict["timestamp_field"] = timestamp_field + if database is not UNSET: + field_dict["database"] = database + if allowed_schemas is not UNSET: + field_dict["allowed_schemas"] = allowed_schemas + if allowed_methods is not UNSET: + field_dict["allowed_methods"] = allowed_methods + if allowed_path_prefixes is not UNSET: + field_dict["allowed_path_prefixes"] = allowed_path_prefixes + if allowed_request_headers is not UNSET: + field_dict["allowed_request_headers"] = allowed_request_headers + if exposed_response_headers is not UNSET: + field_dict["exposed_response_headers"] = exposed_response_headers + if allowed_topics is not UNSET: + field_dict["allowed_topics"] = allowed_topics + if denied_topics is not UNSET: + field_dict["denied_topics"] = denied_topics + if include_internal_topics is not UNSET: + field_dict["include_internal_topics"] = include_internal_topics + if allow_message_reads is not UNSET: + field_dict["allow_message_reads"] = allow_message_reads + if include_message_values is not UNSET: + field_dict["include_message_values"] = include_message_values + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + digest = d.pop("digest", UNSET) + + cluster_scoped = d.pop("cluster_scoped", UNSET) + + pod_logs = d.pop("pod_logs", UNSET) + + maximum_concurrency = d.pop("maximum_concurrency", UNSET) + + maximum_attribute_values = d.pop("maximum_attribute_values", UNSET) + + maximum_documents = d.pop("maximum_documents", UNSET) + + maximum_entries = d.pop("maximum_entries", UNSET) + + maximum_exemplars = d.pop("maximum_exemplars", UNSET) + + maximum_indices = d.pop("maximum_indices", UNSET) + + maximum_label_values = d.pop("maximum_label_values", UNSET) + + maximum_nodes = d.pop("maximum_nodes", UNSET) + + maximum_pattern_points = d.pop("maximum_pattern_points", UNSET) + + maximum_points_per_series = d.pop("maximum_points_per_series", UNSET) + + maximum_profile_types = d.pop("maximum_profile_types", UNSET) + + maximum_query_bytes = d.pop("maximum_query_bytes", UNSET) + + maximum_request_bytes = d.pop("maximum_request_bytes", UNSET) + + maximum_response_bytes = d.pop("maximum_response_bytes", UNSET) + + maximum_range_seconds = d.pop("maximum_range_seconds", UNSET) + + maximum_rows = d.pop("maximum_rows", UNSET) + + maximum_result_bytes = d.pop("maximum_result_bytes", UNSET) + + maximum_items = d.pop("maximum_items", UNSET) + + maximum_messages = d.pop("maximum_messages", UNSET) + + maximum_message_bytes = d.pop("maximum_message_bytes", UNSET) + + maximum_scan_records = d.pop("maximum_scan_records", UNSET) + + maximum_scan_bytes = d.pop("maximum_scan_bytes", UNSET) + + maximum_series = d.pop("maximum_series", UNSET) + + maximum_shards = d.pop("maximum_shards", UNSET) + + maximum_slowlog_entries = d.pop("maximum_slowlog_entries", UNSET) + + maximum_spans_per_span_set = d.pop("maximum_spans_per_span_set", UNSET) + + maximum_stale_values = d.pop("maximum_stale_values", UNSET) + + maximum_timeout_seconds = d.pop("maximum_timeout_seconds", UNSET) + + maximum_traces = d.pop("maximum_traces", UNSET) + + stuck_transaction_seconds = d.pop("stuck_transaction_seconds", UNSET) + + namespaces = cast(list[str], d.pop("namespaces", UNSET)) + + allowed_indices = cast(list[str], d.pop("allowed_indices", UNSET)) + + timestamp_field = d.pop("timestamp_field", UNSET) + + database = d.pop("database", UNSET) + + allowed_schemas = cast(list[str], d.pop("allowed_schemas", UNSET)) + + allowed_methods = cast(list[str], d.pop("allowed_methods", UNSET)) + + allowed_path_prefixes = cast(list[str], d.pop("allowed_path_prefixes", UNSET)) + + allowed_request_headers = cast(list[str], d.pop("allowed_request_headers", UNSET)) + + exposed_response_headers = cast(list[str], d.pop("exposed_response_headers", UNSET)) + + allowed_topics = cast(list[str], d.pop("allowed_topics", UNSET)) + + denied_topics = cast(list[str], d.pop("denied_topics", UNSET)) + + include_internal_topics = d.pop("include_internal_topics", UNSET) + + allow_message_reads = d.pop("allow_message_reads", UNSET) + + include_message_values = d.pop("include_message_values", UNSET) + + private_agent_attributes_providers_item_policy_type_0 = cls( + digest=digest, + cluster_scoped=cluster_scoped, + pod_logs=pod_logs, + maximum_concurrency=maximum_concurrency, + maximum_attribute_values=maximum_attribute_values, + maximum_documents=maximum_documents, + maximum_entries=maximum_entries, + maximum_exemplars=maximum_exemplars, + maximum_indices=maximum_indices, + maximum_label_values=maximum_label_values, + maximum_nodes=maximum_nodes, + maximum_pattern_points=maximum_pattern_points, + maximum_points_per_series=maximum_points_per_series, + maximum_profile_types=maximum_profile_types, + maximum_query_bytes=maximum_query_bytes, + maximum_request_bytes=maximum_request_bytes, + maximum_response_bytes=maximum_response_bytes, + maximum_range_seconds=maximum_range_seconds, + maximum_rows=maximum_rows, + maximum_result_bytes=maximum_result_bytes, + maximum_items=maximum_items, + maximum_messages=maximum_messages, + maximum_message_bytes=maximum_message_bytes, + maximum_scan_records=maximum_scan_records, + maximum_scan_bytes=maximum_scan_bytes, + maximum_series=maximum_series, + maximum_shards=maximum_shards, + maximum_slowlog_entries=maximum_slowlog_entries, + maximum_spans_per_span_set=maximum_spans_per_span_set, + maximum_stale_values=maximum_stale_values, + maximum_timeout_seconds=maximum_timeout_seconds, + maximum_traces=maximum_traces, + stuck_transaction_seconds=stuck_transaction_seconds, + namespaces=namespaces, + allowed_indices=allowed_indices, + timestamp_field=timestamp_field, + database=database, + allowed_schemas=allowed_schemas, + allowed_methods=allowed_methods, + allowed_path_prefixes=allowed_path_prefixes, + allowed_request_headers=allowed_request_headers, + exposed_response_headers=exposed_response_headers, + allowed_topics=allowed_topics, + denied_topics=denied_topics, + include_internal_topics=include_internal_topics, + allow_message_reads=allow_message_reads, + include_message_values=include_message_values, + ) + + return private_agent_attributes_providers_item_policy_type_0 diff --git a/rootly_sdk/models/private_agent_attributes_status.py b/rootly_sdk/models/private_agent_attributes_status.py new file mode 100644 index 00000000..fedf2c49 --- /dev/null +++ b/rootly_sdk/models/private_agent_attributes_status.py @@ -0,0 +1,16 @@ +from typing import Literal + +PrivateAgentAttributesStatus = Literal["active", "revoked"] + +PRIVATE_AGENT_ATTRIBUTES_STATUS_VALUES: set[PrivateAgentAttributesStatus] = { + "active", + "revoked", +} + + +def check_private_agent_attributes_status(value: str | None) -> PrivateAgentAttributesStatus | None: + if value is None: + return None + if value in PRIVATE_AGENT_ATTRIBUTES_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PRIVATE_AGENT_ATTRIBUTES_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/private_agent_enrollment_token_response.py b/rootly_sdk/models/private_agent_enrollment_token_response.py new file mode 100644 index 00000000..d42f645c --- /dev/null +++ b/rootly_sdk/models/private_agent_enrollment_token_response.py @@ -0,0 +1,67 @@ +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 + +if TYPE_CHECKING: + from ..models.private_agent_enrollment_token_response_data import PrivateAgentEnrollmentTokenResponseData + + +T = TypeVar("T", bound="PrivateAgentEnrollmentTokenResponse") + + +@_attrs_define +class PrivateAgentEnrollmentTokenResponse: + """ + Attributes: + data (PrivateAgentEnrollmentTokenResponseData): + """ + + data: PrivateAgentEnrollmentTokenResponseData + 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.private_agent_enrollment_token_response_data import PrivateAgentEnrollmentTokenResponseData + + d = dict(src_dict) + data = PrivateAgentEnrollmentTokenResponseData.from_dict(d.pop("data")) + + private_agent_enrollment_token_response = cls( + data=data, + ) + + private_agent_enrollment_token_response.additional_properties = d + return private_agent_enrollment_token_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/private_agent_enrollment_token_response_data.py b/rootly_sdk/models/private_agent_enrollment_token_response_data.py new file mode 100644 index 00000000..11894af4 --- /dev/null +++ b/rootly_sdk/models/private_agent_enrollment_token_response_data.py @@ -0,0 +1,74 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar +from uuid import UUID + +from attrs import define as _attrs_define + +from ..models.private_agent_enrollment_token_response_data_type import ( + PrivateAgentEnrollmentTokenResponseDataType, + check_private_agent_enrollment_token_response_data_type, +) + +if TYPE_CHECKING: + from ..models.private_agent_enrollment_token_response_data_attributes import ( + PrivateAgentEnrollmentTokenResponseDataAttributes, + ) + + +T = TypeVar("T", bound="PrivateAgentEnrollmentTokenResponseData") + + +@_attrs_define +class PrivateAgentEnrollmentTokenResponseData: + """ + Attributes: + id (UUID): + type_ (PrivateAgentEnrollmentTokenResponseDataType): + attributes (PrivateAgentEnrollmentTokenResponseDataAttributes): + """ + + id: UUID + type_: PrivateAgentEnrollmentTokenResponseDataType + attributes: PrivateAgentEnrollmentTokenResponseDataAttributes + + def to_dict(self) -> dict[str, Any]: + id = str(self.id) + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + + 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.private_agent_enrollment_token_response_data_attributes import ( + PrivateAgentEnrollmentTokenResponseDataAttributes, + ) + + d = dict(src_dict) + id = UUID(d.pop("id")) + + type_ = check_private_agent_enrollment_token_response_data_type(d.pop("type")) + + attributes = PrivateAgentEnrollmentTokenResponseDataAttributes.from_dict(d.pop("attributes")) + + private_agent_enrollment_token_response_data = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + return private_agent_enrollment_token_response_data diff --git a/rootly_sdk/models/private_agent_enrollment_token_response_data_attributes.py b/rootly_sdk/models/private_agent_enrollment_token_response_data_attributes.py new file mode 100644 index 00000000..924094ea --- /dev/null +++ b/rootly_sdk/models/private_agent_enrollment_token_response_data_attributes.py @@ -0,0 +1,51 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="PrivateAgentEnrollmentTokenResponseDataAttributes") + + +@_attrs_define +class PrivateAgentEnrollmentTokenResponseDataAttributes: + """ + Attributes: + token (str): One-time secret. Returned only on creation; do not log or store in source control. + expires_at (datetime.datetime): + """ + + token: str + expires_at: datetime.datetime + + def to_dict(self) -> dict[str, Any]: + token = self.token + + expires_at = self.expires_at.isoformat() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "token": token, + "expires_at": expires_at, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + token = d.pop("token") + + expires_at = datetime.datetime.fromisoformat(d.pop("expires_at")) + + private_agent_enrollment_token_response_data_attributes = cls( + token=token, + expires_at=expires_at, + ) + + return private_agent_enrollment_token_response_data_attributes diff --git a/rootly_sdk/models/private_agent_enrollment_token_response_data_type.py b/rootly_sdk/models/private_agent_enrollment_token_response_data_type.py new file mode 100644 index 00000000..0308e37e --- /dev/null +++ b/rootly_sdk/models/private_agent_enrollment_token_response_data_type.py @@ -0,0 +1,19 @@ +from typing import Literal + +PrivateAgentEnrollmentTokenResponseDataType = Literal["private_agent_enrollment_tokens"] + +PRIVATE_AGENT_ENROLLMENT_TOKEN_RESPONSE_DATA_TYPE_VALUES: set[PrivateAgentEnrollmentTokenResponseDataType] = { + "private_agent_enrollment_tokens", +} + + +def check_private_agent_enrollment_token_response_data_type( + value: str | None, +) -> PrivateAgentEnrollmentTokenResponseDataType | None: + if value is None: + return None + if value in PRIVATE_AGENT_ENROLLMENT_TOKEN_RESPONSE_DATA_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {PRIVATE_AGENT_ENROLLMENT_TOKEN_RESPONSE_DATA_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/private_agent_list.py b/rootly_sdk/models/private_agent_list.py new file mode 100644 index 00000000..99b6891f --- /dev/null +++ b/rootly_sdk/models/private_agent_list.py @@ -0,0 +1,85 @@ +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 + +if TYPE_CHECKING: + from ..models.private_agent_list_meta import PrivateAgentListMeta + from ..models.private_agent_summary import PrivateAgentSummary + + +T = TypeVar("T", bound="PrivateAgentList") + + +@_attrs_define +class PrivateAgentList: + """ + Attributes: + data (list[PrivateAgentSummary]): + meta (PrivateAgentListMeta): + """ + + data: list[PrivateAgentSummary] + meta: PrivateAgentListMeta + 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 = self.meta.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "data": data, + "meta": meta, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.private_agent_list_meta import PrivateAgentListMeta + from ..models.private_agent_summary import PrivateAgentSummary + + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = PrivateAgentSummary.from_dict(data_item_data) + + data.append(data_item) + + meta = PrivateAgentListMeta.from_dict(d.pop("meta")) + + private_agent_list = cls( + data=data, + meta=meta, + ) + + private_agent_list.additional_properties = d + return private_agent_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/private_agent_list_meta.py b/rootly_sdk/models/private_agent_list_meta.py new file mode 100644 index 00000000..c1fa00da --- /dev/null +++ b/rootly_sdk/models/private_agent_list_meta.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="PrivateAgentListMeta") + + +@_attrs_define +class PrivateAgentListMeta: + """ """ + + 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) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + private_agent_list_meta = cls() + + private_agent_list_meta.additional_properties = d + return private_agent_list_meta + + @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.py b/rootly_sdk/models/private_agent_response.py similarity index 70% rename from rootly_sdk/models/new_alert_retrigger_rule.py rename to rootly_sdk/models/private_agent_response.py index c62901d5..02465e88 100644 --- a/rootly_sdk/models/new_alert_retrigger_rule.py +++ b/rootly_sdk/models/private_agent_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -5,20 +7,20 @@ from attrs import field as _attrs_field if TYPE_CHECKING: - from ..models.new_alert_retrigger_rule_data import NewAlertRetriggerRuleData + from ..models.private_agent import PrivateAgent -T = TypeVar("T", bound="NewAlertRetriggerRule") +T = TypeVar("T", bound="PrivateAgentResponse") @_attrs_define -class NewAlertRetriggerRule: +class PrivateAgentResponse: """ Attributes: - data (NewAlertRetriggerRuleData): + data (PrivateAgent): """ - data: "NewAlertRetriggerRuleData" + data: PrivateAgent additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,17 +38,17 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.new_alert_retrigger_rule_data import NewAlertRetriggerRuleData + from ..models.private_agent import PrivateAgent d = dict(src_dict) - data = NewAlertRetriggerRuleData.from_dict(d.pop("data")) + data = PrivateAgent.from_dict(d.pop("data")) - new_alert_retrigger_rule = cls( + private_agent_response = cls( data=data, ) - new_alert_retrigger_rule.additional_properties = d - return new_alert_retrigger_rule + private_agent_response.additional_properties = d + return private_agent_response @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/private_agent_summary.py b/rootly_sdk/models/private_agent_summary.py new file mode 100644 index 00000000..a81d2c62 --- /dev/null +++ b/rootly_sdk/models/private_agent_summary.py @@ -0,0 +1,67 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar +from uuid import UUID + +from attrs import define as _attrs_define + +from ..models.private_agent_summary_type import PrivateAgentSummaryType, check_private_agent_summary_type + +if TYPE_CHECKING: + from ..models.private_agent_summary_attributes import PrivateAgentSummaryAttributes + + +T = TypeVar("T", bound="PrivateAgentSummary") + + +@_attrs_define +class PrivateAgentSummary: + """ + Attributes: + id (UUID): + type_ (PrivateAgentSummaryType): + attributes (PrivateAgentSummaryAttributes): + """ + + id: UUID + type_: PrivateAgentSummaryType + attributes: PrivateAgentSummaryAttributes + + def to_dict(self) -> dict[str, Any]: + id = str(self.id) + + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + + 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.private_agent_summary_attributes import PrivateAgentSummaryAttributes + + d = dict(src_dict) + id = UUID(d.pop("id")) + + type_ = check_private_agent_summary_type(d.pop("type")) + + attributes = PrivateAgentSummaryAttributes.from_dict(d.pop("attributes")) + + private_agent_summary = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + return private_agent_summary diff --git a/rootly_sdk/models/private_agent_summary_attributes.py b/rootly_sdk/models/private_agent_summary_attributes.py new file mode 100644 index 00000000..7020ce52 --- /dev/null +++ b/rootly_sdk/models/private_agent_summary_attributes.py @@ -0,0 +1,161 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..models.private_agent_summary_attributes_deployment_mode import ( + PrivateAgentSummaryAttributesDeploymentMode, + check_private_agent_summary_attributes_deployment_mode, +) +from ..models.private_agent_summary_attributes_status import ( + PrivateAgentSummaryAttributesStatus, + check_private_agent_summary_attributes_status, +) + +T = TypeVar("T", bound="PrivateAgentSummaryAttributes") + + +@_attrs_define +class PrivateAgentSummaryAttributes: + """ + Attributes: + name (str): + description (None | str): Non-sensitive routing metadata. Do not include secrets or personal data. + enabled (bool): For active agents, whether Rootly may advertise tools and assign new work. + status (PrivateAgentSummaryAttributesStatus): + online (bool): Active agent seen within two minutes; does not imply all providers are healthy. + deployment_mode (PrivateAgentSummaryAttributesDeploymentMode): + agent_version (str): + last_seen_at (datetime.datetime | None): + schema_digest (None | str): + created_at (datetime.datetime): + updated_at (datetime.datetime): + """ + + name: str + description: None | str + enabled: bool + status: PrivateAgentSummaryAttributesStatus + online: bool + deployment_mode: PrivateAgentSummaryAttributesDeploymentMode + agent_version: str + last_seen_at: datetime.datetime | None + schema_digest: None | str + created_at: datetime.datetime + updated_at: datetime.datetime + + def to_dict(self) -> dict[str, Any]: + name = self.name + + description: None | str + description = self.description + + enabled = self.enabled + + status: str = self.status + + online = self.online + + deployment_mode: str = self.deployment_mode + + agent_version = self.agent_version + + last_seen_at: None | str + if isinstance(self.last_seen_at, datetime.datetime): + last_seen_at = self.last_seen_at.isoformat() + else: + last_seen_at = self.last_seen_at + + schema_digest: None | str + schema_digest = self.schema_digest + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "name": name, + "description": description, + "enabled": enabled, + "status": status, + "online": online, + "deployment_mode": deployment_mode, + "agent_version": agent_version, + "last_seen_at": last_seen_at, + "schema_digest": schema_digest, + "created_at": created_at, + "updated_at": updated_at, + } + ) + + 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 | str: + if data is None: + return data + return cast(None | str, data) + + description = _parse_description(d.pop("description")) + + enabled = d.pop("enabled") + + status = check_private_agent_summary_attributes_status(d.pop("status")) + + online = d.pop("online") + + deployment_mode = check_private_agent_summary_attributes_deployment_mode(d.pop("deployment_mode")) + + agent_version = d.pop("agent_version") + + def _parse_last_seen_at(data: object) -> datetime.datetime | None: + if data is None: + return data + try: + if not isinstance(data, str): + raise TypeError() + last_seen_at_type_0 = datetime.datetime.fromisoformat(data) + + return last_seen_at_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.datetime | None, data) + + last_seen_at = _parse_last_seen_at(d.pop("last_seen_at")) + + def _parse_schema_digest(data: object) -> None | str: + if data is None: + return data + return cast(None | str, data) + + schema_digest = _parse_schema_digest(d.pop("schema_digest")) + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) + + private_agent_summary_attributes = cls( + name=name, + description=description, + enabled=enabled, + status=status, + online=online, + deployment_mode=deployment_mode, + agent_version=agent_version, + last_seen_at=last_seen_at, + schema_digest=schema_digest, + created_at=created_at, + updated_at=updated_at, + ) + + return private_agent_summary_attributes diff --git a/rootly_sdk/models/private_agent_summary_attributes_deployment_mode.py b/rootly_sdk/models/private_agent_summary_attributes_deployment_mode.py new file mode 100644 index 00000000..a3ab0c87 --- /dev/null +++ b/rootly_sdk/models/private_agent_summary_attributes_deployment_mode.py @@ -0,0 +1,20 @@ +from typing import Literal + +PrivateAgentSummaryAttributesDeploymentMode = Literal["combined", "split-core"] + +PRIVATE_AGENT_SUMMARY_ATTRIBUTES_DEPLOYMENT_MODE_VALUES: set[PrivateAgentSummaryAttributesDeploymentMode] = { + "combined", + "split-core", +} + + +def check_private_agent_summary_attributes_deployment_mode( + value: str | None, +) -> PrivateAgentSummaryAttributesDeploymentMode | None: + if value is None: + return None + if value in PRIVATE_AGENT_SUMMARY_ATTRIBUTES_DEPLOYMENT_MODE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {PRIVATE_AGENT_SUMMARY_ATTRIBUTES_DEPLOYMENT_MODE_VALUES!r}" + ) diff --git a/rootly_sdk/models/private_agent_summary_attributes_status.py b/rootly_sdk/models/private_agent_summary_attributes_status.py new file mode 100644 index 00000000..c4932ad0 --- /dev/null +++ b/rootly_sdk/models/private_agent_summary_attributes_status.py @@ -0,0 +1,16 @@ +from typing import Literal + +PrivateAgentSummaryAttributesStatus = Literal["active", "revoked"] + +PRIVATE_AGENT_SUMMARY_ATTRIBUTES_STATUS_VALUES: set[PrivateAgentSummaryAttributesStatus] = { + "active", + "revoked", +} + + +def check_private_agent_summary_attributes_status(value: str | None) -> PrivateAgentSummaryAttributesStatus | None: + if value is None: + return None + if value in PRIVATE_AGENT_SUMMARY_ATTRIBUTES_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PRIVATE_AGENT_SUMMARY_ATTRIBUTES_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/private_agent_summary_type.py b/rootly_sdk/models/private_agent_summary_type.py new file mode 100644 index 00000000..0478ae50 --- /dev/null +++ b/rootly_sdk/models/private_agent_summary_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +PrivateAgentSummaryType = Literal["private_agents"] + +PRIVATE_AGENT_SUMMARY_TYPE_VALUES: set[PrivateAgentSummaryType] = { + "private_agents", +} + + +def check_private_agent_summary_type(value: str | None) -> PrivateAgentSummaryType | None: + if value is None: + return None + if value in PRIVATE_AGENT_SUMMARY_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PRIVATE_AGENT_SUMMARY_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/private_agent_type.py b/rootly_sdk/models/private_agent_type.py new file mode 100644 index 00000000..992918bc --- /dev/null +++ b/rootly_sdk/models/private_agent_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +PrivateAgentType = Literal["private_agents"] + +PRIVATE_AGENT_TYPE_VALUES: set[PrivateAgentType] = { + "private_agents", +} + + +def check_private_agent_type(value: str | None) -> PrivateAgentType | None: + if value is None: + return None + if value in PRIVATE_AGENT_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PRIVATE_AGENT_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/private_agent_update.py b/rootly_sdk/models/private_agent_update.py new file mode 100644 index 00000000..654126eb --- /dev/null +++ b/rootly_sdk/models/private_agent_update.py @@ -0,0 +1,48 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.private_agent_update_data import PrivateAgentUpdateData + + +T = TypeVar("T", bound="PrivateAgentUpdate") + + +@_attrs_define +class PrivateAgentUpdate: + """ + Attributes: + data (PrivateAgentUpdateData): + """ + + data: PrivateAgentUpdateData + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.private_agent_update_data import PrivateAgentUpdateData + + d = dict(src_dict) + data = PrivateAgentUpdateData.from_dict(d.pop("data")) + + private_agent_update = cls( + data=data, + ) + + return private_agent_update diff --git a/rootly_sdk/models/private_agent_update_data.py b/rootly_sdk/models/private_agent_update_data.py new file mode 100644 index 00000000..1a641b1a --- /dev/null +++ b/rootly_sdk/models/private_agent_update_data.py @@ -0,0 +1,58 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.private_agent_update_data_type import PrivateAgentUpdateDataType, check_private_agent_update_data_type + +if TYPE_CHECKING: + from ..models.private_agent_update_data_attributes import PrivateAgentUpdateDataAttributes + + +T = TypeVar("T", bound="PrivateAgentUpdateData") + + +@_attrs_define +class PrivateAgentUpdateData: + """ + Attributes: + type_ (PrivateAgentUpdateDataType): + attributes (PrivateAgentUpdateDataAttributes): + """ + + type_: PrivateAgentUpdateDataType + attributes: PrivateAgentUpdateDataAttributes + + def to_dict(self) -> dict[str, Any]: + type_: str = self.type_ + + attributes = self.attributes.to_dict() + + field_dict: dict[str, Any] = {} + + 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.private_agent_update_data_attributes import PrivateAgentUpdateDataAttributes + + d = dict(src_dict) + type_ = check_private_agent_update_data_type(d.pop("type")) + + attributes = PrivateAgentUpdateDataAttributes.from_dict(d.pop("attributes")) + + private_agent_update_data = cls( + type_=type_, + attributes=attributes, + ) + + return private_agent_update_data diff --git a/rootly_sdk/models/private_agent_update_data_attributes.py b/rootly_sdk/models/private_agent_update_data_attributes.py new file mode 100644 index 00000000..c714d75a --- /dev/null +++ b/rootly_sdk/models/private_agent_update_data_attributes.py @@ -0,0 +1,71 @@ +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="PrivateAgentUpdateDataAttributes") + + +@_attrs_define +class PrivateAgentUpdateDataAttributes: + """ + Attributes: + name (str | Unset): + enabled (bool | Unset): + description (None | str | Unset): Non-sensitive routing metadata. Do not include secrets or personal data. + """ + + name: str | Unset = UNSET + enabled: bool | Unset = UNSET + description: None | str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + name = self.name + + enabled = self.enabled + + description: None | str | Unset + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if name is not UNSET: + field_dict["name"] = name + if enabled is not UNSET: + field_dict["enabled"] = enabled + if description is not UNSET: + field_dict["description"] = description + + 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) + + enabled = d.pop("enabled", UNSET) + + def _parse_description(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + description = _parse_description(d.pop("description", UNSET)) + + private_agent_update_data_attributes = cls( + name=name, + enabled=enabled, + description=description, + ) + + return private_agent_update_data_attributes diff --git a/rootly_sdk/models/private_agent_update_data_type.py b/rootly_sdk/models/private_agent_update_data_type.py new file mode 100644 index 00000000..505d7803 --- /dev/null +++ b/rootly_sdk/models/private_agent_update_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +PrivateAgentUpdateDataType = Literal["private_agents"] + +PRIVATE_AGENT_UPDATE_DATA_TYPE_VALUES: set[PrivateAgentUpdateDataType] = { + "private_agents", +} + + +def check_private_agent_update_data_type(value: str | None) -> PrivateAgentUpdateDataType | None: + if value is None: + return None + if value in PRIVATE_AGENT_UPDATE_DATA_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PRIVATE_AGENT_UPDATE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/problem.py b/rootly_sdk/models/problem.py new file mode 100644 index 00000000..8dc89d0d --- /dev/null +++ b/rootly_sdk/models/problem.py @@ -0,0 +1,619 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.problem_priority import ProblemPriority, check_problem_priority +from ..models.problem_status import ProblemStatus, check_problem_status +from ..types import UNSET, Unset + +T = TypeVar("T", bound="Problem") + + +@_attrs_define +class Problem: + """ + Attributes: + title (str): The title of the problem + status (ProblemStatus): The status of the problem + created_at (str): Date of creation + updated_at (str): Date of last update + sequential_id (int | Unset): Team-scoped sequential number of the problem + display_id (str | Unset): Human-readable identifier of the problem (e.g. PROB-12) + description (None | str | Unset): The description of the problem + owner_user_id (int | None | Unset): ID of the user who owns the problem + owner_group_id (None | str | Unset): ID of the group (team) that owns the problem + priority (ProblemPriority | Unset): The priority of the problem + due_date (datetime.date | None | Unset): The due date of the problem + scope (None | str | Unset): The scope of the problem + exit_criteria (None | str | Unset): The exit criteria of the problem + impact_so_far (None | str | Unset): The impact observed so far + root_cause (None | str | Unset): The root cause of the problem + resolution (None | str | Unset): The resolution of the problem + deferral_reason (None | str | Unset): The reason and accepted risk for deferring the problem + cancellation_reason (None | str | Unset): The reason for cancelling the problem + next_review_at (None | str | Unset): The next review date for a deferred problem + re_review_cadence (int | None | Unset): Days between reviews for a deferred problem + created_by_user_id (int | Unset): ID of the user who created the problem + in_progress_by_user_id (int | None | Unset): ID of the user who moved the problem to in progress + completed_by_user_id (int | None | Unset): ID of the user who completed the problem + deferred_by_user_id (int | None | Unset): ID of the user who approved deferring the problem + cancelled_by_user_id (int | None | Unset): ID of the user who cancelled the problem + in_progress_at (None | str | Unset): When the problem moved to in progress + completed_at (None | str | Unset): When the problem was completed + deferred_at (None | str | Unset): When the problem was deferred + cancelled_at (None | str | Unset): When the problem was cancelled + incident_ids (list[str] | Unset): IDs of incidents linked to the problem + incidents_count (int | Unset): Number of incidents linked to the problem + action_items_count (int | Unset): Number of action items on the problem + subscribers_count (int | Unset): Number of users following the problem + users_assigned_count (int | Unset): Number of problem role assignees + url (str | Unset): URL of the problem in the Rootly web app + """ + + title: str + status: ProblemStatus + created_at: str + updated_at: str + sequential_id: int | Unset = UNSET + display_id: str | Unset = UNSET + description: None | str | Unset = UNSET + owner_user_id: int | None | Unset = UNSET + owner_group_id: None | str | Unset = UNSET + priority: ProblemPriority | Unset = UNSET + due_date: datetime.date | None | Unset = UNSET + scope: None | str | Unset = UNSET + exit_criteria: None | str | Unset = UNSET + impact_so_far: None | str | Unset = UNSET + root_cause: None | str | Unset = UNSET + resolution: None | str | Unset = UNSET + deferral_reason: None | str | Unset = UNSET + cancellation_reason: None | str | Unset = UNSET + next_review_at: None | str | Unset = UNSET + re_review_cadence: int | None | Unset = UNSET + created_by_user_id: int | Unset = UNSET + in_progress_by_user_id: int | None | Unset = UNSET + completed_by_user_id: int | None | Unset = UNSET + deferred_by_user_id: int | None | Unset = UNSET + cancelled_by_user_id: int | None | Unset = UNSET + in_progress_at: None | str | Unset = UNSET + completed_at: None | str | Unset = UNSET + deferred_at: None | str | Unset = UNSET + cancelled_at: None | str | Unset = UNSET + incident_ids: list[str] | Unset = UNSET + incidents_count: int | Unset = UNSET + action_items_count: int | Unset = UNSET + subscribers_count: int | Unset = UNSET + users_assigned_count: int | Unset = UNSET + url: str | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + title = self.title + + status: str = self.status + + created_at = self.created_at + + updated_at = self.updated_at + + sequential_id = self.sequential_id + + display_id = self.display_id + + description: None | str | Unset + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + owner_user_id: int | None | Unset + if isinstance(self.owner_user_id, Unset): + owner_user_id = UNSET + else: + owner_user_id = self.owner_user_id + + owner_group_id: None | str | Unset + if isinstance(self.owner_group_id, Unset): + owner_group_id = UNSET + else: + owner_group_id = self.owner_group_id + + priority: str | Unset = UNSET + if not isinstance(self.priority, Unset): + priority = self.priority + + due_date: None | str | Unset + if isinstance(self.due_date, Unset): + due_date = UNSET + elif isinstance(self.due_date, datetime.date): + due_date = self.due_date.isoformat() + else: + due_date = self.due_date + + scope: None | str | Unset + if isinstance(self.scope, Unset): + scope = UNSET + else: + scope = self.scope + + exit_criteria: None | str | Unset + if isinstance(self.exit_criteria, Unset): + exit_criteria = UNSET + else: + exit_criteria = self.exit_criteria + + impact_so_far: None | str | Unset + if isinstance(self.impact_so_far, Unset): + impact_so_far = UNSET + else: + impact_so_far = self.impact_so_far + + root_cause: None | str | Unset + if isinstance(self.root_cause, Unset): + root_cause = UNSET + else: + root_cause = self.root_cause + + resolution: None | str | Unset + if isinstance(self.resolution, Unset): + resolution = UNSET + else: + resolution = self.resolution + + deferral_reason: None | str | Unset + if isinstance(self.deferral_reason, Unset): + deferral_reason = UNSET + else: + deferral_reason = self.deferral_reason + + cancellation_reason: None | str | Unset + if isinstance(self.cancellation_reason, Unset): + cancellation_reason = UNSET + else: + cancellation_reason = self.cancellation_reason + + next_review_at: None | str | Unset + if isinstance(self.next_review_at, Unset): + next_review_at = UNSET + else: + next_review_at = self.next_review_at + + re_review_cadence: int | None | Unset + if isinstance(self.re_review_cadence, Unset): + re_review_cadence = UNSET + else: + re_review_cadence = self.re_review_cadence + + created_by_user_id = self.created_by_user_id + + in_progress_by_user_id: int | None | Unset + if isinstance(self.in_progress_by_user_id, Unset): + in_progress_by_user_id = UNSET + else: + in_progress_by_user_id = self.in_progress_by_user_id + + completed_by_user_id: int | None | Unset + if isinstance(self.completed_by_user_id, Unset): + completed_by_user_id = UNSET + else: + completed_by_user_id = self.completed_by_user_id + + deferred_by_user_id: int | None | Unset + if isinstance(self.deferred_by_user_id, Unset): + deferred_by_user_id = UNSET + else: + deferred_by_user_id = self.deferred_by_user_id + + cancelled_by_user_id: int | None | Unset + if isinstance(self.cancelled_by_user_id, Unset): + cancelled_by_user_id = UNSET + else: + cancelled_by_user_id = self.cancelled_by_user_id + + in_progress_at: None | str | Unset + if isinstance(self.in_progress_at, Unset): + in_progress_at = UNSET + else: + in_progress_at = self.in_progress_at + + completed_at: None | str | Unset + if isinstance(self.completed_at, Unset): + completed_at = UNSET + else: + completed_at = self.completed_at + + deferred_at: None | str | Unset + if isinstance(self.deferred_at, Unset): + deferred_at = UNSET + else: + deferred_at = self.deferred_at + + cancelled_at: None | str | Unset + if isinstance(self.cancelled_at, Unset): + cancelled_at = UNSET + else: + cancelled_at = self.cancelled_at + + incident_ids: list[str] | Unset = UNSET + if not isinstance(self.incident_ids, Unset): + incident_ids = self.incident_ids + + incidents_count = self.incidents_count + + action_items_count = self.action_items_count + + subscribers_count = self.subscribers_count + + users_assigned_count = self.users_assigned_count + + url = self.url + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "title": title, + "status": status, + "created_at": created_at, + "updated_at": updated_at, + } + ) + if sequential_id is not UNSET: + field_dict["sequential_id"] = sequential_id + if display_id is not UNSET: + field_dict["display_id"] = display_id + if description is not UNSET: + field_dict["description"] = description + if owner_user_id is not UNSET: + field_dict["owner_user_id"] = owner_user_id + if owner_group_id is not UNSET: + field_dict["owner_group_id"] = owner_group_id + if priority is not UNSET: + field_dict["priority"] = priority + if due_date is not UNSET: + field_dict["due_date"] = due_date + if scope is not UNSET: + field_dict["scope"] = scope + if exit_criteria is not UNSET: + field_dict["exit_criteria"] = exit_criteria + if impact_so_far is not UNSET: + field_dict["impact_so_far"] = impact_so_far + if root_cause is not UNSET: + field_dict["root_cause"] = root_cause + if resolution is not UNSET: + field_dict["resolution"] = resolution + if deferral_reason is not UNSET: + field_dict["deferral_reason"] = deferral_reason + if cancellation_reason is not UNSET: + field_dict["cancellation_reason"] = cancellation_reason + if next_review_at is not UNSET: + field_dict["next_review_at"] = next_review_at + if re_review_cadence is not UNSET: + field_dict["re_review_cadence"] = re_review_cadence + if created_by_user_id is not UNSET: + field_dict["created_by_user_id"] = created_by_user_id + if in_progress_by_user_id is not UNSET: + field_dict["in_progress_by_user_id"] = in_progress_by_user_id + if completed_by_user_id is not UNSET: + field_dict["completed_by_user_id"] = completed_by_user_id + if deferred_by_user_id is not UNSET: + field_dict["deferred_by_user_id"] = deferred_by_user_id + if cancelled_by_user_id is not UNSET: + field_dict["cancelled_by_user_id"] = cancelled_by_user_id + if in_progress_at is not UNSET: + field_dict["in_progress_at"] = in_progress_at + if completed_at is not UNSET: + field_dict["completed_at"] = completed_at + if deferred_at is not UNSET: + field_dict["deferred_at"] = deferred_at + if cancelled_at is not UNSET: + field_dict["cancelled_at"] = cancelled_at + if incident_ids is not UNSET: + field_dict["incident_ids"] = incident_ids + if incidents_count is not UNSET: + field_dict["incidents_count"] = incidents_count + if action_items_count is not UNSET: + field_dict["action_items_count"] = action_items_count + if subscribers_count is not UNSET: + field_dict["subscribers_count"] = subscribers_count + if users_assigned_count is not UNSET: + field_dict["users_assigned_count"] = users_assigned_count + if url is not UNSET: + field_dict["url"] = url + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + title = d.pop("title") + + status = check_problem_status(d.pop("status")) + + created_at = d.pop("created_at") + + updated_at = d.pop("updated_at") + + sequential_id = d.pop("sequential_id", UNSET) + + display_id = d.pop("display_id", UNSET) + + def _parse_description(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_owner_user_id(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + owner_user_id = _parse_owner_user_id(d.pop("owner_user_id", UNSET)) + + def _parse_owner_group_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + owner_group_id = _parse_owner_group_id(d.pop("owner_group_id", UNSET)) + + _priority = d.pop("priority", UNSET) + priority: ProblemPriority | Unset + if isinstance(_priority, Unset): + priority = UNSET + else: + priority = check_problem_priority(_priority) + + def _parse_due_date(data: object) -> datetime.date | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + due_date_type_0 = datetime.date.fromisoformat(data) + + return due_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None | Unset, data) + + due_date = _parse_due_date(d.pop("due_date", UNSET)) + + def _parse_scope(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + scope = _parse_scope(d.pop("scope", UNSET)) + + def _parse_exit_criteria(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + exit_criteria = _parse_exit_criteria(d.pop("exit_criteria", UNSET)) + + def _parse_impact_so_far(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + impact_so_far = _parse_impact_so_far(d.pop("impact_so_far", UNSET)) + + def _parse_root_cause(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + root_cause = _parse_root_cause(d.pop("root_cause", UNSET)) + + def _parse_resolution(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + resolution = _parse_resolution(d.pop("resolution", UNSET)) + + def _parse_deferral_reason(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + deferral_reason = _parse_deferral_reason(d.pop("deferral_reason", UNSET)) + + def _parse_cancellation_reason(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + cancellation_reason = _parse_cancellation_reason(d.pop("cancellation_reason", UNSET)) + + def _parse_next_review_at(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + next_review_at = _parse_next_review_at(d.pop("next_review_at", UNSET)) + + def _parse_re_review_cadence(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + re_review_cadence = _parse_re_review_cadence(d.pop("re_review_cadence", UNSET)) + + created_by_user_id = d.pop("created_by_user_id", UNSET) + + def _parse_in_progress_by_user_id(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + in_progress_by_user_id = _parse_in_progress_by_user_id(d.pop("in_progress_by_user_id", UNSET)) + + def _parse_completed_by_user_id(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + completed_by_user_id = _parse_completed_by_user_id(d.pop("completed_by_user_id", UNSET)) + + def _parse_deferred_by_user_id(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + deferred_by_user_id = _parse_deferred_by_user_id(d.pop("deferred_by_user_id", UNSET)) + + def _parse_cancelled_by_user_id(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + cancelled_by_user_id = _parse_cancelled_by_user_id(d.pop("cancelled_by_user_id", UNSET)) + + def _parse_in_progress_at(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + in_progress_at = _parse_in_progress_at(d.pop("in_progress_at", UNSET)) + + def _parse_completed_at(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) + + def _parse_deferred_at(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + deferred_at = _parse_deferred_at(d.pop("deferred_at", UNSET)) + + def _parse_cancelled_at(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + cancelled_at = _parse_cancelled_at(d.pop("cancelled_at", UNSET)) + + incident_ids = cast(list[str], d.pop("incident_ids", UNSET)) + + incidents_count = d.pop("incidents_count", UNSET) + + action_items_count = d.pop("action_items_count", UNSET) + + subscribers_count = d.pop("subscribers_count", UNSET) + + users_assigned_count = d.pop("users_assigned_count", UNSET) + + url = d.pop("url", UNSET) + + problem = cls( + title=title, + status=status, + created_at=created_at, + updated_at=updated_at, + sequential_id=sequential_id, + display_id=display_id, + description=description, + owner_user_id=owner_user_id, + owner_group_id=owner_group_id, + priority=priority, + due_date=due_date, + scope=scope, + exit_criteria=exit_criteria, + impact_so_far=impact_so_far, + root_cause=root_cause, + resolution=resolution, + deferral_reason=deferral_reason, + cancellation_reason=cancellation_reason, + next_review_at=next_review_at, + re_review_cadence=re_review_cadence, + created_by_user_id=created_by_user_id, + in_progress_by_user_id=in_progress_by_user_id, + completed_by_user_id=completed_by_user_id, + deferred_by_user_id=deferred_by_user_id, + cancelled_by_user_id=cancelled_by_user_id, + in_progress_at=in_progress_at, + completed_at=completed_at, + deferred_at=deferred_at, + cancelled_at=cancelled_at, + incident_ids=incident_ids, + incidents_count=incidents_count, + action_items_count=action_items_count, + subscribers_count=subscribers_count, + users_assigned_count=users_assigned_count, + url=url, + ) + + problem.additional_properties = d + return problem + + @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/problem_action_item.py b/rootly_sdk/models/problem_action_item.py new file mode 100644 index 00000000..55af046a --- /dev/null +++ b/rootly_sdk/models/problem_action_item.py @@ -0,0 +1,242 @@ +from __future__ import annotations + +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 ..models.problem_action_item_priority import ProblemActionItemPriority, check_problem_action_item_priority +from ..models.problem_action_item_status import ProblemActionItemStatus, check_problem_action_item_status +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.user_flat_response import UserFlatResponse + + +T = TypeVar("T", bound="ProblemActionItem") + + +@_attrs_define +class ProblemActionItem: + """ + Attributes: + summary (str): The summary of the action item + created_at (str): Date of creation + updated_at (str): Date of last update + problem_id (str | Unset): ID of the problem this action item belongs to + description (None | str | Unset): The description of the action item + assigned_to_user_id (int | None | Unset): ID of user you wish to assign this action item + priority (ProblemActionItemPriority | Unset): The priority of the action item + status (ProblemActionItemStatus | Unset): The status of the action item + due_date (None | str | Unset): The due date of the action item + jira_issue_url (None | str | Unset): The Jira issue URL. + assigned_to (UserFlatResponse | Unset): Flat user attributes as returned by UserFlatSerializer (no nested + associations) + created_by (UserFlatResponse | Unset): Flat user attributes as returned by UserFlatSerializer (no nested + associations) + """ + + summary: str + created_at: str + updated_at: str + problem_id: str | Unset = UNSET + description: None | str | Unset = UNSET + assigned_to_user_id: int | None | Unset = UNSET + priority: ProblemActionItemPriority | Unset = UNSET + status: ProblemActionItemStatus | Unset = UNSET + due_date: None | str | Unset = UNSET + jira_issue_url: None | str | Unset = UNSET + assigned_to: UserFlatResponse | Unset = UNSET + created_by: UserFlatResponse | Unset = 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 + + problem_id = self.problem_id + + description: None | str | Unset + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + assigned_to_user_id: int | None | Unset + if isinstance(self.assigned_to_user_id, Unset): + assigned_to_user_id = UNSET + else: + assigned_to_user_id = self.assigned_to_user_id + + priority: str | Unset = UNSET + if not isinstance(self.priority, Unset): + priority = self.priority + + status: str | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status + + due_date: None | str | Unset + if isinstance(self.due_date, Unset): + due_date = UNSET + else: + due_date = self.due_date + + jira_issue_url: None | str | Unset + if isinstance(self.jira_issue_url, Unset): + jira_issue_url = UNSET + else: + jira_issue_url = self.jira_issue_url + + assigned_to: dict[str, Any] | Unset = UNSET + if not isinstance(self.assigned_to, Unset): + assigned_to = self.assigned_to.to_dict() + + created_by: dict[str, Any] | Unset = UNSET + if not isinstance(self.created_by, Unset): + created_by = self.created_by.to_dict() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "summary": summary, + "created_at": created_at, + "updated_at": updated_at, + } + ) + if problem_id is not UNSET: + field_dict["problem_id"] = problem_id + if description is not UNSET: + field_dict["description"] = description + if assigned_to_user_id is not UNSET: + field_dict["assigned_to_user_id"] = assigned_to_user_id + if priority is not UNSET: + field_dict["priority"] = priority + if status is not UNSET: + field_dict["status"] = status + if due_date is not UNSET: + field_dict["due_date"] = due_date + if jira_issue_url is not UNSET: + field_dict["jira_issue_url"] = jira_issue_url + if assigned_to is not UNSET: + field_dict["assigned_to"] = assigned_to + if created_by is not UNSET: + field_dict["created_by"] = created_by + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.user_flat_response import UserFlatResponse + + d = dict(src_dict) + summary = d.pop("summary") + + created_at = d.pop("created_at") + + updated_at = d.pop("updated_at") + + problem_id = d.pop("problem_id", UNSET) + + def _parse_description(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_assigned_to_user_id(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + assigned_to_user_id = _parse_assigned_to_user_id(d.pop("assigned_to_user_id", UNSET)) + + _priority = d.pop("priority", UNSET) + priority: ProblemActionItemPriority | Unset + if isinstance(_priority, Unset): + priority = UNSET + else: + priority = check_problem_action_item_priority(_priority) + + _status = d.pop("status", UNSET) + status: ProblemActionItemStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = check_problem_action_item_status(_status) + + def _parse_due_date(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + due_date = _parse_due_date(d.pop("due_date", UNSET)) + + def _parse_jira_issue_url(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) + + _assigned_to = d.pop("assigned_to", UNSET) + assigned_to: UserFlatResponse | Unset + if isinstance(_assigned_to, Unset): + assigned_to = UNSET + else: + assigned_to = UserFlatResponse.from_dict(_assigned_to) + + _created_by = d.pop("created_by", UNSET) + created_by: UserFlatResponse | Unset + if isinstance(_created_by, Unset): + created_by = UNSET + else: + created_by = UserFlatResponse.from_dict(_created_by) + + problem_action_item = cls( + summary=summary, + created_at=created_at, + updated_at=updated_at, + problem_id=problem_id, + description=description, + assigned_to_user_id=assigned_to_user_id, + priority=priority, + status=status, + due_date=due_date, + jira_issue_url=jira_issue_url, + assigned_to=assigned_to, + created_by=created_by, + ) + + problem_action_item.additional_properties = d + return problem_action_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/problem_action_item_list.py b/rootly_sdk/models/problem_action_item_list.py new file mode 100644 index 00000000..99b93955 --- /dev/null +++ b/rootly_sdk/models/problem_action_item_list.py @@ -0,0 +1,120 @@ +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 ..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.problem_action_item_list_data_item import ProblemActionItemListDataItem + + +T = TypeVar("T", bound="ProblemActionItemList") + + +@_attrs_define +class ProblemActionItemList: + """ + Attributes: + data (list[ProblemActionItemListDataItem]): + links (Links): + meta (Meta): + included (list[JsonapiIncludedResource] | Unset): + """ + + data: list[ProblemActionItemListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = 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: list[dict[str, Any]] | Unset = 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.problem_action_item_list_data_item import ProblemActionItemListDataItem + + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = ProblemActionItemListDataItem.from_dict(data_item_data) + + data.append(data_item) + + links = Links.from_dict(d.pop("links")) + + meta = Meta.from_dict(d.pop("meta")) + + _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) + + included.append(included_item) + + problem_action_item_list = cls( + data=data, + links=links, + meta=meta, + included=included, + ) + + problem_action_item_list.additional_properties = d + return problem_action_item_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_response_data.py b/rootly_sdk/models/problem_action_item_list_data_item.py similarity index 62% rename from rootly_sdk/models/alert_retrigger_rule_response_data.py rename to rootly_sdk/models/problem_action_item_list_data_item.py index 64c9f063..aef0c20a 100644 --- a/rootly_sdk/models/alert_retrigger_rule_response_data.py +++ b/rootly_sdk/models/problem_action_item_list_data_item.py @@ -1,33 +1,35 @@ +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.alert_retrigger_rule_response_data_type import ( - AlertRetriggerRuleResponseDataType, - check_alert_retrigger_rule_response_data_type, +from ..models.problem_action_item_list_data_item_type import ( + ProblemActionItemListDataItemType, + check_problem_action_item_list_data_item_type, ) if TYPE_CHECKING: - from ..models.alert_retrigger_rule import AlertRetriggerRule + from ..models.problem_action_item import ProblemActionItem -T = TypeVar("T", bound="AlertRetriggerRuleResponseData") +T = TypeVar("T", bound="ProblemActionItemListDataItem") @_attrs_define -class AlertRetriggerRuleResponseData: +class ProblemActionItemListDataItem: """ Attributes: - id (str): Unique ID of the alert_retrigger_rule - type_ (AlertRetriggerRuleResponseDataType): - attributes (AlertRetriggerRule): + id (str): Unique ID of the action item + type_ (ProblemActionItemListDataItemType): + attributes (ProblemActionItem): """ id: str - type_: AlertRetriggerRuleResponseDataType - attributes: "AlertRetriggerRule" + type_: ProblemActionItemListDataItemType + attributes: ProblemActionItem additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,23 +53,23 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.alert_retrigger_rule import AlertRetriggerRule + from ..models.problem_action_item import ProblemActionItem d = dict(src_dict) id = d.pop("id") - type_ = check_alert_retrigger_rule_response_data_type(d.pop("type")) + type_ = check_problem_action_item_list_data_item_type(d.pop("type")) - attributes = AlertRetriggerRule.from_dict(d.pop("attributes")) + attributes = ProblemActionItem.from_dict(d.pop("attributes")) - alert_retrigger_rule_response_data = cls( + problem_action_item_list_data_item = cls( id=id, type_=type_, attributes=attributes, ) - alert_retrigger_rule_response_data.additional_properties = d - return alert_retrigger_rule_response_data + problem_action_item_list_data_item.additional_properties = d + return problem_action_item_list_data_item @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/problem_action_item_list_data_item_type.py b/rootly_sdk/models/problem_action_item_list_data_item_type.py new file mode 100644 index 00000000..b3cc837e --- /dev/null +++ b/rootly_sdk/models/problem_action_item_list_data_item_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +ProblemActionItemListDataItemType = Literal["problem_action_items"] + +PROBLEM_ACTION_ITEM_LIST_DATA_ITEM_TYPE_VALUES: set[ProblemActionItemListDataItemType] = { + "problem_action_items", +} + + +def check_problem_action_item_list_data_item_type(value: str | None) -> ProblemActionItemListDataItemType | None: + if value is None: + return None + if value in PROBLEM_ACTION_ITEM_LIST_DATA_ITEM_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PROBLEM_ACTION_ITEM_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/problem_action_item_priority.py b/rootly_sdk/models/problem_action_item_priority.py new file mode 100644 index 00000000..44c9c4c5 --- /dev/null +++ b/rootly_sdk/models/problem_action_item_priority.py @@ -0,0 +1,17 @@ +from typing import Literal + +ProblemActionItemPriority = Literal["high", "low", "medium"] + +PROBLEM_ACTION_ITEM_PRIORITY_VALUES: set[ProblemActionItemPriority] = { + "high", + "low", + "medium", +} + + +def check_problem_action_item_priority(value: str | None) -> ProblemActionItemPriority | None: + if value is None: + return None + if value in PROBLEM_ACTION_ITEM_PRIORITY_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PROBLEM_ACTION_ITEM_PRIORITY_VALUES!r}") diff --git a/rootly_sdk/models/problem_action_item_response.py b/rootly_sdk/models/problem_action_item_response.py new file mode 100644 index 00000000..92d8d60d --- /dev/null +++ b/rootly_sdk/models/problem_action_item_response.py @@ -0,0 +1,92 @@ +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 ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.problem_action_item_response_data import ProblemActionItemResponseData + + +T = TypeVar("T", bound="ProblemActionItemResponse") + + +@_attrs_define +class ProblemActionItemResponse: + """ + Attributes: + data (ProblemActionItemResponseData): + included (list[JsonapiIncludedResource] | Unset): + """ + + data: ProblemActionItemResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + included: list[dict[str, Any]] | Unset = 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.problem_action_item_response_data import ProblemActionItemResponseData + + d = dict(src_dict) + data = ProblemActionItemResponseData.from_dict(d.pop("data")) + + _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) + + included.append(included_item) + + problem_action_item_response = cls( + data=data, + included=included, + ) + + problem_action_item_response.additional_properties = d + return problem_action_item_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/problem_action_item_response_data.py b/rootly_sdk/models/problem_action_item_response_data.py new file mode 100644 index 00000000..cb59dd5f --- /dev/null +++ b/rootly_sdk/models/problem_action_item_response_data.py @@ -0,0 +1,88 @@ +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.problem_action_item_response_data_type import ( + ProblemActionItemResponseDataType, + check_problem_action_item_response_data_type, +) + +if TYPE_CHECKING: + from ..models.problem_action_item import ProblemActionItem + + +T = TypeVar("T", bound="ProblemActionItemResponseData") + + +@_attrs_define +class ProblemActionItemResponseData: + """ + Attributes: + id (str): Unique ID of the action item + type_ (ProblemActionItemResponseDataType): + attributes (ProblemActionItem): + """ + + id: str + type_: ProblemActionItemResponseDataType + attributes: ProblemActionItem + 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.problem_action_item import ProblemActionItem + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_problem_action_item_response_data_type(d.pop("type")) + + attributes = ProblemActionItem.from_dict(d.pop("attributes")) + + problem_action_item_response_data = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + problem_action_item_response_data.additional_properties = d + return problem_action_item_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/problem_action_item_response_data_type.py b/rootly_sdk/models/problem_action_item_response_data_type.py new file mode 100644 index 00000000..30f23b1d --- /dev/null +++ b/rootly_sdk/models/problem_action_item_response_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +ProblemActionItemResponseDataType = Literal["problem_action_items"] + +PROBLEM_ACTION_ITEM_RESPONSE_DATA_TYPE_VALUES: set[ProblemActionItemResponseDataType] = { + "problem_action_items", +} + + +def check_problem_action_item_response_data_type(value: str | None) -> ProblemActionItemResponseDataType | None: + if value is None: + return None + if value in PROBLEM_ACTION_ITEM_RESPONSE_DATA_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PROBLEM_ACTION_ITEM_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/problem_action_item_status.py b/rootly_sdk/models/problem_action_item_status.py new file mode 100644 index 00000000..8dbbfd12 --- /dev/null +++ b/rootly_sdk/models/problem_action_item_status.py @@ -0,0 +1,18 @@ +from typing import Literal + +ProblemActionItemStatus = Literal["cancelled", "done", "in_progress", "open"] + +PROBLEM_ACTION_ITEM_STATUS_VALUES: set[ProblemActionItemStatus] = { + "cancelled", + "done", + "in_progress", + "open", +} + + +def check_problem_action_item_status(value: str | None) -> ProblemActionItemStatus | None: + if value is None: + return None + if value in PROBLEM_ACTION_ITEM_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PROBLEM_ACTION_ITEM_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/alert_retrigger_rule_list.py b/rootly_sdk/models/problem_list.py similarity index 71% rename from rootly_sdk/models/alert_retrigger_rule_list.py rename to rootly_sdk/models/problem_list.py index e1137b96..64f65512 100644 --- a/rootly_sdk/models/alert_retrigger_rule_list.py +++ b/rootly_sdk/models/problem_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -7,29 +9,29 @@ 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 + from ..models.problem_list_data_item import ProblemListDataItem -T = TypeVar("T", bound="AlertRetriggerRuleList") +T = TypeVar("T", bound="ProblemList") @_attrs_define -class AlertRetriggerRuleList: +class ProblemList: """ Attributes: - data (list['AlertRetriggerRuleListDataItem']): + data (list[ProblemListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["AlertRetriggerRuleListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[ProblemListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -65,16 +67,16 @@ def to_dict(self) -> dict[str, Any]: @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 + from ..models.problem_list_data_item import ProblemListDataItem d = dict(src_dict) data = [] _data = d.pop("data") for data_item_data in _data: - data_item = AlertRetriggerRuleListDataItem.from_dict(data_item_data) + data_item = ProblemListDataItem.from_dict(data_item_data) data.append(data_item) @@ -82,22 +84,24 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - included.append(included_item) + included.append(included_item) - alert_retrigger_rule_list = cls( + problem_list = cls( data=data, links=links, meta=meta, included=included, ) - alert_retrigger_rule_list.additional_properties = d - return alert_retrigger_rule_list + problem_list.additional_properties = d + return problem_list @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/new_alert_retrigger_rule_data.py b/rootly_sdk/models/problem_list_data_item.py similarity index 59% rename from rootly_sdk/models/new_alert_retrigger_rule_data.py rename to rootly_sdk/models/problem_list_data_item.py index 9adebe16..ec6bd65f 100644 --- a/rootly_sdk/models/new_alert_retrigger_rule_data.py +++ b/rootly_sdk/models/problem_list_data_item.py @@ -1,34 +1,37 @@ +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_alert_retrigger_rule_data_type import ( - NewAlertRetriggerRuleDataType, - check_new_alert_retrigger_rule_data_type, -) +from ..models.problem_list_data_item_type import ProblemListDataItemType, check_problem_list_data_item_type if TYPE_CHECKING: - from ..models.new_alert_retrigger_rule_data_attributes import NewAlertRetriggerRuleDataAttributes + from ..models.problem import Problem -T = TypeVar("T", bound="NewAlertRetriggerRuleData") +T = TypeVar("T", bound="ProblemListDataItem") @_attrs_define -class NewAlertRetriggerRuleData: +class ProblemListDataItem: """ Attributes: - type_ (NewAlertRetriggerRuleDataType): - attributes (NewAlertRetriggerRuleDataAttributes): + id (str): Unique ID of the problem + type_ (ProblemListDataItemType): + attributes (Problem): """ - type_: NewAlertRetriggerRuleDataType - attributes: "NewAlertRetriggerRuleDataAttributes" + id: str + type_: ProblemListDataItemType + attributes: Problem 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() @@ -37,6 +40,7 @@ def to_dict(self) -> dict[str, Any]: field_dict.update(self.additional_properties) field_dict.update( { + "id": id, "type": type_, "attributes": attributes, } @@ -46,20 +50,23 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.new_alert_retrigger_rule_data_attributes import NewAlertRetriggerRuleDataAttributes + from ..models.problem import Problem d = dict(src_dict) - type_ = check_new_alert_retrigger_rule_data_type(d.pop("type")) + id = d.pop("id") + + type_ = check_problem_list_data_item_type(d.pop("type")) - attributes = NewAlertRetriggerRuleDataAttributes.from_dict(d.pop("attributes")) + attributes = Problem.from_dict(d.pop("attributes")) - new_alert_retrigger_rule_data = cls( + problem_list_data_item = cls( + id=id, type_=type_, attributes=attributes, ) - new_alert_retrigger_rule_data.additional_properties = d - return new_alert_retrigger_rule_data + problem_list_data_item.additional_properties = d + return problem_list_data_item @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/problem_list_data_item_type.py b/rootly_sdk/models/problem_list_data_item_type.py new file mode 100644 index 00000000..919de524 --- /dev/null +++ b/rootly_sdk/models/problem_list_data_item_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +ProblemListDataItemType = Literal["problems"] + +PROBLEM_LIST_DATA_ITEM_TYPE_VALUES: set[ProblemListDataItemType] = { + "problems", +} + + +def check_problem_list_data_item_type(value: str | None) -> ProblemListDataItemType | None: + if value is None: + return None + if value in PROBLEM_LIST_DATA_ITEM_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PROBLEM_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/problem_priority.py b/rootly_sdk/models/problem_priority.py new file mode 100644 index 00000000..28cb3a6e --- /dev/null +++ b/rootly_sdk/models/problem_priority.py @@ -0,0 +1,18 @@ +from typing import Literal + +ProblemPriority = Literal["P0", "P1", "P2", "P3"] + +PROBLEM_PRIORITY_VALUES: set[ProblemPriority] = { + "P0", + "P1", + "P2", + "P3", +} + + +def check_problem_priority(value: str | None) -> ProblemPriority | None: + if value is None: + return None + if value in PROBLEM_PRIORITY_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PROBLEM_PRIORITY_VALUES!r}") diff --git a/rootly_sdk/models/alert_retrigger_rule_response.py b/rootly_sdk/models/problem_response.py similarity index 65% rename from rootly_sdk/models/alert_retrigger_rule_response.py rename to rootly_sdk/models/problem_response.py index 78cd47eb..a0bdcb16 100644 --- a/rootly_sdk/models/alert_retrigger_rule_response.py +++ b/rootly_sdk/models/problem_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -7,29 +9,29 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.alert_retrigger_rule_response_data import AlertRetriggerRuleResponseData from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.problem_response_data import ProblemResponseData -T = TypeVar("T", bound="AlertRetriggerRuleResponse") +T = TypeVar("T", bound="ProblemResponse") @_attrs_define -class AlertRetriggerRuleResponse: +class ProblemResponse: """ Attributes: - data (AlertRetriggerRuleResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + data (ProblemResponseData): + included (list[JsonapiIncludedResource] | Unset): """ - data: "AlertRetriggerRuleResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: ProblemResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -50,26 +52,28 @@ def to_dict(self) -> dict[str, Any]: @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 + from ..models.problem_response_data import ProblemResponseData d = dict(src_dict) - data = AlertRetriggerRuleResponseData.from_dict(d.pop("data")) + data = ProblemResponseData.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: list[JsonapiIncludedResource] | Unset = UNSET + if _included is not UNSET: + included = [] + for included_item_data in _included: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) - alert_retrigger_rule_response = cls( + problem_response = cls( data=data, included=included, ) - alert_retrigger_rule_response.additional_properties = d - return alert_retrigger_rule_response + problem_response.additional_properties = d + return problem_response @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/update_alert_retrigger_rule_data.py b/rootly_sdk/models/problem_response_data.py similarity index 58% rename from rootly_sdk/models/update_alert_retrigger_rule_data.py rename to rootly_sdk/models/problem_response_data.py index c7d5f159..5e491710 100644 --- a/rootly_sdk/models/update_alert_retrigger_rule_data.py +++ b/rootly_sdk/models/problem_response_data.py @@ -1,34 +1,37 @@ +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_alert_retrigger_rule_data_type import ( - UpdateAlertRetriggerRuleDataType, - check_update_alert_retrigger_rule_data_type, -) +from ..models.problem_response_data_type import ProblemResponseDataType, check_problem_response_data_type if TYPE_CHECKING: - from ..models.update_alert_retrigger_rule_data_attributes import UpdateAlertRetriggerRuleDataAttributes + from ..models.problem import Problem -T = TypeVar("T", bound="UpdateAlertRetriggerRuleData") +T = TypeVar("T", bound="ProblemResponseData") @_attrs_define -class UpdateAlertRetriggerRuleData: +class ProblemResponseData: """ Attributes: - type_ (UpdateAlertRetriggerRuleDataType): - attributes (UpdateAlertRetriggerRuleDataAttributes): + id (str): Unique ID of the problem + type_ (ProblemResponseDataType): + attributes (Problem): """ - type_: UpdateAlertRetriggerRuleDataType - attributes: "UpdateAlertRetriggerRuleDataAttributes" + id: str + type_: ProblemResponseDataType + attributes: Problem 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() @@ -37,6 +40,7 @@ def to_dict(self) -> dict[str, Any]: field_dict.update(self.additional_properties) field_dict.update( { + "id": id, "type": type_, "attributes": attributes, } @@ -46,20 +50,23 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.update_alert_retrigger_rule_data_attributes import UpdateAlertRetriggerRuleDataAttributes + from ..models.problem import Problem d = dict(src_dict) - type_ = check_update_alert_retrigger_rule_data_type(d.pop("type")) + id = d.pop("id") + + type_ = check_problem_response_data_type(d.pop("type")) - attributes = UpdateAlertRetriggerRuleDataAttributes.from_dict(d.pop("attributes")) + attributes = Problem.from_dict(d.pop("attributes")) - update_alert_retrigger_rule_data = cls( + problem_response_data = cls( + id=id, type_=type_, attributes=attributes, ) - update_alert_retrigger_rule_data.additional_properties = d - return update_alert_retrigger_rule_data + problem_response_data.additional_properties = d + return problem_response_data @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/problem_response_data_type.py b/rootly_sdk/models/problem_response_data_type.py new file mode 100644 index 00000000..acd05fde --- /dev/null +++ b/rootly_sdk/models/problem_response_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +ProblemResponseDataType = Literal["problems"] + +PROBLEM_RESPONSE_DATA_TYPE_VALUES: set[ProblemResponseDataType] = { + "problems", +} + + +def check_problem_response_data_type(value: str | None) -> ProblemResponseDataType | None: + if value is None: + return None + if value in PROBLEM_RESPONSE_DATA_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PROBLEM_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/problem_status.py b/rootly_sdk/models/problem_status.py new file mode 100644 index 00000000..ab071aa4 --- /dev/null +++ b/rootly_sdk/models/problem_status.py @@ -0,0 +1,19 @@ +from typing import Literal + +ProblemStatus = Literal["cancelled", "completed", "created", "deferred", "in_progress"] + +PROBLEM_STATUS_VALUES: set[ProblemStatus] = { + "cancelled", + "completed", + "created", + "deferred", + "in_progress", +} + + +def check_problem_status(value: str | None) -> ProblemStatus | None: + if value is None: + return None + if value in PROBLEM_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {PROBLEM_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/publish_incident_task_params.py b/rootly_sdk/models/publish_incident_task_params.py index 3a5074ae..b3d2c60c 100644 --- a/rootly_sdk/models/publish_incident_task_params.py +++ b/rootly_sdk/models/publish_incident_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -8,6 +10,10 @@ PublishIncidentTaskParamsStatus, check_publish_incident_task_params_status, ) +from ..models.publish_incident_task_params_synced_component_status import ( + PublishIncidentTaskParamsSyncedComponentStatus, + check_publish_incident_task_params_synced_component_status, +) from ..models.publish_incident_task_params_task_type import ( PublishIncidentTaskParamsTaskType, check_publish_incident_task_params_task_type, @@ -16,6 +22,9 @@ if TYPE_CHECKING: from ..models.publish_incident_task_params_incident import PublishIncidentTaskParamsIncident + from ..models.publish_incident_task_params_selected_component_statuses import ( + PublishIncidentTaskParamsSelectedComponentStatuses, + ) from ..models.publish_incident_task_params_status_page_template import PublishIncidentTaskParamsStatusPageTemplate @@ -30,31 +39,47 @@ class PublishIncidentTaskParams: public_title (str): status (PublishIncidentTaskParamsStatus): Default: 'resolved'. status_page_id (str): - 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 + 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): + status_page_ids (list[str] | Unset): Publishes the update to every listed status page. This field is in limited + Early Access; contact Rootly Support to request access. When set, it takes precedence over status_page_id and + the first entry becomes status_page_id. + selected_component_keys (list[str] | Unset): Composite "SourceType:" keys of the status page components + affected by the publish. This field is in Early Access and is not generally available; contact Rootly Support to + request access. + selected_component_statuses (PublishIncidentTaskParamsSelectedComponentStatuses | Unset): Impact status to + publish for each selected component key. Keys must match selected_component_keys entries. + sync_incident_components (bool | None | Unset): When true, every run also publishes the incident's tagged + services and functionalities that are components on the target page. Defaults to true when + selected_component_keys is empty. This field is in Early Access and is not generally available; contact Rootly + Support to request access. + synced_component_status (PublishIncidentTaskParamsSyncedComponentStatus | Unset): Impact status published for + components synced from the incident. Defaults to degraded_performance. A component also listed in + selected_component_keys keeps its selected_component_statuses entry. + 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 """ - incident: "PublishIncidentTaskParamsIncident" + incident: PublishIncidentTaskParamsIncident public_title: str status_page_id: str status: PublishIncidentTaskParamsStatus = "resolved" - 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 + 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 + status_page_ids: list[str] | Unset = UNSET + selected_component_keys: list[str] | Unset = UNSET + selected_component_statuses: PublishIncidentTaskParamsSelectedComponentStatuses | Unset = UNSET + sync_incident_components: bool | None | Unset = UNSET + synced_component_status: PublishIncidentTaskParamsSyncedComponentStatus | Unset = UNSET + integration_payload: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -66,7 +91,7 @@ def to_dict(self) -> dict[str, Any]: status_page_id = self.status_page_id - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -76,15 +101,33 @@ def to_dict(self) -> dict[str, Any]: should_tweet = self.should_tweet - status_page_template: Unset | dict[str, Any] = UNSET + status_page_template: dict[str, Any] | Unset = UNSET if not isinstance(self.status_page_template, Unset): status_page_template = self.status_page_template.to_dict() - status_page_ids: Unset | list[str] = UNSET + status_page_ids: list[str] | Unset = UNSET if not isinstance(self.status_page_ids, Unset): status_page_ids = self.status_page_ids - integration_payload: None | Unset | str + selected_component_keys: list[str] | Unset = UNSET + if not isinstance(self.selected_component_keys, Unset): + selected_component_keys = self.selected_component_keys + + selected_component_statuses: dict[str, Any] | Unset = UNSET + if not isinstance(self.selected_component_statuses, Unset): + selected_component_statuses = self.selected_component_statuses.to_dict() + + sync_incident_components: bool | None | Unset + if isinstance(self.sync_incident_components, Unset): + sync_incident_components = UNSET + else: + sync_incident_components = self.sync_incident_components + + synced_component_status: str | Unset = UNSET + if not isinstance(self.synced_component_status, Unset): + synced_component_status = self.synced_component_status + + integration_payload: None | str | Unset if isinstance(self.integration_payload, Unset): integration_payload = UNSET else: @@ -112,6 +155,14 @@ def to_dict(self) -> dict[str, Any]: field_dict["status_page_template"] = status_page_template if status_page_ids is not UNSET: field_dict["status_page_ids"] = status_page_ids + if selected_component_keys is not UNSET: + field_dict["selected_component_keys"] = selected_component_keys + if selected_component_statuses is not UNSET: + field_dict["selected_component_statuses"] = selected_component_statuses + if sync_incident_components is not UNSET: + field_dict["sync_incident_components"] = sync_incident_components + if synced_component_status is not UNSET: + field_dict["synced_component_status"] = synced_component_status if integration_payload is not UNSET: field_dict["integration_payload"] = integration_payload @@ -120,6 +171,9 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.publish_incident_task_params_incident import PublishIncidentTaskParamsIncident + from ..models.publish_incident_task_params_selected_component_statuses import ( + PublishIncidentTaskParamsSelectedComponentStatuses, + ) from ..models.publish_incident_task_params_status_page_template import ( PublishIncidentTaskParamsStatusPageTemplate, ) @@ -134,7 +188,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: Unset | PublishIncidentTaskParamsTaskType + task_type: PublishIncidentTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -147,7 +201,7 @@ 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: Unset | PublishIncidentTaskParamsStatusPageTemplate + status_page_template: PublishIncidentTaskParamsStatusPageTemplate | Unset if isinstance(_status_page_template, Unset): status_page_template = UNSET else: @@ -155,12 +209,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status_page_ids = cast(list[str], d.pop("status_page_ids", UNSET)) - def _parse_integration_payload(data: object) -> None | Unset | str: + selected_component_keys = cast(list[str], d.pop("selected_component_keys", UNSET)) + + _selected_component_statuses = d.pop("selected_component_statuses", UNSET) + selected_component_statuses: PublishIncidentTaskParamsSelectedComponentStatuses | Unset + if isinstance(_selected_component_statuses, Unset): + selected_component_statuses = UNSET + else: + selected_component_statuses = PublishIncidentTaskParamsSelectedComponentStatuses.from_dict( + _selected_component_statuses + ) + + def _parse_sync_incident_components(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + sync_incident_components = _parse_sync_incident_components(d.pop("sync_incident_components", UNSET)) + + _synced_component_status = d.pop("synced_component_status", UNSET) + synced_component_status: PublishIncidentTaskParamsSyncedComponentStatus | Unset + if isinstance(_synced_component_status, Unset): + synced_component_status = UNSET + else: + synced_component_status = check_publish_incident_task_params_synced_component_status( + _synced_component_status + ) + + def _parse_integration_payload(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) integration_payload = _parse_integration_payload(d.pop("integration_payload", UNSET)) @@ -175,6 +258,10 @@ def _parse_integration_payload(data: object) -> None | Unset | str: should_tweet=should_tweet, status_page_template=status_page_template, status_page_ids=status_page_ids, + selected_component_keys=selected_component_keys, + selected_component_statuses=selected_component_statuses, + sync_incident_components=sync_incident_components, + synced_component_status=synced_component_status, 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 01e13aec..2b20e7ca 100644 --- a/rootly_sdk/models/publish_incident_task_params_incident.py +++ b/rootly_sdk/models/publish_incident_task_params_incident.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class PublishIncidentTaskParamsIncident: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_selected_component_statuses.py b/rootly_sdk/models/publish_incident_task_params_selected_component_statuses.py new file mode 100644 index 00000000..1df3130a --- /dev/null +++ b/rootly_sdk/models/publish_incident_task_params_selected_component_statuses.py @@ -0,0 +1,65 @@ +from __future__ import annotations + +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.publish_incident_task_params_selected_component_statuses_additional_property import ( + PublishIncidentTaskParamsSelectedComponentStatusesAdditionalProperty, + check_publish_incident_task_params_selected_component_statuses_additional_property, +) + +T = TypeVar("T", bound="PublishIncidentTaskParamsSelectedComponentStatuses") + + +@_attrs_define +class PublishIncidentTaskParamsSelectedComponentStatuses: + """Impact status to publish for each selected component key. Keys must match selected_component_keys entries.""" + + additional_properties: dict[str, PublishIncidentTaskParamsSelectedComponentStatusesAdditionalProperty] = ( + _attrs_field(init=False, factory=dict) + ) + + def to_dict(self) -> dict[str, Any]: + + field_dict: dict[str, Any] = {} + for prop_name, prop in self.additional_properties.items(): + field_dict[prop_name] = prop + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + publish_incident_task_params_selected_component_statuses = cls() + + additional_properties = {} + for prop_name, prop_dict in d.items(): + additional_property = check_publish_incident_task_params_selected_component_statuses_additional_property( + prop_dict + ) + + additional_properties[prop_name] = additional_property + + publish_incident_task_params_selected_component_statuses.additional_properties = additional_properties + return publish_incident_task_params_selected_component_statuses + + @property + def additional_keys(self) -> list[str]: + return list(self.additional_properties.keys()) + + def __getitem__(self, key: str) -> PublishIncidentTaskParamsSelectedComponentStatusesAdditionalProperty: + return self.additional_properties[key] + + def __setitem__( + self, key: str, value: PublishIncidentTaskParamsSelectedComponentStatusesAdditionalProperty + ) -> 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/publish_incident_task_params_selected_component_statuses_additional_property.py b/rootly_sdk/models/publish_incident_task_params_selected_component_statuses_additional_property.py new file mode 100644 index 00000000..8e546ba0 --- /dev/null +++ b/rootly_sdk/models/publish_incident_task_params_selected_component_statuses_additional_property.py @@ -0,0 +1,26 @@ +from typing import Literal + +PublishIncidentTaskParamsSelectedComponentStatusesAdditionalProperty = Literal[ + "degraded_performance", "major_outage", "operational", "partial_outage" +] + +PUBLISH_INCIDENT_TASK_PARAMS_SELECTED_COMPONENT_STATUSES_ADDITIONAL_PROPERTY_VALUES: set[ + PublishIncidentTaskParamsSelectedComponentStatusesAdditionalProperty +] = { + "degraded_performance", + "major_outage", + "operational", + "partial_outage", +} + + +def check_publish_incident_task_params_selected_component_statuses_additional_property( + value: str | None, +) -> PublishIncidentTaskParamsSelectedComponentStatusesAdditionalProperty | None: + if value is None: + return None + if value in PUBLISH_INCIDENT_TASK_PARAMS_SELECTED_COMPONENT_STATUSES_ADDITIONAL_PROPERTY_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {PUBLISH_INCIDENT_TASK_PARAMS_SELECTED_COMPONENT_STATUSES_ADDITIONAL_PROPERTY_VALUES!r}" + ) diff --git a/rootly_sdk/models/publish_incident_task_params_status.py b/rootly_sdk/models/publish_incident_task_params_status.py index 22f63517..72c28750 100644 --- a/rootly_sdk/models/publish_incident_task_params_status.py +++ b/rootly_sdk/models/publish_incident_task_params_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PublishIncidentTaskParamsStatus = Literal[ "completed", "identified", "in_progress", "investigating", "monitoring", "resolved", "scheduled" @@ -19,5 +19,5 @@ def check_publish_incident_task_params_status(value: str | None) -> PublishIncid if value is None: return None if value in PUBLISH_INCIDENT_TASK_PARAMS_STATUS_VALUES: - return cast(PublishIncidentTaskParamsStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {PUBLISH_INCIDENT_TASK_PARAMS_STATUS_VALUES!r}") 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 fb64cc16..05bd965f 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class PublishIncidentTaskParamsStatusPageTemplate: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_synced_component_status.py b/rootly_sdk/models/publish_incident_task_params_synced_component_status.py new file mode 100644 index 00000000..0d0f5581 --- /dev/null +++ b/rootly_sdk/models/publish_incident_task_params_synced_component_status.py @@ -0,0 +1,24 @@ +from typing import Literal + +PublishIncidentTaskParamsSyncedComponentStatus = Literal[ + "degraded_performance", "major_outage", "operational", "partial_outage" +] + +PUBLISH_INCIDENT_TASK_PARAMS_SYNCED_COMPONENT_STATUS_VALUES: set[PublishIncidentTaskParamsSyncedComponentStatus] = { + "degraded_performance", + "major_outage", + "operational", + "partial_outage", +} + + +def check_publish_incident_task_params_synced_component_status( + value: str | None, +) -> PublishIncidentTaskParamsSyncedComponentStatus | None: + if value is None: + return None + if value in PUBLISH_INCIDENT_TASK_PARAMS_SYNCED_COMPONENT_STATUS_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {PUBLISH_INCIDENT_TASK_PARAMS_SYNCED_COMPONENT_STATUS_VALUES!r}" + ) diff --git a/rootly_sdk/models/publish_incident_task_params_task_type.py b/rootly_sdk/models/publish_incident_task_params_task_type.py index c6b2ba30..29dbd3c1 100644 --- a/rootly_sdk/models/publish_incident_task_params_task_type.py +++ b/rootly_sdk/models/publish_incident_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PublishIncidentTaskParamsTaskType = Literal["publish_incident"] @@ -11,5 +11,5 @@ def check_publish_incident_task_params_task_type(value: str | None) -> PublishIn if value is None: return None if value in PUBLISH_INCIDENT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(PublishIncidentTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {PUBLISH_INCIDENT_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/pulse.py b/rootly_sdk/models/pulse.py index f2638491..d5f9b38b 100644 --- a/rootly_sdk/models/pulse.py +++ b/rootly_sdk/models/pulse.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -24,25 +26,25 @@ class Pulse: summary (str): The summary of the pulse created_at (str): Date of creation updated_at (str): Date of last update - 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 + 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 """ summary: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,55 +58,55 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - source: None | Unset | str + source: None | str | Unset if isinstance(self.source, Unset): source = UNSET else: source = self.source - services: Unset | list[dict[str, Any]] = UNSET + services: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + environments: list[dict[str, Any]] | Unset = 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 | Unset | str + external_url: None | str | Unset if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - labels: Unset | list[None | dict[str, Any]] = UNSET + labels: list[dict[str, Any] | None] | Unset = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: None | dict[str, Any] + labels_item: dict[str, Any] | None if isinstance(labels_item_data, PulseLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - refs: Unset | list[None | dict[str, Any]] = UNSET + refs: list[dict[str, Any] | None] | Unset = UNSET if not isinstance(self.refs, Unset): refs = [] for refs_item_data in self.refs: - refs_item: None | dict[str, Any] + refs_item: dict[str, Any] | None if isinstance(refs_item_data, PulseRefsItemType0): refs_item = refs_item_data.to_dict() else: refs_item = refs_item_data refs.append(refs_item) - data: None | Unset | dict[str, Any] + data: dict[str, Any] | None | Unset if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, PulseDataType0): @@ -153,81 +155,89 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_source(data: object) -> None | Unset | str: + def _parse_source(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) source = _parse_source(d.pop("source", UNSET)) - services = [] _services = d.pop("services", UNSET) - for services_item_data in _services or []: - services_item = Service.from_dict(services_item_data) + 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) - services.append(services_item) + services.append(services_item) - environments = [] _environments = d.pop("environments", UNSET) - for environments_item_data in _environments or []: - environments_item = Environment.from_dict(environments_item_data) + 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) - environments.append(environments_item) + environments.append(environments_item) - def _parse_external_url(data: object) -> None | Unset | str: + def _parse_external_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - labels = [] _labels = d.pop("labels", UNSET) - for labels_item_data in _labels or []: + labels: list[None | PulseLabelsItemType0] | Unset = UNSET + if _labels is not UNSET: + labels = [] + for labels_item_data in _labels: - 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) + 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) - return labels_item_type_0 - except: # noqa: E722 - pass - return cast(Union["PulseLabelsItemType0", None], data) + return labels_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | PulseLabelsItemType0, 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) - for refs_item_data in _refs or []: + refs: list[None | PulseRefsItemType0] | Unset = UNSET + if _refs is not UNSET: + refs = [] + for refs_item_data in _refs: - 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) + 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) - return refs_item_type_0 - except: # noqa: E722 - pass - return cast(Union["PulseRefsItemType0", None], data) + return refs_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | PulseRefsItemType0, 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) -> Union["PulseDataType0", None, Unset]: + def _parse_data(data: object) -> None | PulseDataType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -238,9 +248,9 @@ def _parse_data(data: object) -> Union["PulseDataType0", None, Unset]: data_type_0 = PulseDataType0.from_dict(data) return data_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["PulseDataType0", None, Unset], data) + return cast(None | PulseDataType0 | 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 341057a8..afcb2bbc 100644 --- a/rootly_sdk/models/pulse_data_type_0.py +++ b/rootly_sdk/models/pulse_data_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 6636720d..ff7e4e81 100644 --- a/rootly_sdk/models/pulse_labels_item_type_0.py +++ b/rootly_sdk/models/pulse_labels_item_type_0.py @@ -1,3 +1,5 @@ +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 c83b7397..d0db689e 100644 --- a/rootly_sdk/models/pulse_list.py +++ b/rootly_sdk/models/pulse_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class PulseList: """ Attributes: - data (list['PulseListDataItem']): + data (list[PulseListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["PulseListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[PulseListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 50c07fba..8a4f7e68 100644 --- a/rootly_sdk/models/pulse_list_data_item.py +++ b/rootly_sdk/models/pulse_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/pulse_list_data_item_type.py b/rootly_sdk/models/pulse_list_data_item_type.py index 432604d5..97d62faf 100644 --- a/rootly_sdk/models/pulse_list_data_item_type.py +++ b/rootly_sdk/models/pulse_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PulseListDataItemType = Literal["pulses"] @@ -11,5 +11,5 @@ def check_pulse_list_data_item_type(value: str | None) -> PulseListDataItemType if value is None: return None if value in PULSE_LIST_DATA_ITEM_TYPE_VALUES: - return cast(PulseListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {PULSE_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/pulse_refs_item_type_0.py b/rootly_sdk/models/pulse_refs_item_type_0.py index 7a101f7f..c65c8b53 100644 --- a/rootly_sdk/models/pulse_refs_item_type_0.py +++ b/rootly_sdk/models/pulse_refs_item_type_0.py @@ -1,3 +1,5 @@ +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 d5b9e15c..334dcd92 100644 --- a/rootly_sdk/models/pulse_response.py +++ b/rootly_sdk/models/pulse_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class PulseResponse: """ Attributes: data (PulseResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "PulseResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: PulseResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 7b7d58cc..f9fe8791 100644 --- a/rootly_sdk/models/pulse_response_data.py +++ b/rootly_sdk/models/pulse_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/pulse_response_data_type.py b/rootly_sdk/models/pulse_response_data_type.py index 20e448b3..b29e9719 100644 --- a/rootly_sdk/models/pulse_response_data_type.py +++ b/rootly_sdk/models/pulse_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PulseResponseDataType = Literal["pulses"] @@ -11,5 +11,5 @@ def check_pulse_response_data_type(value: str | None) -> PulseResponseDataType | if value is None: return None if value in PULSE_RESPONSE_DATA_TYPE_VALUES: - return cast(PulseResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {PULSE_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/pulse_trigger_params.py b/rootly_sdk/models/pulse_trigger_params.py index e96eb5f8..138e75d9 100644 --- a/rootly_sdk/models/pulse_trigger_params.py +++ b/rootly_sdk/models/pulse_trigger_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -38,80 +40,80 @@ class PulseTriggerParams: """ Attributes: trigger_type (PulseTriggerParamsTriggerType): - 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[*] + 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[*] """ trigger_type: PulseTriggerParamsTriggerType - 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 + 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 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: Unset | list[str] = UNSET + triggers: list[str] | Unset = 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: Unset | str = UNSET + pulse_condition: str | Unset = UNSET if not isinstance(self.pulse_condition, Unset): pulse_condition = self.pulse_condition - pulse_condition_source: Unset | str = UNSET + pulse_condition_source: str | Unset = 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: Unset | list[str] = UNSET + pulse_sources: list[str] | Unset = UNSET if not isinstance(self.pulse_sources, Unset): pulse_sources = self.pulse_sources - pulse_condition_label: Unset | str = UNSET + pulse_condition_label: str | Unset = 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: Unset | list[str] = UNSET + pulse_labels: list[str] | Unset = UNSET if not isinstance(self.pulse_labels, Unset): pulse_labels = self.pulse_labels - pulse_condition_payload: Unset | str = UNSET + pulse_condition_payload: str | Unset = 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: Unset | list[str] = UNSET + pulse_payload: list[str] | Unset = UNSET if not isinstance(self.pulse_payload, Unset): pulse_payload = self.pulse_payload - pulse_query_payload: None | Unset | str + pulse_query_payload: None | str | Unset if isinstance(self.pulse_query_payload, Unset): pulse_query_payload = UNSET else: @@ -156,22 +158,24 @@ 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) - for triggers_item_data in _triggers or []: - triggers_item = check_pulse_trigger_params_triggers_item(triggers_item_data) + 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) - triggers.append(triggers_item) + triggers.append(triggers_item) _pulse_condition = d.pop("pulse_condition", UNSET) - pulse_condition: Unset | PulseTriggerParamsPulseCondition + pulse_condition: PulseTriggerParamsPulseCondition | Unset 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: Unset | PulseTriggerParamsPulseConditionSource + pulse_condition_source: PulseTriggerParamsPulseConditionSource | Unset if isinstance(_pulse_condition_source, Unset): pulse_condition_source = UNSET else: @@ -182,7 +186,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: Unset | PulseTriggerParamsPulseConditionLabel + pulse_condition_label: PulseTriggerParamsPulseConditionLabel | Unset if isinstance(_pulse_condition_label, Unset): pulse_condition_label = UNSET else: @@ -193,7 +197,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: Unset | PulseTriggerParamsPulseConditionPayload + pulse_condition_payload: PulseTriggerParamsPulseConditionPayload | Unset if isinstance(_pulse_condition_payload, Unset): pulse_condition_payload = UNSET else: @@ -203,12 +207,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 | Unset | str: + def _parse_pulse_query_payload(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pulse_query_payload = _parse_pulse_query_payload(d.pop("pulse_query_payload", UNSET)) diff --git a/rootly_sdk/models/pulse_trigger_params_pulse_condition.py b/rootly_sdk/models/pulse_trigger_params_pulse_condition.py index 8f35d08d..858185f1 100644 --- a/rootly_sdk/models/pulse_trigger_params_pulse_condition.py +++ b/rootly_sdk/models/pulse_trigger_params_pulse_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PulseTriggerParamsPulseCondition = Literal["ALL", "ANY", "NONE"] @@ -13,5 +13,5 @@ def check_pulse_trigger_params_pulse_condition(value: str | None) -> PulseTrigge if value is None: return None if value in PULSE_TRIGGER_PARAMS_PULSE_CONDITION_VALUES: - return cast(PulseTriggerParamsPulseCondition, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {PULSE_TRIGGER_PARAMS_PULSE_CONDITION_VALUES!r}") diff --git a/rootly_sdk/models/pulse_trigger_params_pulse_condition_label.py b/rootly_sdk/models/pulse_trigger_params_pulse_condition_label.py index 32b88686..bc5b307d 100644 --- a/rootly_sdk/models/pulse_trigger_params_pulse_condition_label.py +++ b/rootly_sdk/models/pulse_trigger_params_pulse_condition_label.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PulseTriggerParamsPulseConditionLabel = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -21,7 +21,7 @@ def check_pulse_trigger_params_pulse_condition_label(value: str | None) -> Pulse if value is None: return None if value in PULSE_TRIGGER_PARAMS_PULSE_CONDITION_LABEL_VALUES: - return cast(PulseTriggerParamsPulseConditionLabel, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {PULSE_TRIGGER_PARAMS_PULSE_CONDITION_LABEL_VALUES!r}" ) diff --git a/rootly_sdk/models/pulse_trigger_params_pulse_condition_payload.py b/rootly_sdk/models/pulse_trigger_params_pulse_condition_payload.py index 96270154..96335d6e 100644 --- a/rootly_sdk/models/pulse_trigger_params_pulse_condition_payload.py +++ b/rootly_sdk/models/pulse_trigger_params_pulse_condition_payload.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PulseTriggerParamsPulseConditionPayload = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_pulse_trigger_params_pulse_condition_payload( if value is None: return None if value in PULSE_TRIGGER_PARAMS_PULSE_CONDITION_PAYLOAD_VALUES: - return cast(PulseTriggerParamsPulseConditionPayload, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {PULSE_TRIGGER_PARAMS_PULSE_CONDITION_PAYLOAD_VALUES!r}" ) diff --git a/rootly_sdk/models/pulse_trigger_params_pulse_condition_source.py b/rootly_sdk/models/pulse_trigger_params_pulse_condition_source.py index 32354761..02306006 100644 --- a/rootly_sdk/models/pulse_trigger_params_pulse_condition_source.py +++ b/rootly_sdk/models/pulse_trigger_params_pulse_condition_source.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PulseTriggerParamsPulseConditionSource = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_pulse_trigger_params_pulse_condition_source( if value is None: return None if value in PULSE_TRIGGER_PARAMS_PULSE_CONDITION_SOURCE_VALUES: - return cast(PulseTriggerParamsPulseConditionSource, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {PULSE_TRIGGER_PARAMS_PULSE_CONDITION_SOURCE_VALUES!r}" ) diff --git a/rootly_sdk/models/pulse_trigger_params_trigger_type.py b/rootly_sdk/models/pulse_trigger_params_trigger_type.py index 73fdc134..c3e12ef2 100644 --- a/rootly_sdk/models/pulse_trigger_params_trigger_type.py +++ b/rootly_sdk/models/pulse_trigger_params_trigger_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PulseTriggerParamsTriggerType = Literal["pulse"] @@ -11,5 +11,5 @@ def check_pulse_trigger_params_trigger_type(value: str | None) -> PulseTriggerPa if value is None: return None if value in PULSE_TRIGGER_PARAMS_TRIGGER_TYPE_VALUES: - return cast(PulseTriggerParamsTriggerType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {PULSE_TRIGGER_PARAMS_TRIGGER_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/pulse_trigger_params_triggers_item.py b/rootly_sdk/models/pulse_trigger_params_triggers_item.py index fba9d424..939af6da 100644 --- a/rootly_sdk/models/pulse_trigger_params_triggers_item.py +++ b/rootly_sdk/models/pulse_trigger_params_triggers_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal PulseTriggerParamsTriggersItem = Literal["pulse_created"] @@ -11,5 +11,5 @@ def check_pulse_trigger_params_triggers_item(value: str | None) -> PulseTriggerP if value is None: return None if value in PULSE_TRIGGER_PARAMS_TRIGGERS_ITEM_VALUES: - return cast(PulseTriggerParamsTriggersItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {PULSE_TRIGGER_PARAMS_TRIGGERS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/receipt.py b/rootly_sdk/models/receipt.py index 56511e01..1e6442b7 100644 --- a/rootly_sdk/models/receipt.py +++ b/rootly_sdk/models/receipt.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -16,21 +18,21 @@ class Receipt: """ Attributes: state (ReceiptState): Delivery state of the receipt. - 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). + 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). """ state: ReceiptState - reason: Unset | ReceiptReason = UNSET - resource_type: Unset | str = UNSET - resource_id: Unset | str = UNSET + reason: ReceiptReason | Unset = UNSET + resource_type: str | Unset = UNSET + resource_id: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: state: str = self.state - reason: Unset | str = UNSET + reason: str | Unset = UNSET if not isinstance(self.reason, Unset): reason = self.reason @@ -60,7 +62,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: Unset | ReceiptReason + reason: ReceiptReason | Unset if isinstance(_reason, Unset): reason = UNSET else: diff --git a/rootly_sdk/models/receipt_reason.py b/rootly_sdk/models/receipt_reason.py index ebafb401..5b8619cc 100644 --- a/rootly_sdk/models/receipt_reason.py +++ b/rootly_sdk/models/receipt_reason.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ReceiptReason = Literal["deduplicated", "no_route_matched", "suppressed", "validation_error"] @@ -14,5 +14,5 @@ def check_receipt_reason(value: str | None) -> ReceiptReason | None: if value is None: return None if value in RECEIPT_REASON_VALUES: - return cast(ReceiptReason, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {RECEIPT_REASON_VALUES!r}") diff --git a/rootly_sdk/models/receipt_state.py b/rootly_sdk/models/receipt_state.py index b4e11286..02cd9f0e 100644 --- a/rootly_sdk/models/receipt_state.py +++ b/rootly_sdk/models/receipt_state.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ReceiptState = Literal["done", "failed", "pending"] @@ -13,5 +13,5 @@ def check_receipt_state(value: str | None) -> ReceiptState | None: if value is None: return None if value in RECEIPT_STATE_VALUES: - return cast(ReceiptState, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {RECEIPT_STATE_VALUES!r}") diff --git a/rootly_sdk/models/redis_client_task_params.py b/rootly_sdk/models/redis_client_task_params.py index 6aa2959c..62446bca 100644 --- a/rootly_sdk/models/redis_client_task_params.py +++ b/rootly_sdk/models/redis_client_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,20 +27,20 @@ class RedisClientTaskParams: Attributes: url (str): Example: redis://redis-12345.c1.us-east-1-2.ec2.cloud.redislabs.com:12345. commands (str): - 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']]): + 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): """ url: str commands: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: commands = self.commands - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -56,7 +58,7 @@ def to_dict(self) -> dict[str, Any]: post_to_incident_timeline = self.post_to_incident_timeline - post_to_slack_channels: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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: @@ -96,7 +98,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: Unset | RedisClientTaskParamsTaskType + task_type: RedisClientTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -108,14 +110,16 @@ 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) - 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: 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 + ) - 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 43f76fd7..f9bb82cb 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class RedisClientTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/redis_client_task_params_task_type.py b/rootly_sdk/models/redis_client_task_params_task_type.py index 0220a728..331dc2d1 100644 --- a/rootly_sdk/models/redis_client_task_params_task_type.py +++ b/rootly_sdk/models/redis_client_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RedisClientTaskParamsTaskType = Literal["redis_client"] @@ -11,5 +11,5 @@ def check_redis_client_task_params_task_type(value: str | None) -> RedisClientTa if value is None: return None if value in REDIS_CLIENT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(RedisClientTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {REDIS_CLIENT_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/remove_from_slack_channel_task_params.py b/rootly_sdk/models/remove_from_slack_channel_task_params.py new file mode 100644 index 00000000..7a7b03f6 --- /dev/null +++ b/rootly_sdk/models/remove_from_slack_channel_task_params.py @@ -0,0 +1,101 @@ +from __future__ import annotations + +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.remove_from_slack_channel_task_params_target_kind import ( + RemoveFromSlackChannelTaskParamsTargetKind, + check_remove_from_slack_channel_task_params_target_kind, +) +from ..models.remove_from_slack_channel_task_params_task_type import ( + RemoveFromSlackChannelTaskParamsTaskType, + check_remove_from_slack_channel_task_params_task_type, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="RemoveFromSlackChannelTaskParams") + + +@_attrs_define +class RemoveFromSlackChannelTaskParams: + """ + Attributes: + task_type (RemoveFromSlackChannelTaskParamsTaskType | Unset): + target_kind (RemoveFromSlackChannelTaskParamsTargetKind | Unset): + dry_run (bool | Unset): + """ + + task_type: RemoveFromSlackChannelTaskParamsTaskType | Unset = UNSET + target_kind: RemoveFromSlackChannelTaskParamsTargetKind | Unset = UNSET + dry_run: bool | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + task_type: str | Unset = UNSET + if not isinstance(self.task_type, Unset): + task_type = self.task_type + + target_kind: str | Unset = UNSET + if not isinstance(self.target_kind, Unset): + target_kind = self.target_kind + + dry_run = self.dry_run + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update({}) + if task_type is not UNSET: + field_dict["task_type"] = task_type + if target_kind is not UNSET: + field_dict["target_kind"] = target_kind + if dry_run is not UNSET: + field_dict["dry_run"] = dry_run + + return field_dict + + @classmethod + 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: RemoveFromSlackChannelTaskParamsTaskType | Unset + if isinstance(_task_type, Unset): + task_type = UNSET + else: + task_type = check_remove_from_slack_channel_task_params_task_type(_task_type) + + _target_kind = d.pop("target_kind", UNSET) + target_kind: RemoveFromSlackChannelTaskParamsTargetKind | Unset + if isinstance(_target_kind, Unset): + target_kind = UNSET + else: + target_kind = check_remove_from_slack_channel_task_params_target_kind(_target_kind) + + dry_run = d.pop("dry_run", UNSET) + + remove_from_slack_channel_task_params = cls( + task_type=task_type, + target_kind=target_kind, + dry_run=dry_run, + ) + + remove_from_slack_channel_task_params.additional_properties = d + return remove_from_slack_channel_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/remove_from_slack_channel_task_params_target_kind.py b/rootly_sdk/models/remove_from_slack_channel_task_params_target_kind.py new file mode 100644 index 00000000..a4624864 --- /dev/null +++ b/rootly_sdk/models/remove_from_slack_channel_task_params_target_kind.py @@ -0,0 +1,19 @@ +from typing import Literal + +RemoveFromSlackChannelTaskParamsTargetKind = Literal["users_without_private_incident_access"] + +REMOVE_FROM_SLACK_CHANNEL_TASK_PARAMS_TARGET_KIND_VALUES: set[RemoveFromSlackChannelTaskParamsTargetKind] = { + "users_without_private_incident_access", +} + + +def check_remove_from_slack_channel_task_params_target_kind( + value: str | None, +) -> RemoveFromSlackChannelTaskParamsTargetKind | None: + if value is None: + return None + if value in REMOVE_FROM_SLACK_CHANNEL_TASK_PARAMS_TARGET_KIND_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {REMOVE_FROM_SLACK_CHANNEL_TASK_PARAMS_TARGET_KIND_VALUES!r}" + ) diff --git a/rootly_sdk/models/remove_from_slack_channel_task_params_task_type.py b/rootly_sdk/models/remove_from_slack_channel_task_params_task_type.py new file mode 100644 index 00000000..6903cf94 --- /dev/null +++ b/rootly_sdk/models/remove_from_slack_channel_task_params_task_type.py @@ -0,0 +1,19 @@ +from typing import Literal + +RemoveFromSlackChannelTaskParamsTaskType = Literal["remove_from_slack_channel"] + +REMOVE_FROM_SLACK_CHANNEL_TASK_PARAMS_TASK_TYPE_VALUES: set[RemoveFromSlackChannelTaskParamsTaskType] = { + "remove_from_slack_channel", +} + + +def check_remove_from_slack_channel_task_params_task_type( + value: str | None, +) -> RemoveFromSlackChannelTaskParamsTaskType | None: + if value is None: + return None + if value in REMOVE_FROM_SLACK_CHANNEL_TASK_PARAMS_TASK_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {REMOVE_FROM_SLACK_CHANNEL_TASK_PARAMS_TASK_TYPE_VALUES!r}" + ) 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 6b299669..4caa857f 100644 --- a/rootly_sdk/models/remove_google_docs_permissions_task_params.py +++ b/rootly_sdk/models/remove_google_docs_permissions_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -24,13 +26,13 @@ class RemoveGoogleDocsPermissionsTaskParams: file_id (str): The Google Doc file ID attribute_to_query_by (RemoveGoogleDocsPermissionsTaskParamsAttributeToQueryBy): Default: 'email_address'. value (str): - task_type (Union[Unset, RemoveGoogleDocsPermissionsTaskParamsTaskType]): + task_type (RemoveGoogleDocsPermissionsTaskParamsTaskType | Unset): """ file_id: str value: str attribute_to_query_by: RemoveGoogleDocsPermissionsTaskParamsAttributeToQueryBy = "email_address" - task_type: Unset | RemoveGoogleDocsPermissionsTaskParamsTaskType = UNSET + task_type: RemoveGoogleDocsPermissionsTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: value = self.value - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -70,7 +72,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: Unset | RemoveGoogleDocsPermissionsTaskParamsTaskType + task_type: RemoveGoogleDocsPermissionsTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/remove_google_docs_permissions_task_params_attribute_to_query_by.py b/rootly_sdk/models/remove_google_docs_permissions_task_params_attribute_to_query_by.py index ffba00bd..d2fa86e9 100644 --- a/rootly_sdk/models/remove_google_docs_permissions_task_params_attribute_to_query_by.py +++ b/rootly_sdk/models/remove_google_docs_permissions_task_params_attribute_to_query_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RemoveGoogleDocsPermissionsTaskParamsAttributeToQueryBy = Literal["email_address", "role", "type"] @@ -17,7 +17,7 @@ def check_remove_google_docs_permissions_task_params_attribute_to_query_by( if value is None: return None if value in REMOVE_GOOGLE_DOCS_PERMISSIONS_TASK_PARAMS_ATTRIBUTE_TO_QUERY_BY_VALUES: - return cast(RemoveGoogleDocsPermissionsTaskParamsAttributeToQueryBy, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {REMOVE_GOOGLE_DOCS_PERMISSIONS_TASK_PARAMS_ATTRIBUTE_TO_QUERY_BY_VALUES!r}" ) diff --git a/rootly_sdk/models/remove_google_docs_permissions_task_params_task_type.py b/rootly_sdk/models/remove_google_docs_permissions_task_params_task_type.py index 681e8436..f24f2d65 100644 --- a/rootly_sdk/models/remove_google_docs_permissions_task_params_task_type.py +++ b/rootly_sdk/models/remove_google_docs_permissions_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RemoveGoogleDocsPermissionsTaskParamsTaskType = Literal["remove_google_docs_permissions"] @@ -13,7 +13,7 @@ def check_remove_google_docs_permissions_task_params_task_type( if value is None: return None if value in REMOVE_GOOGLE_DOCS_PERMISSIONS_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(RemoveGoogleDocsPermissionsTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {REMOVE_GOOGLE_DOCS_PERMISSIONS_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/remove_subscribers.py b/rootly_sdk/models/remove_subscribers.py index 39d25586..81111ad6 100644 --- a/rootly_sdk/models/remove_subscribers.py +++ b/rootly_sdk/models/remove_subscribers.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.remove_subscribers_data import RemoveSubscribersData @@ -18,14 +19,13 @@ class RemoveSubscribers: data (RemoveSubscribersData): """ - data: "RemoveSubscribersData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: RemoveSubscribersData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - remove_subscribers.additional_properties = d return remove_subscribers - - @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/remove_subscribers_data.py b/rootly_sdk/models/remove_subscribers_data.py index 5f04e403..ae5ebe7f 100644 --- a/rootly_sdk/models/remove_subscribers_data.py +++ b/rootly_sdk/models/remove_subscribers_data.py @@ -1,8 +1,9 @@ +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.remove_subscribers_data_type import RemoveSubscribersDataType, check_remove_subscribers_data_type @@ -22,8 +23,7 @@ class RemoveSubscribersData: """ type_: RemoveSubscribersDataType - attributes: "RemoveSubscribersDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: RemoveSubscribersDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - remove_subscribers_data.additional_properties = d return remove_subscribers_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/remove_subscribers_data_attributes.py b/rootly_sdk/models/remove_subscribers_data_attributes.py index c8933597..a2b72357 100644 --- a/rootly_sdk/models/remove_subscribers_data_attributes.py +++ b/rootly_sdk/models/remove_subscribers_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,17 +14,17 @@ class RemoveSubscribersDataAttributes: """ Attributes: - user_ids (Union[None, Unset, list[str]]): IDs of users you wish to remove from the list of subscribers for this + user_ids (list[str] | None | Unset): IDs of users you wish to remove from the 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. + 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: None | Unset | list[str] = UNSET - remove_users_with_no_private_incident_access: None | Unset | bool = False + user_ids: list[str] | None | Unset = UNSET + remove_users_with_no_private_incident_access: bool | None | Unset = False def to_dict(self) -> dict[str, Any]: - user_ids: None | Unset | list[str] + user_ids: list[str] | None | Unset if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -31,7 +33,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - remove_users_with_no_private_incident_access: None | Unset | bool + remove_users_with_no_private_incident_access: bool | None | Unset if isinstance(self.remove_users_with_no_private_incident_access, Unset): remove_users_with_no_private_incident_access = UNSET else: @@ -51,7 +53,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) -> None | Unset | list[str]: + def _parse_user_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -62,18 +64,18 @@ def _parse_user_ids(data: object) -> None | Unset | list[str]: user_ids_type_0 = cast(list[str], data) return user_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_remove_users_with_no_private_incident_access(data: object) -> None | Unset | bool: + def _parse_remove_users_with_no_private_incident_access(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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/remove_subscribers_data_type.py b/rootly_sdk/models/remove_subscribers_data_type.py index 521a32f9..b81292ef 100644 --- a/rootly_sdk/models/remove_subscribers_data_type.py +++ b/rootly_sdk/models/remove_subscribers_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RemoveSubscribersDataType = Literal["incidents"] @@ -11,5 +11,5 @@ def check_remove_subscribers_data_type(value: str | None) -> RemoveSubscribersDa if value is None: return None if value in REMOVE_SUBSCRIBERS_DATA_TYPE_VALUES: - return cast(RemoveSubscribersDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {REMOVE_SUBSCRIBERS_DATA_TYPE_VALUES!r}") 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 7d91f3e8..9415ad6f 100644 --- a/rootly_sdk/models/rename_google_chat_space_task_params.py +++ b/rootly_sdk/models/rename_google_chat_space_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,12 +25,12 @@ class RenameGoogleChatSpaceTaskParams: Attributes: space (RenameGoogleChatSpaceTaskParamsSpace): title (str): - task_type (Union[Unset, RenameGoogleChatSpaceTaskParamsTaskType]): + task_type (RenameGoogleChatSpaceTaskParamsTaskType | Unset): """ - space: "RenameGoogleChatSpaceTaskParamsSpace" + space: RenameGoogleChatSpaceTaskParamsSpace title: str - task_type: Unset | RenameGoogleChatSpaceTaskParamsTaskType = UNSET + task_type: RenameGoogleChatSpaceTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +38,7 @@ def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,7 +65,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: Unset | RenameGoogleChatSpaceTaskParamsTaskType + task_type: RenameGoogleChatSpaceTaskParamsTaskType | Unset 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 d121c0ac..5b28cfb2 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class RenameGoogleChatSpaceTaskParamsSpace: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_google_chat_space_task_params_task_type.py b/rootly_sdk/models/rename_google_chat_space_task_params_task_type.py index 1b672166..1ad1a0f2 100644 --- a/rootly_sdk/models/rename_google_chat_space_task_params_task_type.py +++ b/rootly_sdk/models/rename_google_chat_space_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RenameGoogleChatSpaceTaskParamsTaskType = Literal["rename_google_chat_space"] @@ -13,7 +13,7 @@ def check_rename_google_chat_space_task_params_task_type( if value is None: return None if value in RENAME_GOOGLE_CHAT_SPACE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(RenameGoogleChatSpaceTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {RENAME_GOOGLE_CHAT_SPACE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 4e0c3dfe..c5ecded6 100644 --- a/rootly_sdk/models/rename_microsoft_teams_channel_task_params.py +++ b/rootly_sdk/models/rename_microsoft_teams_channel_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,13 +27,13 @@ class RenameMicrosoftTeamsChannelTaskParams: team (RenameMicrosoftTeamsChannelTaskParamsTeam): channel (RenameMicrosoftTeamsChannelTaskParamsChannel): title (str): - task_type (Union[Unset, RenameMicrosoftTeamsChannelTaskParamsTaskType]): + task_type (RenameMicrosoftTeamsChannelTaskParamsTaskType | Unset): """ - team: "RenameMicrosoftTeamsChannelTaskParamsTeam" - channel: "RenameMicrosoftTeamsChannelTaskParamsChannel" + team: RenameMicrosoftTeamsChannelTaskParamsTeam + channel: RenameMicrosoftTeamsChannelTaskParamsChannel title: str - task_type: Unset | RenameMicrosoftTeamsChannelTaskParamsTaskType = UNSET + task_type: RenameMicrosoftTeamsChannelTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,7 +43,7 @@ def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -74,7 +76,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: Unset | RenameMicrosoftTeamsChannelTaskParamsTaskType + task_type: RenameMicrosoftTeamsChannelTaskParamsTaskType | Unset 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 40a6795c..adc80c16 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class RenameMicrosoftTeamsChannelTaskParamsChannel: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/rename_microsoft_teams_channel_task_params_task_type.py index 5b5974a9..1b05f81b 100644 --- a/rootly_sdk/models/rename_microsoft_teams_channel_task_params_task_type.py +++ b/rootly_sdk/models/rename_microsoft_teams_channel_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RenameMicrosoftTeamsChannelTaskParamsTaskType = Literal["rename_microsoft_teams_channel"] @@ -13,7 +13,7 @@ def check_rename_microsoft_teams_channel_task_params_task_type( if value is None: return None if value in RENAME_MICROSOFT_TEAMS_CHANNEL_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(RenameMicrosoftTeamsChannelTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {RENAME_MICROSOFT_TEAMS_CHANNEL_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 40409c1b..45eda40c 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class RenameMicrosoftTeamsChannelTaskParamsTeam: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 47cecb7e..bf6f9979 100644 --- a/rootly_sdk/models/rename_slack_channel_task_params.py +++ b/rootly_sdk/models/rename_slack_channel_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,12 +25,18 @@ class RenameSlackChannelTaskParams: Attributes: channel (RenameSlackChannelTaskParamsChannel): title (str): - task_type (Union[Unset, RenameSlackChannelTaskParamsTaskType]): + task_type (RenameSlackChannelTaskParamsTaskType | Unset): + retry_count (int | Unset): Number of times to retry on rate-limit (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. """ - channel: "RenameSlackChannelTaskParamsChannel" + channel: RenameSlackChannelTaskParamsChannel title: str - task_type: Unset | RenameSlackChannelTaskParamsTaskType = UNSET + task_type: RenameSlackChannelTaskParamsTaskType | Unset = UNSET + retry_count: int | Unset = 0 + retry_wait_time: int | Unset = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,10 +44,14 @@ def to_dict(self) -> dict[str, Any]: title = self.title - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type + 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( @@ -50,6 +62,10 @@ def to_dict(self) -> dict[str, Any]: ) if task_type is not UNSET: field_dict["task_type"] = task_type + 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 @@ -63,16 +79,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: Unset | RenameSlackChannelTaskParamsTaskType + task_type: RenameSlackChannelTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_rename_slack_channel_task_params_task_type(_task_type) + retry_count = d.pop("retry_count", UNSET) + + retry_wait_time = d.pop("retry_wait_time", UNSET) + rename_slack_channel_task_params = cls( channel=channel, title=title, task_type=task_type, + retry_count=retry_count, + retry_wait_time=retry_wait_time, ) rename_slack_channel_task_params.additional_properties = d 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 4d14a018..e2cc7d5f 100644 --- a/rootly_sdk/models/rename_slack_channel_task_params_channel.py +++ b/rootly_sdk/models/rename_slack_channel_task_params_channel.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class RenameSlackChannelTaskParamsChannel: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/rename_slack_channel_task_params_task_type.py index e236f68b..b239d106 100644 --- a/rootly_sdk/models/rename_slack_channel_task_params_task_type.py +++ b/rootly_sdk/models/rename_slack_channel_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RenameSlackChannelTaskParamsTaskType = Literal["rename_slack_channel"] @@ -11,7 +11,7 @@ def check_rename_slack_channel_task_params_task_type(value: str | None) -> Renam if value is None: return None if value in RENAME_SLACK_CHANNEL_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(RenameSlackChannelTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {RENAME_SLACK_CHANNEL_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/resend_verification_user_phone_number_response_200.py b/rootly_sdk/models/resend_verification_user_phone_number_response_200.py new file mode 100644 index 00000000..0e4bcccd --- /dev/null +++ b/rootly_sdk/models/resend_verification_user_phone_number_response_200.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ResendVerificationUserPhoneNumberResponse200") + + +@_attrs_define +class ResendVerificationUserPhoneNumberResponse200: + """ + Attributes: + message (str): + """ + + message: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "message": message, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + message = d.pop("message") + + resend_verification_user_phone_number_response_200 = cls( + message=message, + ) + + resend_verification_user_phone_number_response_200.additional_properties = d + return resend_verification_user_phone_number_response_200 + + @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/resend_verification_user_phone_number_response_429.py b/rootly_sdk/models/resend_verification_user_phone_number_response_429.py new file mode 100644 index 00000000..01dec76e --- /dev/null +++ b/rootly_sdk/models/resend_verification_user_phone_number_response_429.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ResendVerificationUserPhoneNumberResponse429") + + +@_attrs_define +class ResendVerificationUserPhoneNumberResponse429: + """ + Attributes: + error (str): + """ + + error: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + error = self.error + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "error": error, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + error = d.pop("error") + + resend_verification_user_phone_number_response_429 = cls( + error=error, + ) + + resend_verification_user_phone_number_response_429.additional_properties = d + return resend_verification_user_phone_number_response_429 + + @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/resolve_alert.py b/rootly_sdk/models/resolve_alert.py index d14428fe..fb0a3318 100644 --- a/rootly_sdk/models/resolve_alert.py +++ b/rootly_sdk/models/resolve_alert.py @@ -1,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..types import UNSET, Unset @@ -17,19 +18,18 @@ class ResolveAlert: """ Attributes: - data (Union[Unset, ResolveAlertData]): + data (ResolveAlertData | Unset): """ - data: Union[Unset, "ResolveAlertData"] = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: ResolveAlertData | Unset = UNSET def to_dict(self) -> dict[str, Any]: - data: Unset | dict[str, Any] = UNSET + data: dict[str, Any] | Unset = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if data is not UNSET: field_dict["data"] = data @@ -42,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: Unset | ResolveAlertData + data: ResolveAlertData | Unset if isinstance(_data, Unset): data = UNSET else: @@ -52,21 +52,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - resolve_alert.additional_properties = d return resolve_alert - - @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/resolve_alert_data.py b/rootly_sdk/models/resolve_alert_data.py index 7286461f..0a06e226 100644 --- a/rootly_sdk/models/resolve_alert_data.py +++ b/rootly_sdk/models/resolve_alert_data.py @@ -1,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.resolve_alert_data_type import ResolveAlertDataType, check_resolve_alert_data_type from ..types import UNSET, Unset @@ -18,25 +19,24 @@ class ResolveAlertData: """ Attributes: - type_ (Union[Unset, ResolveAlertDataType]): - attributes (Union[Unset, ResolveAlertDataAttributes]): + type_ (ResolveAlertDataType | Unset): + attributes (ResolveAlertDataAttributes | Unset): """ - type_: Unset | ResolveAlertDataType = UNSET - attributes: Union[Unset, "ResolveAlertDataAttributes"] = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + type_: ResolveAlertDataType | Unset = UNSET + attributes: ResolveAlertDataAttributes | Unset = UNSET def to_dict(self) -> dict[str, Any]: - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if type_ is not UNSET: field_dict["type"] = type_ @@ -51,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_: Unset | ResolveAlertDataType + type_: ResolveAlertDataType | Unset if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_resolve_alert_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Unset | ResolveAlertDataAttributes + attributes: ResolveAlertDataAttributes | Unset if isinstance(_attributes, Unset): attributes = UNSET else: @@ -69,21 +69,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - resolve_alert_data.additional_properties = d return resolve_alert_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/resolve_alert_data_attributes.py b/rootly_sdk/models/resolve_alert_data_attributes.py index a074323f..5eb5f308 100644 --- a/rootly_sdk/models/resolve_alert_data_attributes.py +++ b/rootly_sdk/models/resolve_alert_data_attributes.py @@ -1,10 +1,21 @@ +from __future__ import annotations + 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 ..types import UNSET, Unset +if TYPE_CHECKING: + from ..models.resolve_alert_data_attributes_actor_type_0 import ResolveAlertDataAttributesActorType0 + from ..models.resolve_alert_data_attributes_actor_type_1 import ResolveAlertDataAttributesActorType1 + from ..models.resolve_alert_data_attributes_actor_type_2_type_0 import ResolveAlertDataAttributesActorType2Type0 + from ..models.resolve_alert_data_attributes_actor_type_2_type_1 import ResolveAlertDataAttributesActorType2Type1 + from ..models.resolve_alert_data_attributes_actor_type_3_type_0 import ResolveAlertDataAttributesActorType3Type0 + from ..models.resolve_alert_data_attributes_actor_type_3_type_1 import ResolveAlertDataAttributesActorType3Type1 + + T = TypeVar("T", bound="ResolveAlertDataAttributes") @@ -12,26 +23,64 @@ class ResolveAlertDataAttributes: """ Attributes: - 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): How was the alert resolved? + resolve_related_incidents (bool | None | Unset): Resolve all associated incidents + actor (ResolveAlertDataAttributesActorType0 | ResolveAlertDataAttributesActorType1 | + ResolveAlertDataAttributesActorType2Type0 | ResolveAlertDataAttributesActorType2Type1 | + ResolveAlertDataAttributesActorType3Type0 | ResolveAlertDataAttributesActorType3Type1 | Unset): The user to + record as performing this action. Only available when actor attribution is enabled for the organization; + otherwise it is ignored. Only supported with Global and Team API keys; with a Team API key the user must belong + to one of the key's teams. When omitted or null, the action is attributed to the API key. Otherwise provide + either `email` or `user_id`, not both. """ - resolution_message: None | Unset | str = UNSET - resolve_related_incidents: None | Unset | bool = UNSET + resolution_message: None | str | Unset = UNSET + resolve_related_incidents: bool | None | Unset = UNSET + actor: ( + ResolveAlertDataAttributesActorType0 + | ResolveAlertDataAttributesActorType1 + | ResolveAlertDataAttributesActorType2Type0 + | ResolveAlertDataAttributesActorType2Type1 + | ResolveAlertDataAttributesActorType3Type0 + | ResolveAlertDataAttributesActorType3Type1 + | Unset + ) = UNSET def to_dict(self) -> dict[str, Any]: - resolution_message: None | Unset | str + from ..models.resolve_alert_data_attributes_actor_type_0 import ResolveAlertDataAttributesActorType0 + from ..models.resolve_alert_data_attributes_actor_type_1 import ResolveAlertDataAttributesActorType1 + from ..models.resolve_alert_data_attributes_actor_type_2_type_0 import ResolveAlertDataAttributesActorType2Type0 + from ..models.resolve_alert_data_attributes_actor_type_2_type_1 import ResolveAlertDataAttributesActorType2Type1 + from ..models.resolve_alert_data_attributes_actor_type_3_type_0 import ResolveAlertDataAttributesActorType3Type0 + + resolution_message: None | str | Unset if isinstance(self.resolution_message, Unset): resolution_message = UNSET else: resolution_message = self.resolution_message - resolve_related_incidents: None | Unset | bool + resolve_related_incidents: bool | None | Unset if isinstance(self.resolve_related_incidents, Unset): resolve_related_incidents = UNSET else: resolve_related_incidents = self.resolve_related_incidents + actor: dict[str, Any] | Unset + if isinstance(self.actor, Unset): + actor = UNSET + elif isinstance(self.actor, ResolveAlertDataAttributesActorType0): + actor = self.actor.to_dict() + elif isinstance(self.actor, ResolveAlertDataAttributesActorType1): + actor = self.actor.to_dict() + elif isinstance(self.actor, ResolveAlertDataAttributesActorType2Type0): + actor = self.actor.to_dict() + elif isinstance(self.actor, ResolveAlertDataAttributesActorType2Type1): + actor = self.actor.to_dict() + elif isinstance(self.actor, ResolveAlertDataAttributesActorType3Type0): + actor = self.actor.to_dict() + else: + actor = self.actor.to_dict() + field_dict: dict[str, Any] = {} field_dict.update({}) @@ -39,34 +88,105 @@ def to_dict(self) -> dict[str, Any]: field_dict["resolution_message"] = resolution_message if resolve_related_incidents is not UNSET: field_dict["resolve_related_incidents"] = resolve_related_incidents + if actor is not UNSET: + field_dict["actor"] = actor return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.resolve_alert_data_attributes_actor_type_0 import ResolveAlertDataAttributesActorType0 + from ..models.resolve_alert_data_attributes_actor_type_1 import ResolveAlertDataAttributesActorType1 + from ..models.resolve_alert_data_attributes_actor_type_2_type_0 import ResolveAlertDataAttributesActorType2Type0 + from ..models.resolve_alert_data_attributes_actor_type_2_type_1 import ResolveAlertDataAttributesActorType2Type1 + from ..models.resolve_alert_data_attributes_actor_type_3_type_0 import ResolveAlertDataAttributesActorType3Type0 + from ..models.resolve_alert_data_attributes_actor_type_3_type_1 import ResolveAlertDataAttributesActorType3Type1 + d = dict(src_dict) - def _parse_resolution_message(data: object) -> None | Unset | str: + def _parse_resolution_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) resolution_message = _parse_resolution_message(d.pop("resolution_message", UNSET)) - def _parse_resolve_related_incidents(data: object) -> None | Unset | bool: + def _parse_resolve_related_incidents(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) resolve_related_incidents = _parse_resolve_related_incidents(d.pop("resolve_related_incidents", UNSET)) + def _parse_actor( + data: object, + ) -> ( + ResolveAlertDataAttributesActorType0 + | ResolveAlertDataAttributesActorType1 + | ResolveAlertDataAttributesActorType2Type0 + | ResolveAlertDataAttributesActorType2Type1 + | ResolveAlertDataAttributesActorType3Type0 + | ResolveAlertDataAttributesActorType3Type1 + | Unset + ): + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_0 = ResolveAlertDataAttributesActorType0.from_dict(data) + + return actor_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_1 = ResolveAlertDataAttributesActorType1.from_dict(data) + + return actor_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_2_type_0 = ResolveAlertDataAttributesActorType2Type0.from_dict(data) + + return actor_type_2_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_2_type_1 = ResolveAlertDataAttributesActorType2Type1.from_dict(data) + + return actor_type_2_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_3_type_0 = ResolveAlertDataAttributesActorType3Type0.from_dict(data) + + return actor_type_3_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + actor_type_3_type_1 = ResolveAlertDataAttributesActorType3Type1.from_dict(data) + + return actor_type_3_type_1 + + actor = _parse_actor(d.pop("actor", UNSET)) + resolve_alert_data_attributes = cls( resolution_message=resolution_message, resolve_related_incidents=resolve_related_incidents, + actor=actor, ) return resolve_alert_data_attributes diff --git a/rootly_sdk/models/resolve_alert_data_attributes_actor_type_0.py b/rootly_sdk/models/resolve_alert_data_attributes_actor_type_0.py new file mode 100644 index 00000000..cde4d16c --- /dev/null +++ b/rootly_sdk/models/resolve_alert_data_attributes_actor_type_0.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="ResolveAlertDataAttributesActorType0") + + +@_attrs_define +class ResolveAlertDataAttributesActorType0: + """ + Attributes: + email (str): Email of the user, including verified secondary emails. + """ + + email: str + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + resolve_alert_data_attributes_actor_type_0 = cls( + email=email, + ) + + return resolve_alert_data_attributes_actor_type_0 diff --git a/rootly_sdk/models/resolve_alert_data_attributes_actor_type_1.py b/rootly_sdk/models/resolve_alert_data_attributes_actor_type_1.py new file mode 100644 index 00000000..a01d8ad5 --- /dev/null +++ b/rootly_sdk/models/resolve_alert_data_attributes_actor_type_1.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="ResolveAlertDataAttributesActorType1") + + +@_attrs_define +class ResolveAlertDataAttributesActorType1: + """ + Attributes: + user_id (str): Rootly ID of the user. + """ + + user_id: str + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user_id": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("user_id") + + resolve_alert_data_attributes_actor_type_1 = cls( + user_id=user_id, + ) + + return resolve_alert_data_attributes_actor_type_1 diff --git a/rootly_sdk/models/resolve_alert_data_attributes_actor_type_2_type_0.py b/rootly_sdk/models/resolve_alert_data_attributes_actor_type_2_type_0.py new file mode 100644 index 00000000..1d8f0977 --- /dev/null +++ b/rootly_sdk/models/resolve_alert_data_attributes_actor_type_2_type_0.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="ResolveAlertDataAttributesActorType2Type0") + + +@_attrs_define +class ResolveAlertDataAttributesActorType2Type0: + """ + Attributes: + email (str): Email of the user, including verified secondary emails. + """ + + email: str + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + resolve_alert_data_attributes_actor_type_2_type_0 = cls( + email=email, + ) + + return resolve_alert_data_attributes_actor_type_2_type_0 diff --git a/rootly_sdk/models/resolve_alert_data_attributes_actor_type_2_type_1.py b/rootly_sdk/models/resolve_alert_data_attributes_actor_type_2_type_1.py new file mode 100644 index 00000000..43c9e9a8 --- /dev/null +++ b/rootly_sdk/models/resolve_alert_data_attributes_actor_type_2_type_1.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="ResolveAlertDataAttributesActorType2Type1") + + +@_attrs_define +class ResolveAlertDataAttributesActorType2Type1: + """ + Attributes: + user_id (str): Rootly ID of the user. + """ + + user_id: str + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user_id": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("user_id") + + resolve_alert_data_attributes_actor_type_2_type_1 = cls( + user_id=user_id, + ) + + return resolve_alert_data_attributes_actor_type_2_type_1 diff --git a/rootly_sdk/models/resolve_alert_data_attributes_actor_type_3_type_0.py b/rootly_sdk/models/resolve_alert_data_attributes_actor_type_3_type_0.py new file mode 100644 index 00000000..f43e8ea8 --- /dev/null +++ b/rootly_sdk/models/resolve_alert_data_attributes_actor_type_3_type_0.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="ResolveAlertDataAttributesActorType3Type0") + + +@_attrs_define +class ResolveAlertDataAttributesActorType3Type0: + """ + Attributes: + email (str): Email of the user, including verified secondary emails. + """ + + email: str + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + resolve_alert_data_attributes_actor_type_3_type_0 = cls( + email=email, + ) + + return resolve_alert_data_attributes_actor_type_3_type_0 diff --git a/rootly_sdk/models/resolve_alert_data_attributes_actor_type_3_type_1.py b/rootly_sdk/models/resolve_alert_data_attributes_actor_type_3_type_1.py new file mode 100644 index 00000000..f5f7996f --- /dev/null +++ b/rootly_sdk/models/resolve_alert_data_attributes_actor_type_3_type_1.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="ResolveAlertDataAttributesActorType3Type1") + + +@_attrs_define +class ResolveAlertDataAttributesActorType3Type1: + """ + Attributes: + user_id (str): Rootly ID of the user. + """ + + user_id: str + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user_id": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("user_id") + + resolve_alert_data_attributes_actor_type_3_type_1 = cls( + user_id=user_id, + ) + + return resolve_alert_data_attributes_actor_type_3_type_1 diff --git a/rootly_sdk/models/resolve_alert_data_type.py b/rootly_sdk/models/resolve_alert_data_type.py index a83442bb..f0745468 100644 --- a/rootly_sdk/models/resolve_alert_data_type.py +++ b/rootly_sdk/models/resolve_alert_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ResolveAlertDataType = Literal["alerts"] @@ -11,5 +11,5 @@ def check_resolve_alert_data_type(value: str | None) -> ResolveAlertDataType | N if value is None: return None if value in RESOLVE_ALERT_DATA_TYPE_VALUES: - return cast(ResolveAlertDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {RESOLVE_ALERT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/resolve_incident.py b/rootly_sdk/models/resolve_incident.py index dd2a87be..03bfddfa 100644 --- a/rootly_sdk/models/resolve_incident.py +++ b/rootly_sdk/models/resolve_incident.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.resolve_incident_data import ResolveIncidentData @@ -18,14 +19,13 @@ class ResolveIncident: data (ResolveIncidentData): """ - data: "ResolveIncidentData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: ResolveIncidentData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - resolve_incident.additional_properties = d return resolve_incident - - @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/resolve_incident_data.py b/rootly_sdk/models/resolve_incident_data.py index 7f814f56..d6105ada 100644 --- a/rootly_sdk/models/resolve_incident_data.py +++ b/rootly_sdk/models/resolve_incident_data.py @@ -1,10 +1,12 @@ +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.resolve_incident_data_type import ResolveIncidentDataType, check_resolve_incident_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.resolve_incident_data_attributes import ResolveIncidentDataAttributes @@ -19,25 +21,31 @@ class ResolveIncidentData: Attributes: type_ (ResolveIncidentDataType): attributes (ResolveIncidentDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: ResolveIncidentDataType - attributes: "ResolveIncidentDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: ResolveIncidentDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = ResolveIncidentDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + resolve_incident_data = cls( type_=type_, attributes=attributes, + id=id, ) - resolve_incident_data.additional_properties = d return resolve_incident_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/resolve_incident_data_attributes.py b/rootly_sdk/models/resolve_incident_data_attributes.py index 779a6bc0..f692c9d9 100644 --- a/rootly_sdk/models/resolve_incident_data_attributes.py +++ b/rootly_sdk/models/resolve_incident_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,13 +14,13 @@ class ResolveIncidentDataAttributes: """ Attributes: - resolution_message (Union[None, Unset, str]): How was the incident resolved? + resolution_message (None | str | Unset): How was the incident resolved? """ - resolution_message: None | Unset | str = UNSET + resolution_message: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: - resolution_message: None | Unset | str + resolution_message: None | str | Unset if isinstance(self.resolution_message, Unset): resolution_message = UNSET else: @@ -36,12 +38,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 | Unset | str: + def _parse_resolution_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) resolution_message = _parse_resolution_message(d.pop("resolution_message", UNSET)) diff --git a/rootly_sdk/models/resolve_incident_data_type.py b/rootly_sdk/models/resolve_incident_data_type.py index a45cbba9..7ae4e1bd 100644 --- a/rootly_sdk/models/resolve_incident_data_type.py +++ b/rootly_sdk/models/resolve_incident_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ResolveIncidentDataType = Literal["incidents"] @@ -11,5 +11,5 @@ def check_resolve_incident_data_type(value: str | None) -> ResolveIncidentDataTy if value is None: return None if value in RESOLVE_INCIDENT_DATA_TYPE_VALUES: - return cast(ResolveIncidentDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {RESOLVE_INCIDENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/restart_incident.py b/rootly_sdk/models/restart_incident.py index 6ad06f78..594c3e64 100644 --- a/rootly_sdk/models/restart_incident.py +++ b/rootly_sdk/models/restart_incident.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.restart_incident_data import RestartIncidentData @@ -18,14 +19,13 @@ class RestartIncident: data (RestartIncidentData): """ - data: "RestartIncidentData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: RestartIncidentData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - restart_incident.additional_properties = d return restart_incident - - @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/restart_incident_data.py b/rootly_sdk/models/restart_incident_data.py index ac26db8c..db0056b5 100644 --- a/rootly_sdk/models/restart_incident_data.py +++ b/rootly_sdk/models/restart_incident_data.py @@ -1,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.restart_incident_data_type import RestartIncidentDataType, check_restart_incident_data_type from ..types import UNSET, Unset @@ -19,27 +20,33 @@ class RestartIncidentData: """ Attributes: type_ (RestartIncidentDataType): - attributes (Union[Unset, RestartIncidentDataAttributes]): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. + attributes (RestartIncidentDataAttributes | Unset): """ type_: RestartIncidentDataType - attributes: Union[Unset, "RestartIncidentDataAttributes"] = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + id: str | Unset = UNSET + attributes: RestartIncidentDataAttributes | Unset = UNSET def to_dict(self) -> dict[str, Any]: type_: str = self.type_ - attributes: Unset | dict[str, Any] = UNSET + id = self.id + + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, } ) + if id is not UNSET: + field_dict["id"] = id if attributes is not UNSET: field_dict["attributes"] = attributes @@ -52,8 +59,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) type_ = check_restart_incident_data_type(d.pop("type")) + id = d.pop("id", UNSET) + _attributes = d.pop("attributes", UNSET) - attributes: Unset | RestartIncidentDataAttributes + attributes: RestartIncidentDataAttributes | Unset if isinstance(_attributes, Unset): attributes = UNSET else: @@ -61,24 +70,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: restart_incident_data = cls( type_=type_, + id=id, attributes=attributes, ) - restart_incident_data.additional_properties = d return restart_incident_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/restart_incident_data_attributes.py b/rootly_sdk/models/restart_incident_data_attributes.py index 17cdc6f5..3d95b753 100644 --- a/rootly_sdk/models/restart_incident_data_attributes.py +++ b/rootly_sdk/models/restart_incident_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -11,6 +13,7 @@ class RestartIncidentDataAttributes: """ """ def to_dict(self) -> dict[str, Any]: + field_dict: dict[str, Any] = {} return field_dict diff --git a/rootly_sdk/models/restart_incident_data_type.py b/rootly_sdk/models/restart_incident_data_type.py index 60262680..12ebdcf5 100644 --- a/rootly_sdk/models/restart_incident_data_type.py +++ b/rootly_sdk/models/restart_incident_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RestartIncidentDataType = Literal["incidents"] @@ -11,5 +11,5 @@ def check_restart_incident_data_type(value: str | None) -> RestartIncidentDataTy if value is None: return None if value in RESTART_INCIDENT_DATA_TYPE_VALUES: - return cast(RestartIncidentDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {RESTART_INCIDENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/retrospective_configuration.py b/rootly_sdk/models/retrospective_configuration.py index 3374e771..f2ccd845 100644 --- a/rootly_sdk/models/retrospective_configuration.py +++ b/rootly_sdk/models/retrospective_configuration.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,29 +19,28 @@ class RetrospectiveConfiguration: """ Attributes: - 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): 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: 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind - severity_ids: None | Unset | list[str] + severity_ids: list[str] | None | Unset if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -48,7 +49,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - group_ids: None | Unset | list[str] + group_ids: list[str] | None | Unset if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -57,7 +58,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: None | Unset | list[str] + incident_type_ids: list[str] | None | Unset if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -92,13 +93,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: Unset | RetrospectiveConfigurationKind + kind: RetrospectiveConfigurationKind | Unset if isinstance(_kind, Unset): kind = UNSET else: kind = check_retrospective_configuration_kind(_kind) - def _parse_severity_ids(data: object) -> None | Unset | list[str]: + def _parse_severity_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -109,13 +110,13 @@ def _parse_severity_ids(data: object) -> None | Unset | list[str]: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_group_ids(data: object) -> None | Unset | list[str]: + def _parse_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -126,13 +127,13 @@ def _parse_group_ids(data: object) -> None | Unset | list[str]: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: + def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -143,9 +144,9 @@ def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/retrospective_configuration_kind.py b/rootly_sdk/models/retrospective_configuration_kind.py index b76a16be..006abfd5 100644 --- a/rootly_sdk/models/retrospective_configuration_kind.py +++ b/rootly_sdk/models/retrospective_configuration_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RetrospectiveConfigurationKind = Literal["mandatory", "skip"] @@ -12,5 +12,5 @@ def check_retrospective_configuration_kind(value: str | None) -> RetrospectiveCo if value is None: return None if value in RETROSPECTIVE_CONFIGURATION_KIND_VALUES: - return cast(RetrospectiveConfigurationKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {RETROSPECTIVE_CONFIGURATION_KIND_VALUES!r}") diff --git a/rootly_sdk/models/retrospective_configuration_list.py b/rootly_sdk/models/retrospective_configuration_list.py index 825d65e8..10dc429a 100644 --- a/rootly_sdk/models/retrospective_configuration_list.py +++ b/rootly_sdk/models/retrospective_configuration_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,12 +20,12 @@ class RetrospectiveConfigurationList: """ Attributes: - data (list['RetrospectiveConfigurationListDataItem']): - included (Union[Unset, list['JsonapiIncludedResource']]): + data (list[RetrospectiveConfigurationListDataItem]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["RetrospectiveConfigurationListDataItem"] - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[RetrospectiveConfigurationListDataItem] + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -64,12 +66,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) - included = [] _included = d.pop("included", UNSET) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 c3f88c45..55494c90 100644 --- a/rootly_sdk/models/retrospective_configuration_list_data_item.py +++ b/rootly_sdk/models/retrospective_configuration_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/retrospective_configuration_list_data_item_type.py b/rootly_sdk/models/retrospective_configuration_list_data_item_type.py index c3fbacc4..c9ce29a0 100644 --- a/rootly_sdk/models/retrospective_configuration_list_data_item_type.py +++ b/rootly_sdk/models/retrospective_configuration_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RetrospectiveConfigurationListDataItemType = Literal["retrospective_configurations"] @@ -13,7 +13,7 @@ def check_retrospective_configuration_list_data_item_type( if value is None: return None if value in RETROSPECTIVE_CONFIGURATION_LIST_DATA_ITEM_TYPE_VALUES: - return cast(RetrospectiveConfigurationListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {RETROSPECTIVE_CONFIGURATION_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/retrospective_configuration_response.py b/rootly_sdk/models/retrospective_configuration_response.py index 42219f57..5a8785c4 100644 --- a/rootly_sdk/models/retrospective_configuration_response.py +++ b/rootly_sdk/models/retrospective_configuration_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class RetrospectiveConfigurationResponse: """ Attributes: data (RetrospectiveConfigurationResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "RetrospectiveConfigurationResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: RetrospectiveConfigurationResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 fc3eeec0..430c8851 100644 --- a/rootly_sdk/models/retrospective_configuration_response_data.py +++ b/rootly_sdk/models/retrospective_configuration_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/retrospective_configuration_response_data_type.py b/rootly_sdk/models/retrospective_configuration_response_data_type.py index 97bd1da5..876c9764 100644 --- a/rootly_sdk/models/retrospective_configuration_response_data_type.py +++ b/rootly_sdk/models/retrospective_configuration_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RetrospectiveConfigurationResponseDataType = Literal["retrospective_configurations"] @@ -13,7 +13,7 @@ def check_retrospective_configuration_response_data_type( if value is None: return None if value in RETROSPECTIVE_CONFIGURATION_RESPONSE_DATA_TYPE_VALUES: - return cast(RetrospectiveConfigurationResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {RETROSPECTIVE_CONFIGURATION_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/retrospective_process.py b/rootly_sdk/models/retrospective_process.py index 7f16675f..05b0511d 100644 --- a/rootly_sdk/models/retrospective_process.py +++ b/rootly_sdk/models/retrospective_process.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,29 +27,29 @@ class RetrospectiveProcess: """ Attributes: - 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 + 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 fallback if no processes match the incident's conditions. The default process cannot have conditions and cannot be changed. - 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]): + created_at (str | Unset): Date of creation + updated_at (str | Unset): Date of last update + retrospective_process_matching_criteria (RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType0 | + RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType1 | + RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType2 | 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -60,13 +62,13 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - is_default: None | Unset | bool + is_default: bool | None | Unset if isinstance(self.is_default, Unset): is_default = UNSET else: @@ -76,7 +78,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - retrospective_process_matching_criteria: Unset | dict[str, Any] + retrospective_process_matching_criteria: dict[str, Any] | Unset if isinstance(self.retrospective_process_matching_criteria, Unset): retrospective_process_matching_criteria = UNSET elif isinstance( @@ -123,21 +125,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_is_default(data: object) -> None | Unset | bool: + def _parse_is_default(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) is_default = _parse_is_default(d.pop("is_default", UNSET)) @@ -147,12 +149,12 @@ def _parse_is_default(data: object) -> None | Unset | bool: def _parse_retrospective_process_matching_criteria( data: object, - ) -> Union[ - "RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType0", - "RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType1", - "RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType2", - Unset, - ]: + ) -> ( + RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType0 + | RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType1 + | RetrospectiveProcessRetrospectiveProcessMatchingCriteriaType2 + | Unset + ): if isinstance(data, Unset): return data try: @@ -163,7 +165,7 @@ def _parse_retrospective_process_matching_criteria( ) return retrospective_process_matching_criteria_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -173,7 +175,7 @@ def _parse_retrospective_process_matching_criteria( ) return retrospective_process_matching_criteria_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): 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 bd6c59c6..c6214add 100644 --- a/rootly_sdk/models/retrospective_process_group.py +++ b/rootly_sdk/models/retrospective_process_group.py @@ -1,3 +1,5 @@ +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 49950afc..50cecbee 100644 --- a/rootly_sdk/models/retrospective_process_group_list.py +++ b/rootly_sdk/models/retrospective_process_group_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class RetrospectiveProcessGroupList: """ Attributes: - data (list['RetrospectiveProcessGroupListDataItem']): + data (list[RetrospectiveProcessGroupListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["RetrospectiveProcessGroupListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[RetrospectiveProcessGroupListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 001161de..bd83fc5d 100644 --- a/rootly_sdk/models/retrospective_process_group_list_data_item.py +++ b/rootly_sdk/models/retrospective_process_group_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/retrospective_process_group_list_data_item_type.py b/rootly_sdk/models/retrospective_process_group_list_data_item_type.py index 4a44d870..c3a8e492 100644 --- a/rootly_sdk/models/retrospective_process_group_list_data_item_type.py +++ b/rootly_sdk/models/retrospective_process_group_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RetrospectiveProcessGroupListDataItemType = Literal["retrospective_process_groups"] @@ -13,7 +13,7 @@ def check_retrospective_process_group_list_data_item_type( if value is None: return None if value in RETROSPECTIVE_PROCESS_GROUP_LIST_DATA_ITEM_TYPE_VALUES: - return cast(RetrospectiveProcessGroupListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {RETROSPECTIVE_PROCESS_GROUP_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/retrospective_process_group_response.py b/rootly_sdk/models/retrospective_process_group_response.py index dd1146e7..09c32d7b 100644 --- a/rootly_sdk/models/retrospective_process_group_response.py +++ b/rootly_sdk/models/retrospective_process_group_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class RetrospectiveProcessGroupResponse: """ Attributes: data (RetrospectiveProcessGroupResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "RetrospectiveProcessGroupResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: RetrospectiveProcessGroupResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 728a7c2d..e031954a 100644 --- a/rootly_sdk/models/retrospective_process_group_response_data.py +++ b/rootly_sdk/models/retrospective_process_group_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/retrospective_process_group_response_data_type.py b/rootly_sdk/models/retrospective_process_group_response_data_type.py index 993a1195..4aa280f9 100644 --- a/rootly_sdk/models/retrospective_process_group_response_data_type.py +++ b/rootly_sdk/models/retrospective_process_group_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RetrospectiveProcessGroupResponseDataType = Literal["retrospective_process_groups"] @@ -13,7 +13,7 @@ def check_retrospective_process_group_response_data_type( if value is None: return None if value in RETROSPECTIVE_PROCESS_GROUP_RESPONSE_DATA_TYPE_VALUES: - return cast(RetrospectiveProcessGroupResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {RETROSPECTIVE_PROCESS_GROUP_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/retrospective_process_group_step.py b/rootly_sdk/models/retrospective_process_group_step.py index c1e006cd..d03eeab7 100644 --- a/rootly_sdk/models/retrospective_process_group_step.py +++ b/rootly_sdk/models/retrospective_process_group_step.py @@ -1,3 +1,5 @@ +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 da4c38c5..03d06986 100644 --- a/rootly_sdk/models/retrospective_process_group_step_list.py +++ b/rootly_sdk/models/retrospective_process_group_step_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class RetrospectiveProcessGroupStepList: """ Attributes: - data (list['RetrospectiveProcessGroupStepListDataItem']): + data (list[RetrospectiveProcessGroupStepListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["RetrospectiveProcessGroupStepListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[RetrospectiveProcessGroupStepListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 760eb209..51a6371d 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/retrospective_process_group_step_list_data_item_type.py b/rootly_sdk/models/retrospective_process_group_step_list_data_item_type.py index 97239a36..56ab533f 100644 --- a/rootly_sdk/models/retrospective_process_group_step_list_data_item_type.py +++ b/rootly_sdk/models/retrospective_process_group_step_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RetrospectiveProcessGroupStepListDataItemType = Literal["retrospective_process_group_steps"] @@ -13,7 +13,7 @@ def check_retrospective_process_group_step_list_data_item_type( if value is None: return None if value in RETROSPECTIVE_PROCESS_GROUP_STEP_LIST_DATA_ITEM_TYPE_VALUES: - return cast(RetrospectiveProcessGroupStepListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {RETROSPECTIVE_PROCESS_GROUP_STEP_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/retrospective_process_group_step_response.py b/rootly_sdk/models/retrospective_process_group_step_response.py index dfcd4544..788bcaeb 100644 --- a/rootly_sdk/models/retrospective_process_group_step_response.py +++ b/rootly_sdk/models/retrospective_process_group_step_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class RetrospectiveProcessGroupStepResponse: """ Attributes: data (RetrospectiveProcessGroupStepResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "RetrospectiveProcessGroupStepResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: RetrospectiveProcessGroupStepResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 9cc6a8ce..786a454c 100644 --- a/rootly_sdk/models/retrospective_process_group_step_response_data.py +++ b/rootly_sdk/models/retrospective_process_group_step_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/retrospective_process_group_step_response_data_type.py b/rootly_sdk/models/retrospective_process_group_step_response_data_type.py index e75f9049..1330bad1 100644 --- a/rootly_sdk/models/retrospective_process_group_step_response_data_type.py +++ b/rootly_sdk/models/retrospective_process_group_step_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RetrospectiveProcessGroupStepResponseDataType = Literal["retrospective_process_group_steps"] @@ -13,7 +13,7 @@ def check_retrospective_process_group_step_response_data_type( if value is None: return None if value in RETROSPECTIVE_PROCESS_GROUP_STEP_RESPONSE_DATA_TYPE_VALUES: - return cast(RetrospectiveProcessGroupStepResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {RETROSPECTIVE_PROCESS_GROUP_STEP_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/retrospective_process_list.py b/rootly_sdk/models/retrospective_process_list.py index e8bb5dd4..2f6a2a7a 100644 --- a/rootly_sdk/models/retrospective_process_list.py +++ b/rootly_sdk/models/retrospective_process_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class RetrospectiveProcessList: """ Attributes: - data (list['RetrospectiveProcessListDataItem']): + data (list[RetrospectiveProcessListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["RetrospectiveProcessListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[RetrospectiveProcessListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 0689a834..a63c45f5 100644 --- a/rootly_sdk/models/retrospective_process_list_data_item.py +++ b/rootly_sdk/models/retrospective_process_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/retrospective_process_list_data_item_type.py b/rootly_sdk/models/retrospective_process_list_data_item_type.py index 73ba3105..e0641297 100644 --- a/rootly_sdk/models/retrospective_process_list_data_item_type.py +++ b/rootly_sdk/models/retrospective_process_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RetrospectiveProcessListDataItemType = Literal["retrospective_processes"] @@ -11,5 +11,5 @@ def check_retrospective_process_list_data_item_type(value: str | None) -> Retros if value is None: return None if value in RETROSPECTIVE_PROCESS_LIST_DATA_ITEM_TYPE_VALUES: - return cast(RetrospectiveProcessListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {RETROSPECTIVE_PROCESS_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/retrospective_process_response.py b/rootly_sdk/models/retrospective_process_response.py index 1a67a415..9bb8bceb 100644 --- a/rootly_sdk/models/retrospective_process_response.py +++ b/rootly_sdk/models/retrospective_process_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class RetrospectiveProcessResponse: """ Attributes: data (RetrospectiveProcessResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "RetrospectiveProcessResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: RetrospectiveProcessResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 63527e2b..2b72ed88 100644 --- a/rootly_sdk/models/retrospective_process_response_data.py +++ b/rootly_sdk/models/retrospective_process_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/retrospective_process_response_data_type.py b/rootly_sdk/models/retrospective_process_response_data_type.py index 13317fba..d5d299a4 100644 --- a/rootly_sdk/models/retrospective_process_response_data_type.py +++ b/rootly_sdk/models/retrospective_process_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RetrospectiveProcessResponseDataType = Literal["retrospective_processes"] @@ -11,5 +11,5 @@ def check_retrospective_process_response_data_type(value: str | None) -> Retrosp if value is None: return None if value in RETROSPECTIVE_PROCESS_RESPONSE_DATA_TYPE_VALUES: - return cast(RetrospectiveProcessResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {RETROSPECTIVE_PROCESS_RESPONSE_DATA_TYPE_VALUES!r}") 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 c5264651..dc946fab 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,3 +1,5 @@ +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 5ad34cd0..07a6c5da 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,3 +1,5 @@ +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 a1080736..4243efab 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,3 +1,5 @@ +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 753bfd37..2f2c7941 100644 --- a/rootly_sdk/models/retrospective_step.py +++ b/rootly_sdk/models/retrospective_step.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,25 +19,25 @@ class RetrospectiveStep: title (str): The name of the step created_at (str): Date of creation updated_at (str): Date of last update - 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? + 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? """ retrospective_process_id: str title: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -49,19 +51,19 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - incident_role_id: None | Unset | str + incident_role_id: None | str | Unset if isinstance(self.incident_role_id, Unset): incident_role_id = UNSET else: incident_role_id = self.incident_role_id - due_after_days: None | Unset | int + due_after_days: int | None | Unset if isinstance(self.due_after_days, Unset): due_after_days = UNSET else: @@ -109,30 +111,30 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_incident_role_id(data: object) -> None | Unset | str: + def _parse_incident_role_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) incident_role_id = _parse_incident_role_id(d.pop("incident_role_id", UNSET)) - def _parse_due_after_days(data: object) -> None | Unset | int: + def _parse_due_after_days(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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 eff55e6a..32c6ab31 100644 --- a/rootly_sdk/models/retrospective_step_list.py +++ b/rootly_sdk/models/retrospective_step_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class RetrospectiveStepList: """ Attributes: - data (list['RetrospectiveStepListDataItem']): + data (list[RetrospectiveStepListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["RetrospectiveStepListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[RetrospectiveStepListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 160e4e85..3080ab76 100644 --- a/rootly_sdk/models/retrospective_step_list_data_item.py +++ b/rootly_sdk/models/retrospective_step_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/retrospective_step_list_data_item_type.py b/rootly_sdk/models/retrospective_step_list_data_item_type.py index 88968c67..c7b89cae 100644 --- a/rootly_sdk/models/retrospective_step_list_data_item_type.py +++ b/rootly_sdk/models/retrospective_step_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RetrospectiveStepListDataItemType = Literal["retrospective_steps"] @@ -11,5 +11,5 @@ def check_retrospective_step_list_data_item_type(value: str | None) -> Retrospec if value is None: return None if value in RETROSPECTIVE_STEP_LIST_DATA_ITEM_TYPE_VALUES: - return cast(RetrospectiveStepListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {RETROSPECTIVE_STEP_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/retrospective_step_response.py b/rootly_sdk/models/retrospective_step_response.py index 2caec2db..276b9ce7 100644 --- a/rootly_sdk/models/retrospective_step_response.py +++ b/rootly_sdk/models/retrospective_step_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class RetrospectiveStepResponse: """ Attributes: data (RetrospectiveStepResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "RetrospectiveStepResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: RetrospectiveStepResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 28e0e5b4..db9cd74c 100644 --- a/rootly_sdk/models/retrospective_step_response_data.py +++ b/rootly_sdk/models/retrospective_step_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/retrospective_step_response_data_type.py b/rootly_sdk/models/retrospective_step_response_data_type.py index 40de1186..f2797e07 100644 --- a/rootly_sdk/models/retrospective_step_response_data_type.py +++ b/rootly_sdk/models/retrospective_step_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RetrospectiveStepResponseDataType = Literal["retrospective_steps"] @@ -11,5 +11,5 @@ def check_retrospective_step_response_data_type(value: str | None) -> Retrospect if value is None: return None if value in RETROSPECTIVE_STEP_RESPONSE_DATA_TYPE_VALUES: - return cast(RetrospectiveStepResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {RETROSPECTIVE_STEP_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/role.py b/rootly_sdk/models/role.py index 5bcb4b61..f3333ec5 100644 --- a/rootly_sdk/models/role.py +++ b/rootly_sdk/models/role.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -61,6 +63,10 @@ ) from ..models.role_paging_permissions_item import RolePagingPermissionsItem, check_role_paging_permissions_item from ..models.role_playbooks_permissions_item import RolePlaybooksPermissionsItem, check_role_playbooks_permissions_item +from ..models.role_private_agent_permissions_item import ( + RolePrivateAgentPermissionsItem, + check_role_private_agent_permissions_item, +) from ..models.role_private_incidents_permissions_item import ( RolePrivateIncidentsPermissionsItem, check_role_private_incidents_permissions_item, @@ -78,6 +84,10 @@ check_role_severities_permissions_item, ) from ..models.role_slas_permissions_item import RoleSlasPermissionsItem, check_role_slas_permissions_item +from ..models.role_status_page_updates_permissions_type_0_item import ( + RoleStatusPageUpdatesPermissionsType0Item, + check_role_status_page_updates_permissions_type_0_item, +) from ..models.role_status_pages_permissions_item import ( RoleStatusPagesPermissionsItem, check_role_status_pages_permissions_item, @@ -100,85 +110,91 @@ class Role: name (str): The role name. created_at (str): updated_at (str): - 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]]): + 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): + status_page_updates_permissions (list[RoleStatusPageUpdatesPermissionsType0Item] | None | 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): + private_agent_permissions (list[RolePrivateAgentPermissionsItem] | Unset): Private Agent management permissions: + create issues enrollment tokens, read views agent inventory and details, and delete revokes agent credentials. + Create and delete can be used independently through the API; browser inventory requires read. + slas_permissions (list[RoleSlasPermissionsItem] | Unset): + paging_permissions (list[RolePagingPermissionsItem] | Unset): + incident_communication_permissions (list[RoleIncidentCommunicationPermissionsItem] | Unset): + communication_permissions (list[RoleCommunicationPermissionsItem] | Unset): """ name: str created_at: str updated_at: str - 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 + 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 + status_page_updates_permissions: list[RoleStatusPageUpdatesPermissionsType0Item] | None | 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 + private_agent_permissions: list[RolePrivateAgentPermissionsItem] | 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -190,7 +206,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - incident_permission_set_id: None | Unset | str + incident_permission_set_id: None | str | Unset if isinstance(self.incident_permission_set_id, Unset): incident_permission_set_id = UNSET else: @@ -200,231 +216,250 @@ def to_dict(self) -> dict[str, Any]: is_editable = self.is_editable - alerts_permissions: Unset | list[str] = UNSET + alerts_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + api_keys_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + audits_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + billing_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + environments_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + form_fields_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + functionalities_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + groups_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + incident_causes_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + incident_feedbacks_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + incident_roles_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + incident_types_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + incidents_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + integrations_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + invitations_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + playbooks_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + private_incidents_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + pulses_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + retrospective_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + roles_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + secrets_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + services_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + severities_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + status_pages_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + status_page_updates_permissions: list[str] | None | Unset + if isinstance(self.status_page_updates_permissions, Unset): + status_page_updates_permissions = UNSET + elif isinstance(self.status_page_updates_permissions, list): + status_page_updates_permissions = [] + for status_page_updates_permissions_type_0_item_data in self.status_page_updates_permissions: + status_page_updates_permissions_type_0_item: str = status_page_updates_permissions_type_0_item_data + status_page_updates_permissions.append(status_page_updates_permissions_type_0_item) + + else: + status_page_updates_permissions = self.status_page_updates_permissions + + webhooks_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + workflows_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + catalogs_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + sub_statuses_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + edge_connector_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + private_agent_permissions: list[str] | Unset = UNSET + if not isinstance(self.private_agent_permissions, Unset): + private_agent_permissions = [] + for private_agent_permissions_item_data in self.private_agent_permissions: + private_agent_permissions_item: str = private_agent_permissions_item_data + private_agent_permissions.append(private_agent_permissions_item) + + slas_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + paging_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + incident_communication_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + communication_permissions: list[str] | Unset = UNSET if not isinstance(self.communication_permissions, Unset): communication_permissions = [] for communication_permissions_item_data in self.communication_permissions: @@ -496,6 +531,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["severities_permissions"] = severities_permissions if status_pages_permissions is not UNSET: field_dict["status_pages_permissions"] = status_pages_permissions + if status_page_updates_permissions is not UNSET: + field_dict["status_page_updates_permissions"] = status_page_updates_permissions if webhooks_permissions is not UNSET: field_dict["webhooks_permissions"] = webhooks_permissions if workflows_permissions is not UNSET: @@ -506,6 +543,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["sub_statuses_permissions"] = sub_statuses_permissions if edge_connector_permissions is not UNSET: field_dict["edge_connector_permissions"] = edge_connector_permissions + if private_agent_permissions is not UNSET: + field_dict["private_agent_permissions"] = private_agent_permissions if slas_permissions is not UNSET: field_dict["slas_permissions"] = slas_permissions if paging_permissions is not UNSET: @@ -528,12 +567,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 | Unset | str: + def _parse_incident_permission_set_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) incident_permission_set_id = _parse_incident_permission_set_id(d.pop("incident_permission_set_id", UNSET)) @@ -541,256 +580,375 @@ def _parse_incident_permission_set_id(data: object) -> None | Unset | str: is_editable = d.pop("is_editable", UNSET) - alerts_permissions = [] _alerts_permissions = d.pop("alerts_permissions", UNSET) - for alerts_permissions_item_data in _alerts_permissions or []: - alerts_permissions_item = check_role_alerts_permissions_item(alerts_permissions_item_data) + 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) - alerts_permissions.append(alerts_permissions_item) + alerts_permissions.append(alerts_permissions_item) - api_keys_permissions = [] _api_keys_permissions = d.pop("api_keys_permissions", UNSET) - 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: 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) - 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) - for audits_permissions_item_data in _audits_permissions or []: - audits_permissions_item = check_role_audits_permissions_item(audits_permissions_item_data) + 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) - audits_permissions.append(audits_permissions_item) + audits_permissions.append(audits_permissions_item) - billing_permissions = [] _billing_permissions = d.pop("billing_permissions", UNSET) - for billing_permissions_item_data in _billing_permissions or []: - billing_permissions_item = check_role_billing_permissions_item(billing_permissions_item_data) + 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) - billing_permissions.append(billing_permissions_item) + billing_permissions.append(billing_permissions_item) - environments_permissions = [] _environments_permissions = d.pop("environments_permissions", UNSET) - for environments_permissions_item_data in _environments_permissions or []: - environments_permissions_item = check_role_environments_permissions_item(environments_permissions_item_data) + 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 + ) - environments_permissions.append(environments_permissions_item) + environments_permissions.append(environments_permissions_item) - form_fields_permissions = [] _form_fields_permissions = d.pop("form_fields_permissions", UNSET) - 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: 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 + ) - 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) - for functionalities_permissions_item_data in _functionalities_permissions or []: - functionalities_permissions_item = check_role_functionalities_permissions_item( - functionalities_permissions_item_data - ) + 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 + ) - functionalities_permissions.append(functionalities_permissions_item) + functionalities_permissions.append(functionalities_permissions_item) - groups_permissions = [] _groups_permissions = d.pop("groups_permissions", UNSET) - for groups_permissions_item_data in _groups_permissions or []: - groups_permissions_item = check_role_groups_permissions_item(groups_permissions_item_data) + 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) - groups_permissions.append(groups_permissions_item) + groups_permissions.append(groups_permissions_item) - incident_causes_permissions = [] _incident_causes_permissions = d.pop("incident_causes_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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 + ) - 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) - 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: 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 + ) - 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) - 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: 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 + ) - 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) - for incidents_permissions_item_data in _incidents_permissions or []: - incidents_permissions_item = check_role_incidents_permissions_item(incidents_permissions_item_data) + 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) - incidents_permissions.append(incidents_permissions_item) + incidents_permissions.append(incidents_permissions_item) - integrations_permissions = [] _integrations_permissions = d.pop("integrations_permissions", UNSET) - for integrations_permissions_item_data in _integrations_permissions or []: - integrations_permissions_item = check_role_integrations_permissions_item(integrations_permissions_item_data) + 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 + ) - integrations_permissions.append(integrations_permissions_item) + integrations_permissions.append(integrations_permissions_item) - invitations_permissions = [] _invitations_permissions = d.pop("invitations_permissions", UNSET) - for invitations_permissions_item_data in _invitations_permissions or []: - invitations_permissions_item = check_role_invitations_permissions_item(invitations_permissions_item_data) + 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 + ) - invitations_permissions.append(invitations_permissions_item) + invitations_permissions.append(invitations_permissions_item) - playbooks_permissions = [] _playbooks_permissions = d.pop("playbooks_permissions", UNSET) - for playbooks_permissions_item_data in _playbooks_permissions or []: - playbooks_permissions_item = check_role_playbooks_permissions_item(playbooks_permissions_item_data) + 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) - playbooks_permissions.append(playbooks_permissions_item) + playbooks_permissions.append(playbooks_permissions_item) - private_incidents_permissions = [] _private_incidents_permissions = d.pop("private_incidents_permissions", UNSET) - 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: 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 + ) - 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) - for pulses_permissions_item_data in _pulses_permissions or []: - pulses_permissions_item = check_role_pulses_permissions_item(pulses_permissions_item_data) + 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) - pulses_permissions.append(pulses_permissions_item) + pulses_permissions.append(pulses_permissions_item) - retrospective_permissions = [] _retrospective_permissions = d.pop("retrospective_permissions", UNSET) - for retrospective_permissions_item_data in _retrospective_permissions or []: - retrospective_permissions_item = check_role_retrospective_permissions_item( - retrospective_permissions_item_data - ) + 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 + ) - retrospective_permissions.append(retrospective_permissions_item) + retrospective_permissions.append(retrospective_permissions_item) - roles_permissions = [] _roles_permissions = d.pop("roles_permissions", UNSET) - for roles_permissions_item_data in _roles_permissions or []: - roles_permissions_item = check_role_roles_permissions_item(roles_permissions_item_data) + 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) - roles_permissions.append(roles_permissions_item) + roles_permissions.append(roles_permissions_item) - secrets_permissions = [] _secrets_permissions = d.pop("secrets_permissions", UNSET) - for secrets_permissions_item_data in _secrets_permissions or []: - secrets_permissions_item = check_role_secrets_permissions_item(secrets_permissions_item_data) + 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) - secrets_permissions.append(secrets_permissions_item) + secrets_permissions.append(secrets_permissions_item) - services_permissions = [] _services_permissions = d.pop("services_permissions", UNSET) - for services_permissions_item_data in _services_permissions or []: - services_permissions_item = check_role_services_permissions_item(services_permissions_item_data) + 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) - services_permissions.append(services_permissions_item) + services_permissions.append(services_permissions_item) - severities_permissions = [] _severities_permissions = d.pop("severities_permissions", UNSET) - for severities_permissions_item_data in _severities_permissions or []: - severities_permissions_item = check_role_severities_permissions_item(severities_permissions_item_data) + 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) - severities_permissions.append(severities_permissions_item) + severities_permissions.append(severities_permissions_item) - status_pages_permissions = [] _status_pages_permissions = d.pop("status_pages_permissions", UNSET) - 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: 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 + ) + + status_pages_permissions.append(status_pages_permissions_item) - status_pages_permissions.append(status_pages_permissions_item) + def _parse_status_page_updates_permissions( + data: object, + ) -> list[RoleStatusPageUpdatesPermissionsType0Item] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + status_page_updates_permissions_type_0 = [] + _status_page_updates_permissions_type_0 = data + for status_page_updates_permissions_type_0_item_data in _status_page_updates_permissions_type_0: + status_page_updates_permissions_type_0_item = ( + check_role_status_page_updates_permissions_type_0_item( + status_page_updates_permissions_type_0_item_data + ) + ) + + status_page_updates_permissions_type_0.append(status_page_updates_permissions_type_0_item) + + return status_page_updates_permissions_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[RoleStatusPageUpdatesPermissionsType0Item] | None | Unset, data) + + status_page_updates_permissions = _parse_status_page_updates_permissions( + d.pop("status_page_updates_permissions", UNSET) + ) - webhooks_permissions = [] _webhooks_permissions = d.pop("webhooks_permissions", UNSET) - for webhooks_permissions_item_data in _webhooks_permissions or []: - webhooks_permissions_item = check_role_webhooks_permissions_item(webhooks_permissions_item_data) + 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) - webhooks_permissions.append(webhooks_permissions_item) + webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions = [] _workflows_permissions = d.pop("workflows_permissions", UNSET) - for workflows_permissions_item_data in _workflows_permissions or []: - workflows_permissions_item = check_role_workflows_permissions_item(workflows_permissions_item_data) + 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) - workflows_permissions.append(workflows_permissions_item) + workflows_permissions.append(workflows_permissions_item) - catalogs_permissions = [] _catalogs_permissions = d.pop("catalogs_permissions", UNSET) - for catalogs_permissions_item_data in _catalogs_permissions or []: - catalogs_permissions_item = check_role_catalogs_permissions_item(catalogs_permissions_item_data) + 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) - catalogs_permissions.append(catalogs_permissions_item) + catalogs_permissions.append(catalogs_permissions_item) - sub_statuses_permissions = [] _sub_statuses_permissions = d.pop("sub_statuses_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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 + ) + + edge_connector_permissions.append(edge_connector_permissions_item) + + _private_agent_permissions = d.pop("private_agent_permissions", UNSET) + private_agent_permissions: list[RolePrivateAgentPermissionsItem] | Unset = UNSET + if _private_agent_permissions is not UNSET: + private_agent_permissions = [] + for private_agent_permissions_item_data in _private_agent_permissions: + private_agent_permissions_item = check_role_private_agent_permissions_item( + private_agent_permissions_item_data + ) - edge_connector_permissions.append(edge_connector_permissions_item) + private_agent_permissions.append(private_agent_permissions_item) - slas_permissions = [] _slas_permissions = d.pop("slas_permissions", UNSET) - for slas_permissions_item_data in _slas_permissions or []: - slas_permissions_item = check_role_slas_permissions_item(slas_permissions_item_data) + 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) - slas_permissions.append(slas_permissions_item) + slas_permissions.append(slas_permissions_item) - paging_permissions = [] _paging_permissions = d.pop("paging_permissions", UNSET) - for paging_permissions_item_data in _paging_permissions or []: - paging_permissions_item = check_role_paging_permissions_item(paging_permissions_item_data) + 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) - paging_permissions.append(paging_permissions_item) + paging_permissions.append(paging_permissions_item) - incident_communication_permissions = [] _incident_communication_permissions = d.pop("incident_communication_permissions", UNSET) - 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: 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 + ) - 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) - for communication_permissions_item_data in _communication_permissions or []: - communication_permissions_item = check_role_communication_permissions_item( - communication_permissions_item_data - ) + 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 + ) - communication_permissions.append(communication_permissions_item) + communication_permissions.append(communication_permissions_item) role = cls( name=name, @@ -824,11 +982,13 @@ def _parse_incident_permission_set_id(data: object) -> None | Unset | str: services_permissions=services_permissions, severities_permissions=severities_permissions, status_pages_permissions=status_pages_permissions, + status_page_updates_permissions=status_page_updates_permissions, webhooks_permissions=webhooks_permissions, workflows_permissions=workflows_permissions, catalogs_permissions=catalogs_permissions, sub_statuses_permissions=sub_statuses_permissions, edge_connector_permissions=edge_connector_permissions, + private_agent_permissions=private_agent_permissions, slas_permissions=slas_permissions, paging_permissions=paging_permissions, incident_communication_permissions=incident_communication_permissions, diff --git a/rootly_sdk/models/role_alerts_permissions_item.py b/rootly_sdk/models/role_alerts_permissions_item.py index 654966c2..d392defd 100644 --- a/rootly_sdk/models/role_alerts_permissions_item.py +++ b/rootly_sdk/models/role_alerts_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleAlertsPermissionsItem = Literal["create", "read"] @@ -12,5 +12,5 @@ def check_role_alerts_permissions_item(value: str | None) -> RoleAlertsPermissio if value is None: return None if value in ROLE_ALERTS_PERMISSIONS_ITEM_VALUES: - return cast(RoleAlertsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_ALERTS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_api_keys_permissions_item.py b/rootly_sdk/models/role_api_keys_permissions_item.py index f191ba78..e8b2f7ca 100644 --- a/rootly_sdk/models/role_api_keys_permissions_item.py +++ b/rootly_sdk/models/role_api_keys_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleApiKeysPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_api_keys_permissions_item(value: str | None) -> RoleApiKeysPermis if value is None: return None if value in ROLE_API_KEYS_PERMISSIONS_ITEM_VALUES: - return cast(RoleApiKeysPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_API_KEYS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_audits_permissions_item.py b/rootly_sdk/models/role_audits_permissions_item.py index 52aecb59..a23a8bd2 100644 --- a/rootly_sdk/models/role_audits_permissions_item.py +++ b/rootly_sdk/models/role_audits_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleAuditsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_audits_permissions_item(value: str | None) -> RoleAuditsPermissio if value is None: return None if value in ROLE_AUDITS_PERMISSIONS_ITEM_VALUES: - return cast(RoleAuditsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_AUDITS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_billing_permissions_item.py b/rootly_sdk/models/role_billing_permissions_item.py index a9b62a24..257ca6cb 100644 --- a/rootly_sdk/models/role_billing_permissions_item.py +++ b/rootly_sdk/models/role_billing_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleBillingPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_billing_permissions_item(value: str | None) -> RoleBillingPermiss if value is None: return None if value in ROLE_BILLING_PERMISSIONS_ITEM_VALUES: - return cast(RoleBillingPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_BILLING_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_catalogs_permissions_item.py b/rootly_sdk/models/role_catalogs_permissions_item.py index 5eabe26f..aa0323e4 100644 --- a/rootly_sdk/models/role_catalogs_permissions_item.py +++ b/rootly_sdk/models/role_catalogs_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleCatalogsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_catalogs_permissions_item(value: str | None) -> RoleCatalogsPermi if value is None: return None if value in ROLE_CATALOGS_PERMISSIONS_ITEM_VALUES: - return cast(RoleCatalogsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_CATALOGS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_communication_permissions_item.py b/rootly_sdk/models/role_communication_permissions_item.py index b1a3ddba..5f328a07 100644 --- a/rootly_sdk/models/role_communication_permissions_item.py +++ b/rootly_sdk/models/role_communication_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleCommunicationPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_communication_permissions_item(value: str | None) -> RoleCommunic if value is None: return None if value in ROLE_COMMUNICATION_PERMISSIONS_ITEM_VALUES: - return cast(RoleCommunicationPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_COMMUNICATION_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_edge_connector_permissions_item.py b/rootly_sdk/models/role_edge_connector_permissions_item.py index 2660f3e3..bc11f136 100644 --- a/rootly_sdk/models/role_edge_connector_permissions_item.py +++ b/rootly_sdk/models/role_edge_connector_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleEdgeConnectorPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_edge_connector_permissions_item(value: str | None) -> RoleEdgeCon if value is None: return None if value in ROLE_EDGE_CONNECTOR_PERMISSIONS_ITEM_VALUES: - return cast(RoleEdgeConnectorPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_EDGE_CONNECTOR_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_environments_permissions_item.py b/rootly_sdk/models/role_environments_permissions_item.py index 2c804b05..87c530df 100644 --- a/rootly_sdk/models/role_environments_permissions_item.py +++ b/rootly_sdk/models/role_environments_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleEnvironmentsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_environments_permissions_item(value: str | None) -> RoleEnvironme if value is None: return None if value in ROLE_ENVIRONMENTS_PERMISSIONS_ITEM_VALUES: - return cast(RoleEnvironmentsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_ENVIRONMENTS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_form_fields_permissions_item.py b/rootly_sdk/models/role_form_fields_permissions_item.py index 30b46295..ba061ffd 100644 --- a/rootly_sdk/models/role_form_fields_permissions_item.py +++ b/rootly_sdk/models/role_form_fields_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleFormFieldsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_form_fields_permissions_item(value: str | None) -> RoleFormFields if value is None: return None if value in ROLE_FORM_FIELDS_PERMISSIONS_ITEM_VALUES: - return cast(RoleFormFieldsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_FORM_FIELDS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_functionalities_permissions_item.py b/rootly_sdk/models/role_functionalities_permissions_item.py index 444565e3..d0ca12d7 100644 --- a/rootly_sdk/models/role_functionalities_permissions_item.py +++ b/rootly_sdk/models/role_functionalities_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleFunctionalitiesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_functionalities_permissions_item(value: str | None) -> RoleFuncti if value is None: return None if value in ROLE_FUNCTIONALITIES_PERMISSIONS_ITEM_VALUES: - return cast(RoleFunctionalitiesPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_FUNCTIONALITIES_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_groups_permissions_item.py b/rootly_sdk/models/role_groups_permissions_item.py index 38fe3dce..e575b72c 100644 --- a/rootly_sdk/models/role_groups_permissions_item.py +++ b/rootly_sdk/models/role_groups_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleGroupsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_groups_permissions_item(value: str | None) -> RoleGroupsPermissio if value is None: return None if value in ROLE_GROUPS_PERMISSIONS_ITEM_VALUES: - return cast(RoleGroupsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_GROUPS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_incident_causes_permissions_item.py b/rootly_sdk/models/role_incident_causes_permissions_item.py index 7ab3c4d6..d192d7f1 100644 --- a/rootly_sdk/models/role_incident_causes_permissions_item.py +++ b/rootly_sdk/models/role_incident_causes_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleIncidentCausesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_incident_causes_permissions_item(value: str | None) -> RoleIncide if value is None: return None if value in ROLE_INCIDENT_CAUSES_PERMISSIONS_ITEM_VALUES: - return cast(RoleIncidentCausesPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_INCIDENT_CAUSES_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_incident_communication_permissions_item.py b/rootly_sdk/models/role_incident_communication_permissions_item.py index 08924e2d..b64a8454 100644 --- a/rootly_sdk/models/role_incident_communication_permissions_item.py +++ b/rootly_sdk/models/role_incident_communication_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleIncidentCommunicationPermissionsItem = Literal["create", "delete", "read", "send", "update"] @@ -17,7 +17,7 @@ def check_role_incident_communication_permissions_item( if value is None: return None if value in ROLE_INCIDENT_COMMUNICATION_PERMISSIONS_ITEM_VALUES: - return cast(RoleIncidentCommunicationPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {ROLE_INCIDENT_COMMUNICATION_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/role_incident_feedbacks_permissions_item.py b/rootly_sdk/models/role_incident_feedbacks_permissions_item.py index d06f6d7d..4da25cce 100644 --- a/rootly_sdk/models/role_incident_feedbacks_permissions_item.py +++ b/rootly_sdk/models/role_incident_feedbacks_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleIncidentFeedbacksPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_incident_feedbacks_permissions_item(value: str | None) -> RoleInc if value is None: return None if value in ROLE_INCIDENT_FEEDBACKS_PERMISSIONS_ITEM_VALUES: - return cast(RoleIncidentFeedbacksPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_INCIDENT_FEEDBACKS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_incident_roles_permissions_item.py b/rootly_sdk/models/role_incident_roles_permissions_item.py index bde821af..64839a14 100644 --- a/rootly_sdk/models/role_incident_roles_permissions_item.py +++ b/rootly_sdk/models/role_incident_roles_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleIncidentRolesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_incident_roles_permissions_item(value: str | None) -> RoleInciden if value is None: return None if value in ROLE_INCIDENT_ROLES_PERMISSIONS_ITEM_VALUES: - return cast(RoleIncidentRolesPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_INCIDENT_ROLES_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_incident_types_permissions_item.py b/rootly_sdk/models/role_incident_types_permissions_item.py index c1f3b455..eec0f162 100644 --- a/rootly_sdk/models/role_incident_types_permissions_item.py +++ b/rootly_sdk/models/role_incident_types_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleIncidentTypesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_incident_types_permissions_item(value: str | None) -> RoleInciden if value is None: return None if value in ROLE_INCIDENT_TYPES_PERMISSIONS_ITEM_VALUES: - return cast(RoleIncidentTypesPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_INCIDENT_TYPES_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_incidents_permissions_item.py b/rootly_sdk/models/role_incidents_permissions_item.py index 3b4b61ef..895ef347 100644 --- a/rootly_sdk/models/role_incidents_permissions_item.py +++ b/rootly_sdk/models/role_incidents_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleIncidentsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_incidents_permissions_item(value: str | None) -> RoleIncidentsPer if value is None: return None if value in ROLE_INCIDENTS_PERMISSIONS_ITEM_VALUES: - return cast(RoleIncidentsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_INCIDENTS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_integrations_permissions_item.py b/rootly_sdk/models/role_integrations_permissions_item.py index b26ff9d3..b34a6bf6 100644 --- a/rootly_sdk/models/role_integrations_permissions_item.py +++ b/rootly_sdk/models/role_integrations_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleIntegrationsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_integrations_permissions_item(value: str | None) -> RoleIntegrati if value is None: return None if value in ROLE_INTEGRATIONS_PERMISSIONS_ITEM_VALUES: - return cast(RoleIntegrationsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_INTEGRATIONS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_invitations_permissions_item.py b/rootly_sdk/models/role_invitations_permissions_item.py index 2e05be13..b76bfdaf 100644 --- a/rootly_sdk/models/role_invitations_permissions_item.py +++ b/rootly_sdk/models/role_invitations_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleInvitationsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_invitations_permissions_item(value: str | None) -> RoleInvitation if value is None: return None if value in ROLE_INVITATIONS_PERMISSIONS_ITEM_VALUES: - return cast(RoleInvitationsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_INVITATIONS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_list.py b/rootly_sdk/models/role_list.py index 39a5997a..33e76fac 100644 --- a/rootly_sdk/models/role_list.py +++ b/rootly_sdk/models/role_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class RoleList: """ Attributes: - data (list['RoleListDataItem']): + data (list[RoleListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["RoleListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[RoleListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 438b2303..8fccfd1c 100644 --- a/rootly_sdk/models/role_list_data_item.py +++ b/rootly_sdk/models/role_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/role_list_data_item_type.py b/rootly_sdk/models/role_list_data_item_type.py index 7bc83e88..cf4eedf1 100644 --- a/rootly_sdk/models/role_list_data_item_type.py +++ b/rootly_sdk/models/role_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleListDataItemType = Literal["roles"] @@ -11,5 +11,5 @@ def check_role_list_data_item_type(value: str | None) -> RoleListDataItemType | if value is None: return None if value in ROLE_LIST_DATA_ITEM_TYPE_VALUES: - return cast(RoleListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/role_paging_permissions_item.py b/rootly_sdk/models/role_paging_permissions_item.py index 03231191..656c2e9f 100644 --- a/rootly_sdk/models/role_paging_permissions_item.py +++ b/rootly_sdk/models/role_paging_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RolePagingPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_paging_permissions_item(value: str | None) -> RolePagingPermissio if value is None: return None if value in ROLE_PAGING_PERMISSIONS_ITEM_VALUES: - return cast(RolePagingPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_PAGING_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_playbooks_permissions_item.py b/rootly_sdk/models/role_playbooks_permissions_item.py index 9d2ef542..fc1c560f 100644 --- a/rootly_sdk/models/role_playbooks_permissions_item.py +++ b/rootly_sdk/models/role_playbooks_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RolePlaybooksPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_playbooks_permissions_item(value: str | None) -> RolePlaybooksPer if value is None: return None if value in ROLE_PLAYBOOKS_PERMISSIONS_ITEM_VALUES: - return cast(RolePlaybooksPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_PLAYBOOKS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_private_agent_permissions_item.py b/rootly_sdk/models/role_private_agent_permissions_item.py new file mode 100644 index 00000000..4857c030 --- /dev/null +++ b/rootly_sdk/models/role_private_agent_permissions_item.py @@ -0,0 +1,18 @@ +from typing import Literal + +RolePrivateAgentPermissionsItem = Literal["create", "delete", "read", "update"] + +ROLE_PRIVATE_AGENT_PERMISSIONS_ITEM_VALUES: set[RolePrivateAgentPermissionsItem] = { + "create", + "delete", + "read", + "update", +} + + +def check_role_private_agent_permissions_item(value: str | None) -> RolePrivateAgentPermissionsItem | None: + if value is None: + return None + if value in ROLE_PRIVATE_AGENT_PERMISSIONS_ITEM_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_PRIVATE_AGENT_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_private_incidents_permissions_item.py b/rootly_sdk/models/role_private_incidents_permissions_item.py index 990084ff..ba66d62c 100644 --- a/rootly_sdk/models/role_private_incidents_permissions_item.py +++ b/rootly_sdk/models/role_private_incidents_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RolePrivateIncidentsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_private_incidents_permissions_item(value: str | None) -> RolePriv if value is None: return None if value in ROLE_PRIVATE_INCIDENTS_PERMISSIONS_ITEM_VALUES: - return cast(RolePrivateIncidentsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_PRIVATE_INCIDENTS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_pulses_permissions_item.py b/rootly_sdk/models/role_pulses_permissions_item.py index d7c5356e..d5eef6de 100644 --- a/rootly_sdk/models/role_pulses_permissions_item.py +++ b/rootly_sdk/models/role_pulses_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RolePulsesPermissionsItem = Literal["create", "read", "update"] @@ -13,5 +13,5 @@ def check_role_pulses_permissions_item(value: str | None) -> RolePulsesPermissio if value is None: return None if value in ROLE_PULSES_PERMISSIONS_ITEM_VALUES: - return cast(RolePulsesPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_PULSES_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_relationship.py b/rootly_sdk/models/role_relationship.py index 3bd40da5..a8a730e0 100644 --- a/rootly_sdk/models/role_relationship.py +++ b/rootly_sdk/models/role_relationship.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,16 +19,16 @@ class RoleRelationship: """ Attributes: - data (Union['RoleRelationshipDataType0', None, Unset]): + data (None | RoleRelationshipDataType0 | Unset): """ - data: Union["RoleRelationshipDataType0", None, Unset] = UNSET + data: None | RoleRelationshipDataType0 | 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: None | Unset | dict[str, Any] + data: dict[str, Any] | None | Unset if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, RoleRelationshipDataType0): @@ -48,7 +50,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> Union["RoleRelationshipDataType0", None, Unset]: + def _parse_data(data: object) -> None | RoleRelationshipDataType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -59,9 +61,9 @@ def _parse_data(data: object) -> Union["RoleRelationshipDataType0", None, Unset] data_type_0 = RoleRelationshipDataType0.from_dict(data) return data_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["RoleRelationshipDataType0", None, Unset], data) + return cast(None | RoleRelationshipDataType0 | 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 5f7ec2fe..6a7576ec 100644 --- a/rootly_sdk/models/role_relationship_data_type_0.py +++ b/rootly_sdk/models/role_relationship_data_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -17,18 +19,18 @@ class RoleRelationshipDataType0: """ Attributes: - id (Union[Unset, str]): - type_ (Union[Unset, RoleRelationshipDataType0Type]): + id (str | Unset): + type_ (RoleRelationshipDataType0Type | Unset): """ - id: Unset | str = UNSET - type_: Unset | RoleRelationshipDataType0Type = UNSET + id: str | Unset = UNSET + type_: RoleRelationshipDataType0Type | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -48,7 +50,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | RoleRelationshipDataType0Type + type_: RoleRelationshipDataType0Type | Unset if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/role_relationship_data_type_0_type.py b/rootly_sdk/models/role_relationship_data_type_0_type.py index da77071b..14b30f02 100644 --- a/rootly_sdk/models/role_relationship_data_type_0_type.py +++ b/rootly_sdk/models/role_relationship_data_type_0_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleRelationshipDataType0Type = Literal["roles"] @@ -11,5 +11,5 @@ def check_role_relationship_data_type_0_type(value: str | None) -> RoleRelations if value is None: return None if value in ROLE_RELATIONSHIP_DATA_TYPE_0_TYPE_VALUES: - return cast(RoleRelationshipDataType0Type, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_RELATIONSHIP_DATA_TYPE_0_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/role_response.py b/rootly_sdk/models/role_response.py index 85bba452..66ff7daf 100644 --- a/rootly_sdk/models/role_response.py +++ b/rootly_sdk/models/role_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class RoleResponse: """ Attributes: data (RoleResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "RoleResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: RoleResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 d1400829..9f83836c 100644 --- a/rootly_sdk/models/role_response_data.py +++ b/rootly_sdk/models/role_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/role_response_data_type.py b/rootly_sdk/models/role_response_data_type.py index d68080be..be666994 100644 --- a/rootly_sdk/models/role_response_data_type.py +++ b/rootly_sdk/models/role_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleResponseDataType = Literal["roles"] @@ -11,5 +11,5 @@ def check_role_response_data_type(value: str | None) -> RoleResponseDataType | N if value is None: return None if value in ROLE_RESPONSE_DATA_TYPE_VALUES: - return cast(RoleResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/role_retrospective_permissions_item.py b/rootly_sdk/models/role_retrospective_permissions_item.py index 2e13ca96..731c2c90 100644 --- a/rootly_sdk/models/role_retrospective_permissions_item.py +++ b/rootly_sdk/models/role_retrospective_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleRetrospectivePermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_retrospective_permissions_item(value: str | None) -> RoleRetrospe if value is None: return None if value in ROLE_RETROSPECTIVE_PERMISSIONS_ITEM_VALUES: - return cast(RoleRetrospectivePermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_RETROSPECTIVE_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_roles_permissions_item.py b/rootly_sdk/models/role_roles_permissions_item.py index e7ddb153..1ee0cd0c 100644 --- a/rootly_sdk/models/role_roles_permissions_item.py +++ b/rootly_sdk/models/role_roles_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleRolesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_roles_permissions_item(value: str | None) -> RoleRolesPermissions if value is None: return None if value in ROLE_ROLES_PERMISSIONS_ITEM_VALUES: - return cast(RoleRolesPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_ROLES_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_secrets_permissions_item.py b/rootly_sdk/models/role_secrets_permissions_item.py index b297b8d9..d846cb00 100644 --- a/rootly_sdk/models/role_secrets_permissions_item.py +++ b/rootly_sdk/models/role_secrets_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleSecretsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_secrets_permissions_item(value: str | None) -> RoleSecretsPermiss if value is None: return None if value in ROLE_SECRETS_PERMISSIONS_ITEM_VALUES: - return cast(RoleSecretsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_SECRETS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_services_permissions_item.py b/rootly_sdk/models/role_services_permissions_item.py index 37653ead..25352c18 100644 --- a/rootly_sdk/models/role_services_permissions_item.py +++ b/rootly_sdk/models/role_services_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleServicesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_services_permissions_item(value: str | None) -> RoleServicesPermi if value is None: return None if value in ROLE_SERVICES_PERMISSIONS_ITEM_VALUES: - return cast(RoleServicesPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_SERVICES_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_severities_permissions_item.py b/rootly_sdk/models/role_severities_permissions_item.py index 0ea61333..462c1366 100644 --- a/rootly_sdk/models/role_severities_permissions_item.py +++ b/rootly_sdk/models/role_severities_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleSeveritiesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_severities_permissions_item(value: str | None) -> RoleSeveritiesP if value is None: return None if value in ROLE_SEVERITIES_PERMISSIONS_ITEM_VALUES: - return cast(RoleSeveritiesPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_SEVERITIES_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_slas_permissions_item.py b/rootly_sdk/models/role_slas_permissions_item.py index bf8f9dbd..e69110ae 100644 --- a/rootly_sdk/models/role_slas_permissions_item.py +++ b/rootly_sdk/models/role_slas_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleSlasPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_slas_permissions_item(value: str | None) -> RoleSlasPermissionsIt if value is None: return None if value in ROLE_SLAS_PERMISSIONS_ITEM_VALUES: - return cast(RoleSlasPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_SLAS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_status_page_updates_permissions_type_0_item.py b/rootly_sdk/models/role_status_page_updates_permissions_type_0_item.py new file mode 100644 index 00000000..c6b8cce1 --- /dev/null +++ b/rootly_sdk/models/role_status_page_updates_permissions_type_0_item.py @@ -0,0 +1,22 @@ +from typing import Literal + +RoleStatusPageUpdatesPermissionsType0Item = Literal["create", "delete", "read", "update"] + +ROLE_STATUS_PAGE_UPDATES_PERMISSIONS_TYPE_0_ITEM_VALUES: set[RoleStatusPageUpdatesPermissionsType0Item] = { + "create", + "delete", + "read", + "update", +} + + +def check_role_status_page_updates_permissions_type_0_item( + value: str | None, +) -> RoleStatusPageUpdatesPermissionsType0Item | None: + if value is None: + return None + if value in ROLE_STATUS_PAGE_UPDATES_PERMISSIONS_TYPE_0_ITEM_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {ROLE_STATUS_PAGE_UPDATES_PERMISSIONS_TYPE_0_ITEM_VALUES!r}" + ) diff --git a/rootly_sdk/models/role_status_pages_permissions_item.py b/rootly_sdk/models/role_status_pages_permissions_item.py index 0f4863f7..ff911690 100644 --- a/rootly_sdk/models/role_status_pages_permissions_item.py +++ b/rootly_sdk/models/role_status_pages_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleStatusPagesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_status_pages_permissions_item(value: str | None) -> RoleStatusPag if value is None: return None if value in ROLE_STATUS_PAGES_PERMISSIONS_ITEM_VALUES: - return cast(RoleStatusPagesPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_STATUS_PAGES_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_sub_statuses_permissions_item.py b/rootly_sdk/models/role_sub_statuses_permissions_item.py index cf66ea97..22f2c304 100644 --- a/rootly_sdk/models/role_sub_statuses_permissions_item.py +++ b/rootly_sdk/models/role_sub_statuses_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleSubStatusesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_sub_statuses_permissions_item(value: str | None) -> RoleSubStatus if value is None: return None if value in ROLE_SUB_STATUSES_PERMISSIONS_ITEM_VALUES: - return cast(RoleSubStatusesPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_SUB_STATUSES_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_webhooks_permissions_item.py b/rootly_sdk/models/role_webhooks_permissions_item.py index 2f112ed4..b25e8752 100644 --- a/rootly_sdk/models/role_webhooks_permissions_item.py +++ b/rootly_sdk/models/role_webhooks_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleWebhooksPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_webhooks_permissions_item(value: str | None) -> RoleWebhooksPermi if value is None: return None if value in ROLE_WEBHOOKS_PERMISSIONS_ITEM_VALUES: - return cast(RoleWebhooksPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_WEBHOOKS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/role_workflows_permissions_item.py b/rootly_sdk/models/role_workflows_permissions_item.py index 07600d8d..dc2230f0 100644 --- a/rootly_sdk/models/role_workflows_permissions_item.py +++ b/rootly_sdk/models/role_workflows_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RoleWorkflowsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -14,5 +14,5 @@ def check_role_workflows_permissions_item(value: str | None) -> RoleWorkflowsPer if value is None: return None if value in ROLE_WORKFLOWS_PERMISSIONS_ITEM_VALUES: - return cast(RoleWorkflowsPermissionsItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROLE_WORKFLOWS_PERMISSIONS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/rotate_api_key.py b/rootly_sdk/models/rotate_api_key.py index 3b4d42ab..60da820d 100644 --- a/rootly_sdk/models/rotate_api_key.py +++ b/rootly_sdk/models/rotate_api_key.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.rotate_api_key_data import RotateApiKeyData @@ -18,14 +19,13 @@ class RotateApiKey: data (RotateApiKeyData): """ - data: "RotateApiKeyData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: RotateApiKeyData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - rotate_api_key.additional_properties = d return rotate_api_key - - @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/rotate_api_key_data.py b/rootly_sdk/models/rotate_api_key_data.py index c5409b88..631a9598 100644 --- a/rootly_sdk/models/rotate_api_key_data.py +++ b/rootly_sdk/models/rotate_api_key_data.py @@ -1,8 +1,9 @@ +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.rotate_api_key_data_type import RotateApiKeyDataType, check_rotate_api_key_data_type @@ -22,8 +23,7 @@ class RotateApiKeyData: """ type_: RotateApiKeyDataType - attributes: "RotateApiKeyDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: RotateApiKeyDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - rotate_api_key_data.additional_properties = d return rotate_api_key_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/rotate_api_key_data_attributes.py b/rootly_sdk/models/rotate_api_key_data_attributes.py index d6e37992..6e7e3d4f 100644 --- a/rootly_sdk/models/rotate_api_key_data_attributes.py +++ b/rootly_sdk/models/rotate_api_key_data_attributes.py @@ -1,9 +1,10 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast from attrs import define as _attrs_define -from dateutil.parser import isoparse from ..types import UNSET, Unset @@ -14,16 +15,16 @@ class RotateApiKeyDataAttributes: """ Attributes: - 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): 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: None | Unset | datetime.datetime = UNSET - grace_period_minutes: Unset | int = 30 + expires_at: datetime.datetime | None | Unset = UNSET + grace_period_minutes: int | Unset = 30 def to_dict(self) -> dict[str, Any]: - expires_at: None | Unset | str + expires_at: None | str | Unset if isinstance(self.expires_at, Unset): expires_at = UNSET elif isinstance(self.expires_at, datetime.datetime): @@ -47,7 +48,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) -> None | Unset | datetime.datetime: + def _parse_expires_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -55,12 +56,12 @@ def _parse_expires_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - expires_at_type_0 = isoparse(data) + expires_at_type_0 = datetime.datetime.fromisoformat(data) return expires_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) diff --git a/rootly_sdk/models/rotate_api_key_data_type.py b/rootly_sdk/models/rotate_api_key_data_type.py index 3e8d5c7e..2057fa97 100644 --- a/rootly_sdk/models/rotate_api_key_data_type.py +++ b/rootly_sdk/models/rotate_api_key_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RotateApiKeyDataType = Literal["api_keys"] @@ -11,5 +11,5 @@ def check_rotate_api_key_data_type(value: str | None) -> RotateApiKeyDataType | if value is None: return None if value in ROTATE_API_KEY_DATA_TYPE_VALUES: - return cast(RotateApiKeyDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {ROTATE_API_KEY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/run_command_heroku_task_params.py b/rootly_sdk/models/run_command_heroku_task_params.py index 49a46930..8535d2cc 100644 --- a/rootly_sdk/models/run_command_heroku_task_params.py +++ b/rootly_sdk/models/run_command_heroku_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -30,17 +32,17 @@ class RunCommandHerokuTaskParams: command (str): app_name (str): size (RunCommandHerokuTaskParamsSize): - task_type (Union[Unset, RunCommandHerokuTaskParamsTaskType]): - post_to_incident_timeline (Union[Unset, bool]): - post_to_slack_channels (Union[Unset, list['RunCommandHerokuTaskParamsPostToSlackChannelsItem']]): + task_type (RunCommandHerokuTaskParamsTaskType | Unset): + post_to_incident_timeline (bool | Unset): + post_to_slack_channels (list[RunCommandHerokuTaskParamsPostToSlackChannelsItem] | Unset): """ command: str app_name: str size: RunCommandHerokuTaskParamsSize - task_type: Unset | RunCommandHerokuTaskParamsTaskType = UNSET - post_to_incident_timeline: Unset | bool = UNSET - post_to_slack_channels: Unset | list["RunCommandHerokuTaskParamsPostToSlackChannelsItem"] = UNSET + task_type: RunCommandHerokuTaskParamsTaskType | Unset = UNSET + post_to_incident_timeline: bool | Unset = UNSET + post_to_slack_channels: list[RunCommandHerokuTaskParamsPostToSlackChannelsItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,13 +52,13 @@ def to_dict(self) -> dict[str, Any]: size: str = self.size - task_type: Unset | str = UNSET + task_type: str | Unset = 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: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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: @@ -95,7 +97,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: Unset | RunCommandHerokuTaskParamsTaskType + task_type: RunCommandHerokuTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -103,14 +105,16 @@ 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) - 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: 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 + ) - 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 27b0a046..034627af 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class RunCommandHerokuTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/run_command_heroku_task_params_size.py b/rootly_sdk/models/run_command_heroku_task_params_size.py index 35cdb0e4..c95bf85f 100644 --- a/rootly_sdk/models/run_command_heroku_task_params_size.py +++ b/rootly_sdk/models/run_command_heroku_task_params_size.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RunCommandHerokuTaskParamsSize = Literal["standard-1X", "standard-2X"] @@ -12,5 +12,5 @@ def check_run_command_heroku_task_params_size(value: str | None) -> RunCommandHe if value is None: return None if value in RUN_COMMAND_HEROKU_TASK_PARAMS_SIZE_VALUES: - return cast(RunCommandHerokuTaskParamsSize, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {RUN_COMMAND_HEROKU_TASK_PARAMS_SIZE_VALUES!r}") diff --git a/rootly_sdk/models/run_command_heroku_task_params_task_type.py b/rootly_sdk/models/run_command_heroku_task_params_task_type.py index bd4a8416..3acfb4df 100644 --- a/rootly_sdk/models/run_command_heroku_task_params_task_type.py +++ b/rootly_sdk/models/run_command_heroku_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal RunCommandHerokuTaskParamsTaskType = Literal["run_command_heroku"] @@ -11,5 +11,5 @@ def check_run_command_heroku_task_params_task_type(value: str | None) -> RunComm if value is None: return None if value in RUN_COMMAND_HEROKU_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(RunCommandHerokuTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {RUN_COMMAND_HEROKU_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/schedule.py b/rootly_sdk/models/schedule.py index 01b2ec58..61b529c5 100644 --- a/rootly_sdk/models/schedule.py +++ b/rootly_sdk/models/schedule.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -11,6 +13,7 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.schedule_business_hours_type_0 import ScheduleBusinessHoursType0 from ..models.schedule_slack_channel_type_0 import ScheduleSlackChannelType0 from ..models.schedule_slack_user_group_type_0 import ScheduleSlackUserGroupType0 @@ -26,48 +29,51 @@ 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 (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 + description (None | str | Unset): The description of the schedule + all_time_coverage (bool | None | Unset): 24/7 coverage of the schedule + time_zone (None | str | Unset): IANA time zone the schedule's rotations are rendered in + 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 `slack_channel` to be set; otherwise this value is forced to false on save. - 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 + shift_report_enabled (bool | Unset): 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 (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 + 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 + business_hours (None | ScheduleBusinessHoursType0 | Unset): Controls shadow paging on the schedule. Null + disables shadow paging. start_time and end_time are HH:MM 24-hour format strings. """ name: str owner_user_id: int created_at: str updated_at: str - 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 + description: None | str | Unset = UNSET + all_time_coverage: bool | None | Unset = UNSET + time_zone: None | str | 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 + business_hours: None | ScheduleBusinessHoursType0 | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + from ..models.schedule_business_hours_type_0 import ScheduleBusinessHoursType0 from ..models.schedule_slack_channel_type_0 import ScheduleSlackChannelType0 from ..models.schedule_slack_user_group_type_0 import ScheduleSlackUserGroupType0 @@ -79,19 +85,25 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - all_time_coverage: None | Unset | bool + all_time_coverage: bool | None | Unset if isinstance(self.all_time_coverage, Unset): all_time_coverage = UNSET else: all_time_coverage = self.all_time_coverage - slack_user_group: None | Unset | dict[str, Any] + time_zone: None | str | Unset + if isinstance(self.time_zone, Unset): + time_zone = UNSET + else: + time_zone = self.time_zone + + slack_user_group: dict[str, Any] | None | Unset if isinstance(self.slack_user_group, Unset): slack_user_group = UNSET elif isinstance(self.slack_user_group, ScheduleSlackUserGroupType0): @@ -99,7 +111,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_user_group = self.slack_user_group - slack_channel: None | Unset | dict[str, Any] + slack_channel: dict[str, Any] | None | Unset if isinstance(self.slack_channel, Unset): slack_channel = UNSET elif isinstance(self.slack_channel, ScheduleSlackChannelType0): @@ -107,7 +119,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel = self.slack_channel - owner_group_ids: Unset | list[str] = UNSET + owner_group_ids: list[str] | Unset = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids @@ -121,7 +133,7 @@ def to_dict(self) -> dict[str, Any]: shift_report_enabled = self.shift_report_enabled - shift_report_day_of_week: Unset | str = UNSET + shift_report_day_of_week: str | Unset = UNSET if not isinstance(self.shift_report_day_of_week, Unset): shift_report_day_of_week = self.shift_report_day_of_week @@ -129,6 +141,14 @@ def to_dict(self) -> dict[str, Any]: shift_report_time_zone = self.shift_report_time_zone + business_hours: dict[str, Any] | None | Unset + if isinstance(self.business_hours, Unset): + business_hours = UNSET + elif isinstance(self.business_hours, ScheduleBusinessHoursType0): + business_hours = self.business_hours.to_dict() + else: + business_hours = self.business_hours + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -143,6 +163,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if all_time_coverage is not UNSET: field_dict["all_time_coverage"] = all_time_coverage + if time_zone is not UNSET: + field_dict["time_zone"] = time_zone if slack_user_group is not UNSET: field_dict["slack_user_group"] = slack_user_group if slack_channel is not UNSET: @@ -165,11 +187,14 @@ def to_dict(self) -> dict[str, Any]: field_dict["shift_report_time_of_day"] = shift_report_time_of_day if shift_report_time_zone is not UNSET: field_dict["shift_report_time_zone"] = shift_report_time_zone + if business_hours is not UNSET: + field_dict["business_hours"] = business_hours return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.schedule_business_hours_type_0 import ScheduleBusinessHoursType0 from ..models.schedule_slack_channel_type_0 import ScheduleSlackChannelType0 from ..models.schedule_slack_user_group_type_0 import ScheduleSlackUserGroupType0 @@ -182,25 +207,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_all_time_coverage(data: object) -> None | Unset | bool: + def _parse_all_time_coverage(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) all_time_coverage = _parse_all_time_coverage(d.pop("all_time_coverage", UNSET)) - def _parse_slack_user_group(data: object) -> Union["ScheduleSlackUserGroupType0", None, Unset]: + def _parse_time_zone(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) + + def _parse_slack_user_group(data: object) -> None | ScheduleSlackUserGroupType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -211,13 +245,13 @@ def _parse_slack_user_group(data: object) -> Union["ScheduleSlackUserGroupType0" slack_user_group_type_0 = ScheduleSlackUserGroupType0.from_dict(data) return slack_user_group_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["ScheduleSlackUserGroupType0", None, Unset], data) + return cast(None | ScheduleSlackUserGroupType0 | Unset, data) slack_user_group = _parse_slack_user_group(d.pop("slack_user_group", UNSET)) - def _parse_slack_channel(data: object) -> Union["ScheduleSlackChannelType0", None, Unset]: + def _parse_slack_channel(data: object) -> None | ScheduleSlackChannelType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -228,9 +262,9 @@ def _parse_slack_channel(data: object) -> Union["ScheduleSlackChannelType0", Non slack_channel_type_0 = ScheduleSlackChannelType0.from_dict(data) return slack_channel_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["ScheduleSlackChannelType0", None, Unset], data) + return cast(None | ScheduleSlackChannelType0 | Unset, data) slack_channel = _parse_slack_channel(d.pop("slack_channel", UNSET)) @@ -247,7 +281,7 @@ def _parse_slack_channel(data: object) -> Union["ScheduleSlackChannelType0", Non 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: Unset | ScheduleShiftReportDayOfWeek + shift_report_day_of_week: ScheduleShiftReportDayOfWeek | Unset if isinstance(_shift_report_day_of_week, Unset): shift_report_day_of_week = UNSET else: @@ -257,6 +291,23 @@ def _parse_slack_channel(data: object) -> Union["ScheduleSlackChannelType0", Non shift_report_time_zone = d.pop("shift_report_time_zone", UNSET) + def _parse_business_hours(data: object) -> None | ScheduleBusinessHoursType0 | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + business_hours_type_0 = ScheduleBusinessHoursType0.from_dict(data) + + return business_hours_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | ScheduleBusinessHoursType0 | Unset, data) + + business_hours = _parse_business_hours(d.pop("business_hours", UNSET)) + schedule = cls( name=name, owner_user_id=owner_user_id, @@ -264,6 +315,7 @@ def _parse_slack_channel(data: object) -> Union["ScheduleSlackChannelType0", Non updated_at=updated_at, description=description, all_time_coverage=all_time_coverage, + time_zone=time_zone, slack_user_group=slack_user_group, slack_channel=slack_channel, owner_group_ids=owner_group_ids, @@ -275,6 +327,7 @@ def _parse_slack_channel(data: object) -> Union["ScheduleSlackChannelType0", Non shift_report_day_of_week=shift_report_day_of_week, shift_report_time_of_day=shift_report_time_of_day, shift_report_time_zone=shift_report_time_zone, + business_hours=business_hours, ) schedule.additional_properties = d diff --git a/rootly_sdk/models/schedule_business_hours_type_0.py b/rootly_sdk/models/schedule_business_hours_type_0.py new file mode 100644 index 00000000..13eda02a --- /dev/null +++ b/rootly_sdk/models/schedule_business_hours_type_0.py @@ -0,0 +1,79 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="ScheduleBusinessHoursType0") + + +@_attrs_define +class ScheduleBusinessHoursType0: + """Controls shadow paging on the schedule. Null disables shadow paging. start_time and end_time are HH:MM 24-hour + format strings. + + Attributes: + start_time (str): + end_time (str): + include_weekends (bool): + """ + + start_time: str + end_time: str + include_weekends: bool + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + start_time = self.start_time + + end_time = self.end_time + + include_weekends = self.include_weekends + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "start_time": start_time, + "end_time": end_time, + "include_weekends": include_weekends, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + start_time = d.pop("start_time") + + end_time = d.pop("end_time") + + include_weekends = d.pop("include_weekends") + + schedule_business_hours_type_0 = cls( + start_time=start_time, + end_time=end_time, + include_weekends=include_weekends, + ) + + schedule_business_hours_type_0.additional_properties = d + return schedule_business_hours_type_0 + + @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/schedule_list.py b/rootly_sdk/models/schedule_list.py index 52a5d577..e35b2826 100644 --- a/rootly_sdk/models/schedule_list.py +++ b/rootly_sdk/models/schedule_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class ScheduleList: """ Attributes: - data (list['ScheduleListDataItem']): + data (list[ScheduleListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["ScheduleListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[ScheduleListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 dee5f4d0..f3cd6fdb 100644 --- a/rootly_sdk/models/schedule_list_data_item.py +++ b/rootly_sdk/models/schedule_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/schedule_list_data_item_type.py b/rootly_sdk/models/schedule_list_data_item_type.py index 0a7690b8..bda21e8b 100644 --- a/rootly_sdk/models/schedule_list_data_item_type.py +++ b/rootly_sdk/models/schedule_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ScheduleListDataItemType = Literal["schedules"] @@ -11,5 +11,5 @@ def check_schedule_list_data_item_type(value: str | None) -> ScheduleListDataIte if value is None: return None if value in SCHEDULE_LIST_DATA_ITEM_TYPE_VALUES: - return cast(ScheduleListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SCHEDULE_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/schedule_response.py b/rootly_sdk/models/schedule_response.py index 7a59fdfe..01584487 100644 --- a/rootly_sdk/models/schedule_response.py +++ b/rootly_sdk/models/schedule_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class ScheduleResponse: """ Attributes: data (ScheduleResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "ScheduleResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: ScheduleResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 4b483ed5..1d25406d 100644 --- a/rootly_sdk/models/schedule_response_data.py +++ b/rootly_sdk/models/schedule_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/schedule_response_data_type.py b/rootly_sdk/models/schedule_response_data_type.py index 5e3049f1..d19cee7e 100644 --- a/rootly_sdk/models/schedule_response_data_type.py +++ b/rootly_sdk/models/schedule_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ScheduleResponseDataType = Literal["schedules"] @@ -11,5 +11,5 @@ def check_schedule_response_data_type(value: str | None) -> ScheduleResponseData if value is None: return None if value in SCHEDULE_RESPONSE_DATA_TYPE_VALUES: - return cast(ScheduleResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SCHEDULE_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/schedule_rotation.py b/rootly_sdk/models/schedule_rotation.py index 53d1f657..a48e2182 100644 --- a/rootly_sdk/models/schedule_rotation.py +++ b/rootly_sdk/models/schedule_rotation.py @@ -1,10 +1,11 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field -from dateutil.parser import isoparse from ..models.schedule_rotation_active_days_item import ( ScheduleRotationActiveDaysItem, @@ -42,39 +43,40 @@ 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 (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 + 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. Organizations with one timezone per schedule manage this + on the schedule; a value differing from the schedule's is rejected. Default: 'Etc/UTC'. + start_time (datetime.datetime | None | Unset): RFC3339 date-time when rotation starts. Shifts will only be created after this time. - end_time (Union[None, Unset, datetime.datetime]): RFC3339 date-time when rotation ends. Shifts will only be - created before this time. + end_time (datetime.datetime | None | Unset): 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: 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -108,7 +110,7 @@ def to_dict(self) -> dict[str, Any]: active_all_week = self.active_all_week - active_days: Unset | list[str] = UNSET + active_days: list[str] | Unset = UNSET if not isinstance(self.active_days, Unset): active_days = [] for active_days_item_data in self.active_days: @@ -117,7 +119,7 @@ def to_dict(self) -> dict[str, Any]: active_time_type = self.active_time_type - active_time_attributes: Unset | list[dict[str, Any]] = UNSET + active_time_attributes: list[dict[str, Any]] | Unset = 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 +128,7 @@ def to_dict(self) -> dict[str, Any]: time_zone = self.time_zone - start_time: None | Unset | str + start_time: None | str | Unset if isinstance(self.start_time, Unset): start_time = UNSET elif isinstance(self.start_time, datetime.datetime): @@ -134,7 +136,7 @@ def to_dict(self) -> dict[str, Any]: else: start_time = self.start_time - end_time: None | Unset | str + end_time: None | str | Unset if isinstance(self.end_time, Unset): end_time = UNSET elif isinstance(self.end_time, datetime.datetime): @@ -198,12 +200,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_schedule_rotationable_attributes( data: object, - ) -> Union[ - "ScheduleRotationScheduleRotationableAttributesType0", - "ScheduleRotationScheduleRotationableAttributesType1", - "ScheduleRotationScheduleRotationableAttributesType2", - "ScheduleRotationScheduleRotationableAttributesType3", - ]: + ) -> ( + ScheduleRotationScheduleRotationableAttributesType0 + | ScheduleRotationScheduleRotationableAttributesType1 + | ScheduleRotationScheduleRotationableAttributesType2 + | ScheduleRotationScheduleRotationableAttributesType3 + ): try: if not isinstance(data, dict): raise TypeError() @@ -212,7 +214,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -222,7 +224,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -232,7 +234,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_2 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -250,27 +252,31 @@ def _parse_schedule_rotationable_attributes( active_all_week = d.pop("active_all_week", UNSET) - active_days = [] _active_days = d.pop("active_days", UNSET) - for active_days_item_data in _active_days or []: - active_days_item = check_schedule_rotation_active_days_item(active_days_item_data) + 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) - 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) - 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: 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 + ) - 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) -> None | Unset | datetime.datetime: + def _parse_start_time(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -278,16 +284,16 @@ def _parse_start_time(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - start_time_type_0 = isoparse(data) + start_time_type_0 = datetime.datetime.fromisoformat(data) return start_time_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> None | Unset | datetime.datetime: + def _parse_end_time(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -295,12 +301,12 @@ def _parse_end_time(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - end_time_type_0 = isoparse(data) + end_time_type_0 = datetime.datetime.fromisoformat(data) return end_time_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, 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 f3b1c891..d21d18dd 100644 --- a/rootly_sdk/models/schedule_rotation_active_day.py +++ b/rootly_sdk/models/schedule_rotation_active_day.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,15 +26,15 @@ 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) 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 ee238b25..8407725b 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class ScheduleRotationActiveDayActiveTimeAttributesItem: """ Attributes: - 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): Start time for schedule rotation active time + end_time (str | Unset): End time for schedule rotation active time """ - start_time: Unset | str = UNSET - end_time: Unset | str = UNSET + start_time: str | Unset = UNSET + end_time: str | Unset = UNSET 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_day_name.py b/rootly_sdk/models/schedule_rotation_active_day_day_name.py index 015ebdb1..eb8554d3 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_day_name.py +++ b/rootly_sdk/models/schedule_rotation_active_day_day_name.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ScheduleRotationActiveDayDayName = Literal["F", "M", "R", "S", "T", "U", "W"] @@ -17,5 +17,5 @@ def check_schedule_rotation_active_day_day_name(value: str | None) -> ScheduleRo if value is None: return None if value in SCHEDULE_ROTATION_ACTIVE_DAY_DAY_NAME_VALUES: - return cast(ScheduleRotationActiveDayDayName, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SCHEDULE_ROTATION_ACTIVE_DAY_DAY_NAME_VALUES!r}") diff --git a/rootly_sdk/models/schedule_rotation_active_day_list.py b/rootly_sdk/models/schedule_rotation_active_day_list.py index 68ad8077..f1f443f6 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_list.py +++ b/rootly_sdk/models/schedule_rotation_active_day_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class ScheduleRotationActiveDayList: """ Attributes: - data (list['ScheduleRotationActiveDayListDataItem']): + data (list[ScheduleRotationActiveDayListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["ScheduleRotationActiveDayListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[ScheduleRotationActiveDayListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 e5f8d111..89218d8f 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/schedule_rotation_active_day_list_data_item_type.py b/rootly_sdk/models/schedule_rotation_active_day_list_data_item_type.py index ef58f7ad..ba937ee7 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_list_data_item_type.py +++ b/rootly_sdk/models/schedule_rotation_active_day_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ScheduleRotationActiveDayListDataItemType = Literal["schedule_rotation_active_days"] @@ -13,7 +13,7 @@ def check_schedule_rotation_active_day_list_data_item_type( if value is None: return None if value in SCHEDULE_ROTATION_ACTIVE_DAY_LIST_DATA_ITEM_TYPE_VALUES: - return cast(ScheduleRotationActiveDayListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SCHEDULE_ROTATION_ACTIVE_DAY_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/schedule_rotation_active_day_response.py b/rootly_sdk/models/schedule_rotation_active_day_response.py index 0bcef0d5..be14e5db 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_response.py +++ b/rootly_sdk/models/schedule_rotation_active_day_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,20 +20,20 @@ class ScheduleRotationActiveDayResponse: """ Attributes: - data (Union[Unset, ScheduleRotationActiveDayResponseData]): - included (Union[Unset, list['JsonapiIncludedResource']]): + data (ScheduleRotationActiveDayResponseData | Unset): + included (list[JsonapiIncludedResource] | Unset): """ - data: Union[Unset, "ScheduleRotationActiveDayResponseData"] = UNSET - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: ScheduleRotationActiveDayResponseData | Unset = UNSET + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Unset | dict[str, Any] = UNSET + data: dict[str, Any] | Unset = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -55,18 +57,20 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Unset | ScheduleRotationActiveDayResponseData + data: ScheduleRotationActiveDayResponseData | Unset if isinstance(_data, Unset): data = UNSET else: data = ScheduleRotationActiveDayResponseData.from_dict(_data) - included = [] _included = d.pop("included", UNSET) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 97dce826..de8b9b12 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_response_data.py +++ b/rootly_sdk/models/schedule_rotation_active_day_response_data.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,24 +23,24 @@ class ScheduleRotationActiveDayResponseData: """ Attributes: - id (Union[Unset, str]): Unique ID of the schedule rotation active time - type_ (Union[Unset, ScheduleRotationActiveDayResponseDataType]): - attributes (Union[Unset, ScheduleRotationActiveDay]): + id (str | Unset): Unique ID of the schedule rotation active time + type_ (ScheduleRotationActiveDayResponseDataType | Unset): + attributes (ScheduleRotationActiveDay | Unset): """ - id: Unset | str = UNSET - type_: Unset | ScheduleRotationActiveDayResponseDataType = UNSET - attributes: Union[Unset, "ScheduleRotationActiveDay"] = UNSET + id: str | Unset = UNSET + type_: ScheduleRotationActiveDayResponseDataType | Unset = UNSET + attributes: ScheduleRotationActiveDay | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -62,14 +64,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | ScheduleRotationActiveDayResponseDataType + type_: ScheduleRotationActiveDayResponseDataType | Unset if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_schedule_rotation_active_day_response_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Unset | ScheduleRotationActiveDay + attributes: ScheduleRotationActiveDay | Unset if isinstance(_attributes, Unset): attributes = UNSET else: diff --git a/rootly_sdk/models/schedule_rotation_active_day_response_data_type.py b/rootly_sdk/models/schedule_rotation_active_day_response_data_type.py index 8595cb3c..14fa5da2 100644 --- a/rootly_sdk/models/schedule_rotation_active_day_response_data_type.py +++ b/rootly_sdk/models/schedule_rotation_active_day_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ScheduleRotationActiveDayResponseDataType = Literal["schedule_rotation_active_days"] @@ -13,7 +13,7 @@ def check_schedule_rotation_active_day_response_data_type( if value is None: return None if value in SCHEDULE_ROTATION_ACTIVE_DAY_RESPONSE_DATA_TYPE_VALUES: - return cast(ScheduleRotationActiveDayResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SCHEDULE_ROTATION_ACTIVE_DAY_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/schedule_rotation_active_days_item.py b/rootly_sdk/models/schedule_rotation_active_days_item.py index ef5e9e7c..57cf3214 100644 --- a/rootly_sdk/models/schedule_rotation_active_days_item.py +++ b/rootly_sdk/models/schedule_rotation_active_days_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ScheduleRotationActiveDaysItem = Literal["F", "M", "R", "S", "T", "U", "W"] @@ -17,5 +17,5 @@ def check_schedule_rotation_active_days_item(value: str | None) -> ScheduleRotat if value is None: return None if value in SCHEDULE_ROTATION_ACTIVE_DAYS_ITEM_VALUES: - return cast(ScheduleRotationActiveDaysItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SCHEDULE_ROTATION_ACTIVE_DAYS_ITEM_VALUES!r}") 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 0133b6f5..f61260d2 100644 --- a/rootly_sdk/models/schedule_rotation_active_time_attributes_item.py +++ b/rootly_sdk/models/schedule_rotation_active_time_attributes_item.py @@ -1,3 +1,5 @@ +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 0c67d4c7..c0c3fa9f 100644 --- a/rootly_sdk/models/schedule_rotation_list.py +++ b/rootly_sdk/models/schedule_rotation_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class ScheduleRotationList: """ Attributes: - data (list['ScheduleRotationListDataItem']): + data (list[ScheduleRotationListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["ScheduleRotationListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[ScheduleRotationListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 c61c5b9c..a05d662e 100644 --- a/rootly_sdk/models/schedule_rotation_list_data_item.py +++ b/rootly_sdk/models/schedule_rotation_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/schedule_rotation_list_data_item_type.py b/rootly_sdk/models/schedule_rotation_list_data_item_type.py index 62d8c7b2..0d10b0cb 100644 --- a/rootly_sdk/models/schedule_rotation_list_data_item_type.py +++ b/rootly_sdk/models/schedule_rotation_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ScheduleRotationListDataItemType = Literal["schedule_rotations"] @@ -11,5 +11,5 @@ def check_schedule_rotation_list_data_item_type(value: str | None) -> ScheduleRo if value is None: return None if value in SCHEDULE_ROTATION_LIST_DATA_ITEM_TYPE_VALUES: - return cast(ScheduleRotationListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SCHEDULE_ROTATION_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/schedule_rotation_response.py b/rootly_sdk/models/schedule_rotation_response.py index a0fd94db..fa8128cc 100644 --- a/rootly_sdk/models/schedule_rotation_response.py +++ b/rootly_sdk/models/schedule_rotation_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class ScheduleRotationResponse: """ Attributes: data (ScheduleRotationResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "ScheduleRotationResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: ScheduleRotationResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 885266b5..23264402 100644 --- a/rootly_sdk/models/schedule_rotation_response_data.py +++ b/rootly_sdk/models/schedule_rotation_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/schedule_rotation_response_data_type.py b/rootly_sdk/models/schedule_rotation_response_data_type.py index 157e1921..7c8797e3 100644 --- a/rootly_sdk/models/schedule_rotation_response_data_type.py +++ b/rootly_sdk/models/schedule_rotation_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ScheduleRotationResponseDataType = Literal["schedule_rotations"] @@ -11,5 +11,5 @@ def check_schedule_rotation_response_data_type(value: str | None) -> ScheduleRot if value is None: return None if value in SCHEDULE_ROTATION_RESPONSE_DATA_TYPE_VALUES: - return cast(ScheduleRotationResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SCHEDULE_ROTATION_RESPONSE_DATA_TYPE_VALUES!r}") 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 6835c072..2cd22b53 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,3 +1,5 @@ +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 e03a3206..c36e9741 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,3 +1,5 @@ +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_handoff_day.py b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_1_handoff_day.py index f9e0981b..e45210bd 100644 --- a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_1_handoff_day.py +++ b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_1_handoff_day.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ScheduleRotationScheduleRotationableAttributesType1HandoffDay = Literal["F", "M", "R", "S", "T", "U", "W"] @@ -21,7 +21,7 @@ def check_schedule_rotation_schedule_rotationable_attributes_type_1_handoff_day( if value is None: return None if value in SCHEDULE_ROTATION_SCHEDULE_ROTATIONABLE_ATTRIBUTES_TYPE_1_HANDOFF_DAY_VALUES: - return cast(ScheduleRotationScheduleRotationableAttributesType1HandoffDay, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SCHEDULE_ROTATION_SCHEDULE_ROTATIONABLE_ATTRIBUTES_TYPE_1_HANDOFF_DAY_VALUES!r}" ) 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 b58fca4b..01e31b7b 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,3 +1,5 @@ +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_handoff_day.py b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_2_handoff_day.py index ed7b79d3..8c8bfb31 100644 --- a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_2_handoff_day.py +++ b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_2_handoff_day.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ScheduleRotationScheduleRotationableAttributesType2HandoffDay = Literal["first_day_of_month", "last_day_of_month"] @@ -16,7 +16,7 @@ def check_schedule_rotation_schedule_rotationable_attributes_type_2_handoff_day( if value is None: return None if value in SCHEDULE_ROTATION_SCHEDULE_ROTATIONABLE_ATTRIBUTES_TYPE_2_HANDOFF_DAY_VALUES: - return cast(ScheduleRotationScheduleRotationableAttributesType2HandoffDay, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SCHEDULE_ROTATION_SCHEDULE_ROTATIONABLE_ATTRIBUTES_TYPE_2_HANDOFF_DAY_VALUES!r}" ) 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 78bf3791..4134c043 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,3 +1,5 @@ +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_shift_length_unit.py b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_3_shift_length_unit.py index 0d81958b..7b1c9e57 100644 --- a/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_3_shift_length_unit.py +++ b/rootly_sdk/models/schedule_rotation_schedule_rotationable_attributes_type_3_shift_length_unit.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ScheduleRotationScheduleRotationableAttributesType3ShiftLengthUnit = Literal["days", "hours", "weeks"] @@ -17,7 +17,7 @@ def check_schedule_rotation_schedule_rotationable_attributes_type_3_shift_length if value is None: return None if value in SCHEDULE_ROTATION_SCHEDULE_ROTATIONABLE_ATTRIBUTES_TYPE_3_SHIFT_LENGTH_UNIT_VALUES: - return cast(ScheduleRotationScheduleRotationableAttributesType3ShiftLengthUnit, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SCHEDULE_ROTATION_SCHEDULE_ROTATIONABLE_ATTRIBUTES_TYPE_3_SHIFT_LENGTH_UNIT_VALUES!r}" ) diff --git a/rootly_sdk/models/schedule_rotation_schedule_rotationable_type.py b/rootly_sdk/models/schedule_rotation_schedule_rotationable_type.py index 78982df6..e50a9829 100644 --- a/rootly_sdk/models/schedule_rotation_schedule_rotationable_type.py +++ b/rootly_sdk/models/schedule_rotation_schedule_rotationable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ScheduleRotationScheduleRotationableType = Literal[ "ScheduleBiweeklyRotation", @@ -23,7 +23,7 @@ def check_schedule_rotation_schedule_rotationable_type( if value is None: return None if value in SCHEDULE_ROTATION_SCHEDULE_ROTATIONABLE_TYPE_VALUES: - return cast(ScheduleRotationScheduleRotationableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SCHEDULE_ROTATION_SCHEDULE_ROTATIONABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/schedule_rotation_user.py b/rootly_sdk/models/schedule_rotation_user.py index eb4942e9..77738f7a 100644 --- a/rootly_sdk/models/schedule_rotation_user.py +++ b/rootly_sdk/models/schedule_rotation_user.py @@ -1,3 +1,5 @@ +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 df975947..f8273e38 100644 --- a/rootly_sdk/models/schedule_rotation_user_list.py +++ b/rootly_sdk/models/schedule_rotation_user_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class ScheduleRotationUserList: """ Attributes: - data (list['ScheduleRotationUserListDataItem']): + data (list[ScheduleRotationUserListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["ScheduleRotationUserListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[ScheduleRotationUserListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 654de35e..0ad5a6bf 100644 --- a/rootly_sdk/models/schedule_rotation_user_list_data_item.py +++ b/rootly_sdk/models/schedule_rotation_user_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/schedule_rotation_user_list_data_item_type.py b/rootly_sdk/models/schedule_rotation_user_list_data_item_type.py index a7fabcc1..ae9d5587 100644 --- a/rootly_sdk/models/schedule_rotation_user_list_data_item_type.py +++ b/rootly_sdk/models/schedule_rotation_user_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ScheduleRotationUserListDataItemType = Literal["schedule_rotation_users"] @@ -11,7 +11,7 @@ def check_schedule_rotation_user_list_data_item_type(value: str | None) -> Sched if value is None: return None if value in SCHEDULE_ROTATION_USER_LIST_DATA_ITEM_TYPE_VALUES: - return cast(ScheduleRotationUserListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SCHEDULE_ROTATION_USER_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/schedule_rotation_user_response.py b/rootly_sdk/models/schedule_rotation_user_response.py index 16d4fcf2..721bbce1 100644 --- a/rootly_sdk/models/schedule_rotation_user_response.py +++ b/rootly_sdk/models/schedule_rotation_user_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class ScheduleRotationUserResponse: """ Attributes: data (ScheduleRotationUserResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "ScheduleRotationUserResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: ScheduleRotationUserResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 f406ddaf..bfb24d1c 100644 --- a/rootly_sdk/models/schedule_rotation_user_response_data.py +++ b/rootly_sdk/models/schedule_rotation_user_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/schedule_rotation_user_response_data_type.py b/rootly_sdk/models/schedule_rotation_user_response_data_type.py index cf368d1b..c6468057 100644 --- a/rootly_sdk/models/schedule_rotation_user_response_data_type.py +++ b/rootly_sdk/models/schedule_rotation_user_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ScheduleRotationUserResponseDataType = Literal["schedule_rotation_users"] @@ -11,5 +11,5 @@ def check_schedule_rotation_user_response_data_type(value: str | None) -> Schedu if value is None: return None if value in SCHEDULE_ROTATION_USER_RESPONSE_DATA_TYPE_VALUES: - return cast(ScheduleRotationUserResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SCHEDULE_ROTATION_USER_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/schedule_shift_report_day_of_week.py b/rootly_sdk/models/schedule_shift_report_day_of_week.py index 5f403843..8e79bc14 100644 --- a/rootly_sdk/models/schedule_shift_report_day_of_week.py +++ b/rootly_sdk/models/schedule_shift_report_day_of_week.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ScheduleShiftReportDayOfWeek = Literal["friday", "monday", "saturday", "sunday", "thursday", "tuesday", "wednesday"] @@ -17,5 +17,5 @@ def check_schedule_shift_report_day_of_week(value: str | None) -> ScheduleShiftR if value is None: return None if value in SCHEDULE_SHIFT_REPORT_DAY_OF_WEEK_VALUES: - return cast(ScheduleShiftReportDayOfWeek, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SCHEDULE_SHIFT_REPORT_DAY_OF_WEEK_VALUES!r}") diff --git a/rootly_sdk/models/schedule_slack_channel_type_0.py b/rootly_sdk/models/schedule_slack_channel_type_0.py index ec9d0e00..eb26f635 100644 --- a/rootly_sdk/models/schedule_slack_channel_type_0.py +++ b/rootly_sdk/models/schedule_slack_channel_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class ScheduleSlackChannelType0: """Synced slack channel of the schedule Attributes: - id (Union[Unset, str]): Slack channel ID - name (Union[Unset, str]): Slack channel name + id (str | Unset): Slack channel ID + name (str | Unset): Slack channel name """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 692964b9..ac2adf75 100644 --- a/rootly_sdk/models/schedule_slack_user_group_type_0.py +++ b/rootly_sdk/models/schedule_slack_user_group_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class ScheduleSlackUserGroupType0: """Synced slack group of the schedule Attributes: - id (Union[Unset, str]): Slack user group ID - name (Union[Unset, str]): Slack user group name + id (str | Unset): Slack user group ID + name (str | Unset): Slack user group name """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 e3fd23f3..b1728358 100644 --- a/rootly_sdk/models/secret.py +++ b/rootly_sdk/models/secret.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,19 +18,23 @@ class Secret: name (str): The name of the secret created_at (str): Date of creation updated_at (str): Date of last update - 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 + 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 + owner_group_ids (list[str] | Unset): IDs of the teams whose members can see and pick this secret; their team + admins can manage it. Empty means only users with the org Secrets permission can. Ignored unless team scoping is + enabled for the organization. """ name: str created_at: str updated_at: str - secret: Unset | str = UNSET - hashicorp_vault_mount: Unset | str = UNSET - hashicorp_vault_path: None | Unset | str = UNSET - hashicorp_vault_version: Unset | int = UNSET + secret: str | Unset = UNSET + hashicorp_vault_mount: str | Unset = UNSET + hashicorp_vault_path: None | str | Unset = UNSET + hashicorp_vault_version: int | Unset = UNSET + owner_group_ids: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: hashicorp_vault_mount = self.hashicorp_vault_mount - hashicorp_vault_path: None | Unset | str + hashicorp_vault_path: None | str | Unset if isinstance(self.hashicorp_vault_path, Unset): hashicorp_vault_path = UNSET else: @@ -50,6 +56,10 @@ def to_dict(self) -> dict[str, Any]: hashicorp_vault_version = self.hashicorp_vault_version + owner_group_ids: list[str] | Unset = UNSET + if not isinstance(self.owner_group_ids, Unset): + owner_group_ids = self.owner_group_ids + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -67,6 +77,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["hashicorp_vault_path"] = hashicorp_vault_path if hashicorp_vault_version is not UNSET: field_dict["hashicorp_vault_version"] = hashicorp_vault_version + if owner_group_ids is not UNSET: + field_dict["owner_group_ids"] = owner_group_ids return field_dict @@ -83,17 +95,19 @@ 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 | Unset | str: + def _parse_hashicorp_vault_path(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) hashicorp_vault_path = _parse_hashicorp_vault_path(d.pop("hashicorp_vault_path", UNSET)) hashicorp_vault_version = d.pop("hashicorp_vault_version", UNSET) + owner_group_ids = cast(list[str], d.pop("owner_group_ids", UNSET)) + secret = cls( name=name, created_at=created_at, @@ -102,6 +116,7 @@ def _parse_hashicorp_vault_path(data: object) -> None | Unset | str: hashicorp_vault_mount=hashicorp_vault_mount, hashicorp_vault_path=hashicorp_vault_path, hashicorp_vault_version=hashicorp_vault_version, + owner_group_ids=owner_group_ids, ) secret.additional_properties = d diff --git a/rootly_sdk/models/secret_list.py b/rootly_sdk/models/secret_list.py index f08a58b1..3dd6f324 100644 --- a/rootly_sdk/models/secret_list.py +++ b/rootly_sdk/models/secret_list.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,14 +21,14 @@ class SecretList: """ Attributes: - data (list['SecretListDataItem']): - links (Union[Unset, Links]): - meta (Union[Unset, Meta]): + data (list[SecretListDataItem]): + links (Links | Unset): + meta (Meta | Unset): """ - data: list["SecretListDataItem"] - links: Union[Unset, "Links"] = UNSET - meta: Union[Unset, "Meta"] = UNSET + data: list[SecretListDataItem] + links: Links | Unset = UNSET + meta: Meta | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -35,11 +37,11 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Unset | dict[str, Any] = UNSET + links: dict[str, Any] | Unset = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Unset | dict[str, Any] = UNSET + meta: dict[str, Any] | Unset = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() @@ -72,14 +74,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Unset | Links + links: Links | Unset if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Unset | Meta + meta: Meta | Unset 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 87fbca70..77572c28 100644 --- a/rootly_sdk/models/secret_list_data_item.py +++ b/rootly_sdk/models/secret_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/secret_list_data_item_type.py b/rootly_sdk/models/secret_list_data_item_type.py index 835b678f..33fd38b7 100644 --- a/rootly_sdk/models/secret_list_data_item_type.py +++ b/rootly_sdk/models/secret_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SecretListDataItemType = Literal["secrets"] @@ -11,5 +11,5 @@ def check_secret_list_data_item_type(value: str | None) -> SecretListDataItemTyp if value is None: return None if value in SECRET_LIST_DATA_ITEM_TYPE_VALUES: - return cast(SecretListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SECRET_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/secret_response.py b/rootly_sdk/models/secret_response.py index d6359e52..19eff24a 100644 --- a/rootly_sdk/models/secret_response.py +++ b/rootly_sdk/models/secret_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,7 +20,7 @@ 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]: diff --git a/rootly_sdk/models/secret_response_data.py b/rootly_sdk/models/secret_response_data.py index 2c776f8e..a0383993 100644 --- a/rootly_sdk/models/secret_response_data.py +++ b/rootly_sdk/models/secret_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/secret_response_data_type.py b/rootly_sdk/models/secret_response_data_type.py index 622c01a7..019dd1da 100644 --- a/rootly_sdk/models/secret_response_data_type.py +++ b/rootly_sdk/models/secret_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SecretResponseDataType = Literal["secrets"] @@ -11,5 +11,5 @@ def check_secret_response_data_type(value: str | None) -> SecretResponseDataType if value is None: return None if value in SECRET_RESPONSE_DATA_TYPE_VALUES: - return cast(SecretResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SECRET_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/send_dashboard_report_task_params.py b/rootly_sdk/models/send_dashboard_report_task_params.py index 66a38904..ee77ed07 100644 --- a/rootly_sdk/models/send_dashboard_report_task_params.py +++ b/rootly_sdk/models/send_dashboard_report_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,20 +22,20 @@ class SendDashboardReportTaskParams: dashboard_ids (list[str]): to (list[str]): subject (str): The subject - 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 + 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 """ dashboard_ids: list[str] to: list[str] subject: str body: None | str - task_type: Unset | SendDashboardReportTaskParamsTaskType = UNSET - from_: Unset | str = "Rootly " - preheader: None | Unset | str = UNSET + task_type: SendDashboardReportTaskParamsTaskType | Unset = UNSET + from_: str | Unset = "Rootly " + preheader: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,13 +48,13 @@ def to_dict(self) -> dict[str, Any]: body: None | str body = self.body - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type from_ = self.from_ - preheader: None | Unset | str + preheader: None | str | Unset if isinstance(self.preheader, Unset): preheader = UNSET else: @@ -94,7 +96,7 @@ def _parse_body(data: object) -> None | str: body = _parse_body(d.pop("body")) _task_type = d.pop("task_type", UNSET) - task_type: Unset | SendDashboardReportTaskParamsTaskType + task_type: SendDashboardReportTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -102,12 +104,12 @@ def _parse_body(data: object) -> None | str: from_ = d.pop("from", UNSET) - def _parse_preheader(data: object) -> None | Unset | str: + def _parse_preheader(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) preheader = _parse_preheader(d.pop("preheader", UNSET)) diff --git a/rootly_sdk/models/send_dashboard_report_task_params_task_type.py b/rootly_sdk/models/send_dashboard_report_task_params_task_type.py index 3d433a7a..1040bc89 100644 --- a/rootly_sdk/models/send_dashboard_report_task_params_task_type.py +++ b/rootly_sdk/models/send_dashboard_report_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SendDashboardReportTaskParamsTaskType = Literal["send_dashboard_report"] @@ -13,7 +13,7 @@ def check_send_dashboard_report_task_params_task_type( if value is None: return None if value in SEND_DASHBOARD_REPORT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(SendDashboardReportTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SEND_DASHBOARD_REPORT_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/send_email_task_params.py b/rootly_sdk/models/send_email_task_params.py index 4f63f560..6e1d8cfc 100644 --- a/rootly_sdk/models/send_email_task_params.py +++ b/rootly_sdk/models/send_email_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,29 +21,29 @@ class SendEmailTaskParams: Attributes: to (list[str]): subject (str): The subject - 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 + 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 """ to: list[str] subject: str body: None | str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -52,21 +54,21 @@ def to_dict(self) -> dict[str, Any]: body: None | str body = self.body - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type from_ = self.from_ - cc: Unset | list[str] = UNSET + cc: list[str] | Unset = UNSET if not isinstance(self.cc, Unset): cc = self.cc - bcc: Unset | list[str] = UNSET + bcc: list[str] | Unset = UNSET if not isinstance(self.bcc, Unset): bcc = self.bcc - preheader: None | Unset | str + preheader: None | str | Unset if isinstance(self.preheader, Unset): preheader = UNSET else: @@ -76,7 +78,7 @@ def to_dict(self) -> dict[str, Any]: include_footer = self.include_footer - custom_logo_url: None | Unset | str + custom_logo_url: None | str | Unset if isinstance(self.custom_logo_url, Unset): custom_logo_url = UNSET else: @@ -125,7 +127,7 @@ def _parse_body(data: object) -> None | str: body = _parse_body(d.pop("body")) _task_type = d.pop("task_type", UNSET) - task_type: Unset | SendEmailTaskParamsTaskType + task_type: SendEmailTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -137,12 +139,12 @@ def _parse_body(data: object) -> None | str: bcc = cast(list[str], d.pop("bcc", UNSET)) - def _parse_preheader(data: object) -> None | Unset | str: + def _parse_preheader(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) preheader = _parse_preheader(d.pop("preheader", UNSET)) @@ -150,12 +152,12 @@ def _parse_preheader(data: object) -> None | Unset | str: include_footer = d.pop("include_footer", UNSET) - def _parse_custom_logo_url(data: object) -> None | Unset | str: + def _parse_custom_logo_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) custom_logo_url = _parse_custom_logo_url(d.pop("custom_logo_url", UNSET)) diff --git a/rootly_sdk/models/send_email_task_params_task_type.py b/rootly_sdk/models/send_email_task_params_task_type.py index efb6db64..d7e37bf8 100644 --- a/rootly_sdk/models/send_email_task_params_task_type.py +++ b/rootly_sdk/models/send_email_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SendEmailTaskParamsTaskType = Literal["send_email"] @@ -11,5 +11,5 @@ def check_send_email_task_params_task_type(value: str | None) -> SendEmailTaskPa if value is None: return None if value in SEND_EMAIL_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(SendEmailTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SEND_EMAIL_TASK_PARAMS_TASK_TYPE_VALUES!r}") 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 9b409f79..7c92a7dc 100644 --- a/rootly_sdk/models/send_google_chat_attachments_task_params.py +++ b/rootly_sdk/models/send_google_chat_attachments_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,14 +25,14 @@ class SendGoogleChatAttachmentsTaskParams: """ Attributes: - spaces (list['SendGoogleChatAttachmentsTaskParamsSpacesItem']): + spaces (list[SendGoogleChatAttachmentsTaskParamsSpacesItem]): attachments (str): - task_type (Union[Unset, SendGoogleChatAttachmentsTaskParamsTaskType]): + task_type (SendGoogleChatAttachmentsTaskParamsTaskType | Unset): """ - spaces: list["SendGoogleChatAttachmentsTaskParamsSpacesItem"] + spaces: list[SendGoogleChatAttachmentsTaskParamsSpacesItem] attachments: str - task_type: Unset | SendGoogleChatAttachmentsTaskParamsTaskType = UNSET + task_type: SendGoogleChatAttachmentsTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,7 +43,7 @@ def to_dict(self) -> dict[str, Any]: attachments = self.attachments - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -75,7 +77,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: Unset | SendGoogleChatAttachmentsTaskParamsTaskType + task_type: SendGoogleChatAttachmentsTaskParamsTaskType | Unset 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 325dca5e..0b80e5f7 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class SendGoogleChatAttachmentsTaskParamsSpacesItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_attachments_task_params_task_type.py b/rootly_sdk/models/send_google_chat_attachments_task_params_task_type.py index 17b37e81..625c1e19 100644 --- a/rootly_sdk/models/send_google_chat_attachments_task_params_task_type.py +++ b/rootly_sdk/models/send_google_chat_attachments_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SendGoogleChatAttachmentsTaskParamsTaskType = Literal["send_google_chat_attachments"] @@ -13,7 +13,7 @@ def check_send_google_chat_attachments_task_params_task_type( if value is None: return None if value in SEND_GOOGLE_CHAT_ATTACHMENTS_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(SendGoogleChatAttachmentsTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SEND_GOOGLE_CHAT_ATTACHMENTS_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 800495c3..89889d83 100644 --- a/rootly_sdk/models/send_google_chat_message_task_params.py +++ b/rootly_sdk/models/send_google_chat_message_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -21,17 +23,17 @@ class SendGoogleChatMessageTaskParams: """ Attributes: - spaces (list['SendGoogleChatMessageTaskParamsSpacesItem']): + spaces (list[SendGoogleChatMessageTaskParamsSpacesItem]): text (str): - 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 + task_type (SendGoogleChatMessageTaskParamsTaskType | Unset): + thread_key (None | str | Unset): 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: Unset | SendGoogleChatMessageTaskParamsTaskType = UNSET - thread_key: None | Unset | str = UNSET + task_type: SendGoogleChatMessageTaskParamsTaskType | Unset = UNSET + thread_key: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,11 +44,11 @@ def to_dict(self) -> dict[str, Any]: text = self.text - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - thread_key: None | Unset | str + thread_key: None | str | Unset if isinstance(self.thread_key, Unset): thread_key = UNSET else: @@ -82,18 +84,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: Unset | SendGoogleChatMessageTaskParamsTaskType + task_type: SendGoogleChatMessageTaskParamsTaskType | Unset 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 | Unset | str: + def _parse_thread_key(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 2d271390..71a9a418 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class SendGoogleChatMessageTaskParamsSpacesItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/send_google_chat_message_task_params_task_type.py index c32fa899..d9c1e94c 100644 --- a/rootly_sdk/models/send_google_chat_message_task_params_task_type.py +++ b/rootly_sdk/models/send_google_chat_message_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SendGoogleChatMessageTaskParamsTaskType = Literal["send_google_chat_message"] @@ -13,7 +13,7 @@ def check_send_google_chat_message_task_params_task_type( if value is None: return None if value in SEND_GOOGLE_CHAT_MESSAGE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(SendGoogleChatMessageTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SEND_GOOGLE_CHAT_MESSAGE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 d0df8bde..6aa1da64 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class SendMicrosoftTeamsBlocksTaskParamsType0ChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 a0c00b13..4e82900e 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,14 +25,14 @@ class SendMicrosoftTeamsChatMessageTaskParams: """ Attributes: - chats (list['SendMicrosoftTeamsChatMessageTaskParamsChatsItem']): + chats (list[SendMicrosoftTeamsChatMessageTaskParamsChatsItem]): text (str): The message text - task_type (Union[Unset, SendMicrosoftTeamsChatMessageTaskParamsTaskType]): + task_type (SendMicrosoftTeamsChatMessageTaskParamsTaskType | Unset): """ - chats: list["SendMicrosoftTeamsChatMessageTaskParamsChatsItem"] + chats: list[SendMicrosoftTeamsChatMessageTaskParamsChatsItem] text: str - task_type: Unset | SendMicrosoftTeamsChatMessageTaskParamsTaskType = UNSET + task_type: SendMicrosoftTeamsChatMessageTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -41,7 +43,7 @@ def to_dict(self) -> dict[str, Any]: text = self.text - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -75,7 +77,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: Unset | SendMicrosoftTeamsChatMessageTaskParamsTaskType + task_type: SendMicrosoftTeamsChatMessageTaskParamsTaskType | Unset 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 79ad0464..b5eb86bf 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class SendMicrosoftTeamsChatMessageTaskParamsChatsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/send_microsoft_teams_chat_message_task_params_task_type.py index 876d3bd9..00b50e79 100644 --- a/rootly_sdk/models/send_microsoft_teams_chat_message_task_params_task_type.py +++ b/rootly_sdk/models/send_microsoft_teams_chat_message_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SendMicrosoftTeamsChatMessageTaskParamsTaskType = Literal["send_microsoft_teams_chat_message"] @@ -13,7 +13,7 @@ def check_send_microsoft_teams_chat_message_task_params_task_type( if value is None: return None if value in SEND_MICROSOFT_TEAMS_CHAT_MESSAGE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(SendMicrosoftTeamsChatMessageTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SEND_MICROSOFT_TEAMS_CHAT_MESSAGE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 4d1cc584..62d56aa3 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class SendMicrosoftTeamsMessageTaskParamsType0ChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 9ac42fea..1d13245f 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class SendSlackBlocksTaskParamsType0ChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 c5f42e8d..fb401ba9 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class SendSlackBlocksTaskParamsType1SlackUsersItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 15cbd40a..54a82d43 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class SendSlackBlocksTaskParamsType2SlackUserGroupsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 ed01664b..07a0fed2 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class SendSlackMessageTaskParamsType0ChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 59d8c659..7aa7cd68 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class SendSlackMessageTaskParamsType1SlackUsersItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 642e8eb2..8a055aa3 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class SendSlackMessageTaskParamsType2SlackUserGroupsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 a7013664..188935ea 100644 --- a/rootly_sdk/models/send_sms_task_params.py +++ b/rootly_sdk/models/send_sms_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,13 +19,13 @@ class SendSmsTaskParams: phone_numbers (list[str]): name (str): The name content (str): The SMS message - task_type (Union[Unset, SendSmsTaskParamsTaskType]): + task_type (SendSmsTaskParamsTaskType | Unset): """ phone_numbers: list[str] name: str content: str - task_type: Unset | SendSmsTaskParamsTaskType = UNSET + task_type: SendSmsTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -33,7 +35,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -61,7 +63,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: Unset | SendSmsTaskParamsTaskType + task_type: SendSmsTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/send_sms_task_params_task_type.py b/rootly_sdk/models/send_sms_task_params_task_type.py index dcdc98f9..3ea7647d 100644 --- a/rootly_sdk/models/send_sms_task_params_task_type.py +++ b/rootly_sdk/models/send_sms_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SendSmsTaskParamsTaskType = Literal["send_sms"] @@ -11,5 +11,5 @@ def check_send_sms_task_params_task_type(value: str | None) -> SendSmsTaskParams if value is None: return None if value in SEND_SMS_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(SendSmsTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SEND_SMS_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/send_whatsapp_message_task_params.py b/rootly_sdk/models/send_whatsapp_message_task_params.py index afc93d42..ba3492e7 100644 --- a/rootly_sdk/models/send_whatsapp_message_task_params.py +++ b/rootly_sdk/models/send_whatsapp_message_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,13 +22,13 @@ class SendWhatsappMessageTaskParams: phone_numbers (list[str]): name (str): The name content (str): The WhatsApp message - task_type (Union[Unset, SendWhatsappMessageTaskParamsTaskType]): + task_type (SendWhatsappMessageTaskParamsTaskType | Unset): """ phone_numbers: list[str] name: str content: str - task_type: Unset | SendWhatsappMessageTaskParamsTaskType = UNSET + task_type: SendWhatsappMessageTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,7 +38,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -64,7 +66,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: Unset | SendWhatsappMessageTaskParamsTaskType + task_type: SendWhatsappMessageTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/send_whatsapp_message_task_params_task_type.py b/rootly_sdk/models/send_whatsapp_message_task_params_task_type.py index e0aae6ee..df407c84 100644 --- a/rootly_sdk/models/send_whatsapp_message_task_params_task_type.py +++ b/rootly_sdk/models/send_whatsapp_message_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SendWhatsappMessageTaskParamsTaskType = Literal["send_whatsapp_message"] @@ -13,7 +13,7 @@ def check_send_whatsapp_message_task_params_task_type( if value is None: return None if value in SEND_WHATSAPP_MESSAGE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(SendWhatsappMessageTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SEND_WHATSAPP_MESSAGE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/service.py b/rootly_sdk/models/service.py index 9dbc0f56..7012cdec 100644 --- a/rootly_sdk/models/service.py +++ b/rootly_sdk/models/service.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,88 +27,83 @@ class Service: name (str): The name of the service created_at (str): Date of creation updated_at (str): Date of last update - 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: + 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 status page 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: :namespace/:kind/:entity_name - 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: + 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: rootlyhq/my-service - 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: + 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: rootlyhq/my-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. + 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. """ name: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -121,23 +118,23 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - managed_by: Unset | str = UNSET + managed_by: str | Unset = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -146,85 +143,85 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | Unset | str + backstage_id: None | str | Unset if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | Unset | str + pagerduty_id: None | str | Unset if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | Unset | str + opsgenie_id: None | str | Unset if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - cortex_id: None | Unset | str + cortex_id: None | str | Unset if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | Unset | str + service_now_ci_sys_id: None | str | Unset 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 | Unset | str + github_repository_name: None | str | Unset if isinstance(self.github_repository_name, Unset): github_repository_name = UNSET else: github_repository_name = self.github_repository_name - github_repository_branch: None | Unset | str + github_repository_branch: None | str | Unset if isinstance(self.github_repository_branch, Unset): github_repository_branch = UNSET else: github_repository_branch = self.github_repository_branch - gitlab_repository_name: None | Unset | str + gitlab_repository_name: None | str | Unset if isinstance(self.gitlab_repository_name, Unset): gitlab_repository_name = UNSET else: gitlab_repository_name = self.gitlab_repository_name - gitlab_repository_branch: None | Unset | str + gitlab_repository_branch: None | str | Unset if isinstance(self.gitlab_repository_branch, Unset): gitlab_repository_branch = UNSET else: gitlab_repository_branch = self.gitlab_repository_branch - kubernetes_deployment_name: None | Unset | str + kubernetes_deployment_name: None | str | Unset if isinstance(self.kubernetes_deployment_name, Unset): kubernetes_deployment_name = UNSET else: kubernetes_deployment_name = self.kubernetes_deployment_name - environment_ids: None | Unset | list[str] + environment_ids: list[str] | None | Unset if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -233,7 +230,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -242,7 +239,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: None | Unset | list[str] + owner_group_ids: list[str] | None | Unset if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -251,7 +248,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: None | Unset | list[int] + owner_user_ids: list[int] | None | Unset if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -260,31 +257,31 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - alert_urgency_id: None | Unset | str + alert_urgency_id: None | str | Unset if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - escalation_policy_id: None | Unset | str + escalation_policy_id: None | str | Unset if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - alerts_email_enabled: None | Unset | bool + alerts_email_enabled: bool | None | Unset if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alerts_email_address: None | Unset | str + alerts_email_address: None | str | Unset if isinstance(self.alerts_email_address, Unset): alerts_email_address = UNSET else: alerts_email_address = self.alerts_email_address - slack_channels: None | Unset | list[dict[str, Any]] + slack_channels: list[dict[str, Any]] | None | Unset if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -296,7 +293,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: None | Unset | list[dict[str, Any]] + slack_aliases: list[dict[str, Any]] | None | Unset if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -308,13 +305,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: None | Unset | bool + alert_broadcast_enabled: bool | None | Unset if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: None | Unset | dict[str, Any] + alert_broadcast_channel: dict[str, Any] | None | Unset if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, ServiceAlertBroadcastChannelType0): @@ -322,13 +319,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: None | Unset | bool + incident_broadcast_enabled: bool | None | Unset if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: None | Unset | dict[str, Any] + incident_broadcast_channel: dict[str, Any] | None | Unset if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, ServiceIncidentBroadcastChannelType0): @@ -336,7 +333,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - properties: None | Unset | list[dict[str, Any]] + properties: list[dict[str, Any]] | None | Unset if isinstance(self.properties, Unset): properties = UNSET elif isinstance(self.properties, list): @@ -444,31 +441,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: Unset | ServiceManagedBy + managed_by: ServiceManagedBy | Unset if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_service_managed_by(_managed_by) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -479,130 +476,130 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | Unset | str: + def _parse_backstage_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | Unset | str: + def _parse_pagerduty_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | Unset | str: + def _parse_opsgenie_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_cortex_id(data: object) -> None | Unset | str: + def _parse_cortex_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: + def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_github_repository_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) github_repository_name = _parse_github_repository_name(d.pop("github_repository_name", UNSET)) - def _parse_github_repository_branch(data: object) -> None | Unset | str: + def _parse_github_repository_branch(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) github_repository_branch = _parse_github_repository_branch(d.pop("github_repository_branch", UNSET)) - def _parse_gitlab_repository_name(data: object) -> None | Unset | str: + def _parse_gitlab_repository_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) gitlab_repository_name = _parse_gitlab_repository_name(d.pop("gitlab_repository_name", UNSET)) - def _parse_gitlab_repository_branch(data: object) -> None | Unset | str: + def _parse_gitlab_repository_branch(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) gitlab_repository_branch = _parse_gitlab_repository_branch(d.pop("gitlab_repository_branch", UNSET)) - def _parse_kubernetes_deployment_name(data: object) -> None | Unset | str: + def _parse_kubernetes_deployment_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) kubernetes_deployment_name = _parse_kubernetes_deployment_name(d.pop("kubernetes_deployment_name", UNSET)) - def _parse_environment_ids(data: object) -> None | Unset | list[str]: + def _parse_environment_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -613,13 +610,13 @@ def _parse_environment_ids(data: object) -> None | Unset | list[str]: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -630,13 +627,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: + def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -647,13 +644,13 @@ def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: owner_group_ids_type_0 = cast(list[str], data) return owner_group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: + def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -664,49 +661,49 @@ def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: owner_user_ids_type_0 = cast(list[int], data) return owner_user_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[int], data) + return cast(list[int] | None | Unset, data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | Unset | str: + def _parse_alert_urgency_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_escalation_policy_id(data: object) -> None | Unset | str: + def _parse_escalation_policy_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) - def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: + def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alerts_email_address(data: object) -> None | Unset | str: + def _parse_alerts_email_address(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) alerts_email_address = _parse_alerts_email_address(d.pop("alerts_email_address", UNSET)) - def _parse_slack_channels(data: object) -> None | Unset | list["ServiceSlackChannelsType0Item"]: + def _parse_slack_channels(data: object) -> list[ServiceSlackChannelsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -724,13 +721,13 @@ def _parse_slack_channels(data: object) -> None | Unset | list["ServiceSlackChan slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["ServiceSlackChannelsType0Item"], data) + return cast(list[ServiceSlackChannelsType0Item] | None | Unset, data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> None | Unset | list["ServiceSlackAliasesType0Item"]: + def _parse_slack_aliases(data: object) -> list[ServiceSlackAliasesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -746,22 +743,22 @@ def _parse_slack_aliases(data: object) -> None | Unset | list["ServiceSlackAlias slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["ServiceSlackAliasesType0Item"], data) + return cast(list[ServiceSlackAliasesType0Item] | None | Unset, data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> None | Unset | bool: + def _parse_alert_broadcast_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) - def _parse_alert_broadcast_channel(data: object) -> Union["ServiceAlertBroadcastChannelType0", None, Unset]: + def _parse_alert_broadcast_channel(data: object) -> None | ServiceAlertBroadcastChannelType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -772,24 +769,22 @@ def _parse_alert_broadcast_channel(data: object) -> Union["ServiceAlertBroadcast alert_broadcast_channel_type_0 = ServiceAlertBroadcastChannelType0.from_dict(data) return alert_broadcast_channel_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["ServiceAlertBroadcastChannelType0", None, Unset], data) + return cast(None | ServiceAlertBroadcastChannelType0 | Unset, data) alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> None | Unset | bool: + def _parse_incident_broadcast_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) - def _parse_incident_broadcast_channel( - data: object, - ) -> Union["ServiceIncidentBroadcastChannelType0", None, Unset]: + def _parse_incident_broadcast_channel(data: object) -> None | ServiceIncidentBroadcastChannelType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -800,13 +795,13 @@ def _parse_incident_broadcast_channel( incident_broadcast_channel_type_0 = ServiceIncidentBroadcastChannelType0.from_dict(data) return incident_broadcast_channel_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["ServiceIncidentBroadcastChannelType0", None, Unset], data) + return cast(None | ServiceIncidentBroadcastChannelType0 | Unset, data) incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) - def _parse_properties(data: object) -> None | Unset | list["ServicePropertiesType0Item"]: + def _parse_properties(data: object) -> list[ServicePropertiesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -822,9 +817,9 @@ def _parse_properties(data: object) -> None | Unset | list["ServicePropertiesTyp properties_type_0.append(properties_type_0_item) return properties_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["ServicePropertiesType0Item"], data) + return cast(list[ServicePropertiesType0Item] | None | Unset, 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 c8429803..352191db 100644 --- a/rootly_sdk/models/service_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/service_alert_broadcast_channel_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class ServiceAlertBroadcastChannelType0: """Slack channel to broadcast alerts to Attributes: - id (Union[Unset, str]): Slack channel ID - name (Union[Unset, str]): Slack channel name + id (str | Unset): Slack channel ID + name (str | Unset): Slack channel name """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 801815e9..d5173bde 100644 --- a/rootly_sdk/models/service_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/service_incident_broadcast_channel_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class ServiceIncidentBroadcastChannelType0: """Slack channel to broadcast incidents to Attributes: - id (Union[Unset, str]): Slack channel ID - name (Union[Unset, str]): Slack channel name + id (str | Unset): Slack channel ID + name (str | Unset): Slack channel name """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 5cde24ed..33df45ca 100644 --- a/rootly_sdk/models/service_list.py +++ b/rootly_sdk/models/service_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class ServiceList: """ Attributes: - data (list['ServiceListDataItem']): + data (list[ServiceListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["ServiceListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[ServiceListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 07946659..809cde14 100644 --- a/rootly_sdk/models/service_list_data_item.py +++ b/rootly_sdk/models/service_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/service_list_data_item_type.py b/rootly_sdk/models/service_list_data_item_type.py index 90a8737b..bfd98c55 100644 --- a/rootly_sdk/models/service_list_data_item_type.py +++ b/rootly_sdk/models/service_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ServiceListDataItemType = Literal["services"] @@ -11,5 +11,5 @@ def check_service_list_data_item_type(value: str | None) -> ServiceListDataItemT if value is None: return None if value in SERVICE_LIST_DATA_ITEM_TYPE_VALUES: - return cast(ServiceListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SERVICE_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/service_managed_by.py b/rootly_sdk/models/service_managed_by.py index b66a3a05..d439a42f 100644 --- a/rootly_sdk/models/service_managed_by.py +++ b/rootly_sdk/models/service_managed_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ServiceManagedBy = Literal["admin_web", "api", "backstage", "catalog_sync", "pulumi", "terraform", "web"] @@ -17,5 +17,5 @@ def check_service_managed_by(value: str | None) -> ServiceManagedBy | None: if value is None: return None if value in SERVICE_MANAGED_BY_VALUES: - return cast(ServiceManagedBy, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SERVICE_MANAGED_BY_VALUES!r}") diff --git a/rootly_sdk/models/service_properties_type_0_item.py b/rootly_sdk/models/service_properties_type_0_item.py index c674b2b6..ca3eadbd 100644 --- a/rootly_sdk/models/service_properties_type_0_item.py +++ b/rootly_sdk/models/service_properties_type_0_item.py @@ -1,3 +1,5 @@ +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 645fe2d2..ddc329bc 100644 --- a/rootly_sdk/models/service_response.py +++ b/rootly_sdk/models/service_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class ServiceResponse: """ Attributes: data (ServiceResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "ServiceResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: ServiceResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 a94a16d4..3ee17f08 100644 --- a/rootly_sdk/models/service_response_data.py +++ b/rootly_sdk/models/service_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/service_response_data_type.py b/rootly_sdk/models/service_response_data_type.py index 00d051c6..6151c241 100644 --- a/rootly_sdk/models/service_response_data_type.py +++ b/rootly_sdk/models/service_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ServiceResponseDataType = Literal["services"] @@ -11,5 +11,5 @@ def check_service_response_data_type(value: str | None) -> ServiceResponseDataTy if value is None: return None if value in SERVICE_RESPONSE_DATA_TYPE_VALUES: - return cast(ServiceResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SERVICE_RESPONSE_DATA_TYPE_VALUES!r}") 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 e4b5ebfb..9349bda9 100644 --- a/rootly_sdk/models/service_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/service_slack_aliases_type_0_item.py @@ -1,3 +1,5 @@ +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 0a61b094..a86a7471 100644 --- a/rootly_sdk/models/service_slack_channels_type_0_item.py +++ b/rootly_sdk/models/service_slack_channels_type_0_item.py @@ -1,3 +1,5 @@ +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 91ec5e93..a3bee45c 100644 --- a/rootly_sdk/models/severity.py +++ b/rootly_sdk/models/severity.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -22,29 +24,28 @@ class Severity: name (str): The name of the severity created_at (str): Date of creation updated_at (str): Date of last update - 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 + 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 severity + slack_aliases (list[SeveritySlackAliasesType0Item] | None | Unset): Slack Aliases associated with this severity """ name: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -56,29 +57,29 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - severity: Unset | str = UNSET + severity: str | Unset = UNSET if not isinstance(self.severity, Unset): severity = self.severity - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -87,7 +88,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: None | Unset | list[dict[str, Any]] + slack_channels: list[dict[str, Any]] | None | Unset if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -99,7 +100,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: None | Unset | list[dict[str, Any]] + slack_aliases: list[dict[str, Any]] | None | Unset if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -153,41 +154,41 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) _severity = d.pop("severity", UNSET) - severity: Unset | SeveritySeverity + severity: SeveritySeverity | Unset if isinstance(_severity, Unset): severity = UNSET else: severity = check_severity_severity(_severity) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -198,13 +199,13 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_slack_channels(data: object) -> None | Unset | list["SeveritySlackChannelsType0Item"]: + def _parse_slack_channels(data: object) -> list[SeveritySlackChannelsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -222,13 +223,13 @@ def _parse_slack_channels(data: object) -> None | Unset | list["SeveritySlackCha slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["SeveritySlackChannelsType0Item"], data) + return cast(list[SeveritySlackChannelsType0Item] | None | Unset, data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> None | Unset | list["SeveritySlackAliasesType0Item"]: + def _parse_slack_aliases(data: object) -> list[SeveritySlackAliasesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -244,9 +245,9 @@ def _parse_slack_aliases(data: object) -> None | Unset | list["SeveritySlackAlia slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["SeveritySlackAliasesType0Item"], data) + return cast(list[SeveritySlackAliasesType0Item] | None | Unset, 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 efdf692d..f2f773d4 100644 --- a/rootly_sdk/models/severity_list.py +++ b/rootly_sdk/models/severity_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class SeverityList: """ Attributes: - data (list['SeverityListDataItem']): + data (list[SeverityListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["SeverityListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[SeverityListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 75581779..70b771d4 100644 --- a/rootly_sdk/models/severity_list_data_item.py +++ b/rootly_sdk/models/severity_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/severity_list_data_item_type.py b/rootly_sdk/models/severity_list_data_item_type.py index e793a126..d1931fb4 100644 --- a/rootly_sdk/models/severity_list_data_item_type.py +++ b/rootly_sdk/models/severity_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SeverityListDataItemType = Literal["severities"] @@ -11,5 +11,5 @@ def check_severity_list_data_item_type(value: str | None) -> SeverityListDataIte if value is None: return None if value in SEVERITY_LIST_DATA_ITEM_TYPE_VALUES: - return cast(SeverityListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SEVERITY_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/severity_response.py b/rootly_sdk/models/severity_response.py index 9c282bba..4dfffffe 100644 --- a/rootly_sdk/models/severity_response.py +++ b/rootly_sdk/models/severity_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class SeverityResponse: """ Attributes: data (SeverityResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "SeverityResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: SeverityResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 45ad1467..0e33a4b6 100644 --- a/rootly_sdk/models/severity_response_data.py +++ b/rootly_sdk/models/severity_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/severity_response_data_type.py b/rootly_sdk/models/severity_response_data_type.py index 391eeb51..6b9d9f7c 100644 --- a/rootly_sdk/models/severity_response_data_type.py +++ b/rootly_sdk/models/severity_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SeverityResponseDataType = Literal["severities"] @@ -11,5 +11,5 @@ def check_severity_response_data_type(value: str | None) -> SeverityResponseData if value is None: return None if value in SEVERITY_RESPONSE_DATA_TYPE_VALUES: - return cast(SeverityResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SEVERITY_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/severity_severity.py b/rootly_sdk/models/severity_severity.py index dc01c079..e413ad8a 100644 --- a/rootly_sdk/models/severity_severity.py +++ b/rootly_sdk/models/severity_severity.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SeveritySeverity = Literal["critical", "high", "low", "medium"] @@ -14,5 +14,5 @@ def check_severity_severity(value: str | None) -> SeveritySeverity | None: if value is None: return None if value in SEVERITY_SEVERITY_VALUES: - return cast(SeveritySeverity, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SEVERITY_SEVERITY_VALUES!r}") 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 62f76e97..d7ac6e2f 100644 --- a/rootly_sdk/models/severity_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/severity_slack_aliases_type_0_item.py @@ -1,3 +1,5 @@ +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 38119176..6412d29a 100644 --- a/rootly_sdk/models/severity_slack_channels_type_0_item.py +++ b/rootly_sdk/models/severity_slack_channels_type_0_item.py @@ -1,3 +1,5 @@ +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 bc776d7d..7823454c 100644 --- a/rootly_sdk/models/shift.py +++ b/rootly_sdk/models/shift.py @@ -1,11 +1,17 @@ +from __future__ import annotations + 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 attrs import field as _attrs_field from ..types import UNSET, Unset +if TYPE_CHECKING: + from ..models.overridden_shift import OverriddenShift + + T = TypeVar("T", bound="Shift") @@ -14,12 +20,15 @@ class Shift: """ Attributes: schedule_id (str): ID of schedule - rotation_id (Union[None, str]): ID of rotation + rotation_id (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 (Union[None, Unset, int]): ID of user on shift + user_id (int | None | Unset): ID of user on shift + overridden_shifts (list[OverriddenShift] | None | Unset): For override shifts, the portions of the regular + shifts this override replaces, clipped to the override window. Null for non-override shifts. Available when + overridden shifts are enabled for the organization. """ schedule_id: str @@ -28,7 +37,8 @@ class Shift: ends_at: str is_override: bool is_shadow: bool - user_id: None | Unset | int = UNSET + user_id: int | None | Unset = UNSET + overridden_shifts: list[OverriddenShift] | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -45,12 +55,24 @@ def to_dict(self) -> dict[str, Any]: is_shadow = self.is_shadow - user_id: None | Unset | int + user_id: int | None | Unset if isinstance(self.user_id, Unset): user_id = UNSET else: user_id = self.user_id + overridden_shifts: list[dict[str, Any]] | None | Unset + if isinstance(self.overridden_shifts, Unset): + overridden_shifts = UNSET + elif isinstance(self.overridden_shifts, list): + overridden_shifts = [] + for overridden_shifts_type_0_item_data in self.overridden_shifts: + overridden_shifts_type_0_item = overridden_shifts_type_0_item_data.to_dict() + overridden_shifts.append(overridden_shifts_type_0_item) + + else: + overridden_shifts = self.overridden_shifts + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -65,11 +87,15 @@ def to_dict(self) -> dict[str, Any]: ) if user_id is not UNSET: field_dict["user_id"] = user_id + if overridden_shifts is not UNSET: + field_dict["overridden_shifts"] = overridden_shifts return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.overridden_shift import OverriddenShift + d = dict(src_dict) schedule_id = d.pop("schedule_id") @@ -88,15 +114,37 @@ def _parse_rotation_id(data: object) -> None | str: is_shadow = d.pop("is_shadow") - def _parse_user_id(data: object) -> None | Unset | int: + def _parse_user_id(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) user_id = _parse_user_id(d.pop("user_id", UNSET)) + def _parse_overridden_shifts(data: object) -> list[OverriddenShift] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + overridden_shifts_type_0 = [] + _overridden_shifts_type_0 = data + for overridden_shifts_type_0_item_data in _overridden_shifts_type_0: + overridden_shifts_type_0_item = OverriddenShift.from_dict(overridden_shifts_type_0_item_data) + + overridden_shifts_type_0.append(overridden_shifts_type_0_item) + + return overridden_shifts_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[OverriddenShift] | None | Unset, data) + + overridden_shifts = _parse_overridden_shifts(d.pop("overridden_shifts", UNSET)) + shift = cls( schedule_id=schedule_id, rotation_id=rotation_id, @@ -105,6 +153,7 @@ def _parse_user_id(data: object) -> None | Unset | int: is_override=is_override, is_shadow=is_shadow, user_id=user_id, + overridden_shifts=overridden_shifts, ) shift.additional_properties = d diff --git a/rootly_sdk/models/shift_coverage_request.py b/rootly_sdk/models/shift_coverage_request.py index 79e36899..b4d93260 100644 --- a/rootly_sdk/models/shift_coverage_request.py +++ b/rootly_sdk/models/shift_coverage_request.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,12 +27,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 (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]): + 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): """ schedule_id: str @@ -39,12 +41,12 @@ class ShiftCoverageRequest: created_by_user_id: int starts_at: str ends_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -64,19 +66,19 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - schedule: Unset | dict[str, Any] = UNSET + schedule: dict[str, Any] | Unset = UNSET if not isinstance(self.schedule, Unset): schedule = self.schedule.to_dict() - shift: Unset | dict[str, Any] = UNSET + shift: dict[str, Any] | Unset = UNSET if not isinstance(self.shift, Unset): shift = self.shift.to_dict() - original_shift_user: Unset | dict[str, Any] = UNSET + original_shift_user: dict[str, Any] | Unset = UNSET if not isinstance(self.original_shift_user, Unset): original_shift_user = self.original_shift_user.to_dict() - created_by_user: Unset | dict[str, Any] = UNSET + created_by_user: dict[str, Any] | Unset = UNSET if not isinstance(self.created_by_user, Unset): created_by_user = self.created_by_user.to_dict() @@ -131,28 +133,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: Unset | ScheduleResponse + schedule: ScheduleResponse | Unset if isinstance(_schedule, Unset): schedule = UNSET else: schedule = ScheduleResponse.from_dict(_schedule) _shift = d.pop("shift", UNSET) - shift: Unset | Shift + shift: Shift | Unset if isinstance(_shift, Unset): shift = UNSET else: shift = Shift.from_dict(_shift) _original_shift_user = d.pop("original_shift_user", UNSET) - original_shift_user: Unset | UserResponse + original_shift_user: UserResponse | Unset 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: Unset | UserResponse + created_by_user: UserResponse | Unset 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 2b73e0c5..a4428d03 100644 --- a/rootly_sdk/models/shift_coverage_request_list.py +++ b/rootly_sdk/models/shift_coverage_request_list.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,16 +22,16 @@ class ShiftCoverageRequestList: """ Attributes: - data (list['ShiftCoverageRequestListDataItem']): - links (Union[Unset, Links]): - meta (Union[Unset, Meta]): - included (Union[Unset, list['JsonapiIncludedResource']]): + data (list[ShiftCoverageRequestListDataItem]): + links (Links | Unset): + meta (Meta | Unset): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["ShiftCoverageRequestListDataItem"] - links: Union[Unset, "Links"] = UNSET - meta: Union[Unset, "Meta"] = UNSET - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[ShiftCoverageRequestListDataItem] + links: Links | Unset = UNSET + meta: Meta | Unset = UNSET + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,15 +40,15 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Unset | dict[str, Any] = UNSET + links: dict[str, Any] | Unset = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Unset | dict[str, Any] = UNSET + meta: dict[str, Any] | Unset = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,25 +87,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Unset | Links + links: Links | Unset if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Unset | Meta + meta: Meta | Unset if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) - included = [] _included = d.pop("included", UNSET) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 a919ad5e..a90d354a 100644 --- a/rootly_sdk/models/shift_coverage_request_list_data_item.py +++ b/rootly_sdk/models/shift_coverage_request_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/shift_coverage_request_list_data_item_type.py b/rootly_sdk/models/shift_coverage_request_list_data_item_type.py index 621284cd..a8f17449 100644 --- a/rootly_sdk/models/shift_coverage_request_list_data_item_type.py +++ b/rootly_sdk/models/shift_coverage_request_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ShiftCoverageRequestListDataItemType = Literal["shift_coverage_requests"] @@ -11,7 +11,7 @@ def check_shift_coverage_request_list_data_item_type(value: str | None) -> Shift if value is None: return None if value in SHIFT_COVERAGE_REQUEST_LIST_DATA_ITEM_TYPE_VALUES: - return cast(ShiftCoverageRequestListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SHIFT_COVERAGE_REQUEST_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/shift_coverage_request_response.py b/rootly_sdk/models/shift_coverage_request_response.py index 33e4ac04..5d9b4afb 100644 --- a/rootly_sdk/models/shift_coverage_request_response.py +++ b/rootly_sdk/models/shift_coverage_request_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class ShiftCoverageRequestResponse: """ Attributes: data (ShiftCoverageRequestResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "ShiftCoverageRequestResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: ShiftCoverageRequestResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 367166f5..d5921d7b 100644 --- a/rootly_sdk/models/shift_coverage_request_response_data.py +++ b/rootly_sdk/models/shift_coverage_request_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/shift_coverage_request_response_data_type.py b/rootly_sdk/models/shift_coverage_request_response_data_type.py index d371ff31..1880ce64 100644 --- a/rootly_sdk/models/shift_coverage_request_response_data_type.py +++ b/rootly_sdk/models/shift_coverage_request_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ShiftCoverageRequestResponseDataType = Literal["shift_coverage_requests"] @@ -11,5 +11,5 @@ def check_shift_coverage_request_response_data_type(value: str | None) -> ShiftC if value is None: return None if value in SHIFT_COVERAGE_REQUEST_RESPONSE_DATA_TYPE_VALUES: - return cast(ShiftCoverageRequestResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SHIFT_COVERAGE_REQUEST_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/shift_list.py b/rootly_sdk/models/shift_list.py index 29673dab..280bf14a 100644 --- a/rootly_sdk/models/shift_list.py +++ b/rootly_sdk/models/shift_list.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,14 +21,14 @@ class ShiftList: """ Attributes: - data (list['ShiftListDataItem']): - meta (Union[Unset, Meta]): - included (Union[Unset, list['JsonapiIncludedResource']]): + data (list[ShiftListDataItem]): + meta (Meta | Unset): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["ShiftListDataItem"] - meta: Union[Unset, "Meta"] = UNSET - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[ShiftListDataItem] + meta: Meta | Unset = UNSET + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -35,11 +37,11 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - meta: Unset | dict[str, Any] = UNSET + meta: dict[str, Any] | Unset = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -75,18 +77,20 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _meta = d.pop("meta", UNSET) - meta: Unset | Meta + meta: Meta | Unset if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) - included = [] _included = d.pop("included", UNSET) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 430d4e47..12519c88 100644 --- a/rootly_sdk/models/shift_list_data_item.py +++ b/rootly_sdk/models/shift_list_data_item.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,13 +24,13 @@ class ShiftListDataItem: id (str): Unique ID of the shift type_ (ShiftListDataItemType): attributes (Shift): - relationships (Union[Unset, ShiftRelationships]): + relationships (ShiftRelationships | Unset): """ id: str type_: ShiftListDataItemType - attributes: "Shift" - relationships: Union[Unset, "ShiftRelationships"] = UNSET + attributes: Shift + relationships: ShiftRelationships | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() - relationships: Unset | dict[str, Any] = UNSET + relationships: dict[str, Any] | Unset = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -69,7 +71,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: Unset | ShiftRelationships + relationships: ShiftRelationships | Unset if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/shift_list_data_item_type.py b/rootly_sdk/models/shift_list_data_item_type.py index 1a934bfd..5266d201 100644 --- a/rootly_sdk/models/shift_list_data_item_type.py +++ b/rootly_sdk/models/shift_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ShiftListDataItemType = Literal["shifts"] @@ -11,5 +11,5 @@ def check_shift_list_data_item_type(value: str | None) -> ShiftListDataItemType if value is None: return None if value in SHIFT_LIST_DATA_ITEM_TYPE_VALUES: - return cast(ShiftListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SHIFT_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/shift_override.py b/rootly_sdk/models/shift_override.py index 93b17a4c..b96b91fe 100644 --- a/rootly_sdk/models/shift_override.py +++ b/rootly_sdk/models/shift_override.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -15,14 +17,14 @@ class ShiftOverride: Attributes: shift_id (str): ID of shift created_by_user_id (int): User who created the override - created_at (Union[Unset, str]): Date of creation - updated_at (Union[Unset, str]): Date of last update + created_at (str | Unset): Date of creation + updated_at (str | Unset): Date of last update """ shift_id: str created_by_user_id: int - created_at: Unset | str = UNSET - updated_at: Unset | str = UNSET + created_at: str | Unset = UNSET + updated_at: str | Unset = UNSET 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 4c8f6d9d..d4e8565d 100644 --- a/rootly_sdk/models/shift_override_response.py +++ b/rootly_sdk/models/shift_override_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class ShiftOverrideResponse: """ Attributes: data (ShiftOverrideResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "ShiftOverrideResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: ShiftOverrideResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 30c2fcd8..c290bb53 100644 --- a/rootly_sdk/models/shift_override_response_data.py +++ b/rootly_sdk/models/shift_override_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/shift_override_response_data_type.py b/rootly_sdk/models/shift_override_response_data_type.py index a6d822ce..8819d885 100644 --- a/rootly_sdk/models/shift_override_response_data_type.py +++ b/rootly_sdk/models/shift_override_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ShiftOverrideResponseDataType = Literal["shift_override"] @@ -11,5 +11,5 @@ def check_shift_override_response_data_type(value: str | None) -> ShiftOverrideR if value is None: return None if value in SHIFT_OVERRIDE_RESPONSE_DATA_TYPE_VALUES: - return cast(ShiftOverrideResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SHIFT_OVERRIDE_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/shift_relationships.py b/rootly_sdk/models/shift_relationships.py index 0c6fc19b..f258b100 100644 --- a/rootly_sdk/models/shift_relationships.py +++ b/rootly_sdk/models/shift_relationships.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,26 +21,26 @@ class ShiftRelationships: """ Attributes: - 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): + user (ShiftRelationshipsUser | Unset): + assignee (ShiftRelationshipsAssignee | Unset): Assignee can be either a User or Schedule """ - shift_override: Union[Unset, "ShiftRelationshipsShiftOverride"] = UNSET - user: Union[Unset, "ShiftRelationshipsUser"] = UNSET - assignee: Union[Unset, "ShiftRelationshipsAssignee"] = UNSET + shift_override: ShiftRelationshipsShiftOverride | Unset = UNSET + user: ShiftRelationshipsUser | Unset = UNSET + assignee: ShiftRelationshipsAssignee | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - shift_override: Unset | dict[str, Any] = UNSET + shift_override: dict[str, Any] | Unset = UNSET if not isinstance(self.shift_override, Unset): shift_override = self.shift_override.to_dict() - user: Unset | dict[str, Any] = UNSET + user: dict[str, Any] | Unset = UNSET if not isinstance(self.user, Unset): user = self.user.to_dict() - assignee: Unset | dict[str, Any] = UNSET + assignee: dict[str, Any] | Unset = UNSET if not isinstance(self.assignee, Unset): assignee = self.assignee.to_dict() @@ -62,21 +64,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: Unset | ShiftRelationshipsShiftOverride + shift_override: ShiftRelationshipsShiftOverride | Unset if isinstance(_shift_override, Unset): shift_override = UNSET else: shift_override = ShiftRelationshipsShiftOverride.from_dict(_shift_override) _user = d.pop("user", UNSET) - user: Unset | ShiftRelationshipsUser + user: ShiftRelationshipsUser | Unset if isinstance(_user, Unset): user = UNSET else: user = ShiftRelationshipsUser.from_dict(_user) _assignee = d.pop("assignee", UNSET) - assignee: Unset | ShiftRelationshipsAssignee + assignee: ShiftRelationshipsAssignee | Unset 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 fc798a60..8c75aa9a 100644 --- a/rootly_sdk/models/shift_relationships_assignee.py +++ b/rootly_sdk/models/shift_relationships_assignee.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,16 +20,16 @@ class ShiftRelationshipsAssignee: """Assignee can be either a User or Schedule Attributes: - data (Union['ShiftRelationshipsAssigneeDataType0', None, Unset]): + data (None | ShiftRelationshipsAssigneeDataType0 | Unset): """ - data: Union["ShiftRelationshipsAssigneeDataType0", None, Unset] = UNSET + data: None | ShiftRelationshipsAssigneeDataType0 | 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: None | Unset | dict[str, Any] + data: dict[str, Any] | None | Unset if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, ShiftRelationshipsAssigneeDataType0): @@ -49,7 +51,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> Union["ShiftRelationshipsAssigneeDataType0", None, Unset]: + def _parse_data(data: object) -> None | ShiftRelationshipsAssigneeDataType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -60,9 +62,9 @@ def _parse_data(data: object) -> Union["ShiftRelationshipsAssigneeDataType0", No data_type_0 = ShiftRelationshipsAssigneeDataType0.from_dict(data) return data_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["ShiftRelationshipsAssigneeDataType0", None, Unset], data) + return cast(None | ShiftRelationshipsAssigneeDataType0 | 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 aeb1080c..6d1a4577 100644 --- a/rootly_sdk/models/shift_relationships_assignee_data_type_0.py +++ b/rootly_sdk/models/shift_relationships_assignee_data_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class ShiftRelationshipsAssigneeDataType0: """ Attributes: - id (Union[Unset, str]): - type_ (Union[Unset, str]): + id (str | Unset): + type_ (str | Unset): """ - id: Unset | str = UNSET - type_: Unset | str = UNSET + id: str | Unset = UNSET + type_: str | Unset = UNSET 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 d90fc42e..843e25e3 100644 --- a/rootly_sdk/models/shift_relationships_shift_override.py +++ b/rootly_sdk/models/shift_relationships_shift_override.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,16 +19,16 @@ class ShiftRelationshipsShiftOverride: """ Attributes: - data (Union['ShiftRelationshipsShiftOverrideDataType0', None, Unset]): + data (None | ShiftRelationshipsShiftOverrideDataType0 | Unset): """ - data: Union["ShiftRelationshipsShiftOverrideDataType0", None, Unset] = UNSET + data: None | ShiftRelationshipsShiftOverrideDataType0 | 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: None | Unset | dict[str, Any] + data: dict[str, Any] | None | Unset if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, ShiftRelationshipsShiftOverrideDataType0): @@ -48,7 +50,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> Union["ShiftRelationshipsShiftOverrideDataType0", None, Unset]: + def _parse_data(data: object) -> None | ShiftRelationshipsShiftOverrideDataType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -59,9 +61,9 @@ def _parse_data(data: object) -> Union["ShiftRelationshipsShiftOverrideDataType0 data_type_0 = ShiftRelationshipsShiftOverrideDataType0.from_dict(data) return data_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["ShiftRelationshipsShiftOverrideDataType0", None, Unset], data) + return cast(None | ShiftRelationshipsShiftOverrideDataType0 | 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 914df41a..d5650162 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -17,18 +19,18 @@ class ShiftRelationshipsShiftOverrideDataType0: """ Attributes: - id (Union[Unset, str]): - type_ (Union[Unset, ShiftRelationshipsShiftOverrideDataType0Type]): + id (str | Unset): + type_ (ShiftRelationshipsShiftOverrideDataType0Type | Unset): """ - id: Unset | str = UNSET - type_: Unset | ShiftRelationshipsShiftOverrideDataType0Type = UNSET + id: str | Unset = UNSET + type_: ShiftRelationshipsShiftOverrideDataType0Type | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -48,7 +50,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | ShiftRelationshipsShiftOverrideDataType0Type + type_: ShiftRelationshipsShiftOverrideDataType0Type | Unset if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/shift_relationships_shift_override_data_type_0_type.py b/rootly_sdk/models/shift_relationships_shift_override_data_type_0_type.py index c546ebd4..7737e1fc 100644 --- a/rootly_sdk/models/shift_relationships_shift_override_data_type_0_type.py +++ b/rootly_sdk/models/shift_relationships_shift_override_data_type_0_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ShiftRelationshipsShiftOverrideDataType0Type = Literal["shift_overrides"] @@ -13,7 +13,7 @@ def check_shift_relationships_shift_override_data_type_0_type( if value is None: return None if value in SHIFT_RELATIONSHIPS_SHIFT_OVERRIDE_DATA_TYPE_0_TYPE_VALUES: - return cast(ShiftRelationshipsShiftOverrideDataType0Type, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SHIFT_RELATIONSHIPS_SHIFT_OVERRIDE_DATA_TYPE_0_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/shift_relationships_user.py b/rootly_sdk/models/shift_relationships_user.py index b8b6e5f6..0e550589 100644 --- a/rootly_sdk/models/shift_relationships_user.py +++ b/rootly_sdk/models/shift_relationships_user.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,16 +19,16 @@ class ShiftRelationshipsUser: """ Attributes: - data (Union['ShiftRelationshipsUserDataType0', None, Unset]): + data (None | ShiftRelationshipsUserDataType0 | Unset): """ - data: Union["ShiftRelationshipsUserDataType0", None, Unset] = UNSET + data: None | ShiftRelationshipsUserDataType0 | 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: None | Unset | dict[str, Any] + data: dict[str, Any] | None | Unset if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, ShiftRelationshipsUserDataType0): @@ -48,7 +50,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_data(data: object) -> Union["ShiftRelationshipsUserDataType0", None, Unset]: + def _parse_data(data: object) -> None | ShiftRelationshipsUserDataType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -59,9 +61,9 @@ def _parse_data(data: object) -> Union["ShiftRelationshipsUserDataType0", None, data_type_0 = ShiftRelationshipsUserDataType0.from_dict(data) return data_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["ShiftRelationshipsUserDataType0", None, Unset], data) + return cast(None | ShiftRelationshipsUserDataType0 | 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 d7a7fea9..edc4b248 100644 --- a/rootly_sdk/models/shift_relationships_user_data_type_0.py +++ b/rootly_sdk/models/shift_relationships_user_data_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -17,18 +19,18 @@ class ShiftRelationshipsUserDataType0: """ Attributes: - id (Union[Unset, str]): - type_ (Union[Unset, ShiftRelationshipsUserDataType0Type]): + id (str | Unset): + type_ (ShiftRelationshipsUserDataType0Type | Unset): """ - id: Unset | str = UNSET - type_: Unset | ShiftRelationshipsUserDataType0Type = UNSET + id: str | Unset = UNSET + type_: ShiftRelationshipsUserDataType0Type | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ @@ -48,7 +50,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _type_ = d.pop("type", UNSET) - type_: Unset | ShiftRelationshipsUserDataType0Type + type_: ShiftRelationshipsUserDataType0Type | Unset if isinstance(_type_, Unset): type_ = UNSET else: diff --git a/rootly_sdk/models/shift_relationships_user_data_type_0_type.py b/rootly_sdk/models/shift_relationships_user_data_type_0_type.py index 35bd7de4..e9133c64 100644 --- a/rootly_sdk/models/shift_relationships_user_data_type_0_type.py +++ b/rootly_sdk/models/shift_relationships_user_data_type_0_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal ShiftRelationshipsUserDataType0Type = Literal["users"] @@ -11,5 +11,5 @@ def check_shift_relationships_user_data_type_0_type(value: str | None) -> ShiftR if value is None: return None if value in SHIFT_RELATIONSHIPS_USER_DATA_TYPE_0_TYPE_VALUES: - return cast(ShiftRelationshipsUserDataType0Type, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SHIFT_RELATIONSHIPS_USER_DATA_TYPE_0_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/simple_trigger_params.py b/rootly_sdk/models/simple_trigger_params.py index de2934e1..75b0f282 100644 --- a/rootly_sdk/models/simple_trigger_params.py +++ b/rootly_sdk/models/simple_trigger_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -22,17 +24,17 @@ class SimpleTriggerParams: """ Attributes: trigger_type (SimpleTriggerParamsTriggerType): - triggers (Union[Unset, list[SimpleTriggerParamsTriggersItem]]): + triggers (list[SimpleTriggerParamsTriggersItem] | Unset): """ trigger_type: SimpleTriggerParamsTriggerType - triggers: Unset | list[SimpleTriggerParamsTriggersItem] = UNSET + triggers: list[SimpleTriggerParamsTriggersItem] | Unset = 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: Unset | list[str] = UNSET + triggers: list[str] | Unset = UNSET if not isinstance(self.triggers, Unset): triggers = [] for triggers_item_data in self.triggers: @@ -56,12 +58,14 @@ 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) - for triggers_item_data in _triggers or []: - triggers_item = check_simple_trigger_params_triggers_item(triggers_item_data) + 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) - triggers.append(triggers_item) + triggers.append(triggers_item) simple_trigger_params = cls( trigger_type=trigger_type, diff --git a/rootly_sdk/models/simple_trigger_params_trigger_type.py b/rootly_sdk/models/simple_trigger_params_trigger_type.py index d6591768..f28db457 100644 --- a/rootly_sdk/models/simple_trigger_params_trigger_type.py +++ b/rootly_sdk/models/simple_trigger_params_trigger_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SimpleTriggerParamsTriggerType = Literal["simple"] @@ -11,5 +11,5 @@ def check_simple_trigger_params_trigger_type(value: str | None) -> SimpleTrigger if value is None: return None if value in SIMPLE_TRIGGER_PARAMS_TRIGGER_TYPE_VALUES: - return cast(SimpleTriggerParamsTriggerType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SIMPLE_TRIGGER_PARAMS_TRIGGER_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/simple_trigger_params_triggers_item.py b/rootly_sdk/models/simple_trigger_params_triggers_item.py index 197b4d22..5a99a70d 100644 --- a/rootly_sdk/models/simple_trigger_params_triggers_item.py +++ b/rootly_sdk/models/simple_trigger_params_triggers_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SimpleTriggerParamsTriggersItem = Literal["slack_command"] @@ -11,5 +11,5 @@ def check_simple_trigger_params_triggers_item(value: str | None) -> SimpleTrigge if value is None: return None if value in SIMPLE_TRIGGER_PARAMS_TRIGGERS_ITEM_VALUES: - return cast(SimpleTriggerParamsTriggersItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SIMPLE_TRIGGER_PARAMS_TRIGGERS_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/sla.py b/rootly_sdk/models/sla.py index 97f74a91..c153570e 100644 --- a/rootly_sdk/models/sla.py +++ b/rootly_sdk/models/sla.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast from uuid import UUID @@ -29,23 +31,22 @@ 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 (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 + 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 `manager_user_id` must be provided. - 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 + 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 configurations """ @@ -57,18 +58,18 @@ class Sla: completion_deadline_parent_status: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -90,7 +91,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -98,11 +99,11 @@ def to_dict(self) -> dict[str, Any]: position = self.position - entity_type: Unset | str = UNSET + entity_type: str | Unset = UNSET if not isinstance(self.entity_type, Unset): entity_type = self.entity_type - manager_role_id: None | Unset | str + manager_role_id: None | str | Unset if isinstance(self.manager_role_id, Unset): manager_role_id = UNSET elif isinstance(self.manager_role_id, UUID): @@ -110,13 +111,13 @@ def to_dict(self) -> dict[str, Any]: else: manager_role_id = self.manager_role_id - manager_user_id: None | Unset | int + manager_user_id: int | None | Unset 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 | Unset | str + assignment_deadline_sub_status_id: None | str | Unset if isinstance(self.assignment_deadline_sub_status_id, Unset): assignment_deadline_sub_status_id = UNSET elif isinstance(self.assignment_deadline_sub_status_id, UUID): @@ -126,7 +127,7 @@ def to_dict(self) -> dict[str, Any]: assignment_skip_weekends = self.assignment_skip_weekends - completion_deadline_sub_status_id: None | Unset | str + completion_deadline_sub_status_id: None | str | Unset if isinstance(self.completion_deadline_sub_status_id, Unset): completion_deadline_sub_status_id = UNSET elif isinstance(self.completion_deadline_sub_status_id, UUID): @@ -136,14 +137,14 @@ def to_dict(self) -> dict[str, Any]: completion_skip_weekends = self.completion_skip_weekends - conditions: Unset | list[dict[str, Any]] = UNSET + conditions: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + notification_configurations: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.notification_configurations, Unset): notification_configurations = [] for notification_configurations_item_data in self.notification_configurations: @@ -215,25 +216,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) position = d.pop("position", UNSET) _entity_type = d.pop("entity_type", UNSET) - entity_type: Unset | SlaEntityType + entity_type: SlaEntityType | Unset 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 | UUID | Unset: + def _parse_manager_role_id(data: object) -> None | Unset | UUID: if data is None: return data if isinstance(data, Unset): @@ -244,22 +245,22 @@ def _parse_manager_role_id(data: object) -> None | UUID | Unset: manager_role_id_type_0 = UUID(data) return manager_role_id_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | UUID | Unset, data) + return cast(None | Unset | UUID, data) manager_role_id = _parse_manager_role_id(d.pop("manager_role_id", UNSET)) - def _parse_manager_user_id(data: object) -> None | Unset | int: + def _parse_manager_user_id(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) manager_user_id = _parse_manager_user_id(d.pop("manager_user_id", UNSET)) - def _parse_assignment_deadline_sub_status_id(data: object) -> None | UUID | Unset: + def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUID: if data is None: return data if isinstance(data, Unset): @@ -270,9 +271,9 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | UUID | Unse assignment_deadline_sub_status_id_type_0 = UUID(data) return assignment_deadline_sub_status_id_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | UUID | Unset, data) + return cast(None | Unset | UUID, data) assignment_deadline_sub_status_id = _parse_assignment_deadline_sub_status_id( d.pop("assignment_deadline_sub_status_id", UNSET) @@ -280,7 +281,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | UUID | Unse assignment_skip_weekends = d.pop("assignment_skip_weekends", UNSET) - def _parse_completion_deadline_sub_status_id(data: object) -> None | UUID | Unset: + def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUID: if data is None: return data if isinstance(data, Unset): @@ -291,9 +292,9 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | UUID | Unse completion_deadline_sub_status_id_type_0 = UUID(data) return completion_deadline_sub_status_id_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | UUID | Unset, data) + return cast(None | Unset | UUID, data) completion_deadline_sub_status_id = _parse_completion_deadline_sub_status_id( d.pop("completion_deadline_sub_status_id", UNSET) @@ -301,21 +302,25 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | UUID | Unse completion_skip_weekends = d.pop("completion_skip_weekends", UNSET) - conditions = [] _conditions = d.pop("conditions", UNSET) - for conditions_item_data in _conditions or []: - conditions_item = SlaConditionsItem.from_dict(conditions_item_data) + 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) - conditions.append(conditions_item) + conditions.append(conditions_item) - notification_configurations = [] _notification_configurations = d.pop("notification_configurations", UNSET) - for notification_configurations_item_data in _notification_configurations or []: - notification_configurations_item = SlaNotificationConfigurationsItem.from_dict( - notification_configurations_item_data - ) + 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 + ) - notification_configurations.append(notification_configurations_item) + notification_configurations.append(notification_configurations_item) sla = cls( name=name, diff --git a/rootly_sdk/models/sla_condition_match_type.py b/rootly_sdk/models/sla_condition_match_type.py index 4f0303e9..71d36e5b 100644 --- a/rootly_sdk/models/sla_condition_match_type.py +++ b/rootly_sdk/models/sla_condition_match_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SlaConditionMatchType = Literal["ALL", "ANY"] @@ -12,5 +12,5 @@ def check_sla_condition_match_type(value: str | None) -> SlaConditionMatchType | if value is None: return None if value in SLA_CONDITION_MATCH_TYPE_VALUES: - return cast(SlaConditionMatchType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SLA_CONDITION_MATCH_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/sla_conditions_item.py b/rootly_sdk/models/sla_conditions_item.py index cdaffff6..9a5b164e 100644 --- a/rootly_sdk/models/sla_conditions_item.py +++ b/rootly_sdk/models/sla_conditions_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast from uuid import UUID @@ -18,36 +20,36 @@ class SlaConditionsItem: """ Attributes: - 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): 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: 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: Unset | str = UNSET + id: str | Unset = UNSET if not isinstance(self.id, Unset): id = str(self.id) position = self.position - conditionable_type: Unset | str = UNSET + conditionable_type: str | Unset = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - property_: None | Unset | str + property_: None | str | Unset if isinstance(self.property_, Unset): property_ = UNSET else: @@ -55,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: operator = self.operator - values: None | Unset | list[str] + values: list[str] | None | Unset if isinstance(self.values, Unset): values = UNSET elif isinstance(self.values, list): @@ -64,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: else: values = self.values - form_field_id: None | Unset | str + form_field_id: None | str | Unset if isinstance(self.form_field_id, Unset): form_field_id = UNSET elif isinstance(self.form_field_id, UUID): @@ -96,7 +98,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: Unset | UUID + id: UUID | Unset if isinstance(_id, Unset): id = UNSET else: @@ -105,24 +107,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: Unset | SlaConditionsItemConditionableType + conditionable_type: SlaConditionsItemConditionableType | Unset 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 | Unset | str: + def _parse_property_(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) property_ = _parse_property_(d.pop("property", UNSET)) operator = d.pop("operator", UNSET) - def _parse_values(data: object) -> None | Unset | list[str]: + def _parse_values(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -133,13 +135,13 @@ def _parse_values(data: object) -> None | Unset | list[str]: values_type_0 = cast(list[str], data) return values_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) values = _parse_values(d.pop("values", UNSET)) - def _parse_form_field_id(data: object) -> None | UUID | Unset: + def _parse_form_field_id(data: object) -> None | Unset | UUID: if data is None: return data if isinstance(data, Unset): @@ -150,9 +152,9 @@ def _parse_form_field_id(data: object) -> None | UUID | Unset: form_field_id_type_0 = UUID(data) return form_field_id_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | UUID | Unset, data) + return cast(None | Unset | UUID, data) form_field_id = _parse_form_field_id(d.pop("form_field_id", UNSET)) diff --git a/rootly_sdk/models/sla_conditions_item_conditionable_type.py b/rootly_sdk/models/sla_conditions_item_conditionable_type.py index 3401ddf6..8c181904 100644 --- a/rootly_sdk/models/sla_conditions_item_conditionable_type.py +++ b/rootly_sdk/models/sla_conditions_item_conditionable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SlaConditionsItemConditionableType = Literal["SLAs::BuiltInFieldCondition", "SLAs::CustomFieldCondition"] @@ -12,5 +12,5 @@ def check_sla_conditions_item_conditionable_type(value: str | None) -> SlaCondit if value is None: return None if value in SLA_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES: - return cast(SlaConditionsItemConditionableType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SLA_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/sla_entity_type.py b/rootly_sdk/models/sla_entity_type.py index 345e545f..fdbc8e1c 100644 --- a/rootly_sdk/models/sla_entity_type.py +++ b/rootly_sdk/models/sla_entity_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SlaEntityType = Literal["follow_up"] @@ -11,5 +11,5 @@ def check_sla_entity_type(value: str | None) -> SlaEntityType | None: if value is None: return None if value in SLA_ENTITY_TYPE_VALUES: - return cast(SlaEntityType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SLA_ENTITY_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/sla_list.py b/rootly_sdk/models/sla_list.py index 0294d0ef..b6014b3f 100644 --- a/rootly_sdk/models/sla_list.py +++ b/rootly_sdk/models/sla_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class SlaList: """ Attributes: - data (list['SlaListDataItem']): + data (list[SlaListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["SlaListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[SlaListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 850b573f..5b7c4779 100644 --- a/rootly_sdk/models/sla_list_data_item.py +++ b/rootly_sdk/models/sla_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/sla_list_data_item_type.py b/rootly_sdk/models/sla_list_data_item_type.py index aa372ff6..e5be2eaf 100644 --- a/rootly_sdk/models/sla_list_data_item_type.py +++ b/rootly_sdk/models/sla_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SlaListDataItemType = Literal["slas"] @@ -11,5 +11,5 @@ def check_sla_list_data_item_type(value: str | None) -> SlaListDataItemType | No if value is None: return None if value in SLA_LIST_DATA_ITEM_TYPE_VALUES: - return cast(SlaListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SLA_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/sla_notification_configurations_item.py b/rootly_sdk/models/sla_notification_configurations_item.py index 0bb4b920..dfb47329 100644 --- a/rootly_sdk/models/sla_notification_configurations_item.py +++ b/rootly_sdk/models/sla_notification_configurations_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID @@ -18,27 +20,27 @@ class SlaNotificationConfigurationsItem: """ Attributes: - 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): 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: Unset | UUID = UNSET - offset_type: Unset | SlaNotificationConfigurationsItemOffsetType = UNSET - offset_days: Unset | int = UNSET - created_at: Unset | str = UNSET - updated_at: Unset | str = UNSET + id: UUID | Unset = UNSET + offset_type: SlaNotificationConfigurationsItemOffsetType | Unset = UNSET + offset_days: int | Unset = UNSET + created_at: str | Unset = UNSET + updated_at: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - id: Unset | str = UNSET + id: str | Unset = UNSET if not isinstance(self.id, Unset): id = str(self.id) - offset_type: Unset | str = UNSET + offset_type: str | Unset = UNSET if not isinstance(self.offset_type, Unset): offset_type = self.offset_type @@ -68,14 +70,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: Unset | UUID + id: UUID | Unset if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) _offset_type = d.pop("offset_type", UNSET) - offset_type: Unset | SlaNotificationConfigurationsItemOffsetType + offset_type: SlaNotificationConfigurationsItemOffsetType | Unset if isinstance(_offset_type, Unset): offset_type = UNSET else: diff --git a/rootly_sdk/models/sla_notification_configurations_item_offset_type.py b/rootly_sdk/models/sla_notification_configurations_item_offset_type.py index 1d49fb68..bcec04da 100644 --- a/rootly_sdk/models/sla_notification_configurations_item_offset_type.py +++ b/rootly_sdk/models/sla_notification_configurations_item_offset_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SlaNotificationConfigurationsItemOffsetType = Literal["after_due", "before_due", "when_due"] @@ -15,7 +15,7 @@ def check_sla_notification_configurations_item_offset_type( if value is None: return None if value in SLA_NOTIFICATION_CONFIGURATIONS_ITEM_OFFSET_TYPE_VALUES: - return cast(SlaNotificationConfigurationsItemOffsetType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SLA_NOTIFICATION_CONFIGURATIONS_ITEM_OFFSET_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/sla_response.py b/rootly_sdk/models/sla_response.py index c884fbe7..f61497a8 100644 --- a/rootly_sdk/models/sla_response.py +++ b/rootly_sdk/models/sla_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class SlaResponse: """ Attributes: data (SlaResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "SlaResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: SlaResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 4e671418..b1b876c7 100644 --- a/rootly_sdk/models/sla_response_data.py +++ b/rootly_sdk/models/sla_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/sla_response_data_type.py b/rootly_sdk/models/sla_response_data_type.py index 6aca4e6d..32cfb272 100644 --- a/rootly_sdk/models/sla_response_data_type.py +++ b/rootly_sdk/models/sla_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SlaResponseDataType = Literal["slas"] @@ -11,5 +11,5 @@ def check_sla_response_data_type(value: str | None) -> SlaResponseDataType | Non if value is None: return None if value in SLA_RESPONSE_DATA_TYPE_VALUES: - return cast(SlaResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SLA_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/slack_channel.py b/rootly_sdk/models/slack_channel.py index 07a344c3..845201cd 100644 --- a/rootly_sdk/models/slack_channel.py +++ b/rootly_sdk/models/slack_channel.py @@ -1,3 +1,5 @@ +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 f4a21240..a527230a 100644 --- a/rootly_sdk/models/snapshot_datadog_graph_task_params.py +++ b/rootly_sdk/models/snapshot_datadog_graph_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -25,42 +27,42 @@ class SnapshotDatadogGraphTaskParams: """ Attributes: past_duration (str): in format '1 minute', '30 days', '3 months', etc Example: 1 hour. - 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']]): + 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): """ past_duration: str - 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 + 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 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - dashboards: Unset | list[dict[str, Any]] = UNSET + dashboards: list[dict[str, Any]] | Unset = 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: Unset | list[str] = UNSET + metric_queries: list[str] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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: @@ -100,31 +102,35 @@ 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: Unset | SnapshotDatadogGraphTaskParamsTaskType + task_type: SnapshotDatadogGraphTaskParamsTaskType | Unset 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) - for dashboards_item_data in _dashboards or []: - dashboards_item = SnapshotDatadogGraphTaskParamsDashboardsItem.from_dict(dashboards_item_data) + 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) - 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) - 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: 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 + ) - 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 7b7b6330..9c746203 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class SnapshotDatadogGraphTaskParamsDashboardsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 ea37cf49..1e3ef6f9 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class SnapshotDatadogGraphTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/snapshot_datadog_graph_task_params_task_type.py index 35c43a8c..992e5f2d 100644 --- a/rootly_sdk/models/snapshot_datadog_graph_task_params_task_type.py +++ b/rootly_sdk/models/snapshot_datadog_graph_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SnapshotDatadogGraphTaskParamsTaskType = Literal["snapshot_datadog_graph"] @@ -13,7 +13,7 @@ def check_snapshot_datadog_graph_task_params_task_type( if value is None: return None if value in SNAPSHOT_DATADOG_GRAPH_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(SnapshotDatadogGraphTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SNAPSHOT_DATADOG_GRAPH_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/snapshot_grafana_dashboard_task_params.py b/rootly_sdk/models/snapshot_grafana_dashboard_task_params.py index 96877abd..dfda8c8d 100644 --- a/rootly_sdk/models/snapshot_grafana_dashboard_task_params.py +++ b/rootly_sdk/models/snapshot_grafana_dashboard_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -26,16 +28,16 @@ class SnapshotGrafanaDashboardTaskParams: """ Attributes: - 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): + post_to_incident_timeline (bool | Unset): + post_to_slack_channels (list[SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem] | Unset): """ - dashboards: list["SnapshotGrafanaDashboardTaskParamsDashboardsItem"] - task_type: Unset | SnapshotGrafanaDashboardTaskParamsTaskType = UNSET - post_to_incident_timeline: Unset | bool = UNSET - post_to_slack_channels: Unset | list["SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem"] = UNSET + dashboards: list[SnapshotGrafanaDashboardTaskParamsDashboardsItem] + task_type: SnapshotGrafanaDashboardTaskParamsTaskType | Unset = UNSET + post_to_incident_timeline: bool | Unset = UNSET + post_to_slack_channels: list[SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +46,13 @@ def to_dict(self) -> dict[str, Any]: dashboards_item = dashboards_item_data.to_dict() dashboards.append(dashboards_item) - task_type: Unset | str = UNSET + task_type: str | Unset = 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: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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 +93,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: Unset | SnapshotGrafanaDashboardTaskParamsTaskType + task_type: SnapshotGrafanaDashboardTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -99,14 +101,16 @@ 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) - 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: 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 + ) - 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 4c028f49..7b0c3437 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class SnapshotGrafanaDashboardTaskParamsDashboardsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 0edaa27c..cfa584d1 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class SnapshotGrafanaDashboardTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/snapshot_grafana_dashboard_task_params_task_type.py index 30eaeb0f..5fc8fb62 100644 --- a/rootly_sdk/models/snapshot_grafana_dashboard_task_params_task_type.py +++ b/rootly_sdk/models/snapshot_grafana_dashboard_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SnapshotGrafanaDashboardTaskParamsTaskType = Literal["snapshot_grafana_dashboard"] @@ -13,7 +13,7 @@ def check_snapshot_grafana_dashboard_task_params_task_type( if value is None: return None if value in SNAPSHOT_GRAFANA_DASHBOARD_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(SnapshotGrafanaDashboardTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SNAPSHOT_GRAFANA_DASHBOARD_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/snapshot_looker_look_task_params.py b/rootly_sdk/models/snapshot_looker_look_task_params.py index 87fb439c..f30ca13f 100644 --- a/rootly_sdk/models/snapshot_looker_look_task_params.py +++ b/rootly_sdk/models/snapshot_looker_look_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,16 +26,16 @@ class SnapshotLookerLookTaskParams: """ Attributes: - 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): + post_to_incident_timeline (bool | Unset): + post_to_slack_channels (list[SnapshotLookerLookTaskParamsPostToSlackChannelsItem] | Unset): """ - dashboards: list["SnapshotLookerLookTaskParamsDashboardsItem"] - task_type: Unset | SnapshotLookerLookTaskParamsTaskType = UNSET - post_to_incident_timeline: Unset | bool = UNSET - post_to_slack_channels: Unset | list["SnapshotLookerLookTaskParamsPostToSlackChannelsItem"] = UNSET + dashboards: list[SnapshotLookerLookTaskParamsDashboardsItem] + task_type: SnapshotLookerLookTaskParamsTaskType | Unset = UNSET + post_to_incident_timeline: bool | Unset = UNSET + post_to_slack_channels: list[SnapshotLookerLookTaskParamsPostToSlackChannelsItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,13 +44,13 @@ def to_dict(self) -> dict[str, Any]: dashboards_item = dashboards_item_data.to_dict() dashboards.append(dashboards_item) - task_type: Unset | str = UNSET + task_type: str | Unset = 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: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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: @@ -87,7 +89,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: Unset | SnapshotLookerLookTaskParamsTaskType + task_type: SnapshotLookerLookTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -95,14 +97,16 @@ 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) - 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: 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 + ) - 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 3a5baf68..8f376d5f 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class SnapshotLookerLookTaskParamsDashboardsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 fde08d8f..919bbb01 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class SnapshotLookerLookTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/snapshot_looker_look_task_params_task_type.py index c53efef9..c0576108 100644 --- a/rootly_sdk/models/snapshot_looker_look_task_params_task_type.py +++ b/rootly_sdk/models/snapshot_looker_look_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SnapshotLookerLookTaskParamsTaskType = Literal["snapshot_looker_look"] @@ -11,7 +11,7 @@ def check_snapshot_looker_look_task_params_task_type(value: str | None) -> Snaps if value is None: return None if value in SNAPSHOT_LOOKER_LOOK_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(SnapshotLookerLookTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SNAPSHOT_LOOKER_LOOK_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 aa99c427..364069f3 100644 --- a/rootly_sdk/models/snapshot_new_relic_graph_task_params.py +++ b/rootly_sdk/models/snapshot_new_relic_graph_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -29,16 +31,16 @@ class SnapshotNewRelicGraphTaskParams: Attributes: metric_query (str): metric_type (SnapshotNewRelicGraphTaskParamsMetricType): - task_type (Union[Unset, SnapshotNewRelicGraphTaskParamsTaskType]): - post_to_incident_timeline (Union[Unset, bool]): - post_to_slack_channels (Union[Unset, list['SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem']]): + task_type (SnapshotNewRelicGraphTaskParamsTaskType | Unset): + post_to_incident_timeline (bool | Unset): + post_to_slack_channels (list[SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem] | Unset): """ metric_query: str metric_type: SnapshotNewRelicGraphTaskParamsMetricType - task_type: Unset | SnapshotNewRelicGraphTaskParamsTaskType = UNSET - post_to_incident_timeline: Unset | bool = UNSET - post_to_slack_channels: Unset | list["SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem"] = UNSET + task_type: SnapshotNewRelicGraphTaskParamsTaskType | Unset = UNSET + post_to_incident_timeline: bool | Unset = UNSET + post_to_slack_channels: list[SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,13 +48,13 @@ def to_dict(self) -> dict[str, Any]: metric_type: str = self.metric_type - task_type: Unset | str = UNSET + task_type: str | Unset = 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: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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: @@ -88,7 +90,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: Unset | SnapshotNewRelicGraphTaskParamsTaskType + task_type: SnapshotNewRelicGraphTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -96,14 +98,16 @@ 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) - 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: 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 + ) - 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_metric_type.py b/rootly_sdk/models/snapshot_new_relic_graph_task_params_metric_type.py index 66ac89d4..ea3aaaee 100644 --- a/rootly_sdk/models/snapshot_new_relic_graph_task_params_metric_type.py +++ b/rootly_sdk/models/snapshot_new_relic_graph_task_params_metric_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SnapshotNewRelicGraphTaskParamsMetricType = Literal[ "APDEX", @@ -45,7 +45,7 @@ def check_snapshot_new_relic_graph_task_params_metric_type( if value is None: return None if value in SNAPSHOT_NEW_RELIC_GRAPH_TASK_PARAMS_METRIC_TYPE_VALUES: - return cast(SnapshotNewRelicGraphTaskParamsMetricType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SNAPSHOT_NEW_RELIC_GRAPH_TASK_PARAMS_METRIC_TYPE_VALUES!r}" ) 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 b56e5eee..143318a5 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class SnapshotNewRelicGraphTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/snapshot_new_relic_graph_task_params_task_type.py index 2a904b19..983aa125 100644 --- a/rootly_sdk/models/snapshot_new_relic_graph_task_params_task_type.py +++ b/rootly_sdk/models/snapshot_new_relic_graph_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SnapshotNewRelicGraphTaskParamsTaskType = Literal["snapshot_looker_graph"] @@ -13,7 +13,7 @@ def check_snapshot_new_relic_graph_task_params_task_type( if value is None: return None if value in SNAPSHOT_NEW_RELIC_GRAPH_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(SnapshotNewRelicGraphTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {SNAPSHOT_NEW_RELIC_GRAPH_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/snooze_alert.py b/rootly_sdk/models/snooze_alert.py index 186fac63..5b10f9f5 100644 --- a/rootly_sdk/models/snooze_alert.py +++ b/rootly_sdk/models/snooze_alert.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.snooze_alert_data import SnoozeAlertData @@ -18,14 +19,13 @@ class SnoozeAlert: data (SnoozeAlertData): """ - data: "SnoozeAlertData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: SnoozeAlertData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - snooze_alert.additional_properties = d return snooze_alert - - @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/snooze_alert_data.py b/rootly_sdk/models/snooze_alert_data.py index bf68c5f4..fa880664 100644 --- a/rootly_sdk/models/snooze_alert_data.py +++ b/rootly_sdk/models/snooze_alert_data.py @@ -1,8 +1,9 @@ +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.snooze_alert_data_type import SnoozeAlertDataType, check_snooze_alert_data_type @@ -22,8 +23,7 @@ class SnoozeAlertData: """ type_: SnoozeAlertDataType - attributes: "SnoozeAlertDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: SnoozeAlertDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - snooze_alert_data.additional_properties = d return snooze_alert_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/snooze_alert_data_attributes.py b/rootly_sdk/models/snooze_alert_data_attributes.py index 9fc61d54..469ea42c 100644 --- a/rootly_sdk/models/snooze_alert_data_attributes.py +++ b/rootly_sdk/models/snooze_alert_data_attributes.py @@ -1,8 +1,21 @@ +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 ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.snooze_alert_data_attributes_actor_type_0 import SnoozeAlertDataAttributesActorType0 + from ..models.snooze_alert_data_attributes_actor_type_1 import SnoozeAlertDataAttributesActorType1 + from ..models.snooze_alert_data_attributes_actor_type_2_type_0 import SnoozeAlertDataAttributesActorType2Type0 + from ..models.snooze_alert_data_attributes_actor_type_2_type_1 import SnoozeAlertDataAttributesActorType2Type1 + from ..models.snooze_alert_data_attributes_actor_type_3_type_0 import SnoozeAlertDataAttributesActorType3Type0 + from ..models.snooze_alert_data_attributes_actor_type_3_type_1 import SnoozeAlertDataAttributesActorType3Type1 + + T = TypeVar("T", bound="SnoozeAlertDataAttributes") @@ -11,13 +24,51 @@ class SnoozeAlertDataAttributes: """ Attributes: delay_minutes (int): Number of minutes to snooze the alert for + actor (SnoozeAlertDataAttributesActorType0 | SnoozeAlertDataAttributesActorType1 | + SnoozeAlertDataAttributesActorType2Type0 | SnoozeAlertDataAttributesActorType2Type1 | + SnoozeAlertDataAttributesActorType3Type0 | SnoozeAlertDataAttributesActorType3Type1 | Unset): The user to record + as performing this action. Only available when actor attribution is enabled for the organization; otherwise it + is ignored. Only supported with Global and Team API keys; with a Team API key the user must belong to one of the + key's teams. When omitted or null, the action is attributed to the API key. Otherwise provide either `email` or + `user_id`, not both. """ delay_minutes: int + actor: ( + SnoozeAlertDataAttributesActorType0 + | SnoozeAlertDataAttributesActorType1 + | SnoozeAlertDataAttributesActorType2Type0 + | SnoozeAlertDataAttributesActorType2Type1 + | SnoozeAlertDataAttributesActorType3Type0 + | SnoozeAlertDataAttributesActorType3Type1 + | Unset + ) = UNSET def to_dict(self) -> dict[str, Any]: + from ..models.snooze_alert_data_attributes_actor_type_0 import SnoozeAlertDataAttributesActorType0 + from ..models.snooze_alert_data_attributes_actor_type_1 import SnoozeAlertDataAttributesActorType1 + from ..models.snooze_alert_data_attributes_actor_type_2_type_0 import SnoozeAlertDataAttributesActorType2Type0 + from ..models.snooze_alert_data_attributes_actor_type_2_type_1 import SnoozeAlertDataAttributesActorType2Type1 + from ..models.snooze_alert_data_attributes_actor_type_3_type_0 import SnoozeAlertDataAttributesActorType3Type0 + delay_minutes = self.delay_minutes + actor: dict[str, Any] | Unset + if isinstance(self.actor, Unset): + actor = UNSET + elif isinstance(self.actor, SnoozeAlertDataAttributesActorType0): + actor = self.actor.to_dict() + elif isinstance(self.actor, SnoozeAlertDataAttributesActorType1): + actor = self.actor.to_dict() + elif isinstance(self.actor, SnoozeAlertDataAttributesActorType2Type0): + actor = self.actor.to_dict() + elif isinstance(self.actor, SnoozeAlertDataAttributesActorType2Type1): + actor = self.actor.to_dict() + elif isinstance(self.actor, SnoozeAlertDataAttributesActorType3Type0): + actor = self.actor.to_dict() + else: + actor = self.actor.to_dict() + field_dict: dict[str, Any] = {} field_dict.update( @@ -25,16 +76,87 @@ def to_dict(self) -> dict[str, Any]: "delay_minutes": delay_minutes, } ) + if actor is not UNSET: + field_dict["actor"] = actor return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.snooze_alert_data_attributes_actor_type_0 import SnoozeAlertDataAttributesActorType0 + from ..models.snooze_alert_data_attributes_actor_type_1 import SnoozeAlertDataAttributesActorType1 + from ..models.snooze_alert_data_attributes_actor_type_2_type_0 import SnoozeAlertDataAttributesActorType2Type0 + from ..models.snooze_alert_data_attributes_actor_type_2_type_1 import SnoozeAlertDataAttributesActorType2Type1 + from ..models.snooze_alert_data_attributes_actor_type_3_type_0 import SnoozeAlertDataAttributesActorType3Type0 + from ..models.snooze_alert_data_attributes_actor_type_3_type_1 import SnoozeAlertDataAttributesActorType3Type1 + d = dict(src_dict) delay_minutes = d.pop("delay_minutes") + def _parse_actor( + data: object, + ) -> ( + SnoozeAlertDataAttributesActorType0 + | SnoozeAlertDataAttributesActorType1 + | SnoozeAlertDataAttributesActorType2Type0 + | SnoozeAlertDataAttributesActorType2Type1 + | SnoozeAlertDataAttributesActorType3Type0 + | SnoozeAlertDataAttributesActorType3Type1 + | Unset + ): + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_0 = SnoozeAlertDataAttributesActorType0.from_dict(data) + + return actor_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_1 = SnoozeAlertDataAttributesActorType1.from_dict(data) + + return actor_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_2_type_0 = SnoozeAlertDataAttributesActorType2Type0.from_dict(data) + + return actor_type_2_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_2_type_1 = SnoozeAlertDataAttributesActorType2Type1.from_dict(data) + + return actor_type_2_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_3_type_0 = SnoozeAlertDataAttributesActorType3Type0.from_dict(data) + + return actor_type_3_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + actor_type_3_type_1 = SnoozeAlertDataAttributesActorType3Type1.from_dict(data) + + return actor_type_3_type_1 + + actor = _parse_actor(d.pop("actor", UNSET)) + snooze_alert_data_attributes = cls( delay_minutes=delay_minutes, + actor=actor, ) return snooze_alert_data_attributes diff --git a/rootly_sdk/models/snooze_alert_data_attributes_actor_type_0.py b/rootly_sdk/models/snooze_alert_data_attributes_actor_type_0.py new file mode 100644 index 00000000..fe9c8473 --- /dev/null +++ b/rootly_sdk/models/snooze_alert_data_attributes_actor_type_0.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="SnoozeAlertDataAttributesActorType0") + + +@_attrs_define +class SnoozeAlertDataAttributesActorType0: + """ + Attributes: + email (str): Email of the user, including verified secondary emails. + """ + + email: str + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + snooze_alert_data_attributes_actor_type_0 = cls( + email=email, + ) + + return snooze_alert_data_attributes_actor_type_0 diff --git a/rootly_sdk/models/snooze_alert_data_attributes_actor_type_1.py b/rootly_sdk/models/snooze_alert_data_attributes_actor_type_1.py new file mode 100644 index 00000000..1fb87c84 --- /dev/null +++ b/rootly_sdk/models/snooze_alert_data_attributes_actor_type_1.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="SnoozeAlertDataAttributesActorType1") + + +@_attrs_define +class SnoozeAlertDataAttributesActorType1: + """ + Attributes: + user_id (str): Rootly ID of the user. + """ + + user_id: str + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user_id": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("user_id") + + snooze_alert_data_attributes_actor_type_1 = cls( + user_id=user_id, + ) + + return snooze_alert_data_attributes_actor_type_1 diff --git a/rootly_sdk/models/snooze_alert_data_attributes_actor_type_2_type_0.py b/rootly_sdk/models/snooze_alert_data_attributes_actor_type_2_type_0.py new file mode 100644 index 00000000..a19fe544 --- /dev/null +++ b/rootly_sdk/models/snooze_alert_data_attributes_actor_type_2_type_0.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="SnoozeAlertDataAttributesActorType2Type0") + + +@_attrs_define +class SnoozeAlertDataAttributesActorType2Type0: + """ + Attributes: + email (str): Email of the user, including verified secondary emails. + """ + + email: str + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + snooze_alert_data_attributes_actor_type_2_type_0 = cls( + email=email, + ) + + return snooze_alert_data_attributes_actor_type_2_type_0 diff --git a/rootly_sdk/models/snooze_alert_data_attributes_actor_type_2_type_1.py b/rootly_sdk/models/snooze_alert_data_attributes_actor_type_2_type_1.py new file mode 100644 index 00000000..bdcc8dcd --- /dev/null +++ b/rootly_sdk/models/snooze_alert_data_attributes_actor_type_2_type_1.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="SnoozeAlertDataAttributesActorType2Type1") + + +@_attrs_define +class SnoozeAlertDataAttributesActorType2Type1: + """ + Attributes: + user_id (str): Rootly ID of the user. + """ + + user_id: str + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user_id": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("user_id") + + snooze_alert_data_attributes_actor_type_2_type_1 = cls( + user_id=user_id, + ) + + return snooze_alert_data_attributes_actor_type_2_type_1 diff --git a/rootly_sdk/models/snooze_alert_data_attributes_actor_type_3_type_0.py b/rootly_sdk/models/snooze_alert_data_attributes_actor_type_3_type_0.py new file mode 100644 index 00000000..27350775 --- /dev/null +++ b/rootly_sdk/models/snooze_alert_data_attributes_actor_type_3_type_0.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="SnoozeAlertDataAttributesActorType3Type0") + + +@_attrs_define +class SnoozeAlertDataAttributesActorType3Type0: + """ + Attributes: + email (str): Email of the user, including verified secondary emails. + """ + + email: str + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + snooze_alert_data_attributes_actor_type_3_type_0 = cls( + email=email, + ) + + return snooze_alert_data_attributes_actor_type_3_type_0 diff --git a/rootly_sdk/models/snooze_alert_data_attributes_actor_type_3_type_1.py b/rootly_sdk/models/snooze_alert_data_attributes_actor_type_3_type_1.py new file mode 100644 index 00000000..208e431b --- /dev/null +++ b/rootly_sdk/models/snooze_alert_data_attributes_actor_type_3_type_1.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="SnoozeAlertDataAttributesActorType3Type1") + + +@_attrs_define +class SnoozeAlertDataAttributesActorType3Type1: + """ + Attributes: + user_id (str): Rootly ID of the user. + """ + + user_id: str + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user_id": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("user_id") + + snooze_alert_data_attributes_actor_type_3_type_1 = cls( + user_id=user_id, + ) + + return snooze_alert_data_attributes_actor_type_3_type_1 diff --git a/rootly_sdk/models/snooze_alert_data_type.py b/rootly_sdk/models/snooze_alert_data_type.py index c7260a30..2be94417 100644 --- a/rootly_sdk/models/snooze_alert_data_type.py +++ b/rootly_sdk/models/snooze_alert_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SnoozeAlertDataType = Literal["alerts"] @@ -11,5 +11,5 @@ def check_snooze_alert_data_type(value: str | None) -> SnoozeAlertDataType | Non if value is None: return None if value in SNOOZE_ALERT_DATA_TYPE_VALUES: - return cast(SnoozeAlertDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SNOOZE_ALERT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/start_session_request.py b/rootly_sdk/models/start_session_request.py index 53697c40..bc7434a4 100644 --- a/rootly_sdk/models/start_session_request.py +++ b/rootly_sdk/models/start_session_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -14,20 +16,20 @@ class StartSessionRequest: """ Attributes: - platform (Union[Unset, StartSessionRequestPlatform]): Meeting platform - title (Union[None, Unset, str]): Human-readable label for the recording session + platform (StartSessionRequestPlatform | Unset): Meeting platform + title (None | str | Unset): Human-readable label for the recording session """ - platform: Unset | StartSessionRequestPlatform = UNSET - title: None | Unset | str = UNSET + platform: StartSessionRequestPlatform | Unset = UNSET + title: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - platform: Unset | str = UNSET + platform: str | Unset = UNSET if not isinstance(self.platform, Unset): platform = self.platform - title: None | Unset | str + title: None | str | Unset if isinstance(self.title, Unset): title = UNSET else: @@ -47,18 +49,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: Unset | StartSessionRequestPlatform + platform: StartSessionRequestPlatform | Unset if isinstance(_platform, Unset): platform = UNSET else: platform = check_start_session_request_platform(_platform) - def _parse_title(data: object) -> None | Unset | str: + def _parse_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) title = _parse_title(d.pop("title", UNSET)) diff --git a/rootly_sdk/models/start_session_request_platform.py b/rootly_sdk/models/start_session_request_platform.py index 4fc63e8c..ea7fba62 100644 --- a/rootly_sdk/models/start_session_request_platform.py +++ b/rootly_sdk/models/start_session_request_platform.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StartSessionRequestPlatform = Literal["google_meet", "microsoft_teams", "webex", "zoom"] @@ -14,5 +14,5 @@ def check_start_session_request_platform(value: str | None) -> StartSessionReque if value is None: return None if value in START_SESSION_REQUEST_PLATFORM_VALUES: - return cast(StartSessionRequestPlatform, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {START_SESSION_REQUEST_PLATFORM_VALUES!r}") diff --git a/rootly_sdk/models/start_session_response.py b/rootly_sdk/models/start_session_response.py index 91ebd275..daef3d34 100644 --- a/rootly_sdk/models/start_session_response.py +++ b/rootly_sdk/models/start_session_response.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,14 +19,14 @@ class StartSessionResponse: """ Attributes: - data (Union[Unset, StartSessionResponseData]): + data (StartSessionResponseData | Unset): """ - data: Union[Unset, "StartSessionResponseData"] = UNSET + data: StartSessionResponseData | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Unset | dict[str, Any] = UNSET + data: dict[str, Any] | Unset = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +44,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Unset | StartSessionResponseData + data: StartSessionResponseData | Unset 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 c110c2da..50fc32db 100644 --- a/rootly_sdk/models/start_session_response_data.py +++ b/rootly_sdk/models/start_session_response_data.py @@ -1,3 +1,5 @@ +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 4059997d..629cb1f0 100644 --- a/rootly_sdk/models/status.py +++ b/rootly_sdk/models/status.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,8 +20,8 @@ class Status: enabled (bool): created_at (str): updated_at (str): - slug (Union[Unset, str]): - description (Union[None, Unset, str]): + slug (str | Unset): + description (None | str | Unset): """ name: str @@ -27,8 +29,8 @@ class Status: enabled: bool created_at: str updated_at: str - slug: Unset | str = UNSET - description: None | Unset | str = UNSET + slug: str | Unset = UNSET + description: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -83,12 +85,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 56f94dd4..f9644ce1 100644 --- a/rootly_sdk/models/status_list.py +++ b/rootly_sdk/models/status_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class StatusList: """ Attributes: - data (list['StatusListDataItem']): + data (list[StatusListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["StatusListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[StatusListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 6b27a0a1..14605fe4 100644 --- a/rootly_sdk/models/status_list_data_item.py +++ b/rootly_sdk/models/status_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/status_list_data_item_type.py b/rootly_sdk/models/status_list_data_item_type.py index 3f415393..7e398df2 100644 --- a/rootly_sdk/models/status_list_data_item_type.py +++ b/rootly_sdk/models/status_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StatusListDataItemType = Literal["statuses"] @@ -11,5 +11,5 @@ def check_status_list_data_item_type(value: str | None) -> StatusListDataItemTyp if value is None: return None if value in STATUS_LIST_DATA_ITEM_TYPE_VALUES: - return cast(StatusListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/status_page.py b/rootly_sdk/models/status_page.py index c6c47a56..310d9446 100644 --- a/rootly_sdk/models/status_page.py +++ b/rootly_sdk/models/status_page.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -36,76 +38,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 (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 + 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 search results - 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 + 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 instead) Default: False. - 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 + 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 """ title: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -119,109 +121,109 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - public_title: None | Unset | str + public_title: None | str | Unset if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - header_color: None | Unset | str + header_color: None | str | Unset if isinstance(self.header_color, Unset): header_color = UNSET else: header_color = self.header_color - footer_color: None | Unset | str + footer_color: None | str | Unset if isinstance(self.footer_color, Unset): footer_color = UNSET else: footer_color = self.footer_color - allow_search_engine_index: None | Unset | bool + allow_search_engine_index: bool | None | Unset 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: None | Unset | bool + show_uptime: bool | None | Unset if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: Unset | int = UNSET + show_uptime_last_days: int | Unset = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - success_message: None | Unset | str + success_message: None | str | Unset if isinstance(self.success_message, Unset): success_message = UNSET else: success_message = self.success_message - failure_message: None | Unset | str + failure_message: None | str | Unset if isinstance(self.failure_message, Unset): failure_message = UNSET else: failure_message = self.failure_message - authentication_method: Unset | str = UNSET + authentication_method: str | Unset = UNSET if not isinstance(self.authentication_method, Unset): authentication_method = self.authentication_method - authentication_enabled: None | Unset | bool + authentication_enabled: bool | None | Unset if isinstance(self.authentication_enabled, Unset): authentication_enabled = UNSET else: authentication_enabled = self.authentication_enabled - authentication_password: None | Unset | str + authentication_password: None | str | Unset if isinstance(self.authentication_password, Unset): authentication_password = UNSET else: authentication_password = self.authentication_password - saml_idp_sso_service_url: None | Unset | str + saml_idp_sso_service_url: None | str | Unset 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 | Unset | str + saml_idp_slo_service_url: None | str | Unset 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 | Unset | str + saml_idp_cert: None | str | Unset if isinstance(self.saml_idp_cert, Unset): saml_idp_cert = UNSET else: saml_idp_cert = self.saml_idp_cert - saml_idp_cert_fingerprint: None | Unset | str + saml_idp_cert_fingerprint: None | str | Unset 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: Unset | str = UNSET + saml_name_identifier_format: str | Unset = UNSET if not isinstance(self.saml_name_identifier_format, Unset): saml_name_identifier_format = self.saml_name_identifier_format - section_order: None | Unset | list[str] + section_order: list[str] | None | Unset if isinstance(self.section_order, Unset): section_order = UNSET elif isinstance(self.section_order, list): @@ -233,55 +235,55 @@ def to_dict(self) -> dict[str, Any]: else: section_order = self.section_order - website_url: None | Unset | str + website_url: None | str | Unset if isinstance(self.website_url, Unset): website_url = UNSET else: website_url = self.website_url - website_privacy_url: None | Unset | str + website_privacy_url: None | str | Unset if isinstance(self.website_privacy_url, Unset): website_privacy_url = UNSET else: website_privacy_url = self.website_privacy_url - website_support_url: None | Unset | str + website_support_url: None | str | Unset if isinstance(self.website_support_url, Unset): website_support_url = UNSET else: website_support_url = self.website_support_url - ga_tracking_id: None | Unset | str + ga_tracking_id: None | str | Unset if isinstance(self.ga_tracking_id, Unset): ga_tracking_id = UNSET else: ga_tracking_id = self.ga_tracking_id - time_zone: None | Unset | str + time_zone: None | str | Unset if isinstance(self.time_zone, Unset): time_zone = UNSET else: time_zone = self.time_zone - public: None | Unset | bool + public: bool | None | Unset if isinstance(self.public, Unset): public = UNSET else: public = self.public - service_ids: Unset | list[str] = UNSET + service_ids: list[str] | Unset = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: Unset | list[str] = UNSET + functionality_ids: list[str] | Unset = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - external_domain_names: Unset | list[str] = UNSET + external_domain_names: list[str] | Unset = UNSET if not isinstance(self.external_domain_names, Unset): external_domain_names = self.external_domain_names - cname_records: None | Unset | dict[str, Any] + cname_records: dict[str, Any] | None | Unset if isinstance(self.cname_records, Unset): cname_records = UNSET elif isinstance(self.cname_records, StatusPageCnameRecordsType0): @@ -289,7 +291,7 @@ def to_dict(self) -> dict[str, Any]: else: cname_records = self.cname_records - enabled: None | Unset | bool + enabled: bool | None | Unset if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -382,163 +384,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 | Unset | str: + def _parse_public_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_header_color(data: object) -> None | Unset | str: + def _parse_header_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) header_color = _parse_header_color(d.pop("header_color", UNSET)) - def _parse_footer_color(data: object) -> None | Unset | str: + def _parse_footer_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) footer_color = _parse_footer_color(d.pop("footer_color", UNSET)) - def _parse_allow_search_engine_index(data: object) -> None | Unset | bool: + def _parse_allow_search_engine_index(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) allow_search_engine_index = _parse_allow_search_engine_index(d.pop("allow_search_engine_index", UNSET)) - def _parse_show_uptime(data: object) -> None | Unset | bool: + def _parse_show_uptime(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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: Unset | StatusPageShowUptimeLastDays + show_uptime_last_days: StatusPageShowUptimeLastDays | Unset 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 | Unset | str: + def _parse_success_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) success_message = _parse_success_message(d.pop("success_message", UNSET)) - def _parse_failure_message(data: object) -> None | Unset | str: + def _parse_failure_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) failure_message = _parse_failure_message(d.pop("failure_message", UNSET)) _authentication_method = d.pop("authentication_method", UNSET) - authentication_method: Unset | StatusPageAuthenticationMethod + authentication_method: StatusPageAuthenticationMethod | Unset if isinstance(_authentication_method, Unset): authentication_method = UNSET else: authentication_method = check_status_page_authentication_method(_authentication_method) - def _parse_authentication_enabled(data: object) -> None | Unset | bool: + def _parse_authentication_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) authentication_enabled = _parse_authentication_enabled(d.pop("authentication_enabled", UNSET)) - def _parse_authentication_password(data: object) -> None | Unset | str: + def _parse_authentication_password(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) authentication_password = _parse_authentication_password(d.pop("authentication_password", UNSET)) - def _parse_saml_idp_sso_service_url(data: object) -> None | Unset | str: + def _parse_saml_idp_sso_service_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_saml_idp_slo_service_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_saml_idp_cert(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) saml_idp_cert = _parse_saml_idp_cert(d.pop("saml_idp_cert", UNSET)) - def _parse_saml_idp_cert_fingerprint(data: object) -> None | Unset | str: + def _parse_saml_idp_cert_fingerprint(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: Unset | StatusPageSamlNameIdentifierFormat + saml_name_identifier_format: StatusPageSamlNameIdentifierFormat | Unset 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) -> None | Unset | list[StatusPageSectionOrderType0Item]: + def _parse_section_order(data: object) -> list[StatusPageSectionOrderType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -556,63 +558,63 @@ def _parse_section_order(data: object) -> None | Unset | list[StatusPageSectionO section_order_type_0.append(section_order_type_0_item) return section_order_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[StatusPageSectionOrderType0Item], data) + return cast(list[StatusPageSectionOrderType0Item] | None | Unset, data) section_order = _parse_section_order(d.pop("section_order", UNSET)) - def _parse_website_url(data: object) -> None | Unset | str: + def _parse_website_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) website_url = _parse_website_url(d.pop("website_url", UNSET)) - def _parse_website_privacy_url(data: object) -> None | Unset | str: + def _parse_website_privacy_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) website_privacy_url = _parse_website_privacy_url(d.pop("website_privacy_url", UNSET)) - def _parse_website_support_url(data: object) -> None | Unset | str: + def _parse_website_support_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) website_support_url = _parse_website_support_url(d.pop("website_support_url", UNSET)) - def _parse_ga_tracking_id(data: object) -> None | Unset | str: + def _parse_ga_tracking_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) ga_tracking_id = _parse_ga_tracking_id(d.pop("ga_tracking_id", UNSET)) - def _parse_time_zone(data: object) -> None | Unset | str: + def _parse_time_zone(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) - def _parse_public(data: object) -> None | Unset | bool: + def _parse_public(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) public = _parse_public(d.pop("public", UNSET)) @@ -622,7 +624,7 @@ def _parse_public(data: object) -> None | Unset | bool: external_domain_names = cast(list[str], d.pop("external_domain_names", UNSET)) - def _parse_cname_records(data: object) -> Union["StatusPageCnameRecordsType0", None, Unset]: + def _parse_cname_records(data: object) -> None | StatusPageCnameRecordsType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -633,18 +635,18 @@ def _parse_cname_records(data: object) -> Union["StatusPageCnameRecordsType0", N cname_records_type_0 = StatusPageCnameRecordsType0.from_dict(data) return cname_records_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["StatusPageCnameRecordsType0", None, Unset], data) + return cast(None | StatusPageCnameRecordsType0 | Unset, data) cname_records = _parse_cname_records(d.pop("cname_records", UNSET)) - def _parse_enabled(data: object) -> None | Unset | bool: + def _parse_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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 index db5f70ea..bb9df7bc 100644 --- a/rootly_sdk/models/status_page_announcement.py +++ b/rootly_sdk/models/status_page_announcement.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,7 +21,7 @@ class StatusPageAnnouncement: 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 + user_id (int | None | Unset): ID of the user who posted the announcement """ status_page_id: str @@ -28,7 +30,7 @@ class StatusPageAnnouncement: published_at: str created_at: str updated_at: str - user_id: None | Unset | int = UNSET + user_id: int | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - user_id: None | Unset | int + user_id: int | None | Unset if isinstance(self.user_id, Unset): user_id = UNSET else: @@ -82,12 +84,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_user_id(data: object) -> None | Unset | int: + def _parse_user_id(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) user_id = _parse_user_id(d.pop("user_id", UNSET)) diff --git a/rootly_sdk/models/status_page_announcement_list.py b/rootly_sdk/models/status_page_announcement_list.py index bc302093..89e5aad4 100644 --- a/rootly_sdk/models/status_page_announcement_list.py +++ b/rootly_sdk/models/status_page_announcement_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class StatusPageAnnouncementList: """ Attributes: - data (list['StatusPageAnnouncementListDataItem']): + data (list[StatusPageAnnouncementListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["StatusPageAnnouncementListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[StatusPageAnnouncementListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - included.append(included_item) + included.append(included_item) status_page_announcement_list = cls( data=data, diff --git a/rootly_sdk/models/status_page_announcement_list_data_item.py b/rootly_sdk/models/status_page_announcement_list_data_item.py index 49f72003..df476afc 100644 --- a/rootly_sdk/models/status_page_announcement_list_data_item.py +++ b/rootly_sdk/models/status_page_announcement_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ class StatusPageAnnouncementListDataItem: id: str type_: StatusPageAnnouncementListDataItemType - attributes: "StatusPageAnnouncement" + attributes: StatusPageAnnouncement additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: 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 index e0454e03..a9f49ad6 100644 --- a/rootly_sdk/models/status_page_announcement_list_data_item_type.py +++ b/rootly_sdk/models/status_page_announcement_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StatusPageAnnouncementListDataItemType = Literal["status_page_announcements"] @@ -13,7 +13,7 @@ def check_status_page_announcement_list_data_item_type( if value is None: return None if value in STATUS_PAGE_ANNOUNCEMENT_LIST_DATA_ITEM_TYPE_VALUES: - return cast(StatusPageAnnouncementListDataItemType, value) + return 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 index cc87ac39..222bc3a5 100644 --- a/rootly_sdk/models/status_page_announcement_response.py +++ b/rootly_sdk/models/status_page_announcement_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class StatusPageAnnouncementResponse: """ Attributes: data (StatusPageAnnouncementResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "StatusPageAnnouncementResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: StatusPageAnnouncementResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 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: list[JsonapiIncludedResource] | Unset = UNSET + if _included is not UNSET: + included = [] + for included_item_data in _included: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) status_page_announcement_response = cls( data=data, diff --git a/rootly_sdk/models/status_page_announcement_response_data.py b/rootly_sdk/models/status_page_announcement_response_data.py index 07c7fe72..0ff0141f 100644 --- a/rootly_sdk/models/status_page_announcement_response_data.py +++ b/rootly_sdk/models/status_page_announcement_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ class StatusPageAnnouncementResponseData: id: str type_: StatusPageAnnouncementResponseDataType - attributes: "StatusPageAnnouncement" + attributes: StatusPageAnnouncement additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/status_page_announcement_response_data_type.py b/rootly_sdk/models/status_page_announcement_response_data_type.py index b1cc6f2e..30e29114 100644 --- a/rootly_sdk/models/status_page_announcement_response_data_type.py +++ b/rootly_sdk/models/status_page_announcement_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StatusPageAnnouncementResponseDataType = Literal["status_page_announcements"] @@ -13,7 +13,7 @@ def check_status_page_announcement_response_data_type( if value is None: return None if value in STATUS_PAGE_ANNOUNCEMENT_RESPONSE_DATA_TYPE_VALUES: - return cast(StatusPageAnnouncementResponseDataType, value) + return 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_authentication_method.py b/rootly_sdk/models/status_page_authentication_method.py index 1af00c8f..8468b81a 100644 --- a/rootly_sdk/models/status_page_authentication_method.py +++ b/rootly_sdk/models/status_page_authentication_method.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StatusPageAuthenticationMethod = Literal["none", "password", "saml"] @@ -13,5 +13,5 @@ def check_status_page_authentication_method(value: str | None) -> StatusPageAuth if value is None: return None if value in STATUS_PAGE_AUTHENTICATION_METHOD_VALUES: - return cast(StatusPageAuthenticationMethod, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_AUTHENTICATION_METHOD_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 1993df34..372a2510 100644 --- a/rootly_sdk/models/status_page_cname_records_type_0.py +++ b/rootly_sdk/models/status_page_cname_records_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -17,6 +19,7 @@ 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 index e6b86be7..abfa5de4 100644 --- a/rootly_sdk/models/status_page_component.py +++ b/rootly_sdk/models/status_page_component.py @@ -1,10 +1,11 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast from attrs import define as _attrs_define from 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 @@ -20,25 +21,25 @@ class StatusPageComponent: 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 + status_page_component_group_id (None | str | Unset): ID of the component group the component belongs to + name (None | str | Unset): Name of the component (derived from the source for catalog-backed components) + description (None | str | Unset): 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 + source_type (None | str | Unset): Catalog source type backing the component (null for ad-hoc components) + source_id (None | str | Unset): ID of the catalog source backing the component (null for ad-hoc components) + status (StatusPageComponentStatus | Unset): 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 + status_page_component_group_id: None | str | Unset = UNSET + name: None | str | Unset = UNSET + description: None | str | Unset = UNSET + source_type: None | str | Unset = UNSET + source_id: None | str | Unset = UNSET + status: StatusPageComponentStatus | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,37 +51,37 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at.isoformat() - status_page_component_group_id: None | Unset | str + status_page_component_group_id: None | str | Unset 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 + name: None | str | Unset if isinstance(self.name, Unset): name = UNSET else: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - source_type: None | Unset | str + source_type: None | str | Unset if isinstance(self.source_type, Unset): source_type = UNSET else: source_type = self.source_type - source_id: None | Unset | str + source_id: None | str | Unset if isinstance(self.source_id, Unset): source_id = UNSET else: source_id = self.source_id - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status @@ -116,59 +117,59 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position") - created_at = isoparse(d.pop("created_at")) + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) - updated_at = isoparse(d.pop("updated_at")) + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) - def _parse_status_page_component_group_id(data: object) -> None | Unset | str: + def _parse_status_page_component_group_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: + def _parse_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) name = _parse_name(d.pop("name", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_source_type(data: object) -> None | Unset | str: + def _parse_source_type(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) source_type = _parse_source_type(d.pop("source_type", UNSET)) - def _parse_source_id(data: object) -> None | Unset | str: + def _parse_source_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) source_id = _parse_source_id(d.pop("source_id", UNSET)) _status = d.pop("status", UNSET) - status: Unset | StatusPageComponentStatus + status: StatusPageComponentStatus | Unset if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/status_page_component_group.py b/rootly_sdk/models/status_page_component_group.py index f1847065..065867cc 100644 --- a/rootly_sdk/models/status_page_component_group.py +++ b/rootly_sdk/models/status_page_component_group.py @@ -1,10 +1,11 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field -from dateutil.parser import isoparse from ..types import UNSET, Unset @@ -20,8 +21,8 @@ class StatusPageComponentGroup: 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 + description (None | str | Unset): Description of the component group + collapsed_by_default (bool | Unset): Whether the group renders collapsed on the public page """ status_page_id: str @@ -29,8 +30,8 @@ class StatusPageComponentGroup: position: int created_at: datetime.datetime updated_at: datetime.datetime - description: None | Unset | str = UNSET - collapsed_by_default: Unset | bool = UNSET + description: None | str | Unset = UNSET + collapsed_by_default: bool | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +45,7 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at.isoformat() - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -79,16 +80,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position") - created_at = isoparse(d.pop("created_at")) + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) - updated_at = isoparse(d.pop("updated_at")) + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/status_page_component_group_list.py b/rootly_sdk/models/status_page_component_group_list.py index 75c0e109..a23953d7 100644 --- a/rootly_sdk/models/status_page_component_group_list.py +++ b/rootly_sdk/models/status_page_component_group_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class StatusPageComponentGroupList: """ Attributes: - data (list['StatusPageComponentGroupListDataItem']): + data (list[StatusPageComponentGroupListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["StatusPageComponentGroupListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[StatusPageComponentGroupListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - included.append(included_item) + included.append(included_item) status_page_component_group_list = cls( data=data, 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 index b1dc0e4a..18054189 100644 --- a/rootly_sdk/models/status_page_component_group_list_data_item.py +++ b/rootly_sdk/models/status_page_component_group_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ class StatusPageComponentGroupListDataItem: id: str type_: StatusPageComponentGroupListDataItemType - attributes: "StatusPageComponentGroup" + attributes: StatusPageComponentGroup additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: 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 index 3825d6e3..7abac22e 100644 --- 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 @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StatusPageComponentGroupListDataItemType = Literal["status_page_component_groups"] @@ -13,7 +13,7 @@ def check_status_page_component_group_list_data_item_type( if value is None: return None if value in STATUS_PAGE_COMPONENT_GROUP_LIST_DATA_ITEM_TYPE_VALUES: - return cast(StatusPageComponentGroupListDataItemType, value) + return 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 index 1a0db82b..50de75af 100644 --- a/rootly_sdk/models/status_page_component_group_response.py +++ b/rootly_sdk/models/status_page_component_group_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class StatusPageComponentGroupResponse: """ Attributes: data (StatusPageComponentGroupResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "StatusPageComponentGroupResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: StatusPageComponentGroupResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 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: list[JsonapiIncludedResource] | Unset = UNSET + if _included is not UNSET: + included = [] + for included_item_data in _included: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) status_page_component_group_response = cls( data=data, diff --git a/rootly_sdk/models/status_page_component_group_response_data.py b/rootly_sdk/models/status_page_component_group_response_data.py index b7a04aef..bdb0a70a 100644 --- a/rootly_sdk/models/status_page_component_group_response_data.py +++ b/rootly_sdk/models/status_page_component_group_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ class StatusPageComponentGroupResponseData: id: str type_: StatusPageComponentGroupResponseDataType - attributes: "StatusPageComponentGroup" + attributes: StatusPageComponentGroup additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: 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 index 20f6e77a..b1586647 100644 --- a/rootly_sdk/models/status_page_component_group_response_data_type.py +++ b/rootly_sdk/models/status_page_component_group_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StatusPageComponentGroupResponseDataType = Literal["status_page_component_groups"] @@ -13,7 +13,7 @@ def check_status_page_component_group_response_data_type( if value is None: return None if value in STATUS_PAGE_COMPONENT_GROUP_RESPONSE_DATA_TYPE_VALUES: - return cast(StatusPageComponentGroupResponseDataType, value) + return 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 index 7104d30e..5a509ec4 100644 --- a/rootly_sdk/models/status_page_component_list.py +++ b/rootly_sdk/models/status_page_component_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class StatusPageComponentList: """ Attributes: - data (list['StatusPageComponentListDataItem']): + data (list[StatusPageComponentListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["StatusPageComponentListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[StatusPageComponentListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - included.append(included_item) + included.append(included_item) status_page_component_list = cls( data=data, diff --git a/rootly_sdk/models/status_page_component_list_data_item.py b/rootly_sdk/models/status_page_component_list_data_item.py index 40cc9b1b..abfc1d68 100644 --- a/rootly_sdk/models/status_page_component_list_data_item.py +++ b/rootly_sdk/models/status_page_component_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ class StatusPageComponentListDataItem: id: str type_: StatusPageComponentListDataItemType - attributes: "StatusPageComponent" + attributes: StatusPageComponent additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: 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 index a5c205cd..91150d79 100644 --- a/rootly_sdk/models/status_page_component_list_data_item_type.py +++ b/rootly_sdk/models/status_page_component_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StatusPageComponentListDataItemType = Literal["status_page_components"] @@ -11,5 +11,5 @@ def check_status_page_component_list_data_item_type(value: str | None) -> Status if value is None: return None if value in STATUS_PAGE_COMPONENT_LIST_DATA_ITEM_TYPE_VALUES: - return cast(StatusPageComponentListDataItemType, value) + return 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 index 5330bd92..d5111592 100644 --- a/rootly_sdk/models/status_page_component_response.py +++ b/rootly_sdk/models/status_page_component_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class StatusPageComponentResponse: """ Attributes: data (StatusPageComponentResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "StatusPageComponentResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: StatusPageComponentResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 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: list[JsonapiIncludedResource] | Unset = UNSET + if _included is not UNSET: + included = [] + for included_item_data in _included: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) status_page_component_response = cls( data=data, diff --git a/rootly_sdk/models/status_page_component_response_data.py b/rootly_sdk/models/status_page_component_response_data.py index 5226ae07..1aa27959 100644 --- a/rootly_sdk/models/status_page_component_response_data.py +++ b/rootly_sdk/models/status_page_component_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ class StatusPageComponentResponseData: id: str type_: StatusPageComponentResponseDataType - attributes: "StatusPageComponent" + attributes: StatusPageComponent additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/status_page_component_response_data_type.py b/rootly_sdk/models/status_page_component_response_data_type.py index 53cc391c..b1d262cd 100644 --- a/rootly_sdk/models/status_page_component_response_data_type.py +++ b/rootly_sdk/models/status_page_component_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StatusPageComponentResponseDataType = Literal["status_page_components"] @@ -11,5 +11,5 @@ def check_status_page_component_response_data_type(value: str | None) -> StatusP if value is None: return None if value in STATUS_PAGE_COMPONENT_RESPONSE_DATA_TYPE_VALUES: - return cast(StatusPageComponentResponseDataType, value) + return 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 index 44bf5402..13365353 100644 --- a/rootly_sdk/models/status_page_component_status.py +++ b/rootly_sdk/models/status_page_component_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StatusPageComponentStatus = Literal[ "degraded_performance", "impacted", "maintenance", "major_outage", "operational", "partial_outage" @@ -18,5 +18,5 @@ def check_status_page_component_status(value: str | None) -> StatusPageComponent if value is None: return None if value in STATUS_PAGE_COMPONENT_STATUS_VALUES: - return cast(StatusPageComponentStatus, value) + return 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 7fa0f7d9..04af8849 100644 --- a/rootly_sdk/models/status_page_list.py +++ b/rootly_sdk/models/status_page_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class StatusPageList: """ Attributes: - data (list['StatusPageListDataItem']): + data (list[StatusPageListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["StatusPageListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[StatusPageListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 e1f97706..997d37f3 100644 --- a/rootly_sdk/models/status_page_list_data_item.py +++ b/rootly_sdk/models/status_page_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/status_page_list_data_item_type.py b/rootly_sdk/models/status_page_list_data_item_type.py index aede07ce..86f46d33 100644 --- a/rootly_sdk/models/status_page_list_data_item_type.py +++ b/rootly_sdk/models/status_page_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StatusPageListDataItemType = Literal["status_pages"] @@ -11,5 +11,5 @@ def check_status_page_list_data_item_type(value: str | None) -> StatusPageListDa if value is None: return None if value in STATUS_PAGE_LIST_DATA_ITEM_TYPE_VALUES: - return cast(StatusPageListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/status_page_response.py b/rootly_sdk/models/status_page_response.py index 62760d31..53c01998 100644 --- a/rootly_sdk/models/status_page_response.py +++ b/rootly_sdk/models/status_page_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class StatusPageResponse: """ Attributes: data (StatusPageResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "StatusPageResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: StatusPageResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 84a57c52..6c86f9e6 100644 --- a/rootly_sdk/models/status_page_response_data.py +++ b/rootly_sdk/models/status_page_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/status_page_response_data_type.py b/rootly_sdk/models/status_page_response_data_type.py index d594d6c8..49c8a35e 100644 --- a/rootly_sdk/models/status_page_response_data_type.py +++ b/rootly_sdk/models/status_page_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StatusPageResponseDataType = Literal["status_pages"] @@ -11,5 +11,5 @@ def check_status_page_response_data_type(value: str | None) -> StatusPageRespons if value is None: return None if value in STATUS_PAGE_RESPONSE_DATA_TYPE_VALUES: - return cast(StatusPageResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/status_page_saml_name_identifier_format.py b/rootly_sdk/models/status_page_saml_name_identifier_format.py index fc7a8522..64af263c 100644 --- a/rootly_sdk/models/status_page_saml_name_identifier_format.py +++ b/rootly_sdk/models/status_page_saml_name_identifier_format.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StatusPageSamlNameIdentifierFormat = Literal[ "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", @@ -19,5 +19,5 @@ def check_status_page_saml_name_identifier_format(value: str | None) -> StatusPa if value is None: return None if value in STATUS_PAGE_SAML_NAME_IDENTIFIER_FORMAT_VALUES: - return cast(StatusPageSamlNameIdentifierFormat, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_SAML_NAME_IDENTIFIER_FORMAT_VALUES!r}") diff --git a/rootly_sdk/models/status_page_section_order_type_0_item.py b/rootly_sdk/models/status_page_section_order_type_0_item.py index c542f520..0ecc2e28 100644 --- a/rootly_sdk/models/status_page_section_order_type_0_item.py +++ b/rootly_sdk/models/status_page_section_order_type_0_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StatusPageSectionOrderType0Item = Literal["incidents", "maintenance", "system_status"] @@ -13,5 +13,5 @@ def check_status_page_section_order_type_0_item(value: str | None) -> StatusPage if value is None: return None if value in STATUS_PAGE_SECTION_ORDER_TYPE_0_ITEM_VALUES: - return cast(StatusPageSectionOrderType0Item, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_SECTION_ORDER_TYPE_0_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/status_page_show_uptime_last_days.py b/rootly_sdk/models/status_page_show_uptime_last_days.py index 15d42225..c6c92c8a 100644 --- a/rootly_sdk/models/status_page_show_uptime_last_days.py +++ b/rootly_sdk/models/status_page_show_uptime_last_days.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StatusPageShowUptimeLastDays = Literal[30, 60, 90] @@ -11,5 +11,5 @@ def check_status_page_show_uptime_last_days(value: int) -> StatusPageShowUptimeLastDays: if value in STATUS_PAGE_SHOW_UPTIME_LAST_DAYS_VALUES: - return cast(StatusPageShowUptimeLastDays, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_SHOW_UPTIME_LAST_DAYS_VALUES!r}") diff --git a/rootly_sdk/models/status_page_team.py b/rootly_sdk/models/status_page_team.py new file mode 100644 index 00000000..156bdcf1 --- /dev/null +++ b/rootly_sdk/models/status_page_team.py @@ -0,0 +1,100 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import Any, TypeVar +from uuid import UUID + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +from ..models.status_page_team_permission_level import ( + StatusPageTeamPermissionLevel, + check_status_page_team_permission_level, +) + +T = TypeVar("T", bound="StatusPageTeam") + + +@_attrs_define +class StatusPageTeam: + """ + Attributes: + status_page_id (str): ID of the status page the team is assigned to + group_id (UUID): ID of the team granted access to the status page + permission_level (StatusPageTeamPermissionLevel): Access level granted to members of the team + created_at (datetime.datetime): Date of creation + updated_at (datetime.datetime): Date of last update + """ + + status_page_id: str + group_id: UUID + permission_level: StatusPageTeamPermissionLevel + created_at: datetime.datetime + updated_at: datetime.datetime + 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 + + group_id = str(self.group_id) + + permission_level: str = self.permission_level + + created_at = self.created_at.isoformat() + + updated_at = self.updated_at.isoformat() + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "status_page_id": status_page_id, + "group_id": group_id, + "permission_level": permission_level, + "created_at": created_at, + "updated_at": updated_at, + } + ) + + 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") + + group_id = UUID(d.pop("group_id")) + + permission_level = check_status_page_team_permission_level(d.pop("permission_level")) + + created_at = datetime.datetime.fromisoformat(d.pop("created_at")) + + updated_at = datetime.datetime.fromisoformat(d.pop("updated_at")) + + status_page_team = cls( + status_page_id=status_page_id, + group_id=group_id, + permission_level=permission_level, + created_at=created_at, + updated_at=updated_at, + ) + + status_page_team.additional_properties = d + return status_page_team + + @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_team_list.py b/rootly_sdk/models/status_page_team_list.py new file mode 100644 index 00000000..db1c5ac7 --- /dev/null +++ b/rootly_sdk/models/status_page_team_list.py @@ -0,0 +1,120 @@ +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 ..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_team_list_data_item import StatusPageTeamListDataItem + + +T = TypeVar("T", bound="StatusPageTeamList") + + +@_attrs_define +class StatusPageTeamList: + """ + Attributes: + data (list[StatusPageTeamListDataItem]): + links (Links): + meta (Meta): + included (list[JsonapiIncludedResource] | Unset): + """ + + data: list[StatusPageTeamListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = 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: list[dict[str, Any]] | Unset = 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_team_list_data_item import StatusPageTeamListDataItem + + d = dict(src_dict) + data = [] + _data = d.pop("data") + for data_item_data in _data: + data_item = StatusPageTeamListDataItem.from_dict(data_item_data) + + data.append(data_item) + + links = Links.from_dict(d.pop("links")) + + meta = Meta.from_dict(d.pop("meta")) + + _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) + + included.append(included_item) + + status_page_team_list = cls( + data=data, + links=links, + meta=meta, + included=included, + ) + + status_page_team_list.additional_properties = d + return status_page_team_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_team_list_data_item.py b/rootly_sdk/models/status_page_team_list_data_item.py new file mode 100644 index 00000000..78e9e9ec --- /dev/null +++ b/rootly_sdk/models/status_page_team_list_data_item.py @@ -0,0 +1,88 @@ +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.status_page_team_list_data_item_type import ( + StatusPageTeamListDataItemType, + check_status_page_team_list_data_item_type, +) + +if TYPE_CHECKING: + from ..models.status_page_team import StatusPageTeam + + +T = TypeVar("T", bound="StatusPageTeamListDataItem") + + +@_attrs_define +class StatusPageTeamListDataItem: + """ + Attributes: + id (str): Unique ID of the status page team assignment + type_ (StatusPageTeamListDataItemType): + attributes (StatusPageTeam): + """ + + id: str + type_: StatusPageTeamListDataItemType + attributes: StatusPageTeam + 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_team import StatusPageTeam + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_status_page_team_list_data_item_type(d.pop("type")) + + attributes = StatusPageTeam.from_dict(d.pop("attributes")) + + status_page_team_list_data_item = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + status_page_team_list_data_item.additional_properties = d + return status_page_team_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_team_list_data_item_type.py b/rootly_sdk/models/status_page_team_list_data_item_type.py new file mode 100644 index 00000000..c0e2be03 --- /dev/null +++ b/rootly_sdk/models/status_page_team_list_data_item_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +StatusPageTeamListDataItemType = Literal["status_page_groups"] + +STATUS_PAGE_TEAM_LIST_DATA_ITEM_TYPE_VALUES: set[StatusPageTeamListDataItemType] = { + "status_page_groups", +} + + +def check_status_page_team_list_data_item_type(value: str | None) -> StatusPageTeamListDataItemType | None: + if value is None: + return None + if value in STATUS_PAGE_TEAM_LIST_DATA_ITEM_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_TEAM_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/status_page_team_permission_level.py b/rootly_sdk/models/status_page_team_permission_level.py new file mode 100644 index 00000000..4255d301 --- /dev/null +++ b/rootly_sdk/models/status_page_team_permission_level.py @@ -0,0 +1,16 @@ +from typing import Literal + +StatusPageTeamPermissionLevel = Literal["edit_and_publish", "publish_only"] + +STATUS_PAGE_TEAM_PERMISSION_LEVEL_VALUES: set[StatusPageTeamPermissionLevel] = { + "edit_and_publish", + "publish_only", +} + + +def check_status_page_team_permission_level(value: str | None) -> StatusPageTeamPermissionLevel | None: + if value is None: + return None + if value in STATUS_PAGE_TEAM_PERMISSION_LEVEL_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_TEAM_PERMISSION_LEVEL_VALUES!r}") diff --git a/rootly_sdk/models/status_page_team_response.py b/rootly_sdk/models/status_page_team_response.py new file mode 100644 index 00000000..c953ce7c --- /dev/null +++ b/rootly_sdk/models/status_page_team_response.py @@ -0,0 +1,92 @@ +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 ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.jsonapi_included_resource import JsonapiIncludedResource + from ..models.status_page_team_response_data import StatusPageTeamResponseData + + +T = TypeVar("T", bound="StatusPageTeamResponse") + + +@_attrs_define +class StatusPageTeamResponse: + """ + Attributes: + data (StatusPageTeamResponseData): + included (list[JsonapiIncludedResource] | Unset): + """ + + data: StatusPageTeamResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + included: list[dict[str, Any]] | Unset = 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_team_response_data import StatusPageTeamResponseData + + d = dict(src_dict) + data = StatusPageTeamResponseData.from_dict(d.pop("data")) + + _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) + + included.append(included_item) + + status_page_team_response = cls( + data=data, + included=included, + ) + + status_page_team_response.additional_properties = d + return status_page_team_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_team_response_data.py b/rootly_sdk/models/status_page_team_response_data.py new file mode 100644 index 00000000..7cbeb856 --- /dev/null +++ b/rootly_sdk/models/status_page_team_response_data.py @@ -0,0 +1,88 @@ +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.status_page_team_response_data_type import ( + StatusPageTeamResponseDataType, + check_status_page_team_response_data_type, +) + +if TYPE_CHECKING: + from ..models.status_page_team import StatusPageTeam + + +T = TypeVar("T", bound="StatusPageTeamResponseData") + + +@_attrs_define +class StatusPageTeamResponseData: + """ + Attributes: + id (str): Unique ID of the status page team assignment + type_ (StatusPageTeamResponseDataType): + attributes (StatusPageTeam): + """ + + id: str + type_: StatusPageTeamResponseDataType + attributes: StatusPageTeam + 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_team import StatusPageTeam + + d = dict(src_dict) + id = d.pop("id") + + type_ = check_status_page_team_response_data_type(d.pop("type")) + + attributes = StatusPageTeam.from_dict(d.pop("attributes")) + + status_page_team_response_data = cls( + id=id, + type_=type_, + attributes=attributes, + ) + + status_page_team_response_data.additional_properties = d + return status_page_team_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_team_response_data_type.py b/rootly_sdk/models/status_page_team_response_data_type.py new file mode 100644 index 00000000..93798f56 --- /dev/null +++ b/rootly_sdk/models/status_page_team_response_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +StatusPageTeamResponseDataType = Literal["status_page_groups"] + +STATUS_PAGE_TEAM_RESPONSE_DATA_TYPE_VALUES: set[StatusPageTeamResponseDataType] = { + "status_page_groups", +} + + +def check_status_page_team_response_data_type(value: str | None) -> StatusPageTeamResponseDataType | None: + if value is None: + return None + if value in STATUS_PAGE_TEAM_RESPONSE_DATA_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_TEAM_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/status_page_template.py b/rootly_sdk/models/status_page_template.py index 993227c1..082b8b2b 100644 --- a/rootly_sdk/models/status_page_template.py +++ b/rootly_sdk/models/status_page_template.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -19,12 +21,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 (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 + 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 """ status_page_id: str @@ -32,12 +34,12 @@ class StatusPageTemplate: body: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,29 +53,29 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - update_title: None | Unset | str + update_title: None | str | Unset if isinstance(self.update_title, Unset): update_title = UNSET else: update_title = self.update_title - update_status: None | Unset | str + update_status: None | str | Unset if isinstance(self.update_status, Unset): update_status = UNSET else: update_status = self.update_status - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind - should_notify_subscribers: None | Unset | bool + should_notify_subscribers: bool | None | Unset if isinstance(self.should_notify_subscribers, Unset): should_notify_subscribers = UNSET else: should_notify_subscribers = self.should_notify_subscribers - enabled: None | Unset | bool + enabled: bool | None | Unset if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -120,46 +122,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 | Unset | str: + def _parse_update_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) update_title = _parse_update_title(d.pop("update_title", UNSET)) - def _parse_update_status(data: object) -> None | Unset | str: + def _parse_update_status(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) update_status = _parse_update_status(d.pop("update_status", UNSET)) _kind = d.pop("kind", UNSET) - kind: Unset | StatusPageTemplateKind + kind: StatusPageTemplateKind | Unset if isinstance(_kind, Unset): kind = UNSET else: kind = check_status_page_template_kind(_kind) - def _parse_should_notify_subscribers(data: object) -> None | Unset | bool: + def _parse_should_notify_subscribers(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) should_notify_subscribers = _parse_should_notify_subscribers(d.pop("should_notify_subscribers", UNSET)) - def _parse_enabled(data: object) -> None | Unset | bool: + def _parse_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/status_page_template_kind.py b/rootly_sdk/models/status_page_template_kind.py index f0fa4c78..12520061 100644 --- a/rootly_sdk/models/status_page_template_kind.py +++ b/rootly_sdk/models/status_page_template_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StatusPageTemplateKind = Literal["normal", "scheduled"] @@ -12,5 +12,5 @@ def check_status_page_template_kind(value: str | None) -> StatusPageTemplateKind if value is None: return None if value in STATUS_PAGE_TEMPLATE_KIND_VALUES: - return cast(StatusPageTemplateKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_TEMPLATE_KIND_VALUES!r}") diff --git a/rootly_sdk/models/status_page_template_list.py b/rootly_sdk/models/status_page_template_list.py index e99a7e7a..03fa8984 100644 --- a/rootly_sdk/models/status_page_template_list.py +++ b/rootly_sdk/models/status_page_template_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class StatusPageTemplateList: """ Attributes: - data (list['StatusPageTemplateListDataItem']): + data (list[StatusPageTemplateListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["StatusPageTemplateListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[StatusPageTemplateListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 9a0b4d49..ae1a0142 100644 --- a/rootly_sdk/models/status_page_template_list_data_item.py +++ b/rootly_sdk/models/status_page_template_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/status_page_template_list_data_item_type.py b/rootly_sdk/models/status_page_template_list_data_item_type.py index dcecf99a..2cbc36f6 100644 --- a/rootly_sdk/models/status_page_template_list_data_item_type.py +++ b/rootly_sdk/models/status_page_template_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StatusPageTemplateListDataItemType = Literal["status_page_templates"] @@ -11,5 +11,5 @@ def check_status_page_template_list_data_item_type(value: str | None) -> StatusP if value is None: return None if value in STATUS_PAGE_TEMPLATE_LIST_DATA_ITEM_TYPE_VALUES: - return cast(StatusPageTemplateListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_TEMPLATE_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/status_page_template_response.py b/rootly_sdk/models/status_page_template_response.py index 70f7dfc2..e394d9cd 100644 --- a/rootly_sdk/models/status_page_template_response.py +++ b/rootly_sdk/models/status_page_template_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class StatusPageTemplateResponse: """ Attributes: data (StatusPageTemplateResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "StatusPageTemplateResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: StatusPageTemplateResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 b79e157e..aa4d8b7a 100644 --- a/rootly_sdk/models/status_page_template_response_data.py +++ b/rootly_sdk/models/status_page_template_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/status_page_template_response_data_type.py b/rootly_sdk/models/status_page_template_response_data_type.py index 2f7be541..779bc880 100644 --- a/rootly_sdk/models/status_page_template_response_data_type.py +++ b/rootly_sdk/models/status_page_template_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StatusPageTemplateResponseDataType = Literal["status_page_templates"] @@ -11,5 +11,5 @@ def check_status_page_template_response_data_type(value: str | None) -> StatusPa if value is None: return None if value in STATUS_PAGE_TEMPLATE_RESPONSE_DATA_TYPE_VALUES: - return cast(StatusPageTemplateResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_PAGE_TEMPLATE_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/status_response.py b/rootly_sdk/models/status_response.py index cf5eaa4a..f9a7aeed 100644 --- a/rootly_sdk/models/status_response.py +++ b/rootly_sdk/models/status_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class StatusResponse: """ Attributes: data (StatusResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "StatusResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: StatusResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 973536c0..d5ff8e77 100644 --- a/rootly_sdk/models/status_response_data.py +++ b/rootly_sdk/models/status_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/status_response_data_type.py b/rootly_sdk/models/status_response_data_type.py index 6aa71148..c74e6ab7 100644 --- a/rootly_sdk/models/status_response_data_type.py +++ b/rootly_sdk/models/status_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal StatusResponseDataType = Literal["statuses"] @@ -11,5 +11,5 @@ def check_status_response_data_type(value: str | None) -> StatusResponseDataType if value is None: return None if value in STATUS_RESPONSE_DATA_TYPE_VALUES: - return cast(StatusResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {STATUS_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/sub_status.py b/rootly_sdk/models/sub_status.py index 890672f8..6018ef9b 100644 --- a/rootly_sdk/models/sub_status.py +++ b/rootly_sdk/models/sub_status.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,18 +20,18 @@ class SubStatus: parent_status (SubStatusParentStatus): created_at (str): updated_at (str): - slug (Union[Unset, str]): - description (Union[None, Unset, str]): - position (Union[None, Unset, int]): + slug (str | Unset): + description (None | str | Unset): + position (int | None | Unset): """ name: str parent_status: SubStatusParentStatus created_at: str updated_at: str - slug: Unset | str = UNSET - description: None | Unset | str = UNSET - position: None | Unset | int = UNSET + slug: str | Unset = UNSET + description: None | str | Unset = UNSET + position: int | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -43,13 +45,13 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -87,21 +89,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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 e9eaec8c..cff93a56 100644 --- a/rootly_sdk/models/sub_status_list.py +++ b/rootly_sdk/models/sub_status_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class SubStatusList: """ Attributes: - data (list['SubStatusListDataItem']): + data (list[SubStatusListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["SubStatusListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[SubStatusListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 364a7b4e..2fa6ad7e 100644 --- a/rootly_sdk/models/sub_status_list_data_item.py +++ b/rootly_sdk/models/sub_status_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/sub_status_list_data_item_type.py b/rootly_sdk/models/sub_status_list_data_item_type.py index ab453a82..c3f89e21 100644 --- a/rootly_sdk/models/sub_status_list_data_item_type.py +++ b/rootly_sdk/models/sub_status_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SubStatusListDataItemType = Literal["sub_statuses"] @@ -11,5 +11,5 @@ def check_sub_status_list_data_item_type(value: str | None) -> SubStatusListData if value is None: return None if value in SUB_STATUS_LIST_DATA_ITEM_TYPE_VALUES: - return cast(SubStatusListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SUB_STATUS_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/sub_status_parent_status.py b/rootly_sdk/models/sub_status_parent_status.py index 361c463e..9cd09c68 100644 --- a/rootly_sdk/models/sub_status_parent_status.py +++ b/rootly_sdk/models/sub_status_parent_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SubStatusParentStatus = Literal[ "cancelled", @@ -31,5 +31,5 @@ def check_sub_status_parent_status(value: str | None) -> SubStatusParentStatus | if value is None: return None if value in SUB_STATUS_PARENT_STATUS_VALUES: - return cast(SubStatusParentStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SUB_STATUS_PARENT_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/sub_status_response.py b/rootly_sdk/models/sub_status_response.py index 06ad1b35..a7ba1125 100644 --- a/rootly_sdk/models/sub_status_response.py +++ b/rootly_sdk/models/sub_status_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class SubStatusResponse: """ Attributes: data (SubStatusResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "SubStatusResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: SubStatusResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 7766e6a6..065a8226 100644 --- a/rootly_sdk/models/sub_status_response_data.py +++ b/rootly_sdk/models/sub_status_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/sub_status_response_data_type.py b/rootly_sdk/models/sub_status_response_data_type.py index 5273cc51..af437c24 100644 --- a/rootly_sdk/models/sub_status_response_data_type.py +++ b/rootly_sdk/models/sub_status_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal SubStatusResponseDataType = Literal["sub_statuses"] @@ -11,5 +11,5 @@ def check_sub_status_response_data_type(value: str | None) -> SubStatusResponseD if value is None: return None if value in SUB_STATUS_RESPONSE_DATA_TYPE_VALUES: - return cast(SubStatusResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {SUB_STATUS_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/team.py b/rootly_sdk/models/team.py index 84566f7a..70a2d8ce 100644 --- a/rootly_sdk/models/team.py +++ b/rootly_sdk/models/team.py @@ -1,11 +1,14 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field from ..models.team_auto_add_members_scope import TeamAutoAddMembersScope, check_team_auto_add_members_scope from ..models.team_managed_by import TeamManagedBy, check_team_managed_by +from ..models.team_schedule_override_policy import TeamScheduleOverridePolicy, check_team_schedule_override_policy from ..types import UNSET, Unset if TYPE_CHECKING: @@ -26,80 +29,83 @@ class Team: name (str): The name of the team created_at (str): Date of creation updated_at (str): Date of last update - 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: + 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 + public_description (None | str | Unset): The status page 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: :namespace/:kind/:entity_name - 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 + 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 + scim_group_id (None | str | Unset): The SCIM group id linked 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 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, 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. + 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`. + schedule_override_policy (TeamScheduleOverridePolicy | Unset): Who can create and update overrides for schedules + owned by this team: `everyone` in the organization, only team `members`, or only team `admins`. Users still need + override permission from their on-call role. Only available when the team-level schedule override policy feature + is enabled for the organization. Requests that set it while that feature is disabled are rejected. + properties (list[TeamPropertiesType0Item] | None | Unset): Array of property values for this team. """ name: str created_at: str updated_at: str - 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 + slug: str | Unset = UNSET + managed_by: TeamManagedBy | 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 + 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 + scim_group_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 + schedule_override_policy: TeamScheduleOverridePolicy | Unset = UNSET + properties: list[TeamPropertiesType0Item] | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -114,23 +120,23 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - managed_by: Unset | str = UNSET + managed_by: str | Unset = UNSET if not isinstance(self.managed_by, Unset): managed_by = self.managed_by - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -139,73 +145,79 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | Unset | str + backstage_id: None | str | Unset if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | Unset | str + pagerduty_id: None | str | Unset if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - pagerduty_service_id: None | Unset | str + pagerduty_service_id: None | str | Unset if isinstance(self.pagerduty_service_id, Unset): pagerduty_service_id = UNSET else: pagerduty_service_id = self.pagerduty_service_id - opsgenie_id: None | Unset | str + opsgenie_id: None | str | Unset if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - victor_ops_id: None | Unset | str + victor_ops_id: None | str | Unset if isinstance(self.victor_ops_id, Unset): victor_ops_id = UNSET else: victor_ops_id = self.victor_ops_id - pagertree_id: None | Unset | str + pagertree_id: None | str | Unset if isinstance(self.pagertree_id, Unset): pagertree_id = UNSET else: pagertree_id = self.pagertree_id - cortex_id: None | Unset | str + cortex_id: None | str | Unset if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | Unset | str + service_now_ci_sys_id: None | str | Unset 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: None | Unset | list[int] + scim_group_id: None | str | Unset + if isinstance(self.scim_group_id, Unset): + scim_group_id = UNSET + else: + scim_group_id = self.scim_group_id + + user_ids: list[int] | None | Unset if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -214,7 +226,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - admin_ids: None | Unset | list[int] + admin_ids: list[int] | None | Unset if isinstance(self.admin_ids, Unset): admin_ids = UNSET elif isinstance(self.admin_ids, list): @@ -223,25 +235,25 @@ def to_dict(self) -> dict[str, Any]: else: admin_ids = self.admin_ids - alerts_email_enabled: None | Unset | bool + alerts_email_enabled: bool | None | Unset if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alerts_email_address: None | Unset | str + alerts_email_address: None | str | Unset if isinstance(self.alerts_email_address, Unset): alerts_email_address = UNSET else: alerts_email_address = self.alerts_email_address - alert_urgency_id: None | Unset | str + alert_urgency_id: None | str | Unset if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - slack_channels: None | Unset | list[dict[str, Any]] + slack_channels: list[dict[str, Any]] | None | Unset if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -253,7 +265,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: None | Unset | list[dict[str, Any]] + slack_aliases: list[dict[str, Any]] | None | Unset if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -265,13 +277,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: None | Unset | bool + alert_broadcast_enabled: bool | None | Unset if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: None | Unset | dict[str, Any] + alert_broadcast_channel: dict[str, Any] | None | Unset if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, TeamAlertBroadcastChannelType0): @@ -279,13 +291,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: None | Unset | bool + incident_broadcast_enabled: bool | None | Unset if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: None | Unset | dict[str, Any] + incident_broadcast_channel: dict[str, Any] | None | Unset if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, TeamIncidentBroadcastChannelType0): @@ -293,17 +305,21 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - auto_add_members_when_attached: None | Unset | bool + auto_add_members_when_attached: bool | None | Unset 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: Unset | str = UNSET + auto_add_members_scope: str | Unset = UNSET if not isinstance(self.auto_add_members_scope, Unset): auto_add_members_scope = self.auto_add_members_scope - properties: None | Unset | list[dict[str, Any]] + schedule_override_policy: str | Unset = UNSET + if not isinstance(self.schedule_override_policy, Unset): + schedule_override_policy = self.schedule_override_policy + + properties: list[dict[str, Any]] | None | Unset if isinstance(self.properties, Unset): properties = UNSET elif isinstance(self.properties, list): @@ -356,6 +372,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["cortex_id"] = cortex_id if service_now_ci_sys_id is not UNSET: field_dict["service_now_ci_sys_id"] = service_now_ci_sys_id + if scim_group_id is not UNSET: + field_dict["scim_group_id"] = scim_group_id if user_ids is not UNSET: field_dict["user_ids"] = user_ids if admin_ids is not UNSET: @@ -382,6 +400,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["auto_add_members_when_attached"] = auto_add_members_when_attached if auto_add_members_scope is not UNSET: field_dict["auto_add_members_scope"] = auto_add_members_scope + if schedule_override_policy is not UNSET: + field_dict["schedule_override_policy"] = schedule_override_policy if properties is not UNSET: field_dict["properties"] = properties @@ -405,31 +425,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: Unset | TeamManagedBy + managed_by: TeamManagedBy | Unset if isinstance(_managed_by, Unset): managed_by = UNSET else: managed_by = check_team_managed_by(_managed_by) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -440,112 +460,121 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | Unset | str: + def _parse_backstage_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | Unset | str: + def _parse_pagerduty_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_pagerduty_service_id(data: object) -> None | Unset | str: + def _parse_pagerduty_service_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_service_id = _parse_pagerduty_service_id(d.pop("pagerduty_service_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | Unset | str: + def _parse_opsgenie_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_victor_ops_id(data: object) -> None | Unset | str: + def _parse_victor_ops_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) victor_ops_id = _parse_victor_ops_id(d.pop("victor_ops_id", UNSET)) - def _parse_pagertree_id(data: object) -> None | Unset | str: + def _parse_pagertree_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagertree_id = _parse_pagertree_id(d.pop("pagertree_id", UNSET)) - def _parse_cortex_id(data: object) -> None | Unset | str: + def _parse_cortex_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: + def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) -> None | Unset | list[int]: + def _parse_scim_group_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + scim_group_id = _parse_scim_group_id(d.pop("scim_group_id", UNSET)) + + def _parse_user_ids(data: object) -> list[int] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -556,13 +585,13 @@ def _parse_user_ids(data: object) -> None | Unset | list[int]: user_ids_type_0 = cast(list[int], data) return user_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[int], data) + return cast(list[int] | None | Unset, data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_admin_ids(data: object) -> None | Unset | list[int]: + def _parse_admin_ids(data: object) -> list[int] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -573,40 +602,40 @@ def _parse_admin_ids(data: object) -> None | Unset | list[int]: admin_ids_type_0 = cast(list[int], data) return admin_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[int], data) + return cast(list[int] | None | Unset, data) admin_ids = _parse_admin_ids(d.pop("admin_ids", UNSET)) - def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: + def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alerts_email_address(data: object) -> None | Unset | str: + def _parse_alerts_email_address(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) alerts_email_address = _parse_alerts_email_address(d.pop("alerts_email_address", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | Unset | str: + def _parse_alert_urgency_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_slack_channels(data: object) -> None | Unset | list["TeamSlackChannelsType0Item"]: + def _parse_slack_channels(data: object) -> list[TeamSlackChannelsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -622,13 +651,13 @@ def _parse_slack_channels(data: object) -> None | Unset | list["TeamSlackChannel slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["TeamSlackChannelsType0Item"], data) + return cast(list[TeamSlackChannelsType0Item] | None | Unset, data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases(data: object) -> None | Unset | list["TeamSlackAliasesType0Item"]: + def _parse_slack_aliases(data: object) -> list[TeamSlackAliasesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -644,22 +673,22 @@ def _parse_slack_aliases(data: object) -> None | Unset | list["TeamSlackAliasesT slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["TeamSlackAliasesType0Item"], data) + return cast(list[TeamSlackAliasesType0Item] | None | Unset, data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> None | Unset | bool: + def _parse_alert_broadcast_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) - def _parse_alert_broadcast_channel(data: object) -> Union["TeamAlertBroadcastChannelType0", None, Unset]: + def _parse_alert_broadcast_channel(data: object) -> None | TeamAlertBroadcastChannelType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -670,22 +699,22 @@ def _parse_alert_broadcast_channel(data: object) -> Union["TeamAlertBroadcastCha alert_broadcast_channel_type_0 = TeamAlertBroadcastChannelType0.from_dict(data) return alert_broadcast_channel_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["TeamAlertBroadcastChannelType0", None, Unset], data) + return cast(None | TeamAlertBroadcastChannelType0 | Unset, data) alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> None | Unset | bool: + def _parse_incident_broadcast_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) - def _parse_incident_broadcast_channel(data: object) -> Union["TeamIncidentBroadcastChannelType0", None, Unset]: + def _parse_incident_broadcast_channel(data: object) -> None | TeamIncidentBroadcastChannelType0 | Unset: if data is None: return data if isinstance(data, Unset): @@ -696,31 +725,38 @@ def _parse_incident_broadcast_channel(data: object) -> Union["TeamIncidentBroadc incident_broadcast_channel_type_0 = TeamIncidentBroadcastChannelType0.from_dict(data) return incident_broadcast_channel_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["TeamIncidentBroadcastChannelType0", None, Unset], data) + return cast(None | TeamIncidentBroadcastChannelType0 | Unset, data) incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) - def _parse_auto_add_members_when_attached(data: object) -> None | Unset | bool: + def _parse_auto_add_members_when_attached(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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: Unset | TeamAutoAddMembersScope + auto_add_members_scope: TeamAutoAddMembersScope | Unset 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) -> None | Unset | list["TeamPropertiesType0Item"]: + _schedule_override_policy = d.pop("schedule_override_policy", UNSET) + schedule_override_policy: TeamScheduleOverridePolicy | Unset + if isinstance(_schedule_override_policy, Unset): + schedule_override_policy = UNSET + else: + schedule_override_policy = check_team_schedule_override_policy(_schedule_override_policy) + + def _parse_properties(data: object) -> list[TeamPropertiesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -736,9 +772,9 @@ def _parse_properties(data: object) -> None | Unset | list["TeamPropertiesType0I properties_type_0.append(properties_type_0_item) return properties_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["TeamPropertiesType0Item"], data) + return cast(list[TeamPropertiesType0Item] | None | Unset, data) properties = _parse_properties(d.pop("properties", UNSET)) @@ -762,6 +798,7 @@ def _parse_properties(data: object) -> None | Unset | list["TeamPropertiesType0I pagertree_id=pagertree_id, cortex_id=cortex_id, service_now_ci_sys_id=service_now_ci_sys_id, + scim_group_id=scim_group_id, user_ids=user_ids, admin_ids=admin_ids, alerts_email_enabled=alerts_email_enabled, @@ -775,6 +812,7 @@ def _parse_properties(data: object) -> None | Unset | list["TeamPropertiesType0I incident_broadcast_channel=incident_broadcast_channel, auto_add_members_when_attached=auto_add_members_when_attached, auto_add_members_scope=auto_add_members_scope, + schedule_override_policy=schedule_override_policy, properties=properties, ) 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 091dde36..137ccd8f 100644 --- a/rootly_sdk/models/team_alert_broadcast_channel_type_0.py +++ b/rootly_sdk/models/team_alert_broadcast_channel_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class TeamAlertBroadcastChannelType0: """Slack channel to broadcast alerts to Attributes: - id (Union[Unset, str]): Slack channel ID - name (Union[Unset, str]): Slack channel name + id (str | Unset): Slack channel ID + name (str | Unset): Slack channel name """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_auto_add_members_scope.py b/rootly_sdk/models/team_auto_add_members_scope.py index d81dad07..d1b0e535 100644 --- a/rootly_sdk/models/team_auto_add_members_scope.py +++ b/rootly_sdk/models/team_auto_add_members_scope.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal TeamAutoAddMembersScope = Literal["all", "off", "public_and_test", "public_only"] @@ -14,5 +14,5 @@ def check_team_auto_add_members_scope(value: str | None) -> TeamAutoAddMembersSc if value is None: return None if value in TEAM_AUTO_ADD_MEMBERS_SCOPE_VALUES: - return cast(TeamAutoAddMembersScope, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {TEAM_AUTO_ADD_MEMBERS_SCOPE_VALUES!r}") 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 43046eb0..787a395f 100644 --- a/rootly_sdk/models/team_incident_broadcast_channel_type_0.py +++ b/rootly_sdk/models/team_incident_broadcast_channel_type_0.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class TeamIncidentBroadcastChannelType0: """Slack channel to broadcast incidents to Attributes: - id (Union[Unset, str]): Slack channel ID - name (Union[Unset, str]): Slack channel name + id (str | Unset): Slack channel ID + name (str | Unset): Slack channel name """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 614907f6..9220caa9 100644 --- a/rootly_sdk/models/team_list.py +++ b/rootly_sdk/models/team_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class TeamList: """ Attributes: - data (list['TeamListDataItem']): + data (list[TeamListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["TeamListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[TeamListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 836ccae2..f1419dae 100644 --- a/rootly_sdk/models/team_list_data_item.py +++ b/rootly_sdk/models/team_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/team_list_data_item_type.py b/rootly_sdk/models/team_list_data_item_type.py index e5c8c06f..eb1b6e6a 100644 --- a/rootly_sdk/models/team_list_data_item_type.py +++ b/rootly_sdk/models/team_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal TeamListDataItemType = Literal["groups"] @@ -11,5 +11,5 @@ def check_team_list_data_item_type(value: str | None) -> TeamListDataItemType | if value is None: return None if value in TEAM_LIST_DATA_ITEM_TYPE_VALUES: - return cast(TeamListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {TEAM_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/team_managed_by.py b/rootly_sdk/models/team_managed_by.py index 40cf2930..2957005e 100644 --- a/rootly_sdk/models/team_managed_by.py +++ b/rootly_sdk/models/team_managed_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal TeamManagedBy = Literal["admin_web", "api", "backstage", "catalog_sync", "pulumi", "terraform", "web"] @@ -17,5 +17,5 @@ def check_team_managed_by(value: str | None) -> TeamManagedBy | None: if value is None: return None if value in TEAM_MANAGED_BY_VALUES: - return cast(TeamManagedBy, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {TEAM_MANAGED_BY_VALUES!r}") diff --git a/rootly_sdk/models/team_properties_type_0_item.py b/rootly_sdk/models/team_properties_type_0_item.py index be192ceb..c184a5a0 100644 --- a/rootly_sdk/models/team_properties_type_0_item.py +++ b/rootly_sdk/models/team_properties_type_0_item.py @@ -1,3 +1,5 @@ +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 ec639c53..9f9b9370 100644 --- a/rootly_sdk/models/team_response.py +++ b/rootly_sdk/models/team_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class TeamResponse: """ Attributes: data (TeamResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "TeamResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: TeamResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 50e1b9a5..a9adb9e2 100644 --- a/rootly_sdk/models/team_response_data.py +++ b/rootly_sdk/models/team_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/team_response_data_type.py b/rootly_sdk/models/team_response_data_type.py index c0195a94..1e383624 100644 --- a/rootly_sdk/models/team_response_data_type.py +++ b/rootly_sdk/models/team_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal TeamResponseDataType = Literal["groups"] @@ -11,5 +11,5 @@ def check_team_response_data_type(value: str | None) -> TeamResponseDataType | N if value is None: return None if value in TEAM_RESPONSE_DATA_TYPE_VALUES: - return cast(TeamResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {TEAM_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/team_schedule_override_policy.py b/rootly_sdk/models/team_schedule_override_policy.py new file mode 100644 index 00000000..dc82df1c --- /dev/null +++ b/rootly_sdk/models/team_schedule_override_policy.py @@ -0,0 +1,17 @@ +from typing import Literal + +TeamScheduleOverridePolicy = Literal["admins", "everyone", "members"] + +TEAM_SCHEDULE_OVERRIDE_POLICY_VALUES: set[TeamScheduleOverridePolicy] = { + "admins", + "everyone", + "members", +} + + +def check_team_schedule_override_policy(value: str | None) -> TeamScheduleOverridePolicy | None: + if value is None: + return None + if value in TEAM_SCHEDULE_OVERRIDE_POLICY_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {TEAM_SCHEDULE_OVERRIDE_POLICY_VALUES!r}") 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 e489c76a..5dfb959c 100644 --- a/rootly_sdk/models/team_slack_aliases_type_0_item.py +++ b/rootly_sdk/models/team_slack_aliases_type_0_item.py @@ -1,3 +1,5 @@ +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 f91186df..9f85b005 100644 --- a/rootly_sdk/models/team_slack_channels_type_0_item.py +++ b/rootly_sdk/models/team_slack_channels_type_0_item.py @@ -1,3 +1,5 @@ +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 e0255e8f..dc2ea2cc 100644 --- a/rootly_sdk/models/tiptap_block_schema.py +++ b/rootly_sdk/models/tiptap_block_schema.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -19,20 +21,20 @@ class TiptapBlockSchema: """TipTap block component schema for post mortem templates Attributes: - followup_component (Union[Unset, TiptapBlockSchemaFollowupComponent]): Followup component block - timeline_component (Union[Unset, TiptapBlockSchemaTimelineComponent]): Timeline component block + followup_component (TiptapBlockSchemaFollowupComponent | Unset): Followup component block + timeline_component (TiptapBlockSchemaTimelineComponent | Unset): Timeline component block """ - followup_component: Union[Unset, "TiptapBlockSchemaFollowupComponent"] = UNSET - timeline_component: Union[Unset, "TiptapBlockSchemaTimelineComponent"] = UNSET + followup_component: TiptapBlockSchemaFollowupComponent | Unset = UNSET + timeline_component: TiptapBlockSchemaTimelineComponent | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - followup_component: Unset | dict[str, Any] = UNSET + followup_component: dict[str, Any] | Unset = UNSET if not isinstance(self.followup_component, Unset): followup_component = self.followup_component.to_dict() - timeline_component: Unset | dict[str, Any] = UNSET + timeline_component: dict[str, Any] | Unset = UNSET if not isinstance(self.timeline_component, Unset): timeline_component = self.timeline_component.to_dict() @@ -53,14 +55,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: Unset | TiptapBlockSchemaFollowupComponent + followup_component: TiptapBlockSchemaFollowupComponent | Unset 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: Unset | TiptapBlockSchemaTimelineComponent + timeline_component: TiptapBlockSchemaTimelineComponent | Unset 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 d233714d..8220706b 100644 --- a/rootly_sdk/models/tiptap_block_schema_followup_component.py +++ b/rootly_sdk/models/tiptap_block_schema_followup_component.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -21,18 +23,18 @@ class TiptapBlockSchemaFollowupComponent: html (str): HTML representation:
Example:
. - data_sort (Union[Unset, TiptapBlockSchemaFollowupComponentDataSort]): Sort order for followups. Valid values: + data_sort (TiptapBlockSchemaFollowupComponentDataSort | Unset): Sort order for followups. Valid values: due_date, status, priority Default: 'due_date'. """ html: str - data_sort: Unset | TiptapBlockSchemaFollowupComponentDataSort = "due_date" + data_sort: TiptapBlockSchemaFollowupComponentDataSort | Unset = "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: Unset | str = UNSET + data_sort: str | Unset = UNSET if not isinstance(self.data_sort, Unset): data_sort = self.data_sort @@ -54,7 +56,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: Unset | TiptapBlockSchemaFollowupComponentDataSort + data_sort: TiptapBlockSchemaFollowupComponentDataSort | Unset if isinstance(_data_sort, Unset): data_sort = UNSET else: diff --git a/rootly_sdk/models/tiptap_block_schema_followup_component_data_sort.py b/rootly_sdk/models/tiptap_block_schema_followup_component_data_sort.py index e93f4baf..7c265810 100644 --- a/rootly_sdk/models/tiptap_block_schema_followup_component_data_sort.py +++ b/rootly_sdk/models/tiptap_block_schema_followup_component_data_sort.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal TiptapBlockSchemaFollowupComponentDataSort = Literal["due_date", "priority", "status"] @@ -15,7 +15,7 @@ def check_tiptap_block_schema_followup_component_data_sort( if value is None: return None if value in TIPTAP_BLOCK_SCHEMA_FOLLOWUP_COMPONENT_DATA_SORT_VALUES: - return cast(TiptapBlockSchemaFollowupComponentDataSort, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {TIPTAP_BLOCK_SCHEMA_FOLLOWUP_COMPONENT_DATA_SORT_VALUES!r}" ) diff --git a/rootly_sdk/models/tiptap_block_schema_timeline_component.py b/rootly_sdk/models/tiptap_block_schema_timeline_component.py index 8eef08fc..a8ec7f99 100644 --- a/rootly_sdk/models/tiptap_block_schema_timeline_component.py +++ b/rootly_sdk/models/tiptap_block_schema_timeline_component.py @@ -1,3 +1,5 @@ +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 cfae5e0b..7a15e7ef 100644 --- a/rootly_sdk/models/trigger_workflow_task_params.py +++ b/rootly_sdk/models/trigger_workflow_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -38,19 +40,20 @@ class TriggerWorkflowTaskParams: :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'. + only match [:id]", "(pulse) kind can only match [:id]", "(alert) kind can only match [:id]", "(problem) kind can + only match [:id]"] Default: 'id'. resource (TriggerWorkflowTaskParamsResource): workflow (TriggerWorkflowTaskParamsWorkflow): - task_type (Union[Unset, TriggerWorkflowTaskParamsTaskType]): - check_workflow_conditions (Union[Unset, bool]): + task_type (TriggerWorkflowTaskParamsTaskType | Unset): + check_workflow_conditions (bool | Unset): """ - resource: "TriggerWorkflowTaskParamsResource" - workflow: "TriggerWorkflowTaskParamsWorkflow" + resource: TriggerWorkflowTaskParamsResource + workflow: TriggerWorkflowTaskParamsWorkflow kind: TriggerWorkflowTaskParamsKind = "incident" attribute_to_query_by: TriggerWorkflowTaskParamsAttributeToQueryBy = "id" - task_type: Unset | TriggerWorkflowTaskParamsTaskType = UNSET - check_workflow_conditions: Unset | bool = UNSET + task_type: TriggerWorkflowTaskParamsTaskType | Unset = UNSET + check_workflow_conditions: bool | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -62,7 +65,7 @@ def to_dict(self) -> dict[str, Any]: workflow = self.workflow.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -100,7 +103,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: Unset | TriggerWorkflowTaskParamsTaskType + task_type: TriggerWorkflowTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/trigger_workflow_task_params_attribute_to_query_by.py b/rootly_sdk/models/trigger_workflow_task_params_attribute_to_query_by.py index 9caf7073..79655d83 100644 --- a/rootly_sdk/models/trigger_workflow_task_params_attribute_to_query_by.py +++ b/rootly_sdk/models/trigger_workflow_task_params_attribute_to_query_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal TriggerWorkflowTaskParamsAttributeToQueryBy = Literal[ "airtable_record_id", @@ -51,7 +51,7 @@ def check_trigger_workflow_task_params_attribute_to_query_by( if value is None: return None if value in TRIGGER_WORKFLOW_TASK_PARAMS_ATTRIBUTE_TO_QUERY_BY_VALUES: - return cast(TriggerWorkflowTaskParamsAttributeToQueryBy, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {TRIGGER_WORKFLOW_TASK_PARAMS_ATTRIBUTE_TO_QUERY_BY_VALUES!r}" ) diff --git a/rootly_sdk/models/trigger_workflow_task_params_kind.py b/rootly_sdk/models/trigger_workflow_task_params_kind.py index 255d5ed0..727d3fe5 100644 --- a/rootly_sdk/models/trigger_workflow_task_params_kind.py +++ b/rootly_sdk/models/trigger_workflow_task_params_kind.py @@ -1,12 +1,13 @@ -from typing import Literal, cast +from typing import Literal -TriggerWorkflowTaskParamsKind = Literal["action_item", "alert", "incident", "post_mortem", "pulse"] +TriggerWorkflowTaskParamsKind = Literal["action_item", "alert", "incident", "post_mortem", "problem", "pulse"] TRIGGER_WORKFLOW_TASK_PARAMS_KIND_VALUES: set[TriggerWorkflowTaskParamsKind] = { "action_item", "alert", "incident", "post_mortem", + "problem", "pulse", } @@ -15,5 +16,5 @@ def check_trigger_workflow_task_params_kind(value: str | None) -> TriggerWorkflo if value is None: return None if value in TRIGGER_WORKFLOW_TASK_PARAMS_KIND_VALUES: - return cast(TriggerWorkflowTaskParamsKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {TRIGGER_WORKFLOW_TASK_PARAMS_KIND_VALUES!r}") diff --git a/rootly_sdk/models/trigger_workflow_task_params_resource.py b/rootly_sdk/models/trigger_workflow_task_params_resource.py index 00c4d41f..79d16a80 100644 --- a/rootly_sdk/models/trigger_workflow_task_params_resource.py +++ b/rootly_sdk/models/trigger_workflow_task_params_resource.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class TriggerWorkflowTaskParamsResource: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/trigger_workflow_task_params_task_type.py index 1bc44082..75177560 100644 --- a/rootly_sdk/models/trigger_workflow_task_params_task_type.py +++ b/rootly_sdk/models/trigger_workflow_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal TriggerWorkflowTaskParamsTaskType = Literal["trigger_workflow"] @@ -11,5 +11,5 @@ def check_trigger_workflow_task_params_task_type(value: str | None) -> TriggerWo if value is None: return None if value in TRIGGER_WORKFLOW_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(TriggerWorkflowTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {TRIGGER_WORKFLOW_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/trigger_workflow_task_params_workflow.py b/rootly_sdk/models/trigger_workflow_task_params_workflow.py index 4eb056c6..c4ad90c9 100644 --- a/rootly_sdk/models/trigger_workflow_task_params_workflow.py +++ b/rootly_sdk/models/trigger_workflow_task_params_workflow.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class TriggerWorkflowTaskParamsWorkflow: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 41f13fc8..9c9498a3 100644 --- a/rootly_sdk/models/tweet_twitter_message_task_params.py +++ b/rootly_sdk/models/tweet_twitter_message_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -18,17 +20,17 @@ class TweetTwitterMessageTaskParams: """ Attributes: message (str): - task_type (Union[Unset, TweetTwitterMessageTaskParamsTaskType]): + task_type (TweetTwitterMessageTaskParamsTaskType | Unset): """ message: str - task_type: Unset | TweetTwitterMessageTaskParamsTaskType = UNSET + task_type: TweetTwitterMessageTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: message = self.message - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -50,7 +52,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: Unset | TweetTwitterMessageTaskParamsTaskType + task_type: TweetTwitterMessageTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/tweet_twitter_message_task_params_task_type.py b/rootly_sdk/models/tweet_twitter_message_task_params_task_type.py index c3de16f9..6ddd7e67 100644 --- a/rootly_sdk/models/tweet_twitter_message_task_params_task_type.py +++ b/rootly_sdk/models/tweet_twitter_message_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal TweetTwitterMessageTaskParamsTaskType = Literal["tweet_twitter_message"] @@ -13,7 +13,7 @@ def check_tweet_twitter_message_task_params_task_type( if value is None: return None if value in TWEET_TWITTER_MESSAGE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(TweetTwitterMessageTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {TWEET_TWITTER_MESSAGE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/unassign_role_from_user.py b/rootly_sdk/models/unassign_role_from_user.py index 3475de0e..d71f477a 100644 --- a/rootly_sdk/models/unassign_role_from_user.py +++ b/rootly_sdk/models/unassign_role_from_user.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.unassign_role_from_user_data import UnassignRoleFromUserData @@ -18,14 +19,13 @@ class UnassignRoleFromUser: data (UnassignRoleFromUserData): """ - data: "UnassignRoleFromUserData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UnassignRoleFromUserData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - unassign_role_from_user.additional_properties = d return unassign_role_from_user - - @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/unassign_role_from_user_data.py b/rootly_sdk/models/unassign_role_from_user_data.py index 8771ae9c..d7aafb3a 100644 --- a/rootly_sdk/models/unassign_role_from_user_data.py +++ b/rootly_sdk/models/unassign_role_from_user_data.py @@ -1,8 +1,9 @@ +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.unassign_role_from_user_data_type import ( UnassignRoleFromUserDataType, @@ -25,8 +26,7 @@ class UnassignRoleFromUserData: """ type_: UnassignRoleFromUserDataType - attributes: "UnassignRoleFromUserDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UnassignRoleFromUserDataAttributes def to_dict(self) -> dict[str, Any]: type_: str = self.type_ @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "type": type_, @@ -58,21 +58,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes=attributes, ) - unassign_role_from_user_data.additional_properties = d return unassign_role_from_user_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/unassign_role_from_user_data_attributes.py b/rootly_sdk/models/unassign_role_from_user_data_attributes.py index 6f79ddc6..b936640f 100644 --- a/rootly_sdk/models/unassign_role_from_user_data_attributes.py +++ b/rootly_sdk/models/unassign_role_from_user_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -12,12 +14,12 @@ class UnassignRoleFromUserDataAttributes: """ Attributes: - 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): 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: Unset | str = UNSET - incident_role_id: Unset | str = UNSET + user_id: str | Unset = UNSET + incident_role_id: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: user_id = self.user_id diff --git a/rootly_sdk/models/unassign_role_from_user_data_type.py b/rootly_sdk/models/unassign_role_from_user_data_type.py index 7b4843a4..7a60d5fc 100644 --- a/rootly_sdk/models/unassign_role_from_user_data_type.py +++ b/rootly_sdk/models/unassign_role_from_user_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UnassignRoleFromUserDataType = Literal["incidents"] @@ -11,5 +11,5 @@ def check_unassign_role_from_user_data_type(value: str | None) -> UnassignRoleFr if value is None: return None if value in UNASSIGN_ROLE_FROM_USER_DATA_TYPE_VALUES: - return cast(UnassignRoleFromUserDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UNASSIGN_ROLE_FROM_USER_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_action_item_task_params.py b/rootly_sdk/models/update_action_item_task_params.py index f7d9e4bd..fa6a1f0b 100644 --- a/rootly_sdk/models/update_action_item_task_params.py +++ b/rootly_sdk/models/update_action_item_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -36,33 +38,32 @@ 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 (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 + 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 valid JSON - post_to_incident_timeline (Union[Unset, bool]): + post_to_incident_timeline (bool | Unset): """ query_value: str attribute_to_query_by: UpdateActionItemTaskParamsAttributeToQueryBy = "id" - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -70,7 +71,7 @@ def to_dict(self) -> dict[str, Any]: attribute_to_query_by: str = self.attribute_to_query_by - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -78,11 +79,11 @@ def to_dict(self) -> dict[str, Any]: assigned_to_user_id = self.assigned_to_user_id - assigned_to_user: Unset | dict[str, Any] = UNSET + assigned_to_user: dict[str, Any] | Unset = UNSET if not isinstance(self.assigned_to_user, Unset): assigned_to_user = self.assigned_to_user.to_dict() - group_ids: None | Unset | list[str] + group_ids: list[str] | None | Unset if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -93,15 +94,15 @@ def to_dict(self) -> dict[str, Any]: description = self.description - priority: Unset | str = UNSET + priority: str | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -152,7 +153,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _task_type = d.pop("task_type", UNSET) - task_type: Unset | UpdateActionItemTaskParamsTaskType + task_type: UpdateActionItemTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -163,13 +164,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: Unset | UpdateActionItemTaskParamsAssignedToUser + assigned_to_user: UpdateActionItemTaskParamsAssignedToUser | Unset 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) -> None | Unset | list[str]: + def _parse_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -180,34 +181,34 @@ def _parse_group_ids(data: object) -> None | Unset | list[str]: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) description = d.pop("description", UNSET) _priority = d.pop("priority", UNSET) - priority: Unset | UpdateActionItemTaskParamsPriority + priority: UpdateActionItemTaskParamsPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: priority = check_update_action_item_task_params_priority(_priority) _status = d.pop("status", UNSET) - status: Unset | UpdateActionItemTaskParamsStatus + status: UpdateActionItemTaskParamsStatus | Unset if isinstance(_status, Unset): status = UNSET else: status = check_update_action_item_task_params_status(_status) - def _parse_custom_fields_mapping(data: object) -> None | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 e3bd45eb..215e2fc0 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateActionItemTaskParamsAssignedToUser: """The user this action item is assigned to Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_action_item_task_params_attribute_to_query_by.py b/rootly_sdk/models/update_action_item_task_params_attribute_to_query_by.py index 14379d53..101660e2 100644 --- a/rootly_sdk/models/update_action_item_task_params_attribute_to_query_by.py +++ b/rootly_sdk/models/update_action_item_task_params_attribute_to_query_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateActionItemTaskParamsAttributeToQueryBy = Literal[ "airtable_record_id", @@ -43,7 +43,7 @@ def check_update_action_item_task_params_attribute_to_query_by( if value is None: return None if value in UPDATE_ACTION_ITEM_TASK_PARAMS_ATTRIBUTE_TO_QUERY_BY_VALUES: - return cast(UpdateActionItemTaskParamsAttributeToQueryBy, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ACTION_ITEM_TASK_PARAMS_ATTRIBUTE_TO_QUERY_BY_VALUES!r}" ) diff --git a/rootly_sdk/models/update_action_item_task_params_priority.py b/rootly_sdk/models/update_action_item_task_params_priority.py index 327c3283..22844ecc 100644 --- a/rootly_sdk/models/update_action_item_task_params_priority.py +++ b/rootly_sdk/models/update_action_item_task_params_priority.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateActionItemTaskParamsPriority = Literal["high", "low", "medium"] @@ -13,5 +13,5 @@ def check_update_action_item_task_params_priority(value: str | None) -> UpdateAc if value is None: return None if value in UPDATE_ACTION_ITEM_TASK_PARAMS_PRIORITY_VALUES: - return cast(UpdateActionItemTaskParamsPriority, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ACTION_ITEM_TASK_PARAMS_PRIORITY_VALUES!r}") diff --git a/rootly_sdk/models/update_action_item_task_params_status.py b/rootly_sdk/models/update_action_item_task_params_status.py index 50df74b9..452687bc 100644 --- a/rootly_sdk/models/update_action_item_task_params_status.py +++ b/rootly_sdk/models/update_action_item_task_params_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateActionItemTaskParamsStatus = Literal["cancelled", "done", "in_progress", "open"] @@ -14,5 +14,5 @@ def check_update_action_item_task_params_status(value: str | None) -> UpdateActi if value is None: return None if value in UPDATE_ACTION_ITEM_TASK_PARAMS_STATUS_VALUES: - return cast(UpdateActionItemTaskParamsStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ACTION_ITEM_TASK_PARAMS_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/update_action_item_task_params_task_type.py b/rootly_sdk/models/update_action_item_task_params_task_type.py index 0060fab0..aad94222 100644 --- a/rootly_sdk/models/update_action_item_task_params_task_type.py +++ b/rootly_sdk/models/update_action_item_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateActionItemTaskParamsTaskType = Literal["update_action_item"] @@ -11,5 +11,5 @@ def check_update_action_item_task_params_task_type(value: str | None) -> UpdateA if value is None: return None if value in UPDATE_ACTION_ITEM_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateActionItemTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ACTION_ITEM_TASK_PARAMS_TASK_TYPE_VALUES!r}") 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 5df66fe6..59509bfc 100644 --- a/rootly_sdk/models/update_airtable_table_record_task_params.py +++ b/rootly_sdk/models/update_airtable_table_record_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,16 +22,16 @@ class UpdateAirtableTableRecordTaskParams: base_key (str): The base key table_name (str): The table name record_id (str): The record id - task_type (Union[Unset, UpdateAirtableTableRecordTaskParamsTaskType]): - custom_fields_mapping (Union[None, Unset, str]): Custom field mappings. Can contain liquid markup and need to be + task_type (UpdateAirtableTableRecordTaskParamsTaskType | Unset): + custom_fields_mapping (None | str | Unset): Custom field mappings. Can contain liquid markup and need to be valid JSON """ base_key: str table_name: str record_id: str - task_type: Unset | UpdateAirtableTableRecordTaskParamsTaskType = UNSET - custom_fields_mapping: None | Unset | str = UNSET + task_type: UpdateAirtableTableRecordTaskParamsTaskType | Unset = UNSET + custom_fields_mapping: None | str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -39,11 +41,11 @@ def to_dict(self) -> dict[str, Any]: record_id = self.record_id - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -75,18 +77,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: Unset | UpdateAirtableTableRecordTaskParamsTaskType + task_type: UpdateAirtableTableRecordTaskParamsTaskType | Unset 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 | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_airtable_table_record_task_params_task_type.py b/rootly_sdk/models/update_airtable_table_record_task_params_task_type.py index 8d33192c..0967f4ec 100644 --- a/rootly_sdk/models/update_airtable_table_record_task_params_task_type.py +++ b/rootly_sdk/models/update_airtable_table_record_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAirtableTableRecordTaskParamsTaskType = Literal["update_airtable_table_record"] @@ -13,7 +13,7 @@ def check_update_airtable_table_record_task_params_task_type( if value is None: return None if value in UPDATE_AIRTABLE_TABLE_RECORD_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateAirtableTableRecordTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_AIRTABLE_TABLE_RECORD_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alert.py b/rootly_sdk/models/update_alert.py index 761a488e..36c499f8 100644 --- a/rootly_sdk/models/update_alert.py +++ b/rootly_sdk/models/update_alert.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_alert_data import UpdateAlertData @@ -18,14 +19,13 @@ class UpdateAlert: data (UpdateAlertData): """ - data: "UpdateAlertData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateAlertData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_alert.additional_properties = d return update_alert - - @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_configuration.py b/rootly_sdk/models/update_alert_configuration.py new file mode 100644 index 00000000..1775b6b8 --- /dev/null +++ b/rootly_sdk/models/update_alert_configuration.py @@ -0,0 +1,48 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.update_alert_configuration_data import UpdateAlertConfigurationData + + +T = TypeVar("T", bound="UpdateAlertConfiguration") + + +@_attrs_define +class UpdateAlertConfiguration: + """ + Attributes: + data (UpdateAlertConfigurationData): + """ + + data: UpdateAlertConfigurationData + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + + 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_configuration_data import UpdateAlertConfigurationData + + d = dict(src_dict) + data = UpdateAlertConfigurationData.from_dict(d.pop("data")) + + update_alert_configuration = cls( + data=data, + ) + + return update_alert_configuration diff --git a/rootly_sdk/models/update_alert_configuration_data.py b/rootly_sdk/models/update_alert_configuration_data.py new file mode 100644 index 00000000..2345f51f --- /dev/null +++ b/rootly_sdk/models/update_alert_configuration_data.py @@ -0,0 +1,73 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.update_alert_configuration_data_type import ( + UpdateAlertConfigurationDataType, + check_update_alert_configuration_data_type, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.update_alert_configuration_data_attributes import UpdateAlertConfigurationDataAttributes + + +T = TypeVar("T", bound="UpdateAlertConfigurationData") + + +@_attrs_define +class UpdateAlertConfigurationData: + """ + Attributes: + type_ (UpdateAlertConfigurationDataType): + attributes (UpdateAlertConfigurationDataAttributes): Every attribute is optional and replaces its stored value. + An attribute whose feature is not enabled for the team is refused with 403. + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. Each team has a single alert + configuration, so no id is needed. + """ + + type_: UpdateAlertConfigurationDataType + attributes: UpdateAlertConfigurationDataAttributes + id: str | Unset = 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( + { + "type": type_, + "attributes": attributes, + } + ) + if id is not UNSET: + field_dict["id"] = id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_alert_configuration_data_attributes import UpdateAlertConfigurationDataAttributes + + d = dict(src_dict) + type_ = check_update_alert_configuration_data_type(d.pop("type")) + + attributes = UpdateAlertConfigurationDataAttributes.from_dict(d.pop("attributes")) + + id = d.pop("id", UNSET) + + update_alert_configuration_data = cls( + type_=type_, + attributes=attributes, + id=id, + ) + + return update_alert_configuration_data diff --git a/rootly_sdk/models/update_alert_configuration_data_attributes.py b/rootly_sdk/models/update_alert_configuration_data_attributes.py new file mode 100644 index 00000000..52b7dfe2 --- /dev/null +++ b/rootly_sdk/models/update_alert_configuration_data_attributes.py @@ -0,0 +1,155 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar +from uuid import UUID + +from attrs import define as _attrs_define + +from ..models.update_alert_configuration_data_attributes_manual_paging_form_settings_item import ( + UpdateAlertConfigurationDataAttributesManualPagingFormSettingsItem, + check_update_alert_configuration_data_attributes_manual_paging_form_settings_item, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.update_alert_configuration_data_attributes_alert_acknowledgment import ( + UpdateAlertConfigurationDataAttributesAlertAcknowledgment, + ) + from ..models.update_alert_configuration_data_attributes_default_user_notification_settings import ( + UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettings, + ) + + +T = TypeVar("T", bound="UpdateAlertConfigurationDataAttributes") + + +@_attrs_define +class UpdateAlertConfigurationDataAttributes: + """Every attribute is optional and replaces its stored value. An attribute whose feature is not enabled for the team is + refused with 403. + + Attributes: + alert_acknowledgment (UpdateAlertConfigurationDataAttributesAlertAcknowledgment | Unset): Re-trigger behaviour + for acknowledged alerts. Replaces the stored object as a whole. + manual_paging_form_settings (list[UpdateAlertConfigurationDataAttributesManualPagingFormSettingsItem] | Unset): + Stored entity types for the manual paging form, as configured; at least one is required. The form itself may + hide a type the team cannot use yet, such as functionality. + manual_paging_urgency_ids (list[UUID] | Unset): Alert urgency ids allowed when manually paging. Empty means all; + deleted urgencies are left out. Present and accepted only while the manual-page-urgency-allowlist feature is on + for the team. + default_user_notification_settings (UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettings | + Unset): Channel defaults for new users, per urgency level. Omitted levels keep the built-in defaults; existing + users are never changed. Present and accepted only while org-default-notification-settings is on for the team. + """ + + alert_acknowledgment: UpdateAlertConfigurationDataAttributesAlertAcknowledgment | Unset = UNSET + manual_paging_form_settings: list[UpdateAlertConfigurationDataAttributesManualPagingFormSettingsItem] | Unset = ( + UNSET + ) + manual_paging_urgency_ids: list[UUID] | Unset = UNSET + default_user_notification_settings: ( + UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettings | Unset + ) = UNSET + + def to_dict(self) -> dict[str, Any]: + alert_acknowledgment: dict[str, Any] | Unset = UNSET + if not isinstance(self.alert_acknowledgment, Unset): + alert_acknowledgment = self.alert_acknowledgment.to_dict() + + manual_paging_form_settings: list[str] | Unset = UNSET + if not isinstance(self.manual_paging_form_settings, Unset): + manual_paging_form_settings = [] + for manual_paging_form_settings_item_data in self.manual_paging_form_settings: + manual_paging_form_settings_item: str = manual_paging_form_settings_item_data + manual_paging_form_settings.append(manual_paging_form_settings_item) + + manual_paging_urgency_ids: list[str] | Unset = UNSET + if not isinstance(self.manual_paging_urgency_ids, Unset): + manual_paging_urgency_ids = [] + for manual_paging_urgency_ids_item_data in self.manual_paging_urgency_ids: + manual_paging_urgency_ids_item = str(manual_paging_urgency_ids_item_data) + manual_paging_urgency_ids.append(manual_paging_urgency_ids_item) + + default_user_notification_settings: dict[str, Any] | Unset = UNSET + if not isinstance(self.default_user_notification_settings, Unset): + default_user_notification_settings = self.default_user_notification_settings.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if alert_acknowledgment is not UNSET: + field_dict["alert_acknowledgment"] = alert_acknowledgment + if manual_paging_form_settings is not UNSET: + field_dict["manual_paging_form_settings"] = manual_paging_form_settings + if manual_paging_urgency_ids is not UNSET: + field_dict["manual_paging_urgency_ids"] = manual_paging_urgency_ids + if default_user_notification_settings is not UNSET: + field_dict["default_user_notification_settings"] = default_user_notification_settings + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_alert_configuration_data_attributes_alert_acknowledgment import ( + UpdateAlertConfigurationDataAttributesAlertAcknowledgment, + ) + from ..models.update_alert_configuration_data_attributes_default_user_notification_settings import ( + UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettings, + ) + + d = dict(src_dict) + _alert_acknowledgment = d.pop("alert_acknowledgment", UNSET) + alert_acknowledgment: UpdateAlertConfigurationDataAttributesAlertAcknowledgment | Unset + if isinstance(_alert_acknowledgment, Unset): + alert_acknowledgment = UNSET + else: + alert_acknowledgment = UpdateAlertConfigurationDataAttributesAlertAcknowledgment.from_dict( + _alert_acknowledgment + ) + + _manual_paging_form_settings = d.pop("manual_paging_form_settings", UNSET) + manual_paging_form_settings: ( + list[UpdateAlertConfigurationDataAttributesManualPagingFormSettingsItem] | Unset + ) = UNSET + if _manual_paging_form_settings is not UNSET: + manual_paging_form_settings = [] + for manual_paging_form_settings_item_data in _manual_paging_form_settings: + manual_paging_form_settings_item = ( + check_update_alert_configuration_data_attributes_manual_paging_form_settings_item( + manual_paging_form_settings_item_data + ) + ) + + manual_paging_form_settings.append(manual_paging_form_settings_item) + + _manual_paging_urgency_ids = d.pop("manual_paging_urgency_ids", UNSET) + manual_paging_urgency_ids: list[UUID] | Unset = UNSET + if _manual_paging_urgency_ids is not UNSET: + manual_paging_urgency_ids = [] + for manual_paging_urgency_ids_item_data in _manual_paging_urgency_ids: + manual_paging_urgency_ids_item = UUID(manual_paging_urgency_ids_item_data) + + manual_paging_urgency_ids.append(manual_paging_urgency_ids_item) + + _default_user_notification_settings = d.pop("default_user_notification_settings", UNSET) + default_user_notification_settings: ( + UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettings | Unset + ) + if isinstance(_default_user_notification_settings, Unset): + default_user_notification_settings = UNSET + else: + default_user_notification_settings = ( + UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettings.from_dict( + _default_user_notification_settings + ) + ) + + update_alert_configuration_data_attributes = cls( + alert_acknowledgment=alert_acknowledgment, + manual_paging_form_settings=manual_paging_form_settings, + manual_paging_urgency_ids=manual_paging_urgency_ids, + default_user_notification_settings=default_user_notification_settings, + ) + + return update_alert_configuration_data_attributes diff --git a/rootly_sdk/models/update_alert_configuration_data_attributes_alert_acknowledgment.py b/rootly_sdk/models/update_alert_configuration_data_attributes_alert_acknowledgment.py new file mode 100644 index 00000000..c31a8961 --- /dev/null +++ b/rootly_sdk/models/update_alert_configuration_data_attributes_alert_acknowledgment.py @@ -0,0 +1,76 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.update_alert_configuration_data_attributes_alert_acknowledgment_timeout_minutes import ( + UpdateAlertConfigurationDataAttributesAlertAcknowledgmentTimeoutMinutes, + check_update_alert_configuration_data_attributes_alert_acknowledgment_timeout_minutes, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateAlertConfigurationDataAttributesAlertAcknowledgment") + + +@_attrs_define +class UpdateAlertConfigurationDataAttributesAlertAcknowledgment: + """Re-trigger behaviour for acknowledged alerts. Replaces the stored object as a whole. + + Attributes: + timeout_enabled (bool | Unset): Re-trigger an acknowledged alert after the timeout. + timeout_minutes (UpdateAlertConfigurationDataAttributesAlertAcknowledgmentTimeoutMinutes | Unset): Minutes + before an acknowledged alert re-triggers. + retrigger_manual_alerts (bool | Unset): Whether alerts created from a manual page also re-trigger. Changing it + is rejected with 422 until the manual page re-trigger opt-out is enabled for the team. + """ + + timeout_enabled: bool | Unset = UNSET + timeout_minutes: UpdateAlertConfigurationDataAttributesAlertAcknowledgmentTimeoutMinutes | Unset = UNSET + retrigger_manual_alerts: bool | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + timeout_enabled = self.timeout_enabled + + timeout_minutes: int | Unset = UNSET + if not isinstance(self.timeout_minutes, Unset): + timeout_minutes = self.timeout_minutes + + retrigger_manual_alerts = self.retrigger_manual_alerts + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if timeout_enabled is not UNSET: + field_dict["timeout_enabled"] = timeout_enabled + if timeout_minutes is not UNSET: + field_dict["timeout_minutes"] = timeout_minutes + if retrigger_manual_alerts is not UNSET: + field_dict["retrigger_manual_alerts"] = retrigger_manual_alerts + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + timeout_enabled = d.pop("timeout_enabled", UNSET) + + _timeout_minutes = d.pop("timeout_minutes", UNSET) + timeout_minutes: UpdateAlertConfigurationDataAttributesAlertAcknowledgmentTimeoutMinutes | Unset + if isinstance(_timeout_minutes, Unset): + timeout_minutes = UNSET + else: + timeout_minutes = check_update_alert_configuration_data_attributes_alert_acknowledgment_timeout_minutes( + _timeout_minutes + ) + + retrigger_manual_alerts = d.pop("retrigger_manual_alerts", UNSET) + + update_alert_configuration_data_attributes_alert_acknowledgment = cls( + timeout_enabled=timeout_enabled, + timeout_minutes=timeout_minutes, + retrigger_manual_alerts=retrigger_manual_alerts, + ) + + return update_alert_configuration_data_attributes_alert_acknowledgment diff --git a/rootly_sdk/models/update_alert_configuration_data_attributes_alert_acknowledgment_timeout_minutes.py b/rootly_sdk/models/update_alert_configuration_data_attributes_alert_acknowledgment_timeout_minutes.py new file mode 100644 index 00000000..a81681df --- /dev/null +++ b/rootly_sdk/models/update_alert_configuration_data_attributes_alert_acknowledgment_timeout_minutes.py @@ -0,0 +1,34 @@ +from typing import Literal + +UpdateAlertConfigurationDataAttributesAlertAcknowledgmentTimeoutMinutes = Literal[ + 10, 20, 30, 40, 50, 60, 90, 120, 180, 240, 300, 360, 720, 1440 +] + +UPDATE_ALERT_CONFIGURATION_DATA_ATTRIBUTES_ALERT_ACKNOWLEDGMENT_TIMEOUT_MINUTES_VALUES: set[ + UpdateAlertConfigurationDataAttributesAlertAcknowledgmentTimeoutMinutes +] = { + 10, + 20, + 30, + 40, + 50, + 60, + 90, + 120, + 180, + 240, + 300, + 360, + 720, + 1440, +} + + +def check_update_alert_configuration_data_attributes_alert_acknowledgment_timeout_minutes( + value: int, +) -> UpdateAlertConfigurationDataAttributesAlertAcknowledgmentTimeoutMinutes: + if value in UPDATE_ALERT_CONFIGURATION_DATA_ATTRIBUTES_ALERT_ACKNOWLEDGMENT_TIMEOUT_MINUTES_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_CONFIGURATION_DATA_ATTRIBUTES_ALERT_ACKNOWLEDGMENT_TIMEOUT_MINUTES_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_alert_configuration_data_attributes_default_user_notification_settings.py b/rootly_sdk/models/update_alert_configuration_data_attributes_default_user_notification_settings.py new file mode 100644 index 00000000..1b069e9b --- /dev/null +++ b/rootly_sdk/models/update_alert_configuration_data_attributes_default_user_notification_settings.py @@ -0,0 +1,101 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.update_alert_configuration_data_attributes_default_user_notification_settings_audible_contact_types_item import ( + UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettingsAudibleContactTypesItem, + check_update_alert_configuration_data_attributes_default_user_notification_settings_audible_contact_types_item, +) +from ..models.update_alert_configuration_data_attributes_default_user_notification_settings_quiet_contact_types_item import ( + UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettingsQuietContactTypesItem, + check_update_alert_configuration_data_attributes_default_user_notification_settings_quiet_contact_types_item, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettings") + + +@_attrs_define +class UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettings: + """Channel defaults for new users, per urgency level. Omitted levels keep the built-in defaults; existing users are + never changed. Present and accepted only while org-default-notification-settings is on for the team. + + Attributes: + audible_contact_types + (list[UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettingsAudibleContactTypesItem] | Unset): + Channels enabled on a newly created user's audible notification rule. At least one channel is required. + quiet_contact_types + (list[UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettingsQuietContactTypesItem] | Unset): + Channels enabled on a newly created user's quiet notification rule. At least one channel is required. + """ + + audible_contact_types: ( + list[UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettingsAudibleContactTypesItem] | Unset + ) = UNSET + quiet_contact_types: ( + list[UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettingsQuietContactTypesItem] | Unset + ) = UNSET + + def to_dict(self) -> dict[str, Any]: + audible_contact_types: list[str] | Unset = UNSET + if not isinstance(self.audible_contact_types, Unset): + audible_contact_types = [] + for audible_contact_types_item_data in self.audible_contact_types: + audible_contact_types_item: str = audible_contact_types_item_data + audible_contact_types.append(audible_contact_types_item) + + quiet_contact_types: list[str] | Unset = UNSET + if not isinstance(self.quiet_contact_types, Unset): + quiet_contact_types = [] + for quiet_contact_types_item_data in self.quiet_contact_types: + quiet_contact_types_item: str = quiet_contact_types_item_data + quiet_contact_types.append(quiet_contact_types_item) + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if audible_contact_types is not UNSET: + field_dict["audible_contact_types"] = audible_contact_types + if quiet_contact_types is not UNSET: + field_dict["quiet_contact_types"] = quiet_contact_types + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _audible_contact_types = d.pop("audible_contact_types", UNSET) + audible_contact_types: ( + list[UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettingsAudibleContactTypesItem] | Unset + ) = UNSET + if _audible_contact_types is not UNSET: + audible_contact_types = [] + for audible_contact_types_item_data in _audible_contact_types: + audible_contact_types_item = check_update_alert_configuration_data_attributes_default_user_notification_settings_audible_contact_types_item( + audible_contact_types_item_data + ) + + audible_contact_types.append(audible_contact_types_item) + + _quiet_contact_types = d.pop("quiet_contact_types", UNSET) + quiet_contact_types: ( + list[UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettingsQuietContactTypesItem] | Unset + ) = UNSET + if _quiet_contact_types is not UNSET: + quiet_contact_types = [] + for quiet_contact_types_item_data in _quiet_contact_types: + quiet_contact_types_item = check_update_alert_configuration_data_attributes_default_user_notification_settings_quiet_contact_types_item( + quiet_contact_types_item_data + ) + + quiet_contact_types.append(quiet_contact_types_item) + + update_alert_configuration_data_attributes_default_user_notification_settings = cls( + audible_contact_types=audible_contact_types, + quiet_contact_types=quiet_contact_types, + ) + + return update_alert_configuration_data_attributes_default_user_notification_settings diff --git a/rootly_sdk/models/update_alert_configuration_data_attributes_default_user_notification_settings_audible_contact_types_item.py b/rootly_sdk/models/update_alert_configuration_data_attributes_default_user_notification_settings_audible_contact_types_item.py new file mode 100644 index 00000000..588fd8c1 --- /dev/null +++ b/rootly_sdk/models/update_alert_configuration_data_attributes_default_user_notification_settings_audible_contact_types_item.py @@ -0,0 +1,29 @@ +from typing import Literal + +UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettingsAudibleContactTypesItem = Literal[ + "call", "device", "email", "sms" +] + +UPDATE_ALERT_CONFIGURATION_DATA_ATTRIBUTES_DEFAULT_USER_NOTIFICATION_SETTINGS_AUDIBLE_CONTACT_TYPES_ITEM_VALUES: set[ + UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettingsAudibleContactTypesItem +] = { + "call", + "device", + "email", + "sms", +} + + +def check_update_alert_configuration_data_attributes_default_user_notification_settings_audible_contact_types_item( + value: str | None, +) -> UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettingsAudibleContactTypesItem | None: + if value is None: + return None + if ( + value + in UPDATE_ALERT_CONFIGURATION_DATA_ATTRIBUTES_DEFAULT_USER_NOTIFICATION_SETTINGS_AUDIBLE_CONTACT_TYPES_ITEM_VALUES + ): + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_CONFIGURATION_DATA_ATTRIBUTES_DEFAULT_USER_NOTIFICATION_SETTINGS_AUDIBLE_CONTACT_TYPES_ITEM_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_alert_configuration_data_attributes_default_user_notification_settings_quiet_contact_types_item.py b/rootly_sdk/models/update_alert_configuration_data_attributes_default_user_notification_settings_quiet_contact_types_item.py new file mode 100644 index 00000000..afdce828 --- /dev/null +++ b/rootly_sdk/models/update_alert_configuration_data_attributes_default_user_notification_settings_quiet_contact_types_item.py @@ -0,0 +1,29 @@ +from typing import Literal + +UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettingsQuietContactTypesItem = Literal[ + "call", "email", "non_critical_device", "sms" +] + +UPDATE_ALERT_CONFIGURATION_DATA_ATTRIBUTES_DEFAULT_USER_NOTIFICATION_SETTINGS_QUIET_CONTACT_TYPES_ITEM_VALUES: set[ + UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettingsQuietContactTypesItem +] = { + "call", + "email", + "non_critical_device", + "sms", +} + + +def check_update_alert_configuration_data_attributes_default_user_notification_settings_quiet_contact_types_item( + value: str | None, +) -> UpdateAlertConfigurationDataAttributesDefaultUserNotificationSettingsQuietContactTypesItem | None: + if value is None: + return None + if ( + value + in UPDATE_ALERT_CONFIGURATION_DATA_ATTRIBUTES_DEFAULT_USER_NOTIFICATION_SETTINGS_QUIET_CONTACT_TYPES_ITEM_VALUES + ): + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_CONFIGURATION_DATA_ATTRIBUTES_DEFAULT_USER_NOTIFICATION_SETTINGS_QUIET_CONTACT_TYPES_ITEM_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_alert_configuration_data_attributes_manual_paging_form_settings_item.py b/rootly_sdk/models/update_alert_configuration_data_attributes_manual_paging_form_settings_item.py new file mode 100644 index 00000000..3b52a391 --- /dev/null +++ b/rootly_sdk/models/update_alert_configuration_data_attributes_manual_paging_form_settings_item.py @@ -0,0 +1,27 @@ +from typing import Literal + +UpdateAlertConfigurationDataAttributesManualPagingFormSettingsItem = Literal[ + "escalation_policy", "functionality", "service", "team", "user" +] + +UPDATE_ALERT_CONFIGURATION_DATA_ATTRIBUTES_MANUAL_PAGING_FORM_SETTINGS_ITEM_VALUES: set[ + UpdateAlertConfigurationDataAttributesManualPagingFormSettingsItem +] = { + "escalation_policy", + "functionality", + "service", + "team", + "user", +} + + +def check_update_alert_configuration_data_attributes_manual_paging_form_settings_item( + value: str | None, +) -> UpdateAlertConfigurationDataAttributesManualPagingFormSettingsItem | None: + if value is None: + return None + if value in UPDATE_ALERT_CONFIGURATION_DATA_ATTRIBUTES_MANUAL_PAGING_FORM_SETTINGS_ITEM_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_CONFIGURATION_DATA_ATTRIBUTES_MANUAL_PAGING_FORM_SETTINGS_ITEM_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_alert_configuration_data_type.py b/rootly_sdk/models/update_alert_configuration_data_type.py new file mode 100644 index 00000000..c956f76f --- /dev/null +++ b/rootly_sdk/models/update_alert_configuration_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +UpdateAlertConfigurationDataType = Literal["alert_configurations"] + +UPDATE_ALERT_CONFIGURATION_DATA_TYPE_VALUES: set[UpdateAlertConfigurationDataType] = { + "alert_configurations", +} + + +def check_update_alert_configuration_data_type(value: str | None) -> UpdateAlertConfigurationDataType | None: + if value is None: + return None + if value in UPDATE_ALERT_CONFIGURATION_DATA_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_CONFIGURATION_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_alert_data.py b/rootly_sdk/models/update_alert_data.py index 2caed9f1..d81f276f 100644 --- a/rootly_sdk/models/update_alert_data.py +++ b/rootly_sdk/models/update_alert_data.py @@ -1,10 +1,12 @@ +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_alert_data_type import UpdateAlertDataType, check_update_alert_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_alert_data_attributes import UpdateAlertDataAttributes @@ -19,25 +21,31 @@ class UpdateAlertData: Attributes: type_ (UpdateAlertDataType): attributes (UpdateAlertDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateAlertDataType - attributes: "UpdateAlertDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateAlertDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateAlertDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_alert_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_alert_data.additional_properties = d return update_alert_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_data_attributes.py b/rootly_sdk/models/update_alert_data_attributes.py index 849255f4..f03e3665 100644 --- a/rootly_sdk/models/update_alert_data_attributes.py +++ b/rootly_sdk/models/update_alert_data_attributes.py @@ -1,9 +1,10 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define -from dateutil.parser import isoparse from ..models.update_alert_data_attributes_noise import ( UpdateAlertDataAttributesNoise, @@ -12,6 +13,12 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.update_alert_data_attributes_actor_type_0 import UpdateAlertDataAttributesActorType0 + from ..models.update_alert_data_attributes_actor_type_1 import UpdateAlertDataAttributesActorType1 + from ..models.update_alert_data_attributes_actor_type_2_type_0 import UpdateAlertDataAttributesActorType2Type0 + from ..models.update_alert_data_attributes_actor_type_2_type_1 import UpdateAlertDataAttributesActorType2Type1 + from ..models.update_alert_data_attributes_actor_type_3_type_0 import UpdateAlertDataAttributesActorType3Type0 + from ..models.update_alert_data_attributes_actor_type_3_type_1 import UpdateAlertDataAttributesActorType3Type1 from ..models.update_alert_data_attributes_alert_field_values_attributes_item_type_0 import ( UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0, ) @@ -26,57 +33,92 @@ class UpdateAlertDataAttributes: """ Attributes: - 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 + actor (Unset | UpdateAlertDataAttributesActorType0 | UpdateAlertDataAttributesActorType1 | + UpdateAlertDataAttributesActorType2Type0 | UpdateAlertDataAttributesActorType2Type1 | + UpdateAlertDataAttributesActorType3Type0 | UpdateAlertDataAttributesActorType3Type1): The user to record as + performing this action. Only available when actor attribution is enabled for the organization; otherwise it is + ignored. Only supported with Global and Team API keys; with a Team API key the user must belong to one of the + key's teams. When omitted or null, the action is attributed to the API key. Otherwise provide either `email` or + `user_id`, not both. + 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: 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]] + actor: ( + Unset + | UpdateAlertDataAttributesActorType0 + | UpdateAlertDataAttributesActorType1 + | UpdateAlertDataAttributesActorType2Type0 + | UpdateAlertDataAttributesActorType2Type1 + | UpdateAlertDataAttributesActorType3Type0 + | UpdateAlertDataAttributesActorType3Type1 ) = UNSET + 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 + ) def to_dict(self) -> dict[str, Any]: + from ..models.update_alert_data_attributes_actor_type_0 import UpdateAlertDataAttributesActorType0 + from ..models.update_alert_data_attributes_actor_type_1 import UpdateAlertDataAttributesActorType1 + from ..models.update_alert_data_attributes_actor_type_2_type_0 import UpdateAlertDataAttributesActorType2Type0 + from ..models.update_alert_data_attributes_actor_type_2_type_1 import UpdateAlertDataAttributesActorType2Type1 + from ..models.update_alert_data_attributes_actor_type_3_type_0 import UpdateAlertDataAttributesActorType3Type0 from ..models.update_alert_data_attributes_alert_field_values_attributes_item_type_0 import ( UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0, ) from ..models.update_alert_data_attributes_data_type_0 import UpdateAlertDataAttributesDataType0 from ..models.update_alert_data_attributes_labels_item_type_0 import UpdateAlertDataAttributesLabelsItemType0 - noise: Unset | str = UNSET + actor: dict[str, Any] | Unset + if isinstance(self.actor, Unset): + actor = UNSET + elif isinstance(self.actor, UpdateAlertDataAttributesActorType0): + actor = self.actor.to_dict() + elif isinstance(self.actor, UpdateAlertDataAttributesActorType1): + actor = self.actor.to_dict() + elif isinstance(self.actor, UpdateAlertDataAttributesActorType2Type0): + actor = self.actor.to_dict() + elif isinstance(self.actor, UpdateAlertDataAttributesActorType2Type1): + actor = self.actor.to_dict() + elif isinstance(self.actor, UpdateAlertDataAttributesActorType3Type0): + actor = self.actor.to_dict() + else: + actor = self.actor.to_dict() + + noise: str | Unset = UNSET if not isinstance(self.noise, Unset): noise = self.noise @@ -84,13 +126,13 @@ def to_dict(self) -> dict[str, Any]: summary = self.summary - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -99,7 +141,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - group_ids: None | Unset | list[str] + group_ids: list[str] | None | Unset if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -108,7 +150,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - functionality_ids: None | Unset | list[str] + functionality_ids: list[str] | None | Unset if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -117,7 +159,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - environment_ids: None | Unset | list[str] + environment_ids: list[str] | None | Unset if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -126,7 +168,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -134,7 +176,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | Unset | str + ended_at: None | str | Unset if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -142,36 +184,36 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - external_url: None | Unset | str + external_url: None | str | Unset if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - alert_urgency_id: None | Unset | str + alert_urgency_id: None | str | Unset if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - labels: Unset | list[None | dict[str, Any]] = UNSET + labels: list[dict[str, Any] | None] | Unset = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: None | dict[str, Any] + labels_item: dict[str, Any] | None if isinstance(labels_item_data, UpdateAlertDataAttributesLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - data: None | Unset | dict[str, Any] + data: dict[str, Any] | None | Unset if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, UpdateAlertDataAttributesDataType0): @@ -179,17 +221,17 @@ def to_dict(self) -> dict[str, Any]: else: data = self.data - deduplication_key: None | Unset | str + deduplication_key: None | str | Unset if isinstance(self.deduplication_key, Unset): deduplication_key = UNSET else: deduplication_key = self.deduplication_key - alert_field_values_attributes: Unset | list[None | dict[str, Any]] = UNSET + alert_field_values_attributes: list[dict[str, Any] | None] | Unset = 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: None | dict[str, Any] + alert_field_values_attributes_item: dict[str, Any] | None if isinstance( alert_field_values_attributes_item_data, UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0, @@ -202,6 +244,8 @@ def to_dict(self) -> dict[str, Any]: field_dict: dict[str, Any] = {} field_dict.update({}) + if actor is not UNSET: + field_dict["actor"] = actor if noise is not UNSET: field_dict["noise"] = noise if source is not UNSET: @@ -241,6 +285,12 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_alert_data_attributes_actor_type_0 import UpdateAlertDataAttributesActorType0 + from ..models.update_alert_data_attributes_actor_type_1 import UpdateAlertDataAttributesActorType1 + from ..models.update_alert_data_attributes_actor_type_2_type_0 import UpdateAlertDataAttributesActorType2Type0 + from ..models.update_alert_data_attributes_actor_type_2_type_1 import UpdateAlertDataAttributesActorType2Type1 + from ..models.update_alert_data_attributes_actor_type_3_type_0 import UpdateAlertDataAttributesActorType3Type0 + from ..models.update_alert_data_attributes_actor_type_3_type_1 import UpdateAlertDataAttributesActorType3Type1 from ..models.update_alert_data_attributes_alert_field_values_attributes_item_type_0 import ( UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0, ) @@ -248,8 +298,70 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.update_alert_data_attributes_labels_item_type_0 import UpdateAlertDataAttributesLabelsItemType0 d = dict(src_dict) + + def _parse_actor( + data: object, + ) -> ( + Unset + | UpdateAlertDataAttributesActorType0 + | UpdateAlertDataAttributesActorType1 + | UpdateAlertDataAttributesActorType2Type0 + | UpdateAlertDataAttributesActorType2Type1 + | UpdateAlertDataAttributesActorType3Type0 + | UpdateAlertDataAttributesActorType3Type1 + ): + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_0 = UpdateAlertDataAttributesActorType0.from_dict(data) + + return actor_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_1 = UpdateAlertDataAttributesActorType1.from_dict(data) + + return actor_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_2_type_0 = UpdateAlertDataAttributesActorType2Type0.from_dict(data) + + return actor_type_2_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_2_type_1 = UpdateAlertDataAttributesActorType2Type1.from_dict(data) + + return actor_type_2_type_1 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + actor_type_3_type_0 = UpdateAlertDataAttributesActorType3Type0.from_dict(data) + + return actor_type_3_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + actor_type_3_type_1 = UpdateAlertDataAttributesActorType3Type1.from_dict(data) + + return actor_type_3_type_1 + + actor = _parse_actor(d.pop("actor", UNSET)) + _noise = d.pop("noise", UNSET) - noise: Unset | UpdateAlertDataAttributesNoise + noise: UpdateAlertDataAttributesNoise | Unset if isinstance(_noise, Unset): noise = UNSET else: @@ -259,16 +371,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: summary = d.pop("summary", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -279,13 +391,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_group_ids(data: object) -> None | Unset | list[str]: + def _parse_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -296,13 +408,13 @@ def _parse_group_ids(data: object) -> None | Unset | list[str]: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_functionality_ids(data: object) -> None | Unset | list[str]: + def _parse_functionality_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -313,13 +425,13 @@ def _parse_functionality_ids(data: object) -> None | Unset | list[str]: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_environment_ids(data: object) -> None | Unset | list[str]: + def _parse_environment_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -330,13 +442,13 @@ def _parse_environment_ids(data: object) -> None | Unset | list[str]: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_started_at(data: object) -> None | Unset | datetime.datetime: + def _parse_started_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -344,16 +456,16 @@ def _parse_started_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - started_at_type_0 = isoparse(data) + started_at_type_0 = datetime.datetime.fromisoformat(data) return started_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: + def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -361,64 +473,66 @@ def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - ended_at_type_0 = isoparse(data) + ended_at_type_0 = datetime.datetime.fromisoformat(data) return ended_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_external_url(data: object) -> None | Unset | str: + def _parse_external_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | Unset | str: + def _parse_alert_urgency_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - labels = [] _labels = d.pop("labels", UNSET) - for labels_item_data in _labels or []: + labels: list[None | UpdateAlertDataAttributesLabelsItemType0] | Unset = UNSET + if _labels is not UNSET: + labels = [] + for labels_item_data in _labels: - 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) + 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) - return labels_item_type_0 - except: # noqa: E722 - pass - return cast(Union["UpdateAlertDataAttributesLabelsItemType0", None], data) + return labels_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | UpdateAlertDataAttributesLabelsItemType0, 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) -> Union["UpdateAlertDataAttributesDataType0", None, Unset]: + def _parse_data(data: object) -> None | Unset | UpdateAlertDataAttributesDataType0: if data is None: return data if isinstance(data, Unset): @@ -429,49 +543,54 @@ def _parse_data(data: object) -> Union["UpdateAlertDataAttributesDataType0", Non data_type_0 = UpdateAlertDataAttributesDataType0.from_dict(data) return data_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["UpdateAlertDataAttributesDataType0", None, Unset], data) + return cast(None | Unset | UpdateAlertDataAttributesDataType0, data) data = _parse_data(d.pop("data", UNSET)) - def _parse_deduplication_key(data: object) -> None | Unset | str: + def _parse_deduplication_key(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) - 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) + 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) update_alert_data_attributes = cls( + actor=actor, noise=noise, source=source, summary=summary, diff --git a/rootly_sdk/models/update_alert_data_attributes_actor_type_0.py b/rootly_sdk/models/update_alert_data_attributes_actor_type_0.py new file mode 100644 index 00000000..344f1e38 --- /dev/null +++ b/rootly_sdk/models/update_alert_data_attributes_actor_type_0.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="UpdateAlertDataAttributesActorType0") + + +@_attrs_define +class UpdateAlertDataAttributesActorType0: + """ + Attributes: + email (str): Email of the user, including verified secondary emails. + """ + + email: str + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + update_alert_data_attributes_actor_type_0 = cls( + email=email, + ) + + return update_alert_data_attributes_actor_type_0 diff --git a/rootly_sdk/models/update_alert_data_attributes_actor_type_1.py b/rootly_sdk/models/update_alert_data_attributes_actor_type_1.py new file mode 100644 index 00000000..ac4e0d93 --- /dev/null +++ b/rootly_sdk/models/update_alert_data_attributes_actor_type_1.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="UpdateAlertDataAttributesActorType1") + + +@_attrs_define +class UpdateAlertDataAttributesActorType1: + """ + Attributes: + user_id (str): Rootly ID of the user. + """ + + user_id: str + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user_id": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("user_id") + + update_alert_data_attributes_actor_type_1 = cls( + user_id=user_id, + ) + + return update_alert_data_attributes_actor_type_1 diff --git a/rootly_sdk/models/update_alert_data_attributes_actor_type_2_type_0.py b/rootly_sdk/models/update_alert_data_attributes_actor_type_2_type_0.py new file mode 100644 index 00000000..7ea289c1 --- /dev/null +++ b/rootly_sdk/models/update_alert_data_attributes_actor_type_2_type_0.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="UpdateAlertDataAttributesActorType2Type0") + + +@_attrs_define +class UpdateAlertDataAttributesActorType2Type0: + """ + Attributes: + email (str): Email of the user, including verified secondary emails. + """ + + email: str + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + update_alert_data_attributes_actor_type_2_type_0 = cls( + email=email, + ) + + return update_alert_data_attributes_actor_type_2_type_0 diff --git a/rootly_sdk/models/update_alert_data_attributes_actor_type_2_type_1.py b/rootly_sdk/models/update_alert_data_attributes_actor_type_2_type_1.py new file mode 100644 index 00000000..3ec2bfd5 --- /dev/null +++ b/rootly_sdk/models/update_alert_data_attributes_actor_type_2_type_1.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="UpdateAlertDataAttributesActorType2Type1") + + +@_attrs_define +class UpdateAlertDataAttributesActorType2Type1: + """ + Attributes: + user_id (str): Rootly ID of the user. + """ + + user_id: str + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user_id": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("user_id") + + update_alert_data_attributes_actor_type_2_type_1 = cls( + user_id=user_id, + ) + + return update_alert_data_attributes_actor_type_2_type_1 diff --git a/rootly_sdk/models/update_alert_data_attributes_actor_type_3_type_0.py b/rootly_sdk/models/update_alert_data_attributes_actor_type_3_type_0.py new file mode 100644 index 00000000..ab04192b --- /dev/null +++ b/rootly_sdk/models/update_alert_data_attributes_actor_type_3_type_0.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="UpdateAlertDataAttributesActorType3Type0") + + +@_attrs_define +class UpdateAlertDataAttributesActorType3Type0: + """ + Attributes: + email (str): Email of the user, including verified secondary emails. + """ + + email: str + + def to_dict(self) -> dict[str, Any]: + email = self.email + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "email": email, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + email = d.pop("email") + + update_alert_data_attributes_actor_type_3_type_0 = cls( + email=email, + ) + + return update_alert_data_attributes_actor_type_3_type_0 diff --git a/rootly_sdk/models/update_alert_data_attributes_actor_type_3_type_1.py b/rootly_sdk/models/update_alert_data_attributes_actor_type_3_type_1.py new file mode 100644 index 00000000..edd69c67 --- /dev/null +++ b/rootly_sdk/models/update_alert_data_attributes_actor_type_3_type_1.py @@ -0,0 +1,42 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="UpdateAlertDataAttributesActorType3Type1") + + +@_attrs_define +class UpdateAlertDataAttributesActorType3Type1: + """ + Attributes: + user_id (str): Rootly ID of the user. + """ + + user_id: str + + def to_dict(self) -> dict[str, Any]: + user_id = self.user_id + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "user_id": user_id, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + user_id = d.pop("user_id") + + update_alert_data_attributes_actor_type_3_type_1 = cls( + user_id=user_id, + ) + + return update_alert_data_attributes_actor_type_3_type_1 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 f34dfe8e..8c6620cd 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0") @@ -17,7 +18,6 @@ class UpdateAlertDataAttributesAlertFieldValuesAttributesItemType0: alert_field_id: str value: str - 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 @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: value = self.value field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "alert_field_id": alert_field_id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: value=value, ) - update_alert_data_attributes_alert_field_values_attributes_item_type_0.additional_properties = d return update_alert_data_attributes_alert_field_values_attributes_item_type_0 - - @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_data_attributes_data_type_0.py b/rootly_sdk/models/update_alert_data_attributes_data_type_0.py index 300227e7..29405f27 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 369b1029..d2e0ac80 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,8 +1,9 @@ +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 T = TypeVar("T", bound="UpdateAlertDataAttributesLabelsItemType0") @@ -12,12 +13,11 @@ class UpdateAlertDataAttributesLabelsItemType0: """ Attributes: key (str): Key of the tag - value (Union[bool, float, str]): Value of the tag + value (bool | float | str): Value of the tag """ key: str value: bool | float | str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: key = self.key @@ -26,7 +26,7 @@ def to_dict(self) -> dict[str, Any]: value = self.value field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "key": key, @@ -51,21 +51,4 @@ def _parse_value(data: object) -> bool | float | str: value=value, ) - update_alert_data_attributes_labels_item_type_0.additional_properties = d return update_alert_data_attributes_labels_item_type_0 - - @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_data_attributes_noise.py b/rootly_sdk/models/update_alert_data_attributes_noise.py index 48fc9bd2..30e7a024 100644 --- a/rootly_sdk/models/update_alert_data_attributes_noise.py +++ b/rootly_sdk/models/update_alert_data_attributes_noise.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertDataAttributesNoise = Literal["noise", "not_noise"] @@ -12,5 +12,5 @@ def check_update_alert_data_attributes_noise(value: str | None) -> UpdateAlertDa if value is None: return None if value in UPDATE_ALERT_DATA_ATTRIBUTES_NOISE_VALUES: - return cast(UpdateAlertDataAttributesNoise, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_DATA_ATTRIBUTES_NOISE_VALUES!r}") diff --git a/rootly_sdk/models/update_alert_data_type.py b/rootly_sdk/models/update_alert_data_type.py index e21653b0..d735d215 100644 --- a/rootly_sdk/models/update_alert_data_type.py +++ b/rootly_sdk/models/update_alert_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertDataType = Literal["alerts"] @@ -11,5 +11,5 @@ def check_update_alert_data_type(value: str | None) -> UpdateAlertDataType | Non if value is None: return None if value in UPDATE_ALERT_DATA_TYPE_VALUES: - return cast(UpdateAlertDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_alert_event.py b/rootly_sdk/models/update_alert_event.py index 7e1573dc..a7e1dce4 100644 --- a/rootly_sdk/models/update_alert_event.py +++ b/rootly_sdk/models/update_alert_event.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_alert_event_data import UpdateAlertEventData @@ -19,14 +20,13 @@ class UpdateAlertEvent: data (UpdateAlertEventData): """ - data: "UpdateAlertEventData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateAlertEventData 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, @@ -46,21 +46,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_alert_event.additional_properties = d return update_alert_event - - @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_event_data.py b/rootly_sdk/models/update_alert_event_data.py index 9c5af1dd..dadaac7f 100644 --- a/rootly_sdk/models/update_alert_event_data.py +++ b/rootly_sdk/models/update_alert_event_data.py @@ -1,10 +1,12 @@ +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_alert_event_data_type import UpdateAlertEventDataType, check_update_alert_event_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_alert_event_data_attributes import UpdateAlertEventDataAttributes @@ -19,25 +21,31 @@ class UpdateAlertEventData: Attributes: type_ (UpdateAlertEventDataType): attributes (UpdateAlertEventDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateAlertEventDataType - attributes: "UpdateAlertEventDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateAlertEventDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateAlertEventDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_alert_event_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_alert_event_data.additional_properties = d return update_alert_event_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_event_data_attributes.py b/rootly_sdk/models/update_alert_event_data_attributes.py index 03b49195..82b7f634 100644 --- a/rootly_sdk/models/update_alert_event_data_attributes.py +++ b/rootly_sdk/models/update_alert_event_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,11 +15,11 @@ class UpdateAlertEventDataAttributes: """ Attributes: details (str): Note message. - user_id (Union[Unset, int]): Author of the note. + user_id (int | Unset): Author of the note. """ details: str - user_id: Unset | int = UNSET + user_id: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: details = self.details diff --git a/rootly_sdk/models/update_alert_event_data_type.py b/rootly_sdk/models/update_alert_event_data_type.py index a70e0566..a692bcb1 100644 --- a/rootly_sdk/models/update_alert_event_data_type.py +++ b/rootly_sdk/models/update_alert_event_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertEventDataType = Literal["alert_events"] @@ -11,5 +11,5 @@ def check_update_alert_event_data_type(value: str | None) -> UpdateAlertEventDat if value is None: return None if value in UPDATE_ALERT_EVENT_DATA_TYPE_VALUES: - return cast(UpdateAlertEventDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_EVENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_alert_field.py b/rootly_sdk/models/update_alert_field.py index fa71ba3b..d2771527 100644 --- a/rootly_sdk/models/update_alert_field.py +++ b/rootly_sdk/models/update_alert_field.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_alert_field_data import UpdateAlertFieldData @@ -18,14 +19,13 @@ class UpdateAlertField: data (UpdateAlertFieldData): """ - data: "UpdateAlertFieldData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateAlertFieldData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_alert_field.additional_properties = d return update_alert_field - - @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_field_data.py b/rootly_sdk/models/update_alert_field_data.py index 3eb15a6f..ba850c08 100644 --- a/rootly_sdk/models/update_alert_field_data.py +++ b/rootly_sdk/models/update_alert_field_data.py @@ -1,10 +1,12 @@ +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_alert_field_data_type import UpdateAlertFieldDataType, check_update_alert_field_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_alert_field_data_attributes import UpdateAlertFieldDataAttributes @@ -19,25 +21,31 @@ class UpdateAlertFieldData: Attributes: type_ (UpdateAlertFieldDataType): attributes (UpdateAlertFieldDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateAlertFieldDataType - attributes: "UpdateAlertFieldDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateAlertFieldDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateAlertFieldDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_alert_field_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_alert_field_data.additional_properties = d return update_alert_field_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_field_data_attributes.py b/rootly_sdk/models/update_alert_field_data_attributes.py index cee07f25..e83e44ac 100644 --- a/rootly_sdk/models/update_alert_field_data_attributes.py +++ b/rootly_sdk/models/update_alert_field_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,16 +14,20 @@ class UpdateAlertFieldDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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): The name of the alert field + owner_group_ids (list[str] | None | Unset): IDs of the teams that own the alert field. Callers with org-wide + alert field permissions replace the full set. Callers without them may only add teams they administer, must + leave at least one owner, and owners they do not administer are preserved. """ - slug: None | Unset | str = UNSET - name: Unset | str = UNSET + slug: None | str | Unset = UNSET + name: str | Unset = UNSET + owner_group_ids: list[str] | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -29,6 +35,15 @@ def to_dict(self) -> dict[str, Any]: name = self.name + owner_group_ids: list[str] | None | Unset + if isinstance(self.owner_group_ids, Unset): + owner_group_ids = UNSET + elif isinstance(self.owner_group_ids, list): + owner_group_ids = self.owner_group_ids + + else: + owner_group_ids = self.owner_group_ids + field_dict: dict[str, Any] = {} field_dict.update({}) @@ -36,6 +51,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["slug"] = slug if name is not UNSET: field_dict["name"] = name + if owner_group_ids is not UNSET: + field_dict["owner_group_ids"] = owner_group_ids return field_dict @@ -43,20 +60,38 @@ 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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) + def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + owner_group_ids_type_0 = cast(list[str], data) + + return owner_group_ids_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[str] | None | Unset, data) + + owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) + update_alert_field_data_attributes = cls( slug=slug, name=name, + owner_group_ids=owner_group_ids, ) return update_alert_field_data_attributes diff --git a/rootly_sdk/models/update_alert_field_data_type.py b/rootly_sdk/models/update_alert_field_data_type.py index 63e7f982..7faa88b6 100644 --- a/rootly_sdk/models/update_alert_field_data_type.py +++ b/rootly_sdk/models/update_alert_field_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertFieldDataType = Literal["alert_fields"] @@ -11,5 +11,5 @@ def check_update_alert_field_data_type(value: str | None) -> UpdateAlertFieldDat if value is None: return None if value in UPDATE_ALERT_FIELD_DATA_TYPE_VALUES: - return cast(UpdateAlertFieldDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_FIELD_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_alert_group.py b/rootly_sdk/models/update_alert_group.py index 6576d80b..1bd6f1f3 100644 --- a/rootly_sdk/models/update_alert_group.py +++ b/rootly_sdk/models/update_alert_group.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_alert_group_data import UpdateAlertGroupData @@ -18,14 +19,13 @@ class UpdateAlertGroup: data (UpdateAlertGroupData): """ - data: "UpdateAlertGroupData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateAlertGroupData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_alert_group.additional_properties = d return update_alert_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_alert_group_data.py b/rootly_sdk/models/update_alert_group_data.py index f39cb79b..0c6e534c 100644 --- a/rootly_sdk/models/update_alert_group_data.py +++ b/rootly_sdk/models/update_alert_group_data.py @@ -1,10 +1,12 @@ +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_alert_group_data_type import UpdateAlertGroupDataType, check_update_alert_group_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_alert_group_data_attributes import UpdateAlertGroupDataAttributes @@ -19,25 +21,31 @@ class UpdateAlertGroupData: Attributes: type_ (UpdateAlertGroupDataType): attributes (UpdateAlertGroupDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateAlertGroupDataType - attributes: "UpdateAlertGroupDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateAlertGroupDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateAlertGroupDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_alert_group_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_alert_group_data.additional_properties = d return update_alert_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_alert_group_data_attributes.py b/rootly_sdk/models/update_alert_group_data_attributes.py index cb9224ed..70e08bcf 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes.py +++ b/rootly_sdk/models/update_alert_group_data_attributes.py @@ -1,5 +1,8 @@ +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 @@ -30,38 +33,42 @@ class UpdateAlertGroupDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + 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 + owner_group_ids (list[UUID] | Unset): Teams that own this alert group. Admins of an owning team can manage it, + and an owned alert group can only target destinations that belong to its owning teams. Only available when + owning teams for alert groups are enabled for the organization. + 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 alert grouping instead. - 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']]): + condition_type (UpdateAlertGroupDataAttributesConditionType | Unset): Group alerts when ANY or ALL of the fields + are matching. + conditions (list[UpdateAlertGroupDataAttributesConditionsItem] | 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 + slug: None | str | Unset = UNSET + name: str | Unset = UNSET + description: None | str | Unset = UNSET + time_window: int | Unset = UNSET + owner_group_ids: list[UUID] | 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 def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -69,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -77,33 +84,40 @@ def to_dict(self) -> dict[str, Any]: time_window = self.time_window - targets: Unset | list[dict[str, Any]] = UNSET + owner_group_ids: list[str] | Unset = UNSET + if not isinstance(self.owner_group_ids, Unset): + owner_group_ids = [] + for owner_group_ids_item_data in self.owner_group_ids: + owner_group_ids_item = str(owner_group_ids_item_data) + owner_group_ids.append(owner_group_ids_item) + + targets: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + attributes: list[dict[str, Any]] | Unset = 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: Unset | int = UNSET + group_by_alert_title: int | Unset = UNSET if not isinstance(self.group_by_alert_title, Unset): group_by_alert_title = self.group_by_alert_title - group_by_alert_urgency: Unset | int = UNSET + group_by_alert_urgency: int | Unset = UNSET if not isinstance(self.group_by_alert_urgency, Unset): group_by_alert_urgency = self.group_by_alert_urgency - condition_type: Unset | str = UNSET + condition_type: str | Unset = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - conditions: Unset | list[dict[str, Any]] = UNSET + conditions: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.conditions, Unset): conditions = [] for conditions_item_data in self.conditions: @@ -121,6 +135,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if time_window is not UNSET: field_dict["time_window"] = time_window + if owner_group_ids is not UNSET: + field_dict["owner_group_ids"] = owner_group_ids if targets is not UNSET: field_dict["targets"] = targets if attributes is not UNSET: @@ -148,51 +164,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: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) time_window = d.pop("time_window", UNSET) - targets = [] + _owner_group_ids = d.pop("owner_group_ids", UNSET) + owner_group_ids: list[UUID] | Unset = UNSET + if _owner_group_ids is not UNSET: + owner_group_ids = [] + for owner_group_ids_item_data in _owner_group_ids: + owner_group_ids_item = UUID(owner_group_ids_item_data) + + owner_group_ids.append(owner_group_ids_item) + _targets = d.pop("targets", UNSET) - for targets_item_data in _targets or []: - targets_item = UpdateAlertGroupDataAttributesTargetsItem.from_dict(targets_item_data) + 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) - targets.append(targets_item) + targets.append(targets_item) - attributes = [] _attributes = d.pop("attributes", UNSET) - for attributes_item_data in _attributes or []: - attributes_item = UpdateAlertGroupDataAttributesAttributesItem.from_dict(attributes_item_data) + 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) - attributes.append(attributes_item) + attributes.append(attributes_item) _group_by_alert_title = d.pop("group_by_alert_title", UNSET) - group_by_alert_title: Unset | UpdateAlertGroupDataAttributesGroupByAlertTitle + group_by_alert_title: UpdateAlertGroupDataAttributesGroupByAlertTitle | Unset 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: Unset | UpdateAlertGroupDataAttributesGroupByAlertUrgency + group_by_alert_urgency: UpdateAlertGroupDataAttributesGroupByAlertUrgency | Unset if isinstance(_group_by_alert_urgency, Unset): group_by_alert_urgency = UNSET else: @@ -201,24 +230,27 @@ def _parse_description(data: object) -> None | Unset | str: ) _condition_type = d.pop("condition_type", UNSET) - condition_type: Unset | UpdateAlertGroupDataAttributesConditionType + condition_type: UpdateAlertGroupDataAttributesConditionType | Unset 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) - for conditions_item_data in _conditions or []: - conditions_item = UpdateAlertGroupDataAttributesConditionsItem.from_dict(conditions_item_data) + 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) - conditions.append(conditions_item) + conditions.append(conditions_item) update_alert_group_data_attributes = cls( slug=slug, name=name, description=description, time_window=time_window, + owner_group_ids=owner_group_ids, targets=targets, attributes=attributes, group_by_alert_title=group_by_alert_title, 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 b6248ab5..4228b65d 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,8 +1,9 @@ +from __future__ import annotations + 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 @@ -13,17 +14,16 @@ class UpdateAlertGroupDataAttributesAttributesItem: """ Attributes: - json_path (Union[Unset, str]): The JSON path to the value to group by. + json_path (str | Unset): The JSON path to the value to group by. """ - json_path: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + json_path: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: json_path = self.json_path field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if json_path is not UNSET: field_dict["json_path"] = json_path @@ -39,21 +39,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: json_path=json_path, ) - update_alert_group_data_attributes_attributes_item.additional_properties = d return update_alert_group_data_attributes_attributes_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_group_data_attributes_condition_type.py b/rootly_sdk/models/update_alert_group_data_attributes_condition_type.py index 569858a7..32b051ae 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes_condition_type.py +++ b/rootly_sdk/models/update_alert_group_data_attributes_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertGroupDataAttributesConditionType = Literal["all", "any"] @@ -14,7 +14,7 @@ def check_update_alert_group_data_attributes_condition_type( if value is None: return None if value in UPDATE_ALERT_GROUP_DATA_ATTRIBUTES_CONDITION_TYPE_VALUES: - return cast(UpdateAlertGroupDataAttributesConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_GROUP_DATA_ATTRIBUTES_CONDITION_TYPE_VALUES!r}" ) 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 57211825..df8e441e 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,8 +1,9 @@ +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.update_alert_group_data_attributes_conditions_item_conditionable_type import ( UpdateAlertGroupDataAttributesConditionsItemConditionableType, @@ -29,33 +30,31 @@ class UpdateAlertGroupDataAttributesConditionsItem: field property_field_condition_type (UpdateAlertGroupDataAttributesConditionsItemPropertyFieldConditionType): The condition 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_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 + 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 field condition type is 'is_one_of' or 'is_not_one_of' - 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. + 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. """ property_field_type: UpdateAlertGroupDataAttributesConditionsItemPropertyFieldType property_field_condition_type: UpdateAlertGroupDataAttributesConditionsItemPropertyFieldConditionType - 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) + 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 def to_dict(self) -> dict[str, Any]: property_field_type: str = self.property_field_type @@ -66,11 +65,11 @@ def to_dict(self) -> dict[str, Any]: property_field_value = self.property_field_value - property_field_values: Unset | list[str] = UNSET + property_field_values: list[str] | Unset = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values - alert_urgency_ids: None | Unset | list[str] + alert_urgency_ids: list[str] | None | Unset if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -79,14 +78,14 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: Unset | str = UNSET + conditionable_type: str | Unset = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type conditionable_id = self.conditionable_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "property_field_type": property_field_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) -> None | Unset | list[str]: + def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -138,14 +137,14 @@ def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) - conditionable_type: Unset | UpdateAlertGroupDataAttributesConditionsItemConditionableType + conditionable_type: UpdateAlertGroupDataAttributesConditionsItemConditionableType | Unset if isinstance(_conditionable_type, Unset): conditionable_type = UNSET else: @@ -166,21 +165,4 @@ def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: conditionable_id=conditionable_id, ) - update_alert_group_data_attributes_conditions_item.additional_properties = d return update_alert_group_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_group_data_attributes_conditions_item_conditionable_type.py b/rootly_sdk/models/update_alert_group_data_attributes_conditions_item_conditionable_type.py index d620a03d..a96a9466 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes_conditions_item_conditionable_type.py +++ b/rootly_sdk/models/update_alert_group_data_attributes_conditions_item_conditionable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertGroupDataAttributesConditionsItemConditionableType = Literal["AlertField"] @@ -15,7 +15,7 @@ def check_update_alert_group_data_attributes_conditions_item_conditionable_type( if value is None: return None if value in UPDATE_ALERT_GROUP_DATA_ATTRIBUTES_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES: - return cast(UpdateAlertGroupDataAttributesConditionsItemConditionableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_GROUP_DATA_ATTRIBUTES_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alert_group_data_attributes_conditions_item_property_field_condition_type.py b/rootly_sdk/models/update_alert_group_data_attributes_conditions_item_property_field_condition_type.py index beca3e14..725d833c 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes_conditions_item_property_field_condition_type.py +++ b/rootly_sdk/models/update_alert_group_data_attributes_conditions_item_property_field_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertGroupDataAttributesConditionsItemPropertyFieldConditionType = Literal[ "contains", @@ -33,7 +33,7 @@ def check_update_alert_group_data_attributes_conditions_item_property_field_cond if value is None: return None if value in UPDATE_ALERT_GROUP_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES: - return cast(UpdateAlertGroupDataAttributesConditionsItemPropertyFieldConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_GROUP_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alert_group_data_attributes_conditions_item_property_field_type.py b/rootly_sdk/models/update_alert_group_data_attributes_conditions_item_property_field_type.py index d28e4ab2..3d2722d8 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes_conditions_item_property_field_type.py +++ b/rootly_sdk/models/update_alert_group_data_attributes_conditions_item_property_field_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertGroupDataAttributesConditionsItemPropertyFieldType = Literal["alert_field", "attribute", "payload"] @@ -17,7 +17,7 @@ def check_update_alert_group_data_attributes_conditions_item_property_field_type if value is None: return None if value in UPDATE_ALERT_GROUP_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES: - return cast(UpdateAlertGroupDataAttributesConditionsItemPropertyFieldType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_GROUP_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alert_group_data_attributes_group_by_alert_title.py b/rootly_sdk/models/update_alert_group_data_attributes_group_by_alert_title.py index ac4ca01e..9f439fb1 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes_group_by_alert_title.py +++ b/rootly_sdk/models/update_alert_group_data_attributes_group_by_alert_title.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertGroupDataAttributesGroupByAlertTitle = Literal[0, 1] @@ -12,7 +12,7 @@ def check_update_alert_group_data_attributes_group_by_alert_title( value: int, ) -> UpdateAlertGroupDataAttributesGroupByAlertTitle: if value in UPDATE_ALERT_GROUP_DATA_ATTRIBUTES_GROUP_BY_ALERT_TITLE_VALUES: - return cast(UpdateAlertGroupDataAttributesGroupByAlertTitle, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_GROUP_DATA_ATTRIBUTES_GROUP_BY_ALERT_TITLE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alert_group_data_attributes_group_by_alert_urgency.py b/rootly_sdk/models/update_alert_group_data_attributes_group_by_alert_urgency.py index 275fa6a3..5b8950f5 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes_group_by_alert_urgency.py +++ b/rootly_sdk/models/update_alert_group_data_attributes_group_by_alert_urgency.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertGroupDataAttributesGroupByAlertUrgency = Literal[0, 1] @@ -14,7 +14,7 @@ def check_update_alert_group_data_attributes_group_by_alert_urgency( value: int, ) -> UpdateAlertGroupDataAttributesGroupByAlertUrgency: if value in UPDATE_ALERT_GROUP_DATA_ATTRIBUTES_GROUP_BY_ALERT_URGENCY_VALUES: - return cast(UpdateAlertGroupDataAttributesGroupByAlertUrgency, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_GROUP_DATA_ATTRIBUTES_GROUP_BY_ALERT_URGENCY_VALUES!r}" ) 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 8d67ea3a..1a50889a 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,9 +1,10 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.update_alert_group_data_attributes_targets_item_target_type import ( UpdateAlertGroupDataAttributesTargetsItemTargetType, @@ -24,7 +25,6 @@ class UpdateAlertGroupDataAttributesTargetsItem: target_type: UpdateAlertGroupDataAttributesTargetsItemTargetType target_id: UUID - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: target_type: str = self.target_type @@ -32,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: target_id = str(self.target_id) field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "target_type": target_type, @@ -54,21 +54,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: target_id=target_id, ) - update_alert_group_data_attributes_targets_item.additional_properties = d return update_alert_group_data_attributes_targets_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_group_data_attributes_targets_item_target_type.py b/rootly_sdk/models/update_alert_group_data_attributes_targets_item_target_type.py index 0571f833..77a33a57 100644 --- a/rootly_sdk/models/update_alert_group_data_attributes_targets_item_target_type.py +++ b/rootly_sdk/models/update_alert_group_data_attributes_targets_item_target_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertGroupDataAttributesTargetsItemTargetType = Literal["EscalationPolicy", "Functionality", "Group", "Service"] @@ -18,7 +18,7 @@ def check_update_alert_group_data_attributes_targets_item_target_type( if value is None: return None if value in UPDATE_ALERT_GROUP_DATA_ATTRIBUTES_TARGETS_ITEM_TARGET_TYPE_VALUES: - return cast(UpdateAlertGroupDataAttributesTargetsItemTargetType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_GROUP_DATA_ATTRIBUTES_TARGETS_ITEM_TARGET_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alert_group_data_type.py b/rootly_sdk/models/update_alert_group_data_type.py index 212d0670..e939d42b 100644 --- a/rootly_sdk/models/update_alert_group_data_type.py +++ b/rootly_sdk/models/update_alert_group_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertGroupDataType = Literal["alert_groups"] @@ -11,5 +11,5 @@ def check_update_alert_group_data_type(value: str | None) -> UpdateAlertGroupDat if value is None: return None if value in UPDATE_ALERT_GROUP_DATA_TYPE_VALUES: - return cast(UpdateAlertGroupDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_GROUP_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes.py b/rootly_sdk/models/update_alert_retrigger_rule_data_attributes.py deleted file mode 100644 index af85c35c..00000000 --- a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes.py +++ /dev/null @@ -1,121 +0,0 @@ -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 deleted file mode 100644 index ff89af99..00000000 --- a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item.py +++ /dev/null @@ -1,123 +0,0 @@ -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 deleted file mode 100644 index f4d391e8..00000000 --- a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item_kind.py +++ /dev/null @@ -1,28 +0,0 @@ -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 deleted file mode 100644 index 6cb950d3..00000000 --- a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_conditions_item_operator.py +++ /dev/null @@ -1,39 +0,0 @@ -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 deleted file mode 100644 index 9951e871..00000000 --- a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_match_mode.py +++ /dev/null @@ -1,20 +0,0 @@ -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 deleted file mode 100644 index 3625f499..00000000 --- a/rootly_sdk/models/update_alert_retrigger_rule_data_attributes_timeout_minutes.py +++ /dev/null @@ -1,34 +0,0 @@ -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 deleted file mode 100644 index d27c23e1..00000000 --- a/rootly_sdk/models/update_alert_retrigger_rule_data_type.py +++ /dev/null @@ -1,15 +0,0 @@ -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 05914582..215647e1 100644 --- a/rootly_sdk/models/update_alert_route.py +++ b/rootly_sdk/models/update_alert_route.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_alert_route_data import UpdateAlertRouteData @@ -18,14 +19,13 @@ class UpdateAlertRoute: data (UpdateAlertRouteData): """ - data: "UpdateAlertRouteData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateAlertRouteData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_alert_route.additional_properties = d return update_alert_route - - @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_route_data.py b/rootly_sdk/models/update_alert_route_data.py index a962d3d6..9e15eedc 100644 --- a/rootly_sdk/models/update_alert_route_data.py +++ b/rootly_sdk/models/update_alert_route_data.py @@ -1,10 +1,12 @@ +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_alert_route_data_type import UpdateAlertRouteDataType, check_update_alert_route_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_alert_route_data_attributes import UpdateAlertRouteDataAttributes @@ -19,25 +21,31 @@ class UpdateAlertRouteData: Attributes: type_ (UpdateAlertRouteDataType): attributes (UpdateAlertRouteDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateAlertRouteDataType - attributes: "UpdateAlertRouteDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateAlertRouteDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateAlertRouteDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_alert_route_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_alert_route_data.additional_properties = d return update_alert_route_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_route_data_attributes.py b/rootly_sdk/models/update_alert_route_data_attributes.py index 69d9ef89..4a5c76eb 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes.py +++ b/rootly_sdk/models/update_alert_route_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID @@ -17,39 +19,39 @@ class UpdateAlertRouteDataAttributes: """ Attributes: - 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): 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: 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 + 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 def to_dict(self) -> dict[str, Any]: name = self.name enabled = self.enabled - alerts_source_ids: Unset | list[str] = UNSET + alerts_source_ids: list[str] | Unset = 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: Unset | list[str] = UNSET + owning_team_ids: list[str] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + rules: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -81,26 +83,32 @@ 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) - for alerts_source_ids_item_data in _alerts_source_ids or []: - alerts_source_ids_item = UUID(alerts_source_ids_item_data) + 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) - 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) - for owning_team_ids_item_data in _owning_team_ids or []: - owning_team_ids_item = UUID(owning_team_ids_item_data) + 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) - owning_team_ids.append(owning_team_ids_item) + owning_team_ids.append(owning_team_ids_item) - rules = [] _rules = d.pop("rules", UNSET) - for rules_item_data in _rules or []: - rules_item = UpdateAlertRouteDataAttributesRulesItem.from_dict(rules_item_data) + 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) - 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 086dd93d..56d2eeb4 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,8 +1,9 @@ +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 ..types import UNSET, Unset @@ -23,18 +24,17 @@ class UpdateAlertRouteDataAttributesRulesItem: """ Attributes: name (str): The name of the alert routing rule - 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. + 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. """ name: str - 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) + destinations: list[UpdateAlertRouteDataAttributesRulesItemDestinationsItem] + condition_groups: list[UpdateAlertRouteDataAttributesRulesItemConditionGroupsItem] + position: int | Unset = UNSET + fallback_rule: bool | Unset = False def to_dict(self) -> dict[str, Any]: name = self.name @@ -54,7 +54,7 @@ def to_dict(self) -> dict[str, Any]: fallback_rule = self.fallback_rule field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "name": name, @@ -111,21 +111,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: fallback_rule=fallback_rule, ) - update_alert_route_data_attributes_rules_item.additional_properties = d return update_alert_route_data_attributes_rules_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_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 69d9514c..2e1b4c9d 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,8 +1,9 @@ +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 ..types import UNSET, Unset @@ -19,13 +20,12 @@ class UpdateAlertRouteDataAttributesRulesItemConditionGroupsItem: """ Attributes: - conditions (list['UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem']): - position (Union[Unset, int]): The position of the condition group + conditions (list[UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem]): + position (int | Unset): The position of the condition group """ - conditions: list["UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem"] - position: Unset | int = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + conditions: list[UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem] + position: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: conditions = [] @@ -36,7 +36,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "conditions": conditions, @@ -70,21 +70,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position=position, ) - update_alert_route_data_attributes_rules_item_condition_groups_item.additional_properties = d return update_alert_route_data_attributes_rules_item_condition_groups_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_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 3e3d2b07..f33204ac 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,9 +1,10 @@ +from __future__ import annotations + 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_route_data_attributes_rules_item_condition_groups_item_conditions_item_conditionable_type import ( UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType, @@ -29,29 +30,27 @@ class UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItem: property_field_condition_type (UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType): property_field_type (UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType): - 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_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_condition_type: ( UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType ) property_field_type: UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType - 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 + 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: ( - Unset | UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType + UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | Unset ) = UNSET - conditionable_id: None | UUID | Unset = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + conditionable_id: None | Unset | UUID = UNSET def to_dict(self) -> dict[str, Any]: property_field_condition_type: str = self.property_field_condition_type @@ -60,13 +59,13 @@ def to_dict(self) -> dict[str, Any]: property_field_name = self.property_field_name - property_field_value: None | Unset | str + property_field_value: None | str | Unset if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: None | Unset | list[str] + property_field_values: list[str] | None | Unset if isinstance(self.property_field_values, Unset): property_field_values = UNSET elif isinstance(self.property_field_values, list): @@ -75,7 +74,7 @@ def to_dict(self) -> dict[str, Any]: else: property_field_values = self.property_field_values - alert_urgency_ids: None | Unset | list[str] + alert_urgency_ids: list[str] | None | Unset if isinstance(self.alert_urgency_ids, Unset): alert_urgency_ids = UNSET elif isinstance(self.alert_urgency_ids, list): @@ -84,11 +83,11 @@ def to_dict(self) -> dict[str, Any]: else: alert_urgency_ids = self.alert_urgency_ids - conditionable_type: Unset | str = UNSET + conditionable_type: str | Unset = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | Unset | str + conditionable_id: None | str | Unset if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET elif isinstance(self.conditionable_id, UUID): @@ -97,7 +96,7 @@ def to_dict(self) -> dict[str, Any]: conditionable_id = self.conditionable_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "property_field_condition_type": property_field_condition_type, @@ -132,16 +131,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 | Unset | str: + def _parse_property_field_value(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) - def _parse_property_field_values(data: object) -> None | Unset | list[str]: + def _parse_property_field_values(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -152,13 +151,13 @@ def _parse_property_field_values(data: object) -> None | Unset | list[str]: property_field_values_type_0 = cast(list[str], data) return property_field_values_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) property_field_values = _parse_property_field_values(d.pop("property_field_values", UNSET)) - def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: + def _parse_alert_urgency_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -169,15 +168,15 @@ def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: alert_urgency_ids_type_0 = cast(list[str], data) return alert_urgency_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) alert_urgency_ids = _parse_alert_urgency_ids(d.pop("alert_urgency_ids", UNSET)) _conditionable_type = d.pop("conditionable_type", UNSET) conditionable_type: ( - Unset | UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType + UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType | Unset ) if isinstance(_conditionable_type, Unset): conditionable_type = UNSET @@ -186,7 +185,7 @@ def _parse_alert_urgency_ids(data: object) -> None | Unset | list[str]: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | UUID | Unset: + def _parse_conditionable_id(data: object) -> None | Unset | UUID: if data is None: return data if isinstance(data, Unset): @@ -197,9 +196,9 @@ def _parse_conditionable_id(data: object) -> None | UUID | Unset: conditionable_id_type_0 = UUID(data) return conditionable_id_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | UUID | Unset, data) + return cast(None | Unset | UUID, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) @@ -214,21 +213,4 @@ def _parse_conditionable_id(data: object) -> None | UUID | Unset: conditionable_id=conditionable_id, ) - update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item.additional_properties = d return update_alert_route_data_attributes_rules_item_condition_groups_item_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_route_data_attributes_rules_item_condition_groups_item_conditions_item_conditionable_type.py b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_conditionable_type.py index 727c5a72..7368890b 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_conditionable_type.py +++ b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_conditionable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType = Literal["AlertField"] @@ -18,7 +18,7 @@ def check_update_alert_route_data_attributes_rules_item_condition_groups_item_co value in UPDATE_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES ): - return cast(UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemConditionableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_condition_type.py b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_condition_type.py index cb1ad908..8a570cfb 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_condition_type.py +++ b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType = Literal[ "contains", @@ -34,9 +34,7 @@ def check_update_alert_route_data_attributes_rules_item_condition_groups_item_co value in UPDATE_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES ): - return cast( - UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldConditionType, value - ) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_type.py b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_type.py index ce4d770b..1f5c05f0 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_type.py +++ b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_condition_groups_item_conditions_item_property_field_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType = Literal[ "alert_field", "attribute", "payload" @@ -22,7 +22,7 @@ def check_update_alert_route_data_attributes_rules_item_condition_groups_item_co value in UPDATE_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES ): - return cast(UpdateAlertRouteDataAttributesRulesItemConditionGroupsItemConditionsItemPropertyFieldType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_CONDITION_GROUPS_ITEM_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES!r}" ) 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 c14eb5d0..1d138e07 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,9 +1,10 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.update_alert_route_data_attributes_rules_item_destinations_item_target_type import ( UpdateAlertRouteDataAttributesRulesItemDestinationsItemTargetType, @@ -24,7 +25,6 @@ class UpdateAlertRouteDataAttributesRulesItemDestinationsItem: target_type: UpdateAlertRouteDataAttributesRulesItemDestinationsItemTargetType target_id: UUID - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: target_type: str = self.target_type @@ -32,7 +32,7 @@ def to_dict(self) -> dict[str, Any]: target_id = str(self.target_id) field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "target_type": target_type, @@ -56,21 +56,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: target_id=target_id, ) - update_alert_route_data_attributes_rules_item_destinations_item.additional_properties = d return update_alert_route_data_attributes_rules_item_destinations_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_route_data_attributes_rules_item_destinations_item_target_type.py b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_destinations_item_target_type.py index 4bdedef3..d121a317 100644 --- a/rootly_sdk/models/update_alert_route_data_attributes_rules_item_destinations_item_target_type.py +++ b/rootly_sdk/models/update_alert_route_data_attributes_rules_item_destinations_item_target_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertRouteDataAttributesRulesItemDestinationsItemTargetType = Literal[ "EscalationPolicy", "Functionality", "Group", "Service" @@ -20,7 +20,7 @@ def check_update_alert_route_data_attributes_rules_item_destinations_item_target if value is None: return None if value in UPDATE_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_DESTINATIONS_ITEM_TARGET_TYPE_VALUES: - return cast(UpdateAlertRouteDataAttributesRulesItemDestinationsItemTargetType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_ROUTE_DATA_ATTRIBUTES_RULES_ITEM_DESTINATIONS_ITEM_TARGET_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alert_route_data_type.py b/rootly_sdk/models/update_alert_route_data_type.py index 945157b0..39718017 100644 --- a/rootly_sdk/models/update_alert_route_data_type.py +++ b/rootly_sdk/models/update_alert_route_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertRouteDataType = Literal["alert_routes"] @@ -11,5 +11,5 @@ def check_update_alert_route_data_type(value: str | None) -> UpdateAlertRouteDat if value is None: return None if value in UPDATE_ALERT_ROUTE_DATA_TYPE_VALUES: - return cast(UpdateAlertRouteDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_ROUTE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_alert_routing_rule.py b/rootly_sdk/models/update_alert_routing_rule.py index ab1de97b..ad927e21 100644 --- a/rootly_sdk/models/update_alert_routing_rule.py +++ b/rootly_sdk/models/update_alert_routing_rule.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_alert_routing_rule_data import UpdateAlertRoutingRuleData @@ -18,14 +19,13 @@ class UpdateAlertRoutingRule: data (UpdateAlertRoutingRuleData): """ - data: "UpdateAlertRoutingRuleData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateAlertRoutingRuleData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_alert_routing_rule.additional_properties = d return update_alert_routing_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_routing_rule_data.py b/rootly_sdk/models/update_alert_routing_rule_data.py index e4aafaf3..bafa5925 100644 --- a/rootly_sdk/models/update_alert_routing_rule_data.py +++ b/rootly_sdk/models/update_alert_routing_rule_data.py @@ -1,13 +1,15 @@ +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_alert_routing_rule_data_type import ( UpdateAlertRoutingRuleDataType, check_update_alert_routing_rule_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_alert_routing_rule_data_attributes import UpdateAlertRoutingRuleDataAttributes @@ -22,25 +24,31 @@ class UpdateAlertRoutingRuleData: Attributes: type_ (UpdateAlertRoutingRuleDataType): attributes (UpdateAlertRoutingRuleDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateAlertRoutingRuleDataType - attributes: "UpdateAlertRoutingRuleDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateAlertRoutingRuleDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateAlertRoutingRuleDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_alert_routing_rule_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_alert_routing_rule_data.additional_properties = d return update_alert_routing_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_routing_rule_data_attributes.py b/rootly_sdk/models/update_alert_routing_rule_data_attributes.py index 181ae760..21b53c98 100644 --- a/rootly_sdk/models/update_alert_routing_rule_data_attributes.py +++ b/rootly_sdk/models/update_alert_routing_rule_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from uuid import UUID from attrs import define as _attrs_define @@ -26,56 +28,56 @@ class UpdateAlertRoutingRuleDataAttributes: """ Attributes: - 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): 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: 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 + 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 def to_dict(self) -> dict[str, Any]: name = self.name enabled = self.enabled - alerts_source_id: Unset | str = UNSET + alerts_source_id: str | Unset = UNSET if not isinstance(self.alerts_source_id, Unset): alerts_source_id = str(self.alerts_source_id) position = self.position - owning_team_ids: Unset | list[str] = UNSET + owning_team_ids: list[str] | Unset = 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: Unset | str = UNSET + condition_type: str | Unset = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - conditions: Unset | list[dict[str, Any]] = UNSET + conditions: list[dict[str, Any]] | Unset = 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: Unset | dict[str, Any] = UNSET + destination: dict[str, Any] | Unset = UNSET if not isinstance(self.destination, Unset): destination = self.destination.to_dict() @@ -116,7 +118,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: Unset | UUID + alerts_source_id: UUID | Unset if isinstance(_alerts_source_id, Unset): alerts_source_id = UNSET else: @@ -124,29 +126,33 @@ 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) - for owning_team_ids_item_data in _owning_team_ids or []: - owning_team_ids_item = UUID(owning_team_ids_item_data) + 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) - 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: Unset | UpdateAlertRoutingRuleDataAttributesConditionType + condition_type: UpdateAlertRoutingRuleDataAttributesConditionType | Unset 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) - for conditions_item_data in _conditions or []: - conditions_item = UpdateAlertRoutingRuleDataAttributesConditionsItem.from_dict(conditions_item_data) + 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) - conditions.append(conditions_item) + conditions.append(conditions_item) _destination = d.pop("destination", UNSET) - destination: Unset | UpdateAlertRoutingRuleDataAttributesDestination + destination: UpdateAlertRoutingRuleDataAttributesDestination | Unset if isinstance(_destination, Unset): destination = UNSET else: diff --git a/rootly_sdk/models/update_alert_routing_rule_data_attributes_condition_type.py b/rootly_sdk/models/update_alert_routing_rule_data_attributes_condition_type.py index b2922ee5..ade15bcc 100644 --- a/rootly_sdk/models/update_alert_routing_rule_data_attributes_condition_type.py +++ b/rootly_sdk/models/update_alert_routing_rule_data_attributes_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertRoutingRuleDataAttributesConditionType = Literal["all", "any"] @@ -16,7 +16,7 @@ def check_update_alert_routing_rule_data_attributes_condition_type( if value is None: return None if value in UPDATE_ALERT_ROUTING_RULE_DATA_ATTRIBUTES_CONDITION_TYPE_VALUES: - return cast(UpdateAlertRoutingRuleDataAttributesConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_ROUTING_RULE_DATA_ATTRIBUTES_CONDITION_TYPE_VALUES!r}" ) 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 4c4aa987..f88068ba 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,9 +1,10 @@ +from __future__ import annotations + 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_routing_rule_data_attributes_conditions_item_property_field_condition_type import ( UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType, @@ -22,59 +23,57 @@ class UpdateAlertRoutingRuleDataAttributesConditionsItem: """ Attributes: - 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 + 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 condition type is 'is_one_of' or 'is_not_one_of' except for when property field name is 'alert_urgency' """ - id: Unset | UUID = UNSET - property_field_type: Unset | UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType = UNSET - property_field_name: Unset | str = UNSET + id: UUID | Unset = UNSET + property_field_type: UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType | Unset = UNSET + property_field_name: str | Unset = UNSET property_field_condition_type: ( - Unset | UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType + UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType | 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) + property_field_value: None | str | Unset = UNSET + property_field_values: list[str] | Unset = UNSET def to_dict(self) -> dict[str, Any]: - id: Unset | str = UNSET + id: str | Unset = UNSET if not isinstance(self.id, Unset): id = str(self.id) - property_field_type: Unset | str = UNSET + property_field_type: str | Unset = 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: Unset | str = UNSET + property_field_condition_type: str | Unset = UNSET if not isinstance(self.property_field_condition_type, Unset): property_field_condition_type = self.property_field_condition_type - property_field_value: None | Unset | str + property_field_value: None | str | Unset if isinstance(self.property_field_value, Unset): property_field_value = UNSET else: property_field_value = self.property_field_value - property_field_values: Unset | list[str] = UNSET + property_field_values: list[str] | Unset = UNSET if not isinstance(self.property_field_values, Unset): property_field_values = self.property_field_values field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if id is not UNSET: field_dict["id"] = id @@ -95,14 +94,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: Unset | UUID + id: UUID | Unset if isinstance(_id, Unset): id = UNSET else: id = UUID(_id) _property_field_type = d.pop("property_field_type", UNSET) - property_field_type: Unset | UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType + property_field_type: UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType | Unset if isinstance(_property_field_type, Unset): property_field_type = UNSET else: @@ -114,7 +113,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: ( - Unset | UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType + UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType | Unset ) if isinstance(_property_field_condition_type, Unset): property_field_condition_type = UNSET @@ -125,12 +124,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) ) - def _parse_property_field_value(data: object) -> None | Unset | str: + def _parse_property_field_value(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) property_field_value = _parse_property_field_value(d.pop("property_field_value", UNSET)) @@ -145,21 +144,4 @@ def _parse_property_field_value(data: object) -> None | Unset | str: property_field_values=property_field_values, ) - update_alert_routing_rule_data_attributes_conditions_item.additional_properties = d return update_alert_routing_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_routing_rule_data_attributes_conditions_item_property_field_condition_type.py b/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item_property_field_condition_type.py index d82b7a3b..8432a7e4 100644 --- a/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item_property_field_condition_type.py +++ b/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item_property_field_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType = Literal[ "contains", @@ -31,7 +31,7 @@ def check_update_alert_routing_rule_data_attributes_conditions_item_property_fie if value is None: return None if value in UPDATE_ALERT_ROUTING_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES: - return cast(UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_ROUTING_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_FIELD_CONDITION_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item_property_field_type.py b/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item_property_field_type.py index b657abef..59173e12 100644 --- a/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item_property_field_type.py +++ b/rootly_sdk/models/update_alert_routing_rule_data_attributes_conditions_item_property_field_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType = Literal["attribute", "payload"] @@ -16,7 +16,7 @@ def check_update_alert_routing_rule_data_attributes_conditions_item_property_fie if value is None: return None if value in UPDATE_ALERT_ROUTING_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES: - return cast(UpdateAlertRoutingRuleDataAttributesConditionsItemPropertyFieldType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_ROUTING_RULE_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_FIELD_TYPE_VALUES!r}" ) 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 f573dc7e..c14e8657 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,9 +1,10 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from uuid import UUID from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.update_alert_routing_rule_data_attributes_destination_target_type import ( UpdateAlertRoutingRuleDataAttributesDestinationTargetType, @@ -18,26 +19,25 @@ class UpdateAlertRoutingRuleDataAttributesDestination: """ Attributes: - 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): 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: Unset | UpdateAlertRoutingRuleDataAttributesDestinationTargetType = UNSET - target_id: Unset | UUID = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + target_type: UpdateAlertRoutingRuleDataAttributesDestinationTargetType | Unset = UNSET + target_id: UUID | Unset = UNSET def to_dict(self) -> dict[str, Any]: - target_type: Unset | str = UNSET + target_type: str | Unset = UNSET if not isinstance(self.target_type, Unset): target_type = self.target_type - target_id: Unset | str = UNSET + target_id: str | Unset = UNSET if not isinstance(self.target_id, Unset): target_id = str(self.target_id) field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if target_type is not UNSET: field_dict["target_type"] = target_type @@ -50,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: Unset | UpdateAlertRoutingRuleDataAttributesDestinationTargetType + target_type: UpdateAlertRoutingRuleDataAttributesDestinationTargetType | Unset 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: Unset | UUID + target_id: UUID | Unset if isinstance(_target_id, Unset): target_id = UNSET else: @@ -68,21 +68,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: target_id=target_id, ) - update_alert_routing_rule_data_attributes_destination.additional_properties = d return update_alert_routing_rule_data_attributes_destination - - @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_routing_rule_data_attributes_destination_target_type.py b/rootly_sdk/models/update_alert_routing_rule_data_attributes_destination_target_type.py index de1fc25f..a809ea9c 100644 --- a/rootly_sdk/models/update_alert_routing_rule_data_attributes_destination_target_type.py +++ b/rootly_sdk/models/update_alert_routing_rule_data_attributes_destination_target_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertRoutingRuleDataAttributesDestinationTargetType = Literal[ "EscalationPolicy", "Functionality", "Group", "Service" @@ -20,7 +20,7 @@ def check_update_alert_routing_rule_data_attributes_destination_target_type( if value is None: return None if value in UPDATE_ALERT_ROUTING_RULE_DATA_ATTRIBUTES_DESTINATION_TARGET_TYPE_VALUES: - return cast(UpdateAlertRoutingRuleDataAttributesDestinationTargetType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_ROUTING_RULE_DATA_ATTRIBUTES_DESTINATION_TARGET_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alert_routing_rule_data_type.py b/rootly_sdk/models/update_alert_routing_rule_data_type.py index 5dba34f0..f5d0a77a 100644 --- a/rootly_sdk/models/update_alert_routing_rule_data_type.py +++ b/rootly_sdk/models/update_alert_routing_rule_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertRoutingRuleDataType = Literal["alert_routing_rules"] @@ -11,5 +11,5 @@ def check_update_alert_routing_rule_data_type(value: str | None) -> UpdateAlertR if value is None: return None if value in UPDATE_ALERT_ROUTING_RULE_DATA_TYPE_VALUES: - return cast(UpdateAlertRoutingRuleDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_ROUTING_RULE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_alert_urgency.py b/rootly_sdk/models/update_alert_urgency.py index 4ab66a74..5f379629 100644 --- a/rootly_sdk/models/update_alert_urgency.py +++ b/rootly_sdk/models/update_alert_urgency.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_alert_urgency_data import UpdateAlertUrgencyData @@ -18,14 +19,13 @@ class UpdateAlertUrgency: data (UpdateAlertUrgencyData): """ - data: "UpdateAlertUrgencyData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateAlertUrgencyData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_alert_urgency.additional_properties = d return update_alert_urgency - - @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_urgency_data.py b/rootly_sdk/models/update_alert_urgency_data.py index 0e1ffff3..c4435708 100644 --- a/rootly_sdk/models/update_alert_urgency_data.py +++ b/rootly_sdk/models/update_alert_urgency_data.py @@ -1,10 +1,12 @@ +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_alert_urgency_data_type import UpdateAlertUrgencyDataType, check_update_alert_urgency_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_alert_urgency_data_attributes import UpdateAlertUrgencyDataAttributes @@ -19,25 +21,31 @@ class UpdateAlertUrgencyData: Attributes: type_ (UpdateAlertUrgencyDataType): attributes (UpdateAlertUrgencyDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateAlertUrgencyDataType - attributes: "UpdateAlertUrgencyDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateAlertUrgencyDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateAlertUrgencyDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_alert_urgency_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_alert_urgency_data.additional_properties = d return update_alert_urgency_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_urgency_data_attributes.py b/rootly_sdk/models/update_alert_urgency_data_attributes.py index f9137d5c..cb5ed61f 100644 --- a/rootly_sdk/models/update_alert_urgency_data_attributes.py +++ b/rootly_sdk/models/update_alert_urgency_data_attributes.py @@ -1,8 +1,14 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast from attrs import define as _attrs_define +from ..models.update_alert_urgency_data_attributes_retrigger_timeout_minutes import ( + UpdateAlertUrgencyDataAttributesRetriggerTimeoutMinutes, + check_update_alert_urgency_data_attributes_retrigger_timeout_minutes, +) from ..types import UNSET, Unset T = TypeVar("T", bound="UpdateAlertUrgencyDataAttributes") @@ -12,33 +18,31 @@ class UpdateAlertUrgencyDataAttributes: """ Attributes: - 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): The name of the alert urgency + description (str | Unset): The description of the alert urgency + position (int | None | Unset): Position of the alert urgency + retrigger_timeout_minutes (UpdateAlertUrgencyDataAttributesRetriggerTimeoutMinutes | Unset): Re-trigger + acknowledged alerts of this urgency after N minutes; null inherits the workspace default, -1 = never. """ - name: Unset | str = UNSET - description: Unset | str = UNSET - position: None | Unset | int = UNSET - retrigger_timeout_minutes: None | Unset | int = UNSET + name: str | Unset = UNSET + description: str | Unset = UNSET + position: int | None | Unset = UNSET + retrigger_timeout_minutes: UpdateAlertUrgencyDataAttributesRetriggerTimeoutMinutes | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name description = self.description - position: None | Unset | int + position: int | None | Unset 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: int | Unset = UNSET + if not isinstance(self.retrigger_timeout_minutes, Unset): retrigger_timeout_minutes = self.retrigger_timeout_minutes field_dict: dict[str, Any] = {} @@ -62,23 +66,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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)) + _retrigger_timeout_minutes = d.pop("retrigger_timeout_minutes", UNSET) + retrigger_timeout_minutes: UpdateAlertUrgencyDataAttributesRetriggerTimeoutMinutes | Unset + if isinstance(_retrigger_timeout_minutes, Unset): + retrigger_timeout_minutes = UNSET + else: + retrigger_timeout_minutes = check_update_alert_urgency_data_attributes_retrigger_timeout_minutes( + _retrigger_timeout_minutes + ) update_alert_urgency_data_attributes = cls( name=name, diff --git a/rootly_sdk/models/update_alert_urgency_data_attributes_retrigger_timeout_minutes.py b/rootly_sdk/models/update_alert_urgency_data_attributes_retrigger_timeout_minutes.py new file mode 100644 index 00000000..304cd889 --- /dev/null +++ b/rootly_sdk/models/update_alert_urgency_data_attributes_retrigger_timeout_minutes.py @@ -0,0 +1,35 @@ +from typing import Literal + +UpdateAlertUrgencyDataAttributesRetriggerTimeoutMinutes = Literal[ + -1, 10, 20, 30, 40, 50, 60, 90, 120, 180, 240, 300, 360, 720, 1440 +] + +UPDATE_ALERT_URGENCY_DATA_ATTRIBUTES_RETRIGGER_TIMEOUT_MINUTES_VALUES: set[ + UpdateAlertUrgencyDataAttributesRetriggerTimeoutMinutes +] = { + -1, + 10, + 20, + 30, + 40, + 50, + 60, + 90, + 120, + 180, + 240, + 300, + 360, + 720, + 1440, +} + + +def check_update_alert_urgency_data_attributes_retrigger_timeout_minutes( + value: int, +) -> UpdateAlertUrgencyDataAttributesRetriggerTimeoutMinutes: + if value in UPDATE_ALERT_URGENCY_DATA_ATTRIBUTES_RETRIGGER_TIMEOUT_MINUTES_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_URGENCY_DATA_ATTRIBUTES_RETRIGGER_TIMEOUT_MINUTES_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_alert_urgency_data_type.py b/rootly_sdk/models/update_alert_urgency_data_type.py index f19d9114..149b4f0c 100644 --- a/rootly_sdk/models/update_alert_urgency_data_type.py +++ b/rootly_sdk/models/update_alert_urgency_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertUrgencyDataType = Literal["alert_urgencies"] @@ -11,5 +11,5 @@ def check_update_alert_urgency_data_type(value: str | None) -> UpdateAlertUrgenc if value is None: return None if value in UPDATE_ALERT_URGENCY_DATA_TYPE_VALUES: - return cast(UpdateAlertUrgencyDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ALERT_URGENCY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_alerts_source.py b/rootly_sdk/models/update_alerts_source.py index 2c27342d..b0de33ed 100644 --- a/rootly_sdk/models/update_alerts_source.py +++ b/rootly_sdk/models/update_alerts_source.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_alerts_source_data import UpdateAlertsSourceData @@ -18,14 +19,13 @@ class UpdateAlertsSource: data (UpdateAlertsSourceData): """ - data: "UpdateAlertsSourceData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateAlertsSourceData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_alerts_source.additional_properties = d return update_alerts_source - - @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_alerts_source_data.py b/rootly_sdk/models/update_alerts_source_data.py index c7409215..1a3c065e 100644 --- a/rootly_sdk/models/update_alerts_source_data.py +++ b/rootly_sdk/models/update_alerts_source_data.py @@ -1,10 +1,12 @@ +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_alerts_source_data_type import UpdateAlertsSourceDataType, check_update_alerts_source_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_alerts_source_data_attributes import UpdateAlertsSourceDataAttributes @@ -19,25 +21,31 @@ class UpdateAlertsSourceData: Attributes: type_ (UpdateAlertsSourceDataType): attributes (UpdateAlertsSourceDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateAlertsSourceDataType - attributes: "UpdateAlertsSourceDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateAlertsSourceDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateAlertsSourceDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_alerts_source_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_alerts_source_data.additional_properties = d return update_alerts_source_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_alerts_source_data_attributes.py b/rootly_sdk/models/update_alerts_source_data_attributes.py index 514858bd..6771f3a3 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -38,55 +40,50 @@ class UpdateAlertsSourceDataAttributes: """ Attributes: - 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, + 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, deduplication_key_kind and deduplication_key_path are required. - 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_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 from the request body. - 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 + 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 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. + apply to generic_webhook sources; `accept_threaded_emails`, `notification_target_type` and + `notification_target_id` apply to email sources. + 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. """ - 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 - ) + 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 alert_source_urgency_rules_attributes: ( - Unset | list["UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem"] + list[UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem] | Unset ) = UNSET - sourceable_attributes: Union["UpdateAlertsSourceDataAttributesSourceableAttributesType0", None, Unset] = UNSET - resolution_rule_attributes: Union["UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset] = ( - UNSET - ) - alert_source_fields_attributes: Unset | list["UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem"] = ( + sourceable_attributes: None | Unset | UpdateAlertsSourceDataAttributesSourceableAttributesType0 = UNSET + resolution_rule_attributes: None | Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0 = UNSET + alert_source_fields_attributes: list[UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem] | Unset = ( UNSET ) @@ -105,7 +102,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - source_type: Unset | str = UNSET + source_type: str | Unset = UNSET if not isinstance(self.source_type, Unset): source_type = self.source_type @@ -113,27 +110,27 @@ def to_dict(self) -> dict[str, Any]: deduplicate_alerts_by_key = self.deduplicate_alerts_by_key - deduplication_key_kind: Unset | str = UNSET + deduplication_key_kind: str | Unset = UNSET if not isinstance(self.deduplication_key_kind, Unset): deduplication_key_kind = self.deduplication_key_kind - deduplication_key_path: None | Unset | str + deduplication_key_path: None | str | Unset if isinstance(self.deduplication_key_path, Unset): deduplication_key_path = UNSET else: deduplication_key_path = self.deduplication_key_path - deduplication_key_regexp: None | Unset | str + deduplication_key_regexp: None | str | Unset if isinstance(self.deduplication_key_regexp, Unset): deduplication_key_regexp = UNSET else: deduplication_key_regexp = self.deduplication_key_regexp - owner_group_ids: Unset | list[str] = UNSET + owner_group_ids: list[str] | Unset = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - alert_template_attributes: None | Unset | dict[str, Any] + alert_template_attributes: dict[str, Any] | None | Unset if isinstance(self.alert_template_attributes, Unset): alert_template_attributes = UNSET elif isinstance(self.alert_template_attributes, UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0): @@ -141,14 +138,14 @@ def to_dict(self) -> dict[str, Any]: else: alert_template_attributes = self.alert_template_attributes - alert_source_urgency_rules_attributes: Unset | list[dict[str, Any]] = UNSET + alert_source_urgency_rules_attributes: list[dict[str, Any]] | Unset = 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: None | Unset | dict[str, Any] + sourceable_attributes: dict[str, Any] | None | Unset if isinstance(self.sourceable_attributes, Unset): sourceable_attributes = UNSET elif isinstance(self.sourceable_attributes, UpdateAlertsSourceDataAttributesSourceableAttributesType0): @@ -156,7 +153,7 @@ def to_dict(self) -> dict[str, Any]: else: sourceable_attributes = self.sourceable_attributes - resolution_rule_attributes: None | Unset | dict[str, Any] + resolution_rule_attributes: dict[str, Any] | None | Unset if isinstance(self.resolution_rule_attributes, Unset): resolution_rule_attributes = UNSET elif isinstance(self.resolution_rule_attributes, UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0): @@ -164,7 +161,7 @@ def to_dict(self) -> dict[str, Any]: else: resolution_rule_attributes = self.resolution_rule_attributes - alert_source_fields_attributes: Unset | list[dict[str, Any]] = UNSET + alert_source_fields_attributes: list[dict[str, Any]] | Unset = 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: @@ -229,7 +226,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: Unset | UpdateAlertsSourceDataAttributesSourceType + source_type: UpdateAlertsSourceDataAttributesSourceType | Unset if isinstance(_source_type, Unset): source_type = UNSET else: @@ -240,7 +237,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: Unset | UpdateAlertsSourceDataAttributesDeduplicationKeyKind + deduplication_key_kind: UpdateAlertsSourceDataAttributesDeduplicationKeyKind | Unset if isinstance(_deduplication_key_kind, Unset): deduplication_key_kind = UNSET else: @@ -248,21 +245,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _deduplication_key_kind ) - def _parse_deduplication_key_path(data: object) -> None | Unset | str: + def _parse_deduplication_key_path(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) deduplication_key_path = _parse_deduplication_key_path(d.pop("deduplication_key_path", UNSET)) - def _parse_deduplication_key_regexp(data: object) -> None | Unset | str: + def _parse_deduplication_key_regexp(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) deduplication_key_regexp = _parse_deduplication_key_regexp(d.pop("deduplication_key_regexp", UNSET)) @@ -270,7 +267,7 @@ def _parse_deduplication_key_regexp(data: object) -> None | Unset | str: def _parse_alert_template_attributes( data: object, - ) -> Union["UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0", None, Unset]: + ) -> None | Unset | UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0: if data is None: return data if isinstance(data, Unset): @@ -283,26 +280,30 @@ def _parse_alert_template_attributes( ) return alert_template_attributes_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0", None, Unset], data) + return cast(None | Unset | UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0, 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) - 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: ( + 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 + ) ) - ) - 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, - ) -> Union["UpdateAlertsSourceDataAttributesSourceableAttributesType0", None, Unset]: + ) -> None | Unset | UpdateAlertsSourceDataAttributesSourceableAttributesType0: if data is None: return data if isinstance(data, Unset): @@ -313,15 +314,15 @@ def _parse_sourceable_attributes( sourceable_attributes_type_0 = UpdateAlertsSourceDataAttributesSourceableAttributesType0.from_dict(data) return sourceable_attributes_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["UpdateAlertsSourceDataAttributesSourceableAttributesType0", None, Unset], data) + return cast(None | Unset | UpdateAlertsSourceDataAttributesSourceableAttributesType0, data) sourceable_attributes = _parse_sourceable_attributes(d.pop("sourceable_attributes", UNSET)) def _parse_resolution_rule_attributes( data: object, - ) -> Union["UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset]: + ) -> None | Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0: if data is None: return data if isinstance(data, Unset): @@ -334,22 +335,26 @@ def _parse_resolution_rule_attributes( ) return resolution_rule_attributes_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0", None, Unset], data) + return cast(None | Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0, 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) - 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: ( + 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 + ) ) - ) - 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 954963ad..9cb20ba4 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,8 +1,9 @@ +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 ..types import UNSET, Unset @@ -13,31 +14,42 @@ class UpdateAlertsSourceDataAttributesAlertSourceFieldsAttributesItem: """ Attributes: - 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): The ID of the alert field. Must be visible to the caller; unknown or hidden IDs + return 404 + template_body (None | str | Unset): Liquid expression to extract a specific value from the alert's payload for + evaluation + field_destroy (bool | None | Unset): Set to true to unbind the alert field from the alert source. Built-in + fields cannot be unbound (422) """ - alert_field_id: Unset | str = UNSET - template_body: None | Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + alert_field_id: str | Unset = UNSET + template_body: None | str | Unset = UNSET + field_destroy: bool | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: alert_field_id = self.alert_field_id - template_body: None | Unset | str + template_body: None | str | Unset if isinstance(self.template_body, Unset): template_body = UNSET else: template_body = self.template_body + field_destroy: bool | None | Unset + if isinstance(self.field_destroy, Unset): + field_destroy = UNSET + else: + field_destroy = self.field_destroy + field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if alert_field_id is not UNSET: field_dict["alert_field_id"] = alert_field_id if template_body is not UNSET: field_dict["template_body"] = template_body + if field_destroy is not UNSET: + field_dict["_destroy"] = field_destroy return field_dict @@ -46,35 +58,28 @@ 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 | Unset | str: + def _parse_template_body(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) template_body = _parse_template_body(d.pop("template_body", UNSET)) + def _parse_field_destroy(data: object) -> bool | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(bool | None | Unset, data) + + field_destroy = _parse_field_destroy(d.pop("_destroy", UNSET)) + update_alerts_source_data_attributes_alert_source_fields_attributes_item = cls( alert_field_id=alert_field_id, template_body=template_body, + field_destroy=field_destroy, ) - update_alerts_source_data_attributes_alert_source_fields_attributes_item.additional_properties = d return update_alerts_source_data_attributes_alert_source_fields_attributes_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_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 4542ac61..4dbb4180 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,8 +1,9 @@ +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.update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_conditionable_type import ( UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType, @@ -25,64 +26,62 @@ class UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItem: """ Attributes: - 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 + 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 determine a match - 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_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 - alert_urgency_id (Union[Unset, str]): The ID of the alert urgency + alert_urgency_id (str | Unset): The ID of the alert urgency """ - json_path: None | Unset | str = UNSET - operator: Unset | UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator = UNSET - value: Unset | str = UNSET + json_path: None | str | Unset = UNSET + operator: UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator | Unset = UNSET + value: str | Unset = UNSET conditionable_type: ( - Unset | UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType + UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType | 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) + conditionable_id: None | str | Unset = UNSET + kind: UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind | Unset = UNSET + alert_urgency_id: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: - json_path: None | Unset | str + json_path: None | str | Unset if isinstance(self.json_path, Unset): json_path = UNSET else: json_path = self.json_path - operator: Unset | str = UNSET + operator: str | Unset = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: Unset | str = UNSET + conditionable_type: str | Unset = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | Unset | str + conditionable_id: None | str | Unset if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind alert_urgency_id = self.alert_urgency_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if json_path is not UNSET: field_dict["json_path"] = json_path @@ -105,17 +104,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 | Unset | str: + def _parse_json_path(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) json_path = _parse_json_path(d.pop("json_path", UNSET)) _operator = d.pop("operator", UNSET) - operator: Unset | UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator + operator: UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator | Unset if isinstance(_operator, Unset): operator = UNSET else: @@ -127,7 +126,7 @@ def _parse_json_path(data: object) -> None | Unset | str: _conditionable_type = d.pop("conditionable_type", UNSET) conditionable_type: ( - Unset | UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType + UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType | Unset ) if isinstance(_conditionable_type, Unset): conditionable_type = UNSET @@ -136,17 +135,17 @@ def _parse_json_path(data: object) -> None | Unset | str: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | Unset | str: + def _parse_conditionable_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: Unset | UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind + kind: UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind | Unset if isinstance(_kind, Unset): kind = UNSET else: @@ -164,21 +163,4 @@ def _parse_conditionable_id(data: object) -> None | Unset | str: alert_urgency_id=alert_urgency_id, ) - update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item.additional_properties = d return update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_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_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_conditionable_type.py b/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_conditionable_type.py index d9ec3698..93f462be 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_conditionable_type.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_conditionable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType = Literal["AlertField"] @@ -18,7 +18,7 @@ def check_update_alerts_source_data_attributes_alert_source_urgency_rules_attrib value in UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_ALERT_SOURCE_URGENCY_RULES_ATTRIBUTES_ITEM_CONDITIONABLE_TYPE_VALUES ): - return cast(UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemConditionableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_ALERT_SOURCE_URGENCY_RULES_ATTRIBUTES_ITEM_CONDITIONABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_kind.py b/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_kind.py index 19e29250..436769ca 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_kind.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind = Literal["alert_field", "payload"] @@ -16,7 +16,7 @@ def check_update_alerts_source_data_attributes_alert_source_urgency_rules_attrib if value is None: return None if value in UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_ALERT_SOURCE_URGENCY_RULES_ATTRIBUTES_ITEM_KIND_VALUES: - return cast(UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_ALERT_SOURCE_URGENCY_RULES_ATTRIBUTES_ITEM_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_operator.py b/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_operator.py index 8c25d869..10e5696e 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_operator.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_alert_source_urgency_rules_attributes_item_operator.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator = Literal[ "contains", "does_not_contain", "is", "is_not" @@ -20,7 +20,7 @@ def check_update_alerts_source_data_attributes_alert_source_urgency_rules_attrib if value is None: return None if value in UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_ALERT_SOURCE_URGENCY_RULES_ATTRIBUTES_ITEM_OPERATOR_VALUES: - return cast(UpdateAlertsSourceDataAttributesAlertSourceUrgencyRulesAttributesItemOperator, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_ALERT_SOURCE_URGENCY_RULES_ATTRIBUTES_ITEM_OPERATOR_VALUES!r}" ) 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 9e04ab56..ebf24781 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,8 +1,9 @@ +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 ..types import UNSET, Unset @@ -13,37 +14,36 @@ class UpdateAlertsSourceDataAttributesAlertTemplateAttributesType0: """ Attributes: - 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): The alert title. + description (None | str | Unset): The alert description. + external_url (None | str | Unset): The alert URL. """ - 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) + title: None | str | Unset = UNSET + description: None | str | Unset = UNSET + external_url: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: - title: None | Unset | str + title: None | str | Unset if isinstance(self.title, Unset): title = UNSET else: title = self.title - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - external_url: None | Unset | str + external_url: None | str | Unset if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if title is not UNSET: field_dict["title"] = title @@ -58,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 | Unset | str: + def _parse_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_external_url(data: object) -> None | Unset | str: + def _parse_external_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) @@ -91,21 +91,4 @@ def _parse_external_url(data: object) -> None | Unset | str: external_url=external_url, ) - update_alerts_source_data_attributes_alert_template_attributes_type_0.additional_properties = d return update_alerts_source_data_attributes_alert_template_attributes_type_0 - - @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_alerts_source_data_attributes_deduplication_key_kind.py b/rootly_sdk/models/update_alerts_source_data_attributes_deduplication_key_kind.py index 1da9d5c3..9cdcc345 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_deduplication_key_kind.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_deduplication_key_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertsSourceDataAttributesDeduplicationKeyKind = Literal["payload"] @@ -15,7 +15,7 @@ def check_update_alerts_source_data_attributes_deduplication_key_kind( if value is None: return None if value in UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_DEDUPLICATION_KEY_KIND_VALUES: - return cast(UpdateAlertsSourceDataAttributesDeduplicationKeyKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_DEDUPLICATION_KEY_KIND_VALUES!r}" ) 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 2dce4d7d..060f9b94 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,8 +1,9 @@ +from __future__ import annotations + 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 ..models.update_alerts_source_data_attributes_resolution_rule_attributes_type_0_condition_type import ( UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType, @@ -32,76 +33,73 @@ class UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0: """Provide additional attributes for email alerts source Attributes: - 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 + 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 conditions to evaluate for auto resolution """ - enabled: Unset | bool = UNSET - condition_type: Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType = UNSET + enabled: bool | Unset = UNSET + condition_type: UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType | Unset = UNSET identifier_matchable_type: ( - Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType + UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType | Unset ) = UNSET - identifier_matchable_id: None | Unset | str = UNSET + identifier_matchable_id: None | str | Unset = UNSET identifier_reference_kind: ( - Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind + UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind | Unset ) = UNSET - identifier_json_path: None | Unset | str = UNSET - identifier_value_regex: None | Unset | str = UNSET + identifier_json_path: None | str | Unset = UNSET + identifier_value_regex: None | str | Unset = UNSET conditions_attributes: ( - Unset | list["UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem"] + list[UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem] | Unset ) = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: enabled = self.enabled - condition_type: Unset | str = UNSET + condition_type: str | Unset = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - identifier_matchable_type: Unset | str = UNSET + identifier_matchable_type: str | Unset = UNSET if not isinstance(self.identifier_matchable_type, Unset): identifier_matchable_type = self.identifier_matchable_type - identifier_matchable_id: None | Unset | str + identifier_matchable_id: None | str | Unset if isinstance(self.identifier_matchable_id, Unset): identifier_matchable_id = UNSET else: identifier_matchable_id = self.identifier_matchable_id - identifier_reference_kind: Unset | str = UNSET + identifier_reference_kind: str | Unset = UNSET if not isinstance(self.identifier_reference_kind, Unset): identifier_reference_kind = self.identifier_reference_kind - identifier_json_path: None | Unset | str + identifier_json_path: None | str | Unset if isinstance(self.identifier_json_path, Unset): identifier_json_path = UNSET else: identifier_json_path = self.identifier_json_path - identifier_value_regex: None | Unset | str + identifier_value_regex: None | str | Unset if isinstance(self.identifier_value_regex, Unset): identifier_value_regex = UNSET else: identifier_value_regex = self.identifier_value_regex - conditions_attributes: Unset | list[dict[str, Any]] = UNSET + conditions_attributes: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.conditions_attributes, Unset): conditions_attributes = [] for conditions_attributes_item_data in self.conditions_attributes: @@ -109,7 +107,7 @@ def to_dict(self) -> dict[str, Any]: conditions_attributes.append(conditions_attributes_item) field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if enabled is not UNSET: field_dict["enabled"] = enabled @@ -140,7 +138,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: Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType + condition_type: UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType | Unset if isinstance(_condition_type, Unset): condition_type = UNSET else: @@ -152,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: ( - Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType + UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType | Unset ) if isinstance(_identifier_matchable_type, Unset): identifier_matchable_type = UNSET @@ -163,18 +161,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) ) - def _parse_identifier_matchable_id(data: object) -> None | Unset | str: + def _parse_identifier_matchable_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: ( - Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind + UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind | Unset ) if isinstance(_identifier_reference_kind, Unset): identifier_reference_kind = UNSET @@ -185,34 +183,38 @@ def _parse_identifier_matchable_id(data: object) -> None | Unset | str: ) ) - def _parse_identifier_json_path(data: object) -> None | Unset | str: + def _parse_identifier_json_path(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) identifier_json_path = _parse_identifier_json_path(d.pop("identifier_json_path", UNSET)) - def _parse_identifier_value_regex(data: object) -> None | Unset | str: + def _parse_identifier_value_regex(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) identifier_value_regex = _parse_identifier_value_regex(d.pop("identifier_value_regex", UNSET)) - conditions_attributes = [] _conditions_attributes = d.pop("conditions_attributes", UNSET) - for conditions_attributes_item_data in _conditions_attributes or []: - conditions_attributes_item = ( - UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem.from_dict( - conditions_attributes_item_data + 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 + ) ) - ) - 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, @@ -225,21 +227,4 @@ def _parse_identifier_value_regex(data: object) -> None | Unset | str: conditions_attributes=conditions_attributes, ) - update_alerts_source_data_attributes_resolution_rule_attributes_type_0.additional_properties = d return update_alerts_source_data_attributes_resolution_rule_attributes_type_0 - - @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_alerts_source_data_attributes_resolution_rule_attributes_type_0_condition_type.py b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_condition_type.py index 50f38a97..068e1e30 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_condition_type.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType = Literal["all", "any"] @@ -16,7 +16,7 @@ def check_update_alerts_source_data_attributes_resolution_rule_attributes_type_0 if value is None: return None if value in UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITION_TYPE_VALUES: - return cast(UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITION_TYPE_VALUES!r}" ) 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 c991994f..8133d82f 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,8 +1,9 @@ +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.update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_conditionable_type import ( UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType, @@ -25,63 +26,61 @@ class UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItem: """ Attributes: - field (Union[None, Unset, str]): JSON path expression to extract a specific value from the alert's payload for + field (None | str | Unset): JSON path expression to extract a specific value from the alert's payload for evaluation - 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 + 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 determine a match - 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 + 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 """ - field: None | Unset | str = UNSET - operator: Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator = ( + field: None | str | Unset = UNSET + operator: UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset = ( UNSET ) - value: Unset | str = UNSET + value: str | Unset = UNSET conditionable_type: ( - Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType + UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType | Unset ) = UNSET - conditionable_id: None | Unset | str = UNSET - kind: Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + conditionable_id: None | str | Unset = UNSET + kind: UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset = UNSET def to_dict(self) -> dict[str, Any]: - field: None | Unset | str + field: None | str | Unset if isinstance(self.field, Unset): field = UNSET else: field = self.field - operator: Unset | str = UNSET + operator: str | Unset = UNSET if not isinstance(self.operator, Unset): operator = self.operator value = self.value - conditionable_type: Unset | str = UNSET + conditionable_type: str | Unset = UNSET if not isinstance(self.conditionable_type, Unset): conditionable_type = self.conditionable_type - conditionable_id: None | Unset | str + conditionable_id: None | str | Unset if isinstance(self.conditionable_id, Unset): conditionable_id = UNSET else: conditionable_id = self.conditionable_id - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if field is not UNSET: field_dict["field"] = field @@ -102,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_field(data: object) -> None | Unset | str: + def _parse_field(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) field = _parse_field(d.pop("field", UNSET)) _operator = d.pop("operator", UNSET) - operator: Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator + operator: UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator | Unset if isinstance(_operator, Unset): operator = UNSET else: @@ -124,8 +123,8 @@ def _parse_field(data: object) -> None | Unset | str: _conditionable_type = d.pop("conditionable_type", UNSET) conditionable_type: ( - Unset - | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType + UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType + | Unset ) if isinstance(_conditionable_type, Unset): conditionable_type = UNSET @@ -134,17 +133,17 @@ def _parse_field(data: object) -> None | Unset | str: _conditionable_type ) - def _parse_conditionable_id(data: object) -> None | Unset | str: + def _parse_conditionable_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) conditionable_id = _parse_conditionable_id(d.pop("conditionable_id", UNSET)) _kind = d.pop("kind", UNSET) - kind: Unset | UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind + kind: UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind | Unset if isinstance(_kind, Unset): kind = UNSET else: @@ -161,21 +160,4 @@ def _parse_conditionable_id(data: object) -> None | Unset | str: kind=kind, ) - update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item.additional_properties = d return update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_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_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_conditionable_type.py b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_conditionable_type.py index 4c8ec69c..2b55c8c2 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_conditionable_type.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_conditionable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType = Literal[ "AlertField" @@ -20,10 +20,7 @@ def check_update_alerts_source_data_attributes_resolution_rule_attributes_type_0 value in UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITIONS_ATTRIBUTES_ITEM_CONDITIONABLE_TYPE_VALUES ): - return cast( - UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemConditionableType, - value, - ) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITIONS_ATTRIBUTES_ITEM_CONDITIONABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_kind.py b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_kind.py index 3373dc3f..d30661cc 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_kind.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind = Literal[ "alert_field", "payload" @@ -21,7 +21,7 @@ def check_update_alerts_source_data_attributes_resolution_rule_attributes_type_0 value in UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITIONS_ATTRIBUTES_ITEM_KIND_VALUES ): - return cast(UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITIONS_ATTRIBUTES_ITEM_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_operator.py b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_operator.py index 918a51e9..b07d5180 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_operator.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_conditions_attributes_item_operator.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator = Literal[ "contains", "does_not_contain", "ends_with", "is", "is_not", "starts_with" @@ -25,9 +25,7 @@ def check_update_alerts_source_data_attributes_resolution_rule_attributes_type_0 value in UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITIONS_ATTRIBUTES_ITEM_OPERATOR_VALUES ): - return cast( - UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0ConditionsAttributesItemOperator, value - ) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_CONDITIONS_ATTRIBUTES_ITEM_OPERATOR_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_identifier_matchable_type.py b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_identifier_matchable_type.py index 045d3431..6694eb31 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_identifier_matchable_type.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_identifier_matchable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType = Literal["AlertField"] @@ -15,7 +15,7 @@ def check_update_alerts_source_data_attributes_resolution_rule_attributes_type_0 if value is None: return None if value in UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_IDENTIFIER_MATCHABLE_TYPE_VALUES: - return cast(UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierMatchableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_IDENTIFIER_MATCHABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_identifier_reference_kind.py b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_identifier_reference_kind.py index 3aaef36e..d64ee36a 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_identifier_reference_kind.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_resolution_rule_attributes_type_0_identifier_reference_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind = Literal["alert_field", "payload"] @@ -16,7 +16,7 @@ def check_update_alerts_source_data_attributes_resolution_rule_attributes_type_0 if value is None: return None if value in UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_IDENTIFIER_REFERENCE_KIND_VALUES: - return cast(UpdateAlertsSourceDataAttributesResolutionRuleAttributesType0IdentifierReferenceKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_RESOLUTION_RULE_ATTRIBUTES_TYPE_0_IDENTIFIER_REFERENCE_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_source_type.py b/rootly_sdk/models/update_alerts_source_data_attributes_source_type.py index 2c2b3e9c..94646243 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_source_type.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_source_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertsSourceDataAttributesSourceType = Literal[ "alertmanager", @@ -61,7 +61,7 @@ def check_update_alerts_source_data_attributes_source_type( if value is None: return None if value in UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_SOURCE_TYPE_VALUES: - return cast(UpdateAlertsSourceDataAttributesSourceType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_SOURCE_TYPE_VALUES!r}" ) 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 c7bd0543..e1225b4b 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,9 +1,14 @@ +from __future__ import annotations + 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 ..models.update_alerts_source_data_attributes_sourceable_attributes_type_0_notification_target_type import ( + UpdateAlertsSourceDataAttributesSourceableAttributesType0NotificationTargetType, + check_update_alerts_source_data_attributes_sourceable_attributes_type_0_notification_target_type, +) from ..types import UNSET, Unset if TYPE_CHECKING: @@ -18,31 +23,42 @@ @_attrs_define class UpdateAlertsSourceDataAttributesSourceableAttributesType0: """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. + `field_mappings_attributes` apply to generic_webhook sources; `accept_threaded_emails`, `notification_target_type` + and `notification_target_id` apply to email sources. Attributes: - auto_resolve (Union[Unset, bool]): Set this to true to auto-resolve alerts based on field_mappings_attributes + auto_resolve (bool | Unset): 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 + 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 + notification_target_type (UpdateAlertsSourceDataAttributesSourceableAttributesType0NotificationTargetType | + Unset): Email sources only. The type of the notification target every alert from this source pages directly; + While it points to an active, pageable target, Alert Routes are not evaluated. Only used when the `email-alert- + source-notification-target` feature flag is on for the team. + notification_target_id (None | str | Unset): Email sources only. The ID of the notification target. Set to null + to clear it; this also clears `notification_target_type`. Only used when the `email-alert-source-notification- + target` feature flag is on for the team. + field_mappings_attributes + (list[UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem] | Unset): Specify + rules to auto resolve alerts """ - auto_resolve: Unset | bool = UNSET - resolve_state: None | Unset | str = UNSET - accept_threaded_emails: Unset | bool = UNSET + auto_resolve: bool | Unset = UNSET + resolve_state: None | str | Unset = UNSET + accept_threaded_emails: bool | Unset = UNSET + notification_target_type: ( + UpdateAlertsSourceDataAttributesSourceableAttributesType0NotificationTargetType | Unset + ) = UNSET + notification_target_id: None | str | Unset = UNSET field_mappings_attributes: ( - Unset | list["UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem"] + list[UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem] | Unset ) = 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 | Unset | str + resolve_state: None | str | Unset if isinstance(self.resolve_state, Unset): resolve_state = UNSET else: @@ -50,7 +66,17 @@ def to_dict(self) -> dict[str, Any]: accept_threaded_emails = self.accept_threaded_emails - field_mappings_attributes: Unset | list[dict[str, Any]] = UNSET + notification_target_type: str | Unset = UNSET + if not isinstance(self.notification_target_type, Unset): + notification_target_type = self.notification_target_type + + notification_target_id: None | str | Unset + if isinstance(self.notification_target_id, Unset): + notification_target_id = UNSET + else: + notification_target_id = self.notification_target_id + + field_mappings_attributes: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.field_mappings_attributes, Unset): field_mappings_attributes = [] for field_mappings_attributes_item_data in self.field_mappings_attributes: @@ -58,7 +84,7 @@ def to_dict(self) -> dict[str, Any]: field_mappings_attributes.append(field_mappings_attributes_item) field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if auto_resolve is not UNSET: field_dict["auto_resolve"] = auto_resolve @@ -66,6 +92,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["resolve_state"] = resolve_state if accept_threaded_emails is not UNSET: field_dict["accept_threaded_emails"] = accept_threaded_emails + if notification_target_type is not UNSET: + field_dict["notification_target_type"] = notification_target_type + if notification_target_id is not UNSET: + field_dict["notification_target_id"] = notification_target_id if field_mappings_attributes is not UNSET: field_dict["field_mappings_attributes"] = field_mappings_attributes @@ -80,50 +110,61 @@ 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 | Unset | str: + def _parse_resolve_state(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) - for field_mappings_attributes_item_data in _field_mappings_attributes or []: - field_mappings_attributes_item = ( - UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem.from_dict( - field_mappings_attributes_item_data + _notification_target_type = d.pop("notification_target_type", UNSET) + notification_target_type: ( + UpdateAlertsSourceDataAttributesSourceableAttributesType0NotificationTargetType | Unset + ) + if isinstance(_notification_target_type, Unset): + notification_target_type = UNSET + else: + notification_target_type = ( + check_update_alerts_source_data_attributes_sourceable_attributes_type_0_notification_target_type( + _notification_target_type ) ) - field_mappings_attributes.append(field_mappings_attributes_item) + def _parse_notification_target_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + notification_target_id = _parse_notification_target_id(d.pop("notification_target_id", UNSET)) + + _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 + ) + ) + + field_mappings_attributes.append(field_mappings_attributes_item) update_alerts_source_data_attributes_sourceable_attributes_type_0 = cls( auto_resolve=auto_resolve, resolve_state=resolve_state, accept_threaded_emails=accept_threaded_emails, + notification_target_type=notification_target_type, + notification_target_id=notification_target_id, field_mappings_attributes=field_mappings_attributes, ) - update_alerts_source_data_attributes_sourceable_attributes_type_0.additional_properties = d return update_alerts_source_data_attributes_sourceable_attributes_type_0 - - @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_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 e1ec5f6a..16c315cc 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,8 +1,9 @@ +from __future__ import annotations + 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.update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item_field import ( UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField, @@ -17,26 +18,25 @@ class UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItem: """ Attributes: - field (Union[Unset, UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField]): + field (UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField | Unset): 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 + json_path (str | Unset): 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: Unset | UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField = UNSET - json_path: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + field: UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField | Unset = UNSET + json_path: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: - field: Unset | str = UNSET + field: str | Unset = UNSET if not isinstance(self.field, Unset): field = self.field json_path = self.json_path field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if field is not UNSET: field_dict["field"] = field @@ -49,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: Unset | UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField + field: UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField | Unset if isinstance(_field, Unset): field = UNSET else: @@ -64,21 +64,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: json_path=json_path, ) - update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item.additional_properties = d return update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_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_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item_field.py b/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item_field.py index 607d5504..7d9f2ec8 100644 --- a/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item_field.py +++ b/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0_field_mappings_attributes_item_field.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField = Literal[ "alert_description", @@ -32,7 +32,7 @@ def check_update_alerts_source_data_attributes_sourceable_attributes_type_0_fiel value in UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_SOURCEABLE_ATTRIBUTES_TYPE_0_FIELD_MAPPINGS_ATTRIBUTES_ITEM_FIELD_VALUES ): - return cast(UpdateAlertsSourceDataAttributesSourceableAttributesType0FieldMappingsAttributesItemField, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_SOURCEABLE_ATTRIBUTES_TYPE_0_FIELD_MAPPINGS_ATTRIBUTES_ITEM_FIELD_VALUES!r}" ) diff --git a/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0_notification_target_type.py b/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0_notification_target_type.py new file mode 100644 index 00000000..3a2091c7 --- /dev/null +++ b/rootly_sdk/models/update_alerts_source_data_attributes_sourceable_attributes_type_0_notification_target_type.py @@ -0,0 +1,27 @@ +from typing import Literal + +UpdateAlertsSourceDataAttributesSourceableAttributesType0NotificationTargetType = Literal[ + "EscalationPolicy", "Functionality", "Group", "Service", "User" +] + +UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_SOURCEABLE_ATTRIBUTES_TYPE_0_NOTIFICATION_TARGET_TYPE_VALUES: set[ + UpdateAlertsSourceDataAttributesSourceableAttributesType0NotificationTargetType +] = { + "EscalationPolicy", + "Functionality", + "Group", + "Service", + "User", +} + + +def check_update_alerts_source_data_attributes_sourceable_attributes_type_0_notification_target_type( + value: str | None, +) -> UpdateAlertsSourceDataAttributesSourceableAttributesType0NotificationTargetType | None: + if value is None: + return None + if value in UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_SOURCEABLE_ATTRIBUTES_TYPE_0_NOTIFICATION_TARGET_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ALERTS_SOURCE_DATA_ATTRIBUTES_SOURCEABLE_ATTRIBUTES_TYPE_0_NOTIFICATION_TARGET_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_alerts_source_data_type.py b/rootly_sdk/models/update_alerts_source_data_type.py index 541ee0ce..2d244735 100644 --- a/rootly_sdk/models/update_alerts_source_data_type.py +++ b/rootly_sdk/models/update_alerts_source_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAlertsSourceDataType = Literal["alert_sources"] @@ -11,5 +11,5 @@ def check_update_alerts_source_data_type(value: str | None) -> UpdateAlertsSourc if value is None: return None if value in UPDATE_ALERTS_SOURCE_DATA_TYPE_VALUES: - return cast(UpdateAlertsSourceDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ALERTS_SOURCE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_api_key.py b/rootly_sdk/models/update_api_key.py index e1838445..a5bf1749 100644 --- a/rootly_sdk/models/update_api_key.py +++ b/rootly_sdk/models/update_api_key.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_api_key_data import UpdateApiKeyData @@ -18,14 +19,13 @@ class UpdateApiKey: data (UpdateApiKeyData): """ - data: "UpdateApiKeyData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateApiKeyData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_api_key.additional_properties = d return update_api_key - - @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_api_key_data.py b/rootly_sdk/models/update_api_key_data.py index a680bdf7..53288027 100644 --- a/rootly_sdk/models/update_api_key_data.py +++ b/rootly_sdk/models/update_api_key_data.py @@ -1,10 +1,12 @@ +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_api_key_data_type import UpdateApiKeyDataType, check_update_api_key_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_api_key_data_attributes import UpdateApiKeyDataAttributes @@ -19,25 +21,31 @@ class UpdateApiKeyData: Attributes: type_ (UpdateApiKeyDataType): attributes (UpdateApiKeyDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateApiKeyDataType - attributes: "UpdateApiKeyDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateApiKeyDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateApiKeyDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_api_key_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_api_key_data.additional_properties = d return update_api_key_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_api_key_data_attributes.py b/rootly_sdk/models/update_api_key_data_attributes.py index 56b49b6c..6c37bf3a 100644 --- a/rootly_sdk/models/update_api_key_data_attributes.py +++ b/rootly_sdk/models/update_api_key_data_attributes.py @@ -1,9 +1,10 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast from attrs import define as _attrs_define -from dateutil.parser import isoparse from ..types import UNSET, Unset @@ -14,25 +15,25 @@ class UpdateApiKeyDataAttributes: """ Attributes: - 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): 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: Unset | str = UNSET - description: None | Unset | str = UNSET - expires_at: None | Unset | datetime.datetime = UNSET + name: str | Unset = UNSET + description: None | str | Unset = UNSET + expires_at: datetime.datetime | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - expires_at: None | Unset | str + expires_at: None | str | Unset if isinstance(self.expires_at, Unset): expires_at = UNSET elif isinstance(self.expires_at, datetime.datetime): @@ -57,16 +58,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_expires_at(data: object) -> None | Unset | datetime.datetime: + def _parse_expires_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -74,12 +75,12 @@ def _parse_expires_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - expires_at_type_0 = isoparse(data) + expires_at_type_0 = datetime.datetime.fromisoformat(data) return expires_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) expires_at = _parse_expires_at(d.pop("expires_at", UNSET)) diff --git a/rootly_sdk/models/update_api_key_data_type.py b/rootly_sdk/models/update_api_key_data_type.py index 49c80620..6cb25a23 100644 --- a/rootly_sdk/models/update_api_key_data_type.py +++ b/rootly_sdk/models/update_api_key_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateApiKeyDataType = Literal["api_keys"] @@ -11,5 +11,5 @@ def check_update_api_key_data_type(value: str | None) -> UpdateApiKeyDataType | if value is None: return None if value in UPDATE_API_KEY_DATA_TYPE_VALUES: - return cast(UpdateApiKeyDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_API_KEY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_asana_task_task_params.py b/rootly_sdk/models/update_asana_task_task_params.py index 87c64f6c..5bc3f70a 100644 --- a/rootly_sdk/models/update_asana_task_task_params.py +++ b/rootly_sdk/models/update_asana_task_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -27,27 +29,27 @@ class UpdateAsanaTaskTaskParams: Attributes: task_id (str): The task id completion (UpdateAsanaTaskTaskParamsCompletion): - 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 + 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 valid JSON - dependency_direction (Union[Unset, UpdateAsanaTaskTaskParamsDependencyDirection]): Default: 'blocking'. - dependent_task_ids (Union[None, Unset, list[str]]): Dependent task ids. Supports liquid syntax + dependency_direction (UpdateAsanaTaskTaskParamsDependencyDirection | Unset): Default: 'blocking'. + dependent_task_ids (list[str] | None | Unset): Dependent task ids. Supports liquid syntax """ task_id: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -55,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: completion = self.completion.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -67,17 +69,17 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - dependency_direction: Unset | str = UNSET + dependency_direction: str | Unset = UNSET if not isinstance(self.dependency_direction, Unset): dependency_direction = self.dependency_direction - dependent_task_ids: None | Unset | list[str] + dependent_task_ids: list[str] | None | Unset if isinstance(self.dependent_task_ids, Unset): dependent_task_ids = UNSET elif isinstance(self.dependent_task_ids, list): @@ -123,7 +125,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: Unset | UpdateAsanaTaskTaskParamsTaskType + task_type: UpdateAsanaTaskTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -137,23 +139,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 | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) _dependency_direction = d.pop("dependency_direction", UNSET) - dependency_direction: Unset | UpdateAsanaTaskTaskParamsDependencyDirection + dependency_direction: UpdateAsanaTaskTaskParamsDependencyDirection | Unset 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) -> None | Unset | list[str]: + def _parse_dependent_task_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -164,9 +166,9 @@ def _parse_dependent_task_ids(data: object) -> None | Unset | list[str]: dependent_task_ids_type_0 = cast(list[str], data) return dependent_task_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, 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 83952ce3..9ed49ae3 100644 --- a/rootly_sdk/models/update_asana_task_task_params_completion.py +++ b/rootly_sdk/models/update_asana_task_task_params_completion.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class UpdateAsanaTaskTaskParamsCompletion: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_asana_task_task_params_dependency_direction.py b/rootly_sdk/models/update_asana_task_task_params_dependency_direction.py index 99fd2987..98ac4274 100644 --- a/rootly_sdk/models/update_asana_task_task_params_dependency_direction.py +++ b/rootly_sdk/models/update_asana_task_task_params_dependency_direction.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAsanaTaskTaskParamsDependencyDirection = Literal["blocked_by", "blocking"] @@ -14,7 +14,7 @@ def check_update_asana_task_task_params_dependency_direction( if value is None: return None if value in UPDATE_ASANA_TASK_TASK_PARAMS_DEPENDENCY_DIRECTION_VALUES: - return cast(UpdateAsanaTaskTaskParamsDependencyDirection, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ASANA_TASK_TASK_PARAMS_DEPENDENCY_DIRECTION_VALUES!r}" ) diff --git a/rootly_sdk/models/update_asana_task_task_params_task_type.py b/rootly_sdk/models/update_asana_task_task_params_task_type.py index e75c97e2..b250a5c7 100644 --- a/rootly_sdk/models/update_asana_task_task_params_task_type.py +++ b/rootly_sdk/models/update_asana_task_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAsanaTaskTaskParamsTaskType = Literal["update_asana_task"] @@ -11,5 +11,5 @@ def check_update_asana_task_task_params_task_type(value: str | None) -> UpdateAs if value is None: return None if value in UPDATE_ASANA_TASK_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateAsanaTaskTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ASANA_TASK_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_attached_alerts_task_params.py b/rootly_sdk/models/update_attached_alerts_task_params.py index 5220d7fb..eb67a79b 100644 --- a/rootly_sdk/models/update_attached_alerts_task_params.py +++ b/rootly_sdk/models/update_attached_alerts_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -22,17 +24,17 @@ class UpdateAttachedAlertsTaskParams: """ Attributes: status (UpdateAttachedAlertsTaskParamsStatus): - task_type (Union[Unset, UpdateAttachedAlertsTaskParamsTaskType]): + task_type (UpdateAttachedAlertsTaskParamsTaskType | Unset): """ status: UpdateAttachedAlertsTaskParamsStatus - task_type: Unset | UpdateAttachedAlertsTaskParamsTaskType = UNSET + task_type: UpdateAttachedAlertsTaskParamsTaskType | Unset = 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -54,7 +56,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: Unset | UpdateAttachedAlertsTaskParamsTaskType + task_type: UpdateAttachedAlertsTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_attached_alerts_task_params_status.py b/rootly_sdk/models/update_attached_alerts_task_params_status.py index 14c05c16..0431bab2 100644 --- a/rootly_sdk/models/update_attached_alerts_task_params_status.py +++ b/rootly_sdk/models/update_attached_alerts_task_params_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAttachedAlertsTaskParamsStatus = Literal["acknowledged", "resolved"] @@ -12,5 +12,5 @@ def check_update_attached_alerts_task_params_status(value: str | None) -> Update if value is None: return None if value in UPDATE_ATTACHED_ALERTS_TASK_PARAMS_STATUS_VALUES: - return cast(UpdateAttachedAlertsTaskParamsStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ATTACHED_ALERTS_TASK_PARAMS_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/update_attached_alerts_task_params_task_type.py b/rootly_sdk/models/update_attached_alerts_task_params_task_type.py index cf226505..3e079cca 100644 --- a/rootly_sdk/models/update_attached_alerts_task_params_task_type.py +++ b/rootly_sdk/models/update_attached_alerts_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAttachedAlertsTaskParamsTaskType = Literal["update_attached_alerts"] @@ -13,7 +13,7 @@ def check_update_attached_alerts_task_params_task_type( if value is None: return None if value in UPDATE_ATTACHED_ALERTS_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateAttachedAlertsTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ATTACHED_ALERTS_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_authorization.py b/rootly_sdk/models/update_authorization.py index 93414489..8a158397 100644 --- a/rootly_sdk/models/update_authorization.py +++ b/rootly_sdk/models/update_authorization.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_authorization_data import UpdateAuthorizationData @@ -18,14 +19,13 @@ class UpdateAuthorization: data (UpdateAuthorizationData): """ - data: "UpdateAuthorizationData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateAuthorizationData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_authorization.additional_properties = d return update_authorization - - @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_authorization_data.py b/rootly_sdk/models/update_authorization_data.py index ff68e054..672d0c8b 100644 --- a/rootly_sdk/models/update_authorization_data.py +++ b/rootly_sdk/models/update_authorization_data.py @@ -1,10 +1,12 @@ +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_authorization_data_type import UpdateAuthorizationDataType, check_update_authorization_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_authorization_data_attributes import UpdateAuthorizationDataAttributes @@ -19,25 +21,31 @@ class UpdateAuthorizationData: Attributes: type_ (UpdateAuthorizationDataType): attributes (UpdateAuthorizationDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateAuthorizationDataType - attributes: "UpdateAuthorizationDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateAuthorizationDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateAuthorizationDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_authorization_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_authorization_data.additional_properties = d return update_authorization_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_authorization_data_attributes.py b/rootly_sdk/models/update_authorization_data_attributes.py index e0ed42b6..a5e587cc 100644 --- a/rootly_sdk/models/update_authorization_data_attributes.py +++ b/rootly_sdk/models/update_authorization_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -16,13 +18,13 @@ class UpdateAuthorizationDataAttributes: """ Attributes: - permissions (Union[Unset, list[UpdateAuthorizationDataAttributesPermissionsItem]]): + permissions (list[UpdateAuthorizationDataAttributesPermissionsItem] | Unset): """ - permissions: Unset | list[UpdateAuthorizationDataAttributesPermissionsItem] = UNSET + permissions: list[UpdateAuthorizationDataAttributesPermissionsItem] | Unset = UNSET def to_dict(self) -> dict[str, Any]: - permissions: Unset | list[str] = UNSET + permissions: list[str] | Unset = UNSET if not isinstance(self.permissions, Unset): permissions = [] for permissions_item_data in self.permissions: @@ -40,12 +42,14 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - permissions = [] _permissions = d.pop("permissions", UNSET) - for permissions_item_data in _permissions or []: - permissions_item = check_update_authorization_data_attributes_permissions_item(permissions_item_data) + 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) - permissions.append(permissions_item) + permissions.append(permissions_item) update_authorization_data_attributes = cls( permissions=permissions, diff --git a/rootly_sdk/models/update_authorization_data_attributes_permissions_item.py b/rootly_sdk/models/update_authorization_data_attributes_permissions_item.py index b87f5254..c0cdeead 100644 --- a/rootly_sdk/models/update_authorization_data_attributes_permissions_item.py +++ b/rootly_sdk/models/update_authorization_data_attributes_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAuthorizationDataAttributesPermissionsItem = Literal["authorize", "destroy", "read", "update"] @@ -16,7 +16,7 @@ def check_update_authorization_data_attributes_permissions_item( if value is None: return None if value in UPDATE_AUTHORIZATION_DATA_ATTRIBUTES_PERMISSIONS_ITEM_VALUES: - return cast(UpdateAuthorizationDataAttributesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_AUTHORIZATION_DATA_ATTRIBUTES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_authorization_data_type.py b/rootly_sdk/models/update_authorization_data_type.py index 46d24064..4b9a19d9 100644 --- a/rootly_sdk/models/update_authorization_data_type.py +++ b/rootly_sdk/models/update_authorization_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateAuthorizationDataType = Literal["authorizations"] @@ -11,5 +11,5 @@ def check_update_authorization_data_type(value: str | None) -> UpdateAuthorizati if value is None: return None if value in UPDATE_AUTHORIZATION_DATA_TYPE_VALUES: - return cast(UpdateAuthorizationDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_AUTHORIZATION_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_catalog.py b/rootly_sdk/models/update_catalog.py index 9eeca011..3ba23578 100644 --- a/rootly_sdk/models/update_catalog.py +++ b/rootly_sdk/models/update_catalog.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_catalog_data import UpdateCatalogData @@ -18,14 +19,13 @@ class UpdateCatalog: data (UpdateCatalogData): """ - data: "UpdateCatalogData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateCatalogData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_catalog.additional_properties = d return update_catalog - - @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_catalog_checklist_template.py b/rootly_sdk/models/update_catalog_checklist_template.py index f1b29e91..19775003 100644 --- a/rootly_sdk/models/update_catalog_checklist_template.py +++ b/rootly_sdk/models/update_catalog_checklist_template.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_catalog_checklist_template_data import UpdateCatalogChecklistTemplateData @@ -18,14 +19,13 @@ class UpdateCatalogChecklistTemplate: data (UpdateCatalogChecklistTemplateData): """ - data: "UpdateCatalogChecklistTemplateData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateCatalogChecklistTemplateData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_catalog_checklist_template.additional_properties = d return update_catalog_checklist_template - - @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_catalog_checklist_template_data.py b/rootly_sdk/models/update_catalog_checklist_template_data.py index 1254eb27..b558cf88 100644 --- a/rootly_sdk/models/update_catalog_checklist_template_data.py +++ b/rootly_sdk/models/update_catalog_checklist_template_data.py @@ -1,13 +1,15 @@ +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_catalog_checklist_template_data_type import ( UpdateCatalogChecklistTemplateDataType, check_update_catalog_checklist_template_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_catalog_checklist_template_data_attributes import UpdateCatalogChecklistTemplateDataAttributes @@ -22,25 +24,31 @@ class UpdateCatalogChecklistTemplateData: Attributes: type_ (UpdateCatalogChecklistTemplateDataType): attributes (UpdateCatalogChecklistTemplateDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateCatalogChecklistTemplateDataType - attributes: "UpdateCatalogChecklistTemplateDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateCatalogChecklistTemplateDataAttributes + id: str | Unset = 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 @@ -55,26 +63,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateCatalogChecklistTemplateDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_catalog_checklist_template_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_catalog_checklist_template_data.additional_properties = d return update_catalog_checklist_template_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_catalog_checklist_template_data_attributes.py b/rootly_sdk/models/update_catalog_checklist_template_data_attributes.py index 36041da9..606901c2 100644 --- a/rootly_sdk/models/update_catalog_checklist_template_data_attributes.py +++ b/rootly_sdk/models/update_catalog_checklist_template_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -24,38 +26,36 @@ class UpdateCatalogChecklistTemplateDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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): 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: None | Unset | str = UNSET - name: Unset | str = UNSET - description: None | Unset | str = UNSET + slug: None | str | Unset = UNSET + name: str | Unset = UNSET + description: None | str | Unset = UNSET fields: ( - None - | Unset - | list[ - Union[ - "UpdateCatalogChecklistTemplateDataAttributesBuiltinField", - "UpdateCatalogChecklistTemplateDataAttributesCustomField", - ] + list[ + UpdateCatalogChecklistTemplateDataAttributesBuiltinField + | UpdateCatalogChecklistTemplateDataAttributesCustomField ] + | None + | Unset ) = UNSET - owners: None | Unset | list["UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item"] = UNSET + owners: list[UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_catalog_checklist_template_data_attributes_builtin_field import ( UpdateCatalogChecklistTemplateDataAttributesBuiltinField, ) - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -63,13 +63,13 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - fields: None | Unset | list[dict[str, Any]] + fields: list[dict[str, Any]] | None | Unset if isinstance(self.fields, Unset): fields = UNSET elif isinstance(self.fields, list): @@ -86,7 +86,7 @@ def to_dict(self) -> dict[str, Any]: else: fields = self.fields - owners: None | Unset | list[dict[str, Any]] + owners: list[dict[str, Any]] | None | Unset if isinstance(self.owners, Unset): owners = UNSET elif isinstance(self.owners, list): @@ -128,37 +128,35 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) def _parse_fields( data: object, ) -> ( - None - | Unset - | list[ - Union[ - "UpdateCatalogChecklistTemplateDataAttributesBuiltinField", - "UpdateCatalogChecklistTemplateDataAttributesCustomField", - ] + list[ + UpdateCatalogChecklistTemplateDataAttributesBuiltinField + | UpdateCatalogChecklistTemplateDataAttributesCustomField ] + | None + | Unset ): if data is None: return data @@ -173,10 +171,10 @@ def _parse_fields( def _parse_fields_type_0_item( data: object, - ) -> Union[ - "UpdateCatalogChecklistTemplateDataAttributesBuiltinField", - "UpdateCatalogChecklistTemplateDataAttributesCustomField", - ]: + ) -> ( + UpdateCatalogChecklistTemplateDataAttributesBuiltinField + | UpdateCatalogChecklistTemplateDataAttributesCustomField + ): try: if not isinstance(data, dict): raise TypeError() @@ -185,7 +183,7 @@ def _parse_fields_type_0_item( ) return fields_type_0_item_builtin_field - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -200,17 +198,15 @@ def _parse_fields_type_0_item( fields_type_0.append(fields_type_0_item) return fields_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass return cast( - None - | Unset - | list[ - Union[ - "UpdateCatalogChecklistTemplateDataAttributesBuiltinField", - "UpdateCatalogChecklistTemplateDataAttributesCustomField", - ] - ], + list[ + UpdateCatalogChecklistTemplateDataAttributesBuiltinField + | UpdateCatalogChecklistTemplateDataAttributesCustomField + ] + | None + | Unset, data, ) @@ -218,7 +214,7 @@ def _parse_fields_type_0_item( def _parse_owners( data: object, - ) -> None | Unset | list["UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item"]: + ) -> list[UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -236,9 +232,9 @@ def _parse_owners( owners_type_0.append(owners_type_0_item) return owners_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item"], data) + return cast(list[UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item] | None | Unset, data) owners = _parse_owners(d.pop("owners", UNSET)) 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 f918a230..7e061904 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,3 +1,5 @@ +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_builtin_field_field_source.py b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_builtin_field_field_source.py index 1b299ca0..80d81656 100644 --- a/rootly_sdk/models/update_catalog_checklist_template_data_attributes_builtin_field_field_source.py +++ b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_builtin_field_field_source.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCatalogChecklistTemplateDataAttributesBuiltinFieldFieldSource = Literal["builtin"] @@ -15,7 +15,7 @@ def check_update_catalog_checklist_template_data_attributes_builtin_field_field_ if value is None: return None if value in UPDATE_CATALOG_CHECKLIST_TEMPLATE_DATA_ATTRIBUTES_BUILTIN_FIELD_FIELD_SOURCE_VALUES: - return cast(UpdateCatalogChecklistTemplateDataAttributesBuiltinFieldFieldSource, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_CATALOG_CHECKLIST_TEMPLATE_DATA_ATTRIBUTES_BUILTIN_FIELD_FIELD_SOURCE_VALUES!r}" ) 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 9ff528c0..7831a8c9 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -19,12 +21,12 @@ class UpdateCatalogChecklistTemplateDataAttributesCustomField: Attributes: field_source (UpdateCatalogChecklistTemplateDataAttributesCustomFieldFieldSource): catalog_property_id (str): ID of the catalog property - field_key (Union[Unset, str]): Ignored for custom fields (auto-derived from catalog property) + field_key (str | Unset): Ignored for custom fields (auto-derived from catalog property) """ field_source: UpdateCatalogChecklistTemplateDataAttributesCustomFieldFieldSource catalog_property_id: str - field_key: Unset | str = UNSET + field_key: str | Unset = UNSET 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_custom_field_field_source.py b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_custom_field_field_source.py index e72f78ab..cd5bff86 100644 --- a/rootly_sdk/models/update_catalog_checklist_template_data_attributes_custom_field_field_source.py +++ b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_custom_field_field_source.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCatalogChecklistTemplateDataAttributesCustomFieldFieldSource = Literal["custom"] @@ -15,7 +15,7 @@ def check_update_catalog_checklist_template_data_attributes_custom_field_field_s if value is None: return None if value in UPDATE_CATALOG_CHECKLIST_TEMPLATE_DATA_ATTRIBUTES_CUSTOM_FIELD_FIELD_SOURCE_VALUES: - return cast(UpdateCatalogChecklistTemplateDataAttributesCustomFieldFieldSource, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_CATALOG_CHECKLIST_TEMPLATE_DATA_ATTRIBUTES_CUSTOM_FIELD_FIELD_SOURCE_VALUES!r}" ) 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 073dcfb7..59a41dae 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,8 +1,9 @@ +from __future__ import annotations + 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.update_catalog_checklist_template_data_attributes_owners_type_0_item_type import ( UpdateCatalogChecklistTemplateDataAttributesOwnersType0ItemType, @@ -22,7 +23,6 @@ class UpdateCatalogChecklistTemplateDataAttributesOwnersType0Item: id: str type_: UpdateCatalogChecklistTemplateDataAttributesOwnersType0ItemType - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -30,7 +30,7 @@ def to_dict(self) -> dict[str, Any]: type_: str = self.type_ field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -52,21 +52,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_=type_, ) - update_catalog_checklist_template_data_attributes_owners_type_0_item.additional_properties = d return update_catalog_checklist_template_data_attributes_owners_type_0_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_catalog_checklist_template_data_attributes_owners_type_0_item_type.py b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_owners_type_0_item_type.py index 71c39dea..e544d7e0 100644 --- a/rootly_sdk/models/update_catalog_checklist_template_data_attributes_owners_type_0_item_type.py +++ b/rootly_sdk/models/update_catalog_checklist_template_data_attributes_owners_type_0_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCatalogChecklistTemplateDataAttributesOwnersType0ItemType = Literal["field", "user"] @@ -16,7 +16,7 @@ def check_update_catalog_checklist_template_data_attributes_owners_type_0_item_t if value is None: return None if value in UPDATE_CATALOG_CHECKLIST_TEMPLATE_DATA_ATTRIBUTES_OWNERS_TYPE_0_ITEM_TYPE_VALUES: - return cast(UpdateCatalogChecklistTemplateDataAttributesOwnersType0ItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_CATALOG_CHECKLIST_TEMPLATE_DATA_ATTRIBUTES_OWNERS_TYPE_0_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_catalog_checklist_template_data_type.py b/rootly_sdk/models/update_catalog_checklist_template_data_type.py index a3b555ac..cfe9fb32 100644 --- a/rootly_sdk/models/update_catalog_checklist_template_data_type.py +++ b/rootly_sdk/models/update_catalog_checklist_template_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCatalogChecklistTemplateDataType = Literal["catalog_checklist_templates"] @@ -13,7 +13,7 @@ def check_update_catalog_checklist_template_data_type( if value is None: return None if value in UPDATE_CATALOG_CHECKLIST_TEMPLATE_DATA_TYPE_VALUES: - return cast(UpdateCatalogChecklistTemplateDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_CATALOG_CHECKLIST_TEMPLATE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_catalog_data.py b/rootly_sdk/models/update_catalog_data.py index a7def769..ead64445 100644 --- a/rootly_sdk/models/update_catalog_data.py +++ b/rootly_sdk/models/update_catalog_data.py @@ -1,10 +1,12 @@ +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_catalog_data_type import UpdateCatalogDataType, check_update_catalog_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_catalog_data_attributes import UpdateCatalogDataAttributes @@ -19,25 +21,31 @@ class UpdateCatalogData: Attributes: type_ (UpdateCatalogDataType): attributes (UpdateCatalogDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateCatalogDataType - attributes: "UpdateCatalogDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateCatalogDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateCatalogDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_catalog_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_catalog_data.additional_properties = d return update_catalog_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_catalog_data_attributes.py b/rootly_sdk/models/update_catalog_data_attributes.py index 35787e3d..bfd83117 100644 --- a/rootly_sdk/models/update_catalog_data_attributes.py +++ b/rootly_sdk/models/update_catalog_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,24 +18,24 @@ class UpdateCatalogDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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): + 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: 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 + slug: None | str | Unset = UNSET + name: str | Unset = UNSET + description: None | str | Unset = UNSET + icon: UpdateCatalogDataAttributesIcon | Unset = UNSET + position: int | None | Unset = UNSET + external_id: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -41,23 +43,23 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - icon: Unset | str = UNSET + icon: str | Unset = UNSET if not isinstance(self.icon, Unset): icon = self.icon - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -85,48 +87,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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) _icon = d.pop("icon", UNSET) - icon: Unset | UpdateCatalogDataAttributesIcon + icon: UpdateCatalogDataAttributesIcon | Unset if isinstance(_icon, Unset): icon = UNSET else: icon = check_update_catalog_data_attributes_icon(_icon) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) diff --git a/rootly_sdk/models/update_catalog_data_attributes_icon.py b/rootly_sdk/models/update_catalog_data_attributes_icon.py index 2751c184..34633e4b 100644 --- a/rootly_sdk/models/update_catalog_data_attributes_icon.py +++ b/rootly_sdk/models/update_catalog_data_attributes_icon.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCatalogDataAttributesIcon = Literal[ "chart-bar", "cursor-arrow-ripple", "globe-alt", "light-bulb", "server-stack", "shapes", "user-group", "users" @@ -20,5 +20,5 @@ def check_update_catalog_data_attributes_icon(value: str | None) -> UpdateCatalo if value is None: return None if value in UPDATE_CATALOG_DATA_ATTRIBUTES_ICON_VALUES: - return cast(UpdateCatalogDataAttributesIcon, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_CATALOG_DATA_ATTRIBUTES_ICON_VALUES!r}") diff --git a/rootly_sdk/models/update_catalog_data_type.py b/rootly_sdk/models/update_catalog_data_type.py index ee8cfb4d..7306579e 100644 --- a/rootly_sdk/models/update_catalog_data_type.py +++ b/rootly_sdk/models/update_catalog_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCatalogDataType = Literal["catalogs"] @@ -11,5 +11,5 @@ def check_update_catalog_data_type(value: str | None) -> UpdateCatalogDataType | if value is None: return None if value in UPDATE_CATALOG_DATA_TYPE_VALUES: - return cast(UpdateCatalogDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_CATALOG_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_catalog_entity.py b/rootly_sdk/models/update_catalog_entity.py index 1d01990b..e53da36f 100644 --- a/rootly_sdk/models/update_catalog_entity.py +++ b/rootly_sdk/models/update_catalog_entity.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_catalog_entity_data import UpdateCatalogEntityData @@ -18,14 +19,13 @@ class UpdateCatalogEntity: data (UpdateCatalogEntityData): """ - data: "UpdateCatalogEntityData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateCatalogEntityData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_catalog_entity.additional_properties = d return update_catalog_entity - - @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_catalog_entity_data.py b/rootly_sdk/models/update_catalog_entity_data.py index 1ae7aec8..ca06fcc7 100644 --- a/rootly_sdk/models/update_catalog_entity_data.py +++ b/rootly_sdk/models/update_catalog_entity_data.py @@ -1,10 +1,12 @@ +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_catalog_entity_data_type import UpdateCatalogEntityDataType, check_update_catalog_entity_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_catalog_entity_data_attributes import UpdateCatalogEntityDataAttributes @@ -19,25 +21,31 @@ class UpdateCatalogEntityData: Attributes: type_ (UpdateCatalogEntityDataType): attributes (UpdateCatalogEntityDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateCatalogEntityDataType - attributes: "UpdateCatalogEntityDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateCatalogEntityDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateCatalogEntityDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_catalog_entity_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_catalog_entity_data.additional_properties = d return update_catalog_entity_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_catalog_entity_data_attributes.py b/rootly_sdk/models/update_catalog_entity_data_attributes.py index f4039184..8e9c373b 100644 --- a/rootly_sdk/models/update_catalog_entity_data_attributes.py +++ b/rootly_sdk/models/update_catalog_entity_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -18,30 +20,30 @@ class UpdateCatalogEntityDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + name (str | Unset): + description (None | str | Unset): + public_description (None | str | Unset): The status page description of the catalog entity + 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 catalog. - properties (Union[Unset, list['UpdateCatalogEntityDataAttributesPropertiesItem']]): Array of property values for - this catalog entity + properties (list[UpdateCatalogEntityDataAttributesPropertiesItem] | Unset): Array of property values for this + catalog entity """ - 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 + slug: None | str | Unset = UNSET + name: str | Unset = UNSET + description: None | str | Unset = UNSET + public_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 def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -49,37 +51,37 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | Unset | str + backstage_id: None | str | Unset if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - properties: Unset | list[dict[str, Any]] = UNSET + properties: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -116,68 +118,70 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | Unset | str: + def _parse_backstage_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - properties = [] _properties = d.pop("properties", UNSET) - for properties_item_data in _properties or []: - properties_item = UpdateCatalogEntityDataAttributesPropertiesItem.from_dict(properties_item_data) + 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) - properties.append(properties_item) + properties.append(properties_item) update_catalog_entity_data_attributes = cls( slug=slug, 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 001e4eb7..06dcaffd 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_catalog_entity_data_type.py b/rootly_sdk/models/update_catalog_entity_data_type.py index 797224e0..b66a59ad 100644 --- a/rootly_sdk/models/update_catalog_entity_data_type.py +++ b/rootly_sdk/models/update_catalog_entity_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCatalogEntityDataType = Literal["catalog_entities"] @@ -11,5 +11,5 @@ def check_update_catalog_entity_data_type(value: str | None) -> UpdateCatalogEnt if value is None: return None if value in UPDATE_CATALOG_ENTITY_DATA_TYPE_VALUES: - return cast(UpdateCatalogEntityDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_CATALOG_ENTITY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_catalog_entity_property.py b/rootly_sdk/models/update_catalog_entity_property.py index 27f982f7..6bfeb791 100644 --- a/rootly_sdk/models/update_catalog_entity_property.py +++ b/rootly_sdk/models/update_catalog_entity_property.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_catalog_entity_property_data import UpdateCatalogEntityPropertyData @@ -20,14 +21,13 @@ class UpdateCatalogEntityProperty: data (UpdateCatalogEntityPropertyData): """ - data: "UpdateCatalogEntityPropertyData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateCatalogEntityPropertyData 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, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_catalog_entity_property.additional_properties = d return update_catalog_entity_property - - @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_catalog_entity_property_data.py b/rootly_sdk/models/update_catalog_entity_property_data.py index c1b43386..eb24bcde 100644 --- a/rootly_sdk/models/update_catalog_entity_property_data.py +++ b/rootly_sdk/models/update_catalog_entity_property_data.py @@ -1,13 +1,15 @@ +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_catalog_entity_property_data_type import ( UpdateCatalogEntityPropertyDataType, check_update_catalog_entity_property_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_catalog_entity_property_data_attributes import UpdateCatalogEntityPropertyDataAttributes @@ -22,25 +24,31 @@ class UpdateCatalogEntityPropertyData: Attributes: type_ (UpdateCatalogEntityPropertyDataType): attributes (UpdateCatalogEntityPropertyDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateCatalogEntityPropertyDataType - attributes: "UpdateCatalogEntityPropertyDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateCatalogEntityPropertyDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateCatalogEntityPropertyDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_catalog_entity_property_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_catalog_entity_property_data.additional_properties = d return update_catalog_entity_property_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_catalog_entity_property_data_attributes.py b/rootly_sdk/models/update_catalog_entity_property_data_attributes.py index 82f8b56c..eb945add 100644 --- a/rootly_sdk/models/update_catalog_entity_property_data_attributes.py +++ b/rootly_sdk/models/update_catalog_entity_property_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -16,15 +18,15 @@ class UpdateCatalogEntityPropertyDataAttributes: """ Attributes: - key (Union[Unset, UpdateCatalogEntityPropertyDataAttributesKey]): - value (Union[Unset, str]): + key (UpdateCatalogEntityPropertyDataAttributesKey | Unset): + value (str | Unset): """ - key: Unset | UpdateCatalogEntityPropertyDataAttributesKey = UNSET - value: Unset | str = UNSET + key: UpdateCatalogEntityPropertyDataAttributesKey | Unset = UNSET + value: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: - key: Unset | str = UNSET + key: str | Unset = UNSET if not isinstance(self.key, Unset): key = self.key @@ -44,7 +46,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: Unset | UpdateCatalogEntityPropertyDataAttributesKey + key: UpdateCatalogEntityPropertyDataAttributesKey | Unset if isinstance(_key, Unset): key = UNSET else: diff --git a/rootly_sdk/models/update_catalog_entity_property_data_attributes_key.py b/rootly_sdk/models/update_catalog_entity_property_data_attributes_key.py index d3115cb3..26841641 100644 --- a/rootly_sdk/models/update_catalog_entity_property_data_attributes_key.py +++ b/rootly_sdk/models/update_catalog_entity_property_data_attributes_key.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCatalogEntityPropertyDataAttributesKey = Literal["catalog_entity", "slack", "text"] @@ -15,7 +15,7 @@ def check_update_catalog_entity_property_data_attributes_key( if value is None: return None if value in UPDATE_CATALOG_ENTITY_PROPERTY_DATA_ATTRIBUTES_KEY_VALUES: - return cast(UpdateCatalogEntityPropertyDataAttributesKey, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_CATALOG_ENTITY_PROPERTY_DATA_ATTRIBUTES_KEY_VALUES!r}" ) diff --git a/rootly_sdk/models/update_catalog_entity_property_data_type.py b/rootly_sdk/models/update_catalog_entity_property_data_type.py index 74f1ec19..b8163802 100644 --- a/rootly_sdk/models/update_catalog_entity_property_data_type.py +++ b/rootly_sdk/models/update_catalog_entity_property_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCatalogEntityPropertyDataType = Literal["catalog_entity_properties"] @@ -11,5 +11,5 @@ def check_update_catalog_entity_property_data_type(value: str | None) -> UpdateC if value is None: return None if value in UPDATE_CATALOG_ENTITY_PROPERTY_DATA_TYPE_VALUES: - return cast(UpdateCatalogEntityPropertyDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_CATALOG_ENTITY_PROPERTY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_catalog_field.py b/rootly_sdk/models/update_catalog_field.py index 71d4aaf0..53249d06 100644 --- a/rootly_sdk/models/update_catalog_field.py +++ b/rootly_sdk/models/update_catalog_field.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_catalog_field_data import UpdateCatalogFieldData @@ -18,14 +19,13 @@ class UpdateCatalogField: data (UpdateCatalogFieldData): """ - data: "UpdateCatalogFieldData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateCatalogFieldData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_catalog_field.additional_properties = d return update_catalog_field - - @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_catalog_field_data.py b/rootly_sdk/models/update_catalog_field_data.py index 08e43274..a5502733 100644 --- a/rootly_sdk/models/update_catalog_field_data.py +++ b/rootly_sdk/models/update_catalog_field_data.py @@ -1,10 +1,12 @@ +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_catalog_field_data_type import UpdateCatalogFieldDataType, check_update_catalog_field_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_catalog_field_data_attributes import UpdateCatalogFieldDataAttributes @@ -19,25 +21,31 @@ class UpdateCatalogFieldData: Attributes: type_ (UpdateCatalogFieldDataType): attributes (UpdateCatalogFieldDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateCatalogFieldDataType - attributes: "UpdateCatalogFieldDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateCatalogFieldDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateCatalogFieldDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_catalog_field_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_catalog_field_data.additional_properties = d return update_catalog_field_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_catalog_field_data_attributes.py b/rootly_sdk/models/update_catalog_field_data_attributes.py index 3783689b..c3698e48 100644 --- a/rootly_sdk/models/update_catalog_field_data_attributes.py +++ b/rootly_sdk/models/update_catalog_field_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,30 +22,29 @@ class UpdateCatalogFieldDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + 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 scope. """ - 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 + slug: None | str | Unset = UNSET + 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 def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -51,17 +52,17 @@ def to_dict(self) -> dict[str, Any]: name = self.name - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind - kind_catalog_id: None | Unset | str + kind_catalog_id: None | str | Unset if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: kind_catalog_id = self.kind_catalog_id - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -69,11 +70,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: Unset | str = UNSET + catalog_type: str | Unset = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -105,57 +106,57 @@ 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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) _kind = d.pop("kind", UNSET) - kind: Unset | UpdateCatalogFieldDataAttributesKind + kind: UpdateCatalogFieldDataAttributesKind | Unset if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_catalog_field_data_attributes_kind(_kind) - def _parse_kind_catalog_id(data: object) -> None | Unset | str: + def _parse_kind_catalog_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: Unset | UpdateCatalogFieldDataAttributesCatalogType + catalog_type: UpdateCatalogFieldDataAttributesCatalogType | Unset 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 | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) diff --git a/rootly_sdk/models/update_catalog_field_data_attributes_catalog_type.py b/rootly_sdk/models/update_catalog_field_data_attributes_catalog_type.py index 0892bf9c..d4041cb3 100644 --- a/rootly_sdk/models/update_catalog_field_data_attributes_catalog_type.py +++ b/rootly_sdk/models/update_catalog_field_data_attributes_catalog_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCatalogFieldDataAttributesCatalogType = Literal[ "catalog", "cause", "environment", "functionality", "incident_type", "service", "team" @@ -21,7 +21,7 @@ def check_update_catalog_field_data_attributes_catalog_type( if value is None: return None if value in UPDATE_CATALOG_FIELD_DATA_ATTRIBUTES_CATALOG_TYPE_VALUES: - return cast(UpdateCatalogFieldDataAttributesCatalogType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_CATALOG_FIELD_DATA_ATTRIBUTES_CATALOG_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_catalog_field_data_attributes_kind.py b/rootly_sdk/models/update_catalog_field_data_attributes_kind.py index 706b7e70..c5f895cc 100644 --- a/rootly_sdk/models/update_catalog_field_data_attributes_kind.py +++ b/rootly_sdk/models/update_catalog_field_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCatalogFieldDataAttributesKind = Literal[ "boolean", "cause", "environment", "functionality", "group", "incident_type", "reference", "service", "text", "user" @@ -22,5 +22,5 @@ def check_update_catalog_field_data_attributes_kind(value: str | None) -> Update if value is None: return None if value in UPDATE_CATALOG_FIELD_DATA_ATTRIBUTES_KIND_VALUES: - return cast(UpdateCatalogFieldDataAttributesKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_CATALOG_FIELD_DATA_ATTRIBUTES_KIND_VALUES!r}") diff --git a/rootly_sdk/models/update_catalog_field_data_type.py b/rootly_sdk/models/update_catalog_field_data_type.py index 5300317d..22d34364 100644 --- a/rootly_sdk/models/update_catalog_field_data_type.py +++ b/rootly_sdk/models/update_catalog_field_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCatalogFieldDataType = Literal["catalog_properties"] @@ -11,5 +11,5 @@ def check_update_catalog_field_data_type(value: str | None) -> UpdateCatalogFiel if value is None: return None if value in UPDATE_CATALOG_FIELD_DATA_TYPE_VALUES: - return cast(UpdateCatalogFieldDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_CATALOG_FIELD_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_catalog_property.py b/rootly_sdk/models/update_catalog_property.py index d7ba4b5e..07f3d584 100644 --- a/rootly_sdk/models/update_catalog_property.py +++ b/rootly_sdk/models/update_catalog_property.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_catalog_property_data import UpdateCatalogPropertyData @@ -18,14 +19,13 @@ class UpdateCatalogProperty: data (UpdateCatalogPropertyData): """ - data: "UpdateCatalogPropertyData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateCatalogPropertyData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_catalog_property.additional_properties = d return update_catalog_property - - @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_catalog_property_data.py b/rootly_sdk/models/update_catalog_property_data.py index 2412fa4f..a7119e89 100644 --- a/rootly_sdk/models/update_catalog_property_data.py +++ b/rootly_sdk/models/update_catalog_property_data.py @@ -1,13 +1,15 @@ +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_catalog_property_data_type import ( UpdateCatalogPropertyDataType, check_update_catalog_property_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_catalog_property_data_attributes import UpdateCatalogPropertyDataAttributes @@ -22,25 +24,31 @@ class UpdateCatalogPropertyData: Attributes: type_ (UpdateCatalogPropertyDataType): attributes (UpdateCatalogPropertyDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateCatalogPropertyDataType - attributes: "UpdateCatalogPropertyDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateCatalogPropertyDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateCatalogPropertyDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_catalog_property_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_catalog_property_data.additional_properties = d return update_catalog_property_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_catalog_property_data_attributes.py b/rootly_sdk/models/update_catalog_property_data_attributes.py index c6dd568b..2d5b3c09 100644 --- a/rootly_sdk/models/update_catalog_property_data_attributes.py +++ b/rootly_sdk/models/update_catalog_property_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,30 +22,30 @@ class UpdateCatalogPropertyDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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): + 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: 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 + slug: None | str | Unset = UNSET + 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 def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -51,17 +53,17 @@ def to_dict(self) -> dict[str, Any]: name = self.name - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind - kind_catalog_id: None | Unset | str + kind_catalog_id: None | str | Unset if isinstance(self.kind_catalog_id, Unset): kind_catalog_id = UNSET else: kind_catalog_id = self.kind_catalog_id - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -69,11 +71,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - catalog_type: Unset | str = UNSET + catalog_type: str | Unset = UNSET if not isinstance(self.catalog_type, Unset): catalog_type = self.catalog_type - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: @@ -105,57 +107,57 @@ 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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) _kind = d.pop("kind", UNSET) - kind: Unset | UpdateCatalogPropertyDataAttributesKind + kind: UpdateCatalogPropertyDataAttributesKind | Unset if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_catalog_property_data_attributes_kind(_kind) - def _parse_kind_catalog_id(data: object) -> None | Unset | str: + def _parse_kind_catalog_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) kind_catalog_id = _parse_kind_catalog_id(d.pop("kind_catalog_id", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) required = d.pop("required", UNSET) _catalog_type = d.pop("catalog_type", UNSET) - catalog_type: Unset | UpdateCatalogPropertyDataAttributesCatalogType + catalog_type: UpdateCatalogPropertyDataAttributesCatalogType | Unset 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 | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) diff --git a/rootly_sdk/models/update_catalog_property_data_attributes_catalog_type.py b/rootly_sdk/models/update_catalog_property_data_attributes_catalog_type.py index 7d20b14a..eab007f3 100644 --- a/rootly_sdk/models/update_catalog_property_data_attributes_catalog_type.py +++ b/rootly_sdk/models/update_catalog_property_data_attributes_catalog_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCatalogPropertyDataAttributesCatalogType = Literal[ "catalog", "cause", "environment", "functionality", "incident_type", "service", "team" @@ -21,7 +21,7 @@ def check_update_catalog_property_data_attributes_catalog_type( if value is None: return None if value in UPDATE_CATALOG_PROPERTY_DATA_ATTRIBUTES_CATALOG_TYPE_VALUES: - return cast(UpdateCatalogPropertyDataAttributesCatalogType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_CATALOG_PROPERTY_DATA_ATTRIBUTES_CATALOG_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_catalog_property_data_attributes_kind.py b/rootly_sdk/models/update_catalog_property_data_attributes_kind.py index 9ddd1016..57415067 100644 --- a/rootly_sdk/models/update_catalog_property_data_attributes_kind.py +++ b/rootly_sdk/models/update_catalog_property_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCatalogPropertyDataAttributesKind = Literal[ "boolean", "cause", "environment", "functionality", "group", "incident_type", "reference", "service", "text", "user" @@ -24,7 +24,7 @@ def check_update_catalog_property_data_attributes_kind( if value is None: return None if value in UPDATE_CATALOG_PROPERTY_DATA_ATTRIBUTES_KIND_VALUES: - return cast(UpdateCatalogPropertyDataAttributesKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_CATALOG_PROPERTY_DATA_ATTRIBUTES_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/update_catalog_property_data_type.py b/rootly_sdk/models/update_catalog_property_data_type.py index 7d0180c7..d87806f0 100644 --- a/rootly_sdk/models/update_catalog_property_data_type.py +++ b/rootly_sdk/models/update_catalog_property_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCatalogPropertyDataType = Literal["catalog_properties"] @@ -11,5 +11,5 @@ def check_update_catalog_property_data_type(value: str | None) -> UpdateCatalogP if value is None: return None if value in UPDATE_CATALOG_PROPERTY_DATA_TYPE_VALUES: - return cast(UpdateCatalogPropertyDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_CATALOG_PROPERTY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_cause.py b/rootly_sdk/models/update_cause.py index ff36414d..741f9709 100644 --- a/rootly_sdk/models/update_cause.py +++ b/rootly_sdk/models/update_cause.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_cause_data import UpdateCauseData @@ -18,14 +19,13 @@ class UpdateCause: data (UpdateCauseData): """ - data: "UpdateCauseData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateCauseData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_cause.additional_properties = d return update_cause - - @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_cause_data.py b/rootly_sdk/models/update_cause_data.py index afcaf388..09681ad4 100644 --- a/rootly_sdk/models/update_cause_data.py +++ b/rootly_sdk/models/update_cause_data.py @@ -1,10 +1,12 @@ +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_cause_data_type import UpdateCauseDataType, check_update_cause_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_cause_data_attributes import UpdateCauseDataAttributes @@ -19,25 +21,31 @@ class UpdateCauseData: Attributes: type_ (UpdateCauseDataType): attributes (UpdateCauseDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateCauseDataType - attributes: "UpdateCauseDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateCauseDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateCauseDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_cause_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_cause_data.additional_properties = d return update_cause_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_cause_data_attributes.py b/rootly_sdk/models/update_cause_data_attributes.py index 04ac0a70..c0b6e7e3 100644 --- a/rootly_sdk/models/update_cause_data_attributes.py +++ b/rootly_sdk/models/update_cause_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -16,25 +18,24 @@ class UpdateCauseDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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): The name of the cause + description (None | str | Unset): The description of the cause + public_description (None | str | Unset): The status page description of the cause + position (int | None | Unset): Position of the cause + properties (list[UpdateCauseDataAttributesPropertiesItem] | Unset): Array of property values for this cause. """ - 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 + slug: None | str | Unset = UNSET + name: str | Unset = UNSET + description: None | str | Unset = UNSET + public_description: None | str | Unset = UNSET + position: int | None | Unset = UNSET + properties: list[UpdateCauseDataAttributesPropertiesItem] | Unset = UNSET def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -42,25 +43,25 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - properties: Unset | list[dict[str, Any]] = UNSET + properties: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -91,50 +92,52 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - properties = [] _properties = d.pop("properties", UNSET) - for properties_item_data in _properties or []: - properties_item = UpdateCauseDataAttributesPropertiesItem.from_dict(properties_item_data) + 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) - properties.append(properties_item) + properties.append(properties_item) update_cause_data_attributes = cls( slug=slug, 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 536c2d79..f551eb85 100644 --- a/rootly_sdk/models/update_cause_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_cause_data_attributes_properties_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_cause_data_type.py b/rootly_sdk/models/update_cause_data_type.py index c95669a4..4c95a379 100644 --- a/rootly_sdk/models/update_cause_data_type.py +++ b/rootly_sdk/models/update_cause_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCauseDataType = Literal["causes"] @@ -11,5 +11,5 @@ def check_update_cause_data_type(value: str | None) -> UpdateCauseDataType | Non if value is None: return None if value in UPDATE_CAUSE_DATA_TYPE_VALUES: - return cast(UpdateCauseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_CAUSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_clickup_task_task_params.py b/rootly_sdk/models/update_clickup_task_task_params.py index a1a7d6a6..d9bdbccb 100644 --- a/rootly_sdk/models/update_clickup_task_task_params.py +++ b/rootly_sdk/models/update_clickup_task_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,33 +24,33 @@ class UpdateClickupTaskTaskParams: """ Attributes: task_id (str): The task id - 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 + 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 valid JSON - task_payload (Union[None, Unset, str]): Additional ClickUp task attributes. Will be merged into whatever was + task_payload (None | str | Unset): 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: 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 + 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 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -58,19 +60,19 @@ def to_dict(self) -> dict[str, Any]: tags = self.tags - priority: Unset | dict[str, Any] = UNSET + priority: dict[str, Any] | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() due_date = self.due_date - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - task_payload: None | Unset | str + task_payload: None | str | Unset if isinstance(self.task_payload, Unset): task_payload = UNSET else: @@ -110,7 +112,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: Unset | UpdateClickupTaskTaskParamsTaskType + task_type: UpdateClickupTaskTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -123,7 +125,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tags = d.pop("tags", UNSET) _priority = d.pop("priority", UNSET) - priority: Unset | UpdateClickupTaskTaskParamsPriority + priority: UpdateClickupTaskTaskParamsPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: @@ -131,21 +133,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 | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_task_payload(data: object) -> None | Unset | str: + def _parse_task_payload(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 eb3024d0..bfae1358 100644 --- a/rootly_sdk/models/update_clickup_task_task_params_priority.py +++ b/rootly_sdk/models/update_clickup_task_task_params_priority.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateClickupTaskTaskParamsPriority: """The priority id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_clickup_task_task_params_task_type.py b/rootly_sdk/models/update_clickup_task_task_params_task_type.py index cd93ea6f..fef5825f 100644 --- a/rootly_sdk/models/update_clickup_task_task_params_task_type.py +++ b/rootly_sdk/models/update_clickup_task_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateClickupTaskTaskParamsTaskType = Literal["update_clickup_task"] @@ -11,5 +11,5 @@ def check_update_clickup_task_task_params_task_type(value: str | None) -> Update if value is None: return None if value in UPDATE_CLICKUP_TASK_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateClickupTaskTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_CLICKUP_TASK_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_coda_page_task_params.py b/rootly_sdk/models/update_coda_page_task_params.py index f36a0719..9791bb83 100644 --- a/rootly_sdk/models/update_coda_page_task_params.py +++ b/rootly_sdk/models/update_coda_page_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,27 +24,27 @@ class UpdateCodaPageTaskParams: """ Attributes: page_id (str): The Coda page id - 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]): + 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): """ page_id: str - 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 + 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 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -54,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - template: Unset | dict[str, Any] = UNSET + template: dict[str, Any] | Unset = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -88,7 +90,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: Unset | UpdateCodaPageTaskParamsTaskType + task_type: UpdateCodaPageTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -103,7 +105,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content", UNSET) _template = d.pop("template", UNSET) - template: Unset | UpdateCodaPageTaskParamsTemplate + template: UpdateCodaPageTaskParamsTemplate | Unset if isinstance(_template, Unset): template = UNSET else: diff --git a/rootly_sdk/models/update_coda_page_task_params_task_type.py b/rootly_sdk/models/update_coda_page_task_params_task_type.py index 14caaa1c..dc9e8a78 100644 --- a/rootly_sdk/models/update_coda_page_task_params_task_type.py +++ b/rootly_sdk/models/update_coda_page_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCodaPageTaskParamsTaskType = Literal["update_coda_page"] @@ -11,5 +11,5 @@ def check_update_coda_page_task_params_task_type(value: str | None) -> UpdateCod if value is None: return None if value in UPDATE_CODA_PAGE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateCodaPageTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_CODA_PAGE_TASK_PARAMS_TASK_TYPE_VALUES!r}") 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 267641e6..58a24acc 100644 --- a/rootly_sdk/models/update_coda_page_task_params_template.py +++ b/rootly_sdk/models/update_coda_page_task_params_template.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class UpdateCodaPageTaskParamsTemplate: """ Attributes: - id (Union[Unset, str]): Combined doc_id/page_id in format 'doc_id/page_id' - name (Union[Unset, str]): + id (str | Unset): Combined doc_id/page_id in format 'doc_id/page_id' + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 01e5aa95..876bc0f4 100644 --- a/rootly_sdk/models/update_communications_group.py +++ b/rootly_sdk/models/update_communications_group.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_communications_group_data import UpdateCommunicationsGroupData @@ -18,14 +19,13 @@ class UpdateCommunicationsGroup: data (UpdateCommunicationsGroupData): """ - data: "UpdateCommunicationsGroupData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateCommunicationsGroupData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_communications_group.additional_properties = d return update_communications_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_communications_group_data.py b/rootly_sdk/models/update_communications_group_data.py index 0fee453c..4bc1735e 100644 --- a/rootly_sdk/models/update_communications_group_data.py +++ b/rootly_sdk/models/update_communications_group_data.py @@ -1,13 +1,15 @@ +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_communications_group_data_type import ( UpdateCommunicationsGroupDataType, check_update_communications_group_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_communications_group_data_attributes import UpdateCommunicationsGroupDataAttributes @@ -22,25 +24,31 @@ class UpdateCommunicationsGroupData: Attributes: type_ (UpdateCommunicationsGroupDataType): attributes (UpdateCommunicationsGroupDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateCommunicationsGroupDataType - attributes: "UpdateCommunicationsGroupDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateCommunicationsGroupDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateCommunicationsGroupDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_communications_group_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_communications_group_data.additional_properties = d return update_communications_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_communications_group_data_attributes.py b/rootly_sdk/models/update_communications_group_data_attributes.py index 65184abe..0599fcdb 100644 --- a/rootly_sdk/models/update_communications_group_data_attributes.py +++ b/rootly_sdk/models/update_communications_group_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -25,43 +27,43 @@ class UpdateCommunicationsGroupDataAttributes: """ 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): 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: 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 + 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 communication_group_conditions: ( - None | Unset | list["UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"] + list[UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset ) = UNSET communication_external_group_members: ( - None | Unset | list["UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"] + list[UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset ) = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -69,29 +71,29 @@ def to_dict(self) -> dict[str, Any]: communication_type_id = self.communication_type_id - is_private: None | Unset | bool + is_private: bool | None | Unset if isinstance(self.is_private, Unset): is_private = UNSET else: is_private = self.is_private - condition_type: Unset | str = UNSET + condition_type: str | Unset = UNSET if not isinstance(self.condition_type, Unset): condition_type = self.condition_type - sms_channel: None | Unset | bool + sms_channel: bool | None | Unset if isinstance(self.sms_channel, Unset): sms_channel = UNSET else: sms_channel = self.sms_channel - email_channel: None | Unset | bool + email_channel: bool | None | Unset if isinstance(self.email_channel, Unset): email_channel = UNSET else: email_channel = self.email_channel - member_ids: None | Unset | list[int] + member_ids: list[int] | None | Unset if isinstance(self.member_ids, Unset): member_ids = UNSET elif isinstance(self.member_ids, list): @@ -100,7 +102,7 @@ def to_dict(self) -> dict[str, Any]: else: member_ids = self.member_ids - slack_channel_ids: None | Unset | list[str] + slack_channel_ids: list[str] | None | Unset if isinstance(self.slack_channel_ids, Unset): slack_channel_ids = UNSET elif isinstance(self.slack_channel_ids, list): @@ -109,7 +111,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel_ids = self.slack_channel_ids - communication_group_conditions: None | Unset | list[dict[str, Any]] + communication_group_conditions: list[dict[str, Any]] | None | Unset if isinstance(self.communication_group_conditions, Unset): communication_group_conditions = UNSET elif isinstance(self.communication_group_conditions, list): @@ -121,7 +123,7 @@ def to_dict(self) -> dict[str, Any]: else: communication_group_conditions = self.communication_group_conditions - communication_external_group_members: None | Unset | list[dict[str, Any]] + communication_external_group_members: list[dict[str, Any]] | None | Unset if isinstance(self.communication_external_group_members, Unset): communication_external_group_members = UNSET elif isinstance(self.communication_external_group_members, list): @@ -175,52 +177,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) communication_type_id = d.pop("communication_type_id", UNSET) - def _parse_is_private(data: object) -> None | Unset | bool: + def _parse_is_private(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) is_private = _parse_is_private(d.pop("is_private", UNSET)) _condition_type = d.pop("condition_type", UNSET) - condition_type: Unset | UpdateCommunicationsGroupDataAttributesConditionType + condition_type: UpdateCommunicationsGroupDataAttributesConditionType | Unset 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) -> None | Unset | bool: + def _parse_sms_channel(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) sms_channel = _parse_sms_channel(d.pop("sms_channel", UNSET)) - def _parse_email_channel(data: object) -> None | Unset | bool: + def _parse_email_channel(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) email_channel = _parse_email_channel(d.pop("email_channel", UNSET)) - def _parse_member_ids(data: object) -> None | Unset | list[int]: + def _parse_member_ids(data: object) -> list[int] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -231,13 +233,13 @@ def _parse_member_ids(data: object) -> None | Unset | list[int]: member_ids_type_0 = cast(list[int], data) return member_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[int], data) + return cast(list[int] | None | Unset, data) member_ids = _parse_member_ids(d.pop("member_ids", UNSET)) - def _parse_slack_channel_ids(data: object) -> None | Unset | list[str]: + def _parse_slack_channel_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -248,15 +250,15 @@ def _parse_slack_channel_ids(data: object) -> None | Unset | list[str]: slack_channel_ids_type_0 = cast(list[str], data) return slack_channel_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) slack_channel_ids = _parse_slack_channel_ids(d.pop("slack_channel_ids", UNSET)) def _parse_communication_group_conditions( data: object, - ) -> None | Unset | list["UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"]: + ) -> list[UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -276,11 +278,10 @@ def _parse_communication_group_conditions( communication_group_conditions_type_0.append(communication_group_conditions_type_0_item) return communication_group_conditions_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass return cast( - None | Unset | list["UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item"], - data, + list[UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item] | None | Unset, data ) communication_group_conditions = _parse_communication_group_conditions( @@ -289,7 +290,7 @@ def _parse_communication_group_conditions( def _parse_communication_external_group_members( data: object, - ) -> None | Unset | list["UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"]: + ) -> list[UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -311,12 +312,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass return cast( - None - | Unset - | list["UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item"], + list[UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item] | None | Unset, 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 8634430c..db7c026a 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,8 +1,9 @@ +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 ..types import UNSET, Unset @@ -13,20 +14,19 @@ class UpdateCommunicationsGroupDataAttributesCommunicationExternalGroupMembersType0Item: """ Attributes: - 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): 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: 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) + id: None | str | Unset = UNSET + name: str | Unset = UNSET + email: str | Unset = UNSET + phone_number: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: - id: None | Unset | str + id: None | str | Unset if isinstance(self.id, Unset): id = UNSET else: @@ -39,7 +39,7 @@ def to_dict(self) -> dict[str, Any]: phone_number = self.phone_number field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if id is not UNSET: field_dict["id"] = id @@ -56,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 | Unset | str: + def _parse_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) id = _parse_id(d.pop("id", UNSET)) @@ -78,21 +78,4 @@ def _parse_id(data: object) -> None | Unset | str: phone_number=phone_number, ) - update_communications_group_data_attributes_communication_external_group_members_type_0_item.additional_properties = d return update_communications_group_data_attributes_communication_external_group_members_type_0_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_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 8de71c14..4b7f6ed3 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,8 +1,9 @@ +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.update_communications_group_data_attributes_communication_group_conditions_type_0_item_property_type import ( UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType, @@ -17,39 +18,38 @@ class UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0Item: """ Attributes: - 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): 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: None | Unset | str = UNSET - property_type: Unset | UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType = ( + id: None | str | Unset = UNSET + property_type: UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType | 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) + 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 def to_dict(self) -> dict[str, Any]: - id: None | Unset | str + id: None | str | Unset if isinstance(self.id, Unset): id = UNSET else: id = self.id - property_type: Unset | str = UNSET + property_type: str | Unset = UNSET if not isinstance(self.property_type, Unset): property_type = self.property_type - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -58,7 +58,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - severity_ids: None | Unset | list[str] + severity_ids: list[str] | None | Unset if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -67,7 +67,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - functionality_ids: None | Unset | list[str] + functionality_ids: list[str] | None | Unset if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -76,7 +76,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: None | Unset | list[str] + group_ids: list[str] | None | Unset if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -85,7 +85,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: None | Unset | list[str] + incident_type_ids: list[str] | None | Unset if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -95,7 +95,7 @@ def to_dict(self) -> dict[str, Any]: incident_type_ids = self.incident_type_ids field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if id is not UNSET: field_dict["id"] = id @@ -118,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 | Unset | str: + def _parse_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) id = _parse_id(d.pop("id", UNSET)) _property_type = d.pop("property_type", UNSET) - property_type: Unset | UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType + property_type: UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType | Unset if isinstance(_property_type, Unset): property_type = UNSET else: @@ -136,7 +136,7 @@ def _parse_id(data: object) -> None | Unset | str: _property_type ) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -147,13 +147,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_severity_ids(data: object) -> None | Unset | list[str]: + def _parse_severity_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -164,13 +164,13 @@ def _parse_severity_ids(data: object) -> None | Unset | list[str]: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_functionality_ids(data: object) -> None | Unset | list[str]: + def _parse_functionality_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -181,13 +181,13 @@ def _parse_functionality_ids(data: object) -> None | Unset | list[str]: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> None | Unset | list[str]: + def _parse_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -198,13 +198,13 @@ def _parse_group_ids(data: object) -> None | Unset | list[str]: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: + def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -215,9 +215,9 @@ def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) @@ -231,21 +231,4 @@ def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: incident_type_ids=incident_type_ids, ) - update_communications_group_data_attributes_communication_group_conditions_type_0_item.additional_properties = d return update_communications_group_data_attributes_communication_group_conditions_type_0_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_communications_group_data_attributes_communication_group_conditions_type_0_item_property_type.py b/rootly_sdk/models/update_communications_group_data_attributes_communication_group_conditions_type_0_item_property_type.py index 03122812..6a2c54b4 100644 --- a/rootly_sdk/models/update_communications_group_data_attributes_communication_group_conditions_type_0_item_property_type.py +++ b/rootly_sdk/models/update_communications_group_data_attributes_communication_group_conditions_type_0_item_property_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType = Literal[ "functionality", "group", "incident_type", "service", "severity" @@ -24,7 +24,7 @@ def check_update_communications_group_data_attributes_communication_group_condit value in UPDATE_COMMUNICATIONS_GROUP_DATA_ATTRIBUTES_COMMUNICATION_GROUP_CONDITIONS_TYPE_0_ITEM_PROPERTY_TYPE_VALUES ): - return cast(UpdateCommunicationsGroupDataAttributesCommunicationGroupConditionsType0ItemPropertyType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_COMMUNICATIONS_GROUP_DATA_ATTRIBUTES_COMMUNICATION_GROUP_CONDITIONS_TYPE_0_ITEM_PROPERTY_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_communications_group_data_attributes_condition_type.py b/rootly_sdk/models/update_communications_group_data_attributes_condition_type.py index e21d6bf4..14ebbc63 100644 --- a/rootly_sdk/models/update_communications_group_data_attributes_condition_type.py +++ b/rootly_sdk/models/update_communications_group_data_attributes_condition_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCommunicationsGroupDataAttributesConditionType = Literal["all", "any"] @@ -16,7 +16,7 @@ def check_update_communications_group_data_attributes_condition_type( if value is None: return None if value in UPDATE_COMMUNICATIONS_GROUP_DATA_ATTRIBUTES_CONDITION_TYPE_VALUES: - return cast(UpdateCommunicationsGroupDataAttributesConditionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_COMMUNICATIONS_GROUP_DATA_ATTRIBUTES_CONDITION_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_communications_group_data_type.py b/rootly_sdk/models/update_communications_group_data_type.py index ceebb4f4..f21444ce 100644 --- a/rootly_sdk/models/update_communications_group_data_type.py +++ b/rootly_sdk/models/update_communications_group_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCommunicationsGroupDataType = Literal["communications_groups"] @@ -11,5 +11,5 @@ def check_update_communications_group_data_type(value: str | None) -> UpdateComm if value is None: return None if value in UPDATE_COMMUNICATIONS_GROUP_DATA_TYPE_VALUES: - return cast(UpdateCommunicationsGroupDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_COMMUNICATIONS_GROUP_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_communications_stage.py b/rootly_sdk/models/update_communications_stage.py index ce803372..4b0c99c6 100644 --- a/rootly_sdk/models/update_communications_stage.py +++ b/rootly_sdk/models/update_communications_stage.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_communications_stage_data import UpdateCommunicationsStageData @@ -18,14 +19,13 @@ class UpdateCommunicationsStage: data (UpdateCommunicationsStageData): """ - data: "UpdateCommunicationsStageData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateCommunicationsStageData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_communications_stage.additional_properties = d return update_communications_stage - - @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_communications_stage_data.py b/rootly_sdk/models/update_communications_stage_data.py index e3ead90b..9021fb83 100644 --- a/rootly_sdk/models/update_communications_stage_data.py +++ b/rootly_sdk/models/update_communications_stage_data.py @@ -1,13 +1,15 @@ +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_communications_stage_data_type import ( UpdateCommunicationsStageDataType, check_update_communications_stage_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_communications_stage_data_attributes import UpdateCommunicationsStageDataAttributes @@ -22,25 +24,31 @@ class UpdateCommunicationsStageData: Attributes: type_ (UpdateCommunicationsStageDataType): attributes (UpdateCommunicationsStageDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateCommunicationsStageDataType - attributes: "UpdateCommunicationsStageDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateCommunicationsStageDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateCommunicationsStageDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_communications_stage_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_communications_stage_data.additional_properties = d return update_communications_stage_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_communications_stage_data_attributes.py b/rootly_sdk/models/update_communications_stage_data_attributes.py index 2c399d85..68333c9e 100644 --- a/rootly_sdk/models/update_communications_stage_data_attributes.py +++ b/rootly_sdk/models/update_communications_stage_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,20 +14,20 @@ class UpdateCommunicationsStageDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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): 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: None | Unset | str = UNSET - name: Unset | str = UNSET - description: None | Unset | str = UNSET - position: None | Unset | int = UNSET + slug: None | str | Unset = UNSET + name: str | Unset = UNSET + description: None | str | Unset = UNSET + position: int | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -33,13 +35,13 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -63,32 +65,32 @@ 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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_communications_stage_data_type.py b/rootly_sdk/models/update_communications_stage_data_type.py index b5f9bea5..538cef1f 100644 --- a/rootly_sdk/models/update_communications_stage_data_type.py +++ b/rootly_sdk/models/update_communications_stage_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCommunicationsStageDataType = Literal["communications_stages"] @@ -11,5 +11,5 @@ def check_update_communications_stage_data_type(value: str | None) -> UpdateComm if value is None: return None if value in UPDATE_COMMUNICATIONS_STAGE_DATA_TYPE_VALUES: - return cast(UpdateCommunicationsStageDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_COMMUNICATIONS_STAGE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_communications_template.py b/rootly_sdk/models/update_communications_template.py index e21c6f26..4fa0c81a 100644 --- a/rootly_sdk/models/update_communications_template.py +++ b/rootly_sdk/models/update_communications_template.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_communications_template_data import UpdateCommunicationsTemplateData @@ -18,14 +19,13 @@ class UpdateCommunicationsTemplate: data (UpdateCommunicationsTemplateData): """ - data: "UpdateCommunicationsTemplateData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateCommunicationsTemplateData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_communications_template.additional_properties = d return update_communications_template - - @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_communications_template_data.py b/rootly_sdk/models/update_communications_template_data.py index 86dfa99c..9795e295 100644 --- a/rootly_sdk/models/update_communications_template_data.py +++ b/rootly_sdk/models/update_communications_template_data.py @@ -1,13 +1,15 @@ +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_communications_template_data_type import ( UpdateCommunicationsTemplateDataType, check_update_communications_template_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_communications_template_data_attributes import UpdateCommunicationsTemplateDataAttributes @@ -22,25 +24,31 @@ class UpdateCommunicationsTemplateData: Attributes: type_ (UpdateCommunicationsTemplateDataType): attributes (UpdateCommunicationsTemplateDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateCommunicationsTemplateDataType - attributes: "UpdateCommunicationsTemplateDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateCommunicationsTemplateDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateCommunicationsTemplateDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_communications_template_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_communications_template_data.additional_properties = d return update_communications_template_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_communications_template_data_attributes.py b/rootly_sdk/models/update_communications_template_data_attributes.py index ceb94ac5..66fe1ee0 100644 --- a/rootly_sdk/models/update_communications_template_data_attributes.py +++ b/rootly_sdk/models/update_communications_template_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -18,27 +20,27 @@ class UpdateCommunicationsTemplateDataAttributes: """ 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): 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: Unset | str = UNSET - description: None | Unset | str = UNSET - communication_type_id: Unset | str = UNSET - position: None | Unset | int = UNSET + name: str | Unset = UNSET + description: None | str | Unset = UNSET + communication_type_id: str | Unset = UNSET + position: int | None | Unset = UNSET communication_template_stages_attributes: ( - None | Unset | list["UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"] + list[UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] | None | Unset ) = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -46,13 +48,13 @@ def to_dict(self) -> dict[str, Any]: communication_type_id = self.communication_type_id - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - communication_template_stages_attributes: None | Unset | list[dict[str, Any]] + communication_template_stages_attributes: list[dict[str, Any]] | None | Unset if isinstance(self.communication_template_stages_attributes, Unset): communication_template_stages_attributes = UNSET elif isinstance(self.communication_template_stages_attributes, list): @@ -93,32 +95,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) communication_type_id = d.pop("communication_type_id", UNSET) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) def _parse_communication_template_stages_attributes( data: object, ) -> ( - None + list[UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] + | None | Unset - | list["UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"] ): if data is None: return data @@ -141,12 +143,12 @@ def _parse_communication_template_stages_attributes( ) return communication_template_stages_attributes_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass return cast( - None - | Unset - | list["UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item"], + list[UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item] + | None + | Unset, 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 70e273b7..7bbb5a03 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,8 +1,9 @@ +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 ..types import UNSET, Unset @@ -13,53 +14,52 @@ class UpdateCommunicationsTemplateDataAttributesCommunicationTemplateStagesAttributesType0Item: """ Attributes: - 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): 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: 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) + 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 def to_dict(self) -> dict[str, Any]: - id: None | Unset | str + id: None | str | Unset if isinstance(self.id, Unset): id = UNSET else: id = self.id - sms_content: None | Unset | str + sms_content: None | str | Unset if isinstance(self.sms_content, Unset): sms_content = UNSET else: sms_content = self.sms_content - email_subject: None | Unset | str + email_subject: None | str | Unset if isinstance(self.email_subject, Unset): email_subject = UNSET else: email_subject = self.email_subject - email_body: None | Unset | str + email_body: None | str | Unset if isinstance(self.email_body, Unset): email_body = UNSET else: email_body = self.email_body - slack_content: None | Unset | str + slack_content: None | str | Unset if isinstance(self.slack_content, Unset): slack_content = UNSET else: slack_content = self.slack_content field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if id is not UNSET: field_dict["id"] = id @@ -78,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 | Unset | str: + def _parse_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) id = _parse_id(d.pop("id", UNSET)) - def _parse_sms_content(data: object) -> None | Unset | str: + def _parse_sms_content(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) sms_content = _parse_sms_content(d.pop("sms_content", UNSET)) - def _parse_email_subject(data: object) -> None | Unset | str: + def _parse_email_subject(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) email_subject = _parse_email_subject(d.pop("email_subject", UNSET)) - def _parse_email_body(data: object) -> None | Unset | str: + def _parse_email_body(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) email_body = _parse_email_body(d.pop("email_body", UNSET)) - def _parse_slack_content(data: object) -> None | Unset | str: + def _parse_slack_content(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slack_content = _parse_slack_content(d.pop("slack_content", UNSET)) @@ -131,21 +131,4 @@ def _parse_slack_content(data: object) -> None | Unset | str: slack_content=slack_content, ) - update_communications_template_data_attributes_communication_template_stages_attributes_type_0_item.additional_properties = d return update_communications_template_data_attributes_communication_template_stages_attributes_type_0_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_communications_template_data_type.py b/rootly_sdk/models/update_communications_template_data_type.py index 53fe8af6..3063147e 100644 --- a/rootly_sdk/models/update_communications_template_data_type.py +++ b/rootly_sdk/models/update_communications_template_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCommunicationsTemplateDataType = Literal["communications_templates"] @@ -11,5 +11,5 @@ def check_update_communications_template_data_type(value: str | None) -> UpdateC if value is None: return None if value in UPDATE_COMMUNICATIONS_TEMPLATE_DATA_TYPE_VALUES: - return cast(UpdateCommunicationsTemplateDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_COMMUNICATIONS_TEMPLATE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_communications_type.py b/rootly_sdk/models/update_communications_type.py index 28420815..c18f5dc6 100644 --- a/rootly_sdk/models/update_communications_type.py +++ b/rootly_sdk/models/update_communications_type.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_communications_type_data import UpdateCommunicationsTypeData @@ -18,14 +19,13 @@ class UpdateCommunicationsType: data (UpdateCommunicationsTypeData): """ - data: "UpdateCommunicationsTypeData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateCommunicationsTypeData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_communications_type.additional_properties = d return update_communications_type - - @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_communications_type_data.py b/rootly_sdk/models/update_communications_type_data.py index c34b23c4..7bdfe581 100644 --- a/rootly_sdk/models/update_communications_type_data.py +++ b/rootly_sdk/models/update_communications_type_data.py @@ -1,13 +1,15 @@ +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_communications_type_data_type import ( UpdateCommunicationsTypeDataType, check_update_communications_type_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_communications_type_data_attributes import UpdateCommunicationsTypeDataAttributes @@ -22,25 +24,31 @@ class UpdateCommunicationsTypeData: Attributes: type_ (UpdateCommunicationsTypeDataType): attributes (UpdateCommunicationsTypeDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateCommunicationsTypeDataType - attributes: "UpdateCommunicationsTypeDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateCommunicationsTypeDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateCommunicationsTypeDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_communications_type_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_communications_type_data.additional_properties = d return update_communications_type_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_communications_type_data_attributes.py b/rootly_sdk/models/update_communications_type_data_attributes.py index dd596593..71007365 100644 --- a/rootly_sdk/models/update_communications_type_data_attributes.py +++ b/rootly_sdk/models/update_communications_type_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,22 +14,22 @@ class UpdateCommunicationsTypeDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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): 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: None | Unset | str = UNSET - name: Unset | str = UNSET - description: None | Unset | str = UNSET - color: None | Unset | str = UNSET - position: None | Unset | int = UNSET + slug: None | str | Unset = UNSET + name: str | Unset = UNSET + description: None | str | Unset = UNSET + color: None | str | Unset = UNSET + position: int | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -35,19 +37,19 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -73,41 +75,41 @@ 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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_communications_type_data_type.py b/rootly_sdk/models/update_communications_type_data_type.py index 8befc3cf..249563e2 100644 --- a/rootly_sdk/models/update_communications_type_data_type.py +++ b/rootly_sdk/models/update_communications_type_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCommunicationsTypeDataType = Literal["communications_types"] @@ -11,5 +11,5 @@ def check_update_communications_type_data_type(value: str | None) -> UpdateCommu if value is None: return None if value in UPDATE_COMMUNICATIONS_TYPE_DATA_TYPE_VALUES: - return cast(UpdateCommunicationsTypeDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_COMMUNICATIONS_TYPE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_confluence_page_task_params.py b/rootly_sdk/models/update_confluence_page_task_params.py index ce40e240..4be4ea46 100644 --- a/rootly_sdk/models/update_confluence_page_task_params.py +++ b/rootly_sdk/models/update_confluence_page_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,38 +25,38 @@ class UpdateConfluencePageTaskParams: """ Attributes: file_id (str): The Confluence page ID - 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. + 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. + include_follow_ups (bool | Unset): Default: True. """ file_id: str - 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 + 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 + include_follow_ups: bool | Unset = 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: Unset | dict[str, Any] = UNSET + integration: dict[str, Any] | Unset = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -64,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: post_mortem_template_id = self.post_mortem_template_id - template: Unset | dict[str, Any] = UNSET + template: dict[str, Any] | Unset = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -111,14 +113,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: Unset | UpdateConfluencePageTaskParamsTaskType + task_type: UpdateConfluencePageTaskParamsTaskType | Unset 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: Unset | UpdateConfluencePageTaskParamsIntegration + integration: UpdateConfluencePageTaskParamsIntegration | Unset if isinstance(_integration, Unset): integration = UNSET else: @@ -131,7 +133,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: Unset | UpdateConfluencePageTaskParamsTemplate + template: UpdateConfluencePageTaskParamsTemplate | Unset if isinstance(_template, Unset): template = UNSET else: 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 81dfec1a..a1f464df 100644 --- a/rootly_sdk/models/update_confluence_page_task_params_integration.py +++ b/rootly_sdk/models/update_confluence_page_task_params_integration.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateConfluencePageTaskParamsIntegration: """Specify integration id if you have more than one Confluence instance Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/update_confluence_page_task_params_task_type.py index b8de7a14..f5c086a2 100644 --- a/rootly_sdk/models/update_confluence_page_task_params_task_type.py +++ b/rootly_sdk/models/update_confluence_page_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateConfluencePageTaskParamsTaskType = Literal["update_confluence_page"] @@ -13,7 +13,7 @@ def check_update_confluence_page_task_params_task_type( if value is None: return None if value in UPDATE_CONFLUENCE_PAGE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateConfluencePageTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_CONFLUENCE_PAGE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 92bc9f06..8ab06a92 100644 --- a/rootly_sdk/models/update_confluence_page_task_params_template.py +++ b/rootly_sdk/models/update_confluence_page_task_params_template.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateConfluencePageTaskParamsTemplate: """The Confluence template to use Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 bf4eb47c..85d42f46 100644 --- a/rootly_sdk/models/update_custom_field.py +++ b/rootly_sdk/models/update_custom_field.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_custom_field_data import UpdateCustomFieldData @@ -18,14 +19,13 @@ class UpdateCustomField: data (UpdateCustomFieldData): """ - data: "UpdateCustomFieldData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateCustomFieldData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_custom_field.additional_properties = d return update_custom_field - - @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_custom_field_data.py b/rootly_sdk/models/update_custom_field_data.py index b67f174c..622b5779 100644 --- a/rootly_sdk/models/update_custom_field_data.py +++ b/rootly_sdk/models/update_custom_field_data.py @@ -1,10 +1,12 @@ +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_custom_field_data_type import UpdateCustomFieldDataType, check_update_custom_field_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_custom_field_data_attributes import UpdateCustomFieldDataAttributes @@ -19,25 +21,31 @@ class UpdateCustomFieldData: Attributes: type_ (UpdateCustomFieldDataType): attributes (UpdateCustomFieldDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateCustomFieldDataType - attributes: "UpdateCustomFieldDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateCustomFieldDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateCustomFieldDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_custom_field_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_custom_field_data.additional_properties = d return update_custom_field_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_custom_field_data_attributes.py b/rootly_sdk/models/update_custom_field_data_attributes.py index 0abc43ab..2eac8a3a 100644 --- a/rootly_sdk/models/update_custom_field_data_attributes.py +++ b/rootly_sdk/models/update_custom_field_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,38 +22,38 @@ class UpdateCustomFieldDataAttributes: """ Attributes: - 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): 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: 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 + 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 def to_dict(self) -> dict[str, Any]: label = self.label - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - shown: Unset | list[str] = UNSET + shown: list[str] | Unset = 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: None | Unset | list[str] + required: list[str] | None | Unset if isinstance(self.required, Unset): required = UNSET elif isinstance(self.required, list): @@ -63,7 +65,7 @@ def to_dict(self) -> dict[str, Any]: else: required = self.required - default: None | Unset | str + default: None | str | Unset if isinstance(self.default, Unset): default = UNSET else: @@ -94,23 +96,25 @@ 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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - shown = [] _shown = d.pop("shown", UNSET) - for shown_item_data in _shown or []: - shown_item = check_update_custom_field_data_attributes_shown_item(shown_item_data) + 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) - shown.append(shown_item) + shown.append(shown_item) - def _parse_required(data: object) -> None | Unset | list[UpdateCustomFieldDataAttributesRequiredType0Item]: + def _parse_required(data: object) -> list[UpdateCustomFieldDataAttributesRequiredType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -128,18 +132,18 @@ def _parse_required(data: object) -> None | Unset | list[UpdateCustomFieldDataAt required_type_0.append(required_type_0_item) return required_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[UpdateCustomFieldDataAttributesRequiredType0Item], data) + return cast(list[UpdateCustomFieldDataAttributesRequiredType0Item] | None | Unset, data) required = _parse_required(d.pop("required", UNSET)) - def _parse_default(data: object) -> None | Unset | str: + def _parse_default(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) default = _parse_default(d.pop("default", UNSET)) diff --git a/rootly_sdk/models/update_custom_field_data_attributes_required_type_0_item.py b/rootly_sdk/models/update_custom_field_data_attributes_required_type_0_item.py index f0313e46..3198d13c 100644 --- a/rootly_sdk/models/update_custom_field_data_attributes_required_type_0_item.py +++ b/rootly_sdk/models/update_custom_field_data_attributes_required_type_0_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCustomFieldDataAttributesRequiredType0Item = Literal[ "incident_form", @@ -29,7 +29,7 @@ def check_update_custom_field_data_attributes_required_type_0_item( if value is None: return None if value in UPDATE_CUSTOM_FIELD_DATA_ATTRIBUTES_REQUIRED_TYPE_0_ITEM_VALUES: - return cast(UpdateCustomFieldDataAttributesRequiredType0Item, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_CUSTOM_FIELD_DATA_ATTRIBUTES_REQUIRED_TYPE_0_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_custom_field_data_attributes_shown_item.py b/rootly_sdk/models/update_custom_field_data_attributes_shown_item.py index 71611e0b..bb9f1eaa 100644 --- a/rootly_sdk/models/update_custom_field_data_attributes_shown_item.py +++ b/rootly_sdk/models/update_custom_field_data_attributes_shown_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCustomFieldDataAttributesShownItem = Literal[ "incident_form", @@ -29,7 +29,7 @@ def check_update_custom_field_data_attributes_shown_item( if value is None: return None if value in UPDATE_CUSTOM_FIELD_DATA_ATTRIBUTES_SHOWN_ITEM_VALUES: - return cast(UpdateCustomFieldDataAttributesShownItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_CUSTOM_FIELD_DATA_ATTRIBUTES_SHOWN_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_custom_field_data_type.py b/rootly_sdk/models/update_custom_field_data_type.py index 017f3e5b..2936a917 100644 --- a/rootly_sdk/models/update_custom_field_data_type.py +++ b/rootly_sdk/models/update_custom_field_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCustomFieldDataType = Literal["custom_fields"] @@ -11,5 +11,5 @@ def check_update_custom_field_data_type(value: str | None) -> UpdateCustomFieldD if value is None: return None if value in UPDATE_CUSTOM_FIELD_DATA_TYPE_VALUES: - return cast(UpdateCustomFieldDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_CUSTOM_FIELD_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_custom_field_option.py b/rootly_sdk/models/update_custom_field_option.py index b1be8000..a7c7ecb8 100644 --- a/rootly_sdk/models/update_custom_field_option.py +++ b/rootly_sdk/models/update_custom_field_option.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_custom_field_option_data import UpdateCustomFieldOptionData @@ -18,14 +19,13 @@ class UpdateCustomFieldOption: data (UpdateCustomFieldOptionData): """ - data: "UpdateCustomFieldOptionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateCustomFieldOptionData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_custom_field_option.additional_properties = d return update_custom_field_option - - @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_custom_field_option_data.py b/rootly_sdk/models/update_custom_field_option_data.py index 3070ade9..76c90454 100644 --- a/rootly_sdk/models/update_custom_field_option_data.py +++ b/rootly_sdk/models/update_custom_field_option_data.py @@ -1,13 +1,15 @@ +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_custom_field_option_data_type import ( UpdateCustomFieldOptionDataType, check_update_custom_field_option_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_custom_field_option_data_attributes import UpdateCustomFieldOptionDataAttributes @@ -22,25 +24,31 @@ class UpdateCustomFieldOptionData: Attributes: type_ (UpdateCustomFieldOptionDataType): attributes (UpdateCustomFieldOptionDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateCustomFieldOptionDataType - attributes: "UpdateCustomFieldOptionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateCustomFieldOptionDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateCustomFieldOptionDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_custom_field_option_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_custom_field_option_data.additional_properties = d return update_custom_field_option_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_custom_field_option_data_attributes.py b/rootly_sdk/models/update_custom_field_option_data_attributes.py index b39881c6..72264d79 100644 --- a/rootly_sdk/models/update_custom_field_option_data_attributes.py +++ b/rootly_sdk/models/update_custom_field_option_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -12,16 +14,16 @@ class UpdateCustomFieldOptionDataAttributes: """ Attributes: - 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): 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: Unset | str = UNSET - color: Unset | str = UNSET - default: Unset | bool = UNSET - position: Unset | int = UNSET + value: str | Unset = UNSET + color: str | Unset = UNSET + default: bool | Unset = UNSET + position: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: value = self.value diff --git a/rootly_sdk/models/update_custom_field_option_data_type.py b/rootly_sdk/models/update_custom_field_option_data_type.py index 1b4f290d..b38c3109 100644 --- a/rootly_sdk/models/update_custom_field_option_data_type.py +++ b/rootly_sdk/models/update_custom_field_option_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCustomFieldOptionDataType = Literal["custom_field_options"] @@ -11,5 +11,5 @@ def check_update_custom_field_option_data_type(value: str | None) -> UpdateCusto if value is None: return None if value in UPDATE_CUSTOM_FIELD_OPTION_DATA_TYPE_VALUES: - return cast(UpdateCustomFieldOptionDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_CUSTOM_FIELD_OPTION_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_custom_form.py b/rootly_sdk/models/update_custom_form.py index c207469d..795fcf33 100644 --- a/rootly_sdk/models/update_custom_form.py +++ b/rootly_sdk/models/update_custom_form.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_custom_form_data import UpdateCustomFormData @@ -18,14 +19,13 @@ class UpdateCustomForm: data (UpdateCustomFormData): """ - data: "UpdateCustomFormData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateCustomFormData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_custom_form.additional_properties = d return update_custom_form - - @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_custom_form_data.py b/rootly_sdk/models/update_custom_form_data.py index bc9577de..be301fbe 100644 --- a/rootly_sdk/models/update_custom_form_data.py +++ b/rootly_sdk/models/update_custom_form_data.py @@ -1,10 +1,12 @@ +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_custom_form_data_type import UpdateCustomFormDataType, check_update_custom_form_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_custom_form_data_attributes import UpdateCustomFormDataAttributes @@ -19,25 +21,31 @@ class UpdateCustomFormData: Attributes: type_ (UpdateCustomFormDataType): attributes (UpdateCustomFormDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateCustomFormDataType - attributes: "UpdateCustomFormDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateCustomFormDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateCustomFormDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_custom_form_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_custom_form_data.additional_properties = d return update_custom_form_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_custom_form_data_attributes.py b/rootly_sdk/models/update_custom_form_data_attributes.py index c6dee99f..05c28eeb 100644 --- a/rootly_sdk/models/update_custom_form_data_attributes.py +++ b/rootly_sdk/models/update_custom_form_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,22 +14,22 @@ class UpdateCustomFormDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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): 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: None | Unset | str = UNSET - name: Unset | str = UNSET - description: None | Unset | str = UNSET - enabled: Unset | bool = UNSET - command: Unset | str = UNSET + slug: None | str | Unset = UNSET + name: str | Unset = UNSET + description: None | str | Unset = UNSET + enabled: bool | Unset = UNSET + command: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -35,7 +37,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -65,23 +67,23 @@ 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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/update_custom_form_data_type.py b/rootly_sdk/models/update_custom_form_data_type.py index 29162e6b..75920eb8 100644 --- a/rootly_sdk/models/update_custom_form_data_type.py +++ b/rootly_sdk/models/update_custom_form_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateCustomFormDataType = Literal["custom_forms"] @@ -11,5 +11,5 @@ def check_update_custom_form_data_type(value: str | None) -> UpdateCustomFormDat if value is None: return None if value in UPDATE_CUSTOM_FORM_DATA_TYPE_VALUES: - return cast(UpdateCustomFormDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_CUSTOM_FORM_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_dashboard.py b/rootly_sdk/models/update_dashboard.py index cef144c3..aaa33495 100644 --- a/rootly_sdk/models/update_dashboard.py +++ b/rootly_sdk/models/update_dashboard.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_dashboard_data import UpdateDashboardData @@ -18,14 +19,13 @@ class UpdateDashboard: data (UpdateDashboardData): """ - data: "UpdateDashboardData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateDashboardData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_dashboard.additional_properties = d return update_dashboard - - @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_dashboard_data.py b/rootly_sdk/models/update_dashboard_data.py index 849bda0a..d48643c2 100644 --- a/rootly_sdk/models/update_dashboard_data.py +++ b/rootly_sdk/models/update_dashboard_data.py @@ -1,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.update_dashboard_data_type import UpdateDashboardDataType, check_update_dashboard_data_type from ..types import UNSET, Unset @@ -18,26 +19,32 @@ class UpdateDashboardData: """ Attributes: - type_ (Union[Unset, UpdateDashboardDataType]): - attributes (Union[Unset, UpdateDashboardDataAttributes]): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. + type_ (UpdateDashboardDataType | Unset): + attributes (UpdateDashboardDataAttributes | Unset): """ - type_: Unset | UpdateDashboardDataType = UNSET - attributes: Union[Unset, "UpdateDashboardDataAttributes"] = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + id: str | Unset = UNSET + type_: UpdateDashboardDataType | Unset = UNSET + attributes: UpdateDashboardDataAttributes | Unset = UNSET def to_dict(self) -> dict[str, Any]: - type_: Unset | str = UNSET + id = self.id + + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id if type_ is not UNSET: field_dict["type"] = type_ if attributes is not UNSET: @@ -50,40 +57,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.update_dashboard_data_attributes import UpdateDashboardDataAttributes d = dict(src_dict) + id = d.pop("id", UNSET) + _type_ = d.pop("type", UNSET) - type_: Unset | UpdateDashboardDataType + type_: UpdateDashboardDataType | Unset if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_update_dashboard_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Unset | UpdateDashboardDataAttributes + attributes: UpdateDashboardDataAttributes | Unset if isinstance(_attributes, Unset): attributes = UNSET else: attributes = UpdateDashboardDataAttributes.from_dict(_attributes) update_dashboard_data = cls( + id=id, type_=type_, attributes=attributes, ) - update_dashboard_data.additional_properties = d return update_dashboard_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_dashboard_data_attributes.py b/rootly_sdk/models/update_dashboard_data_attributes.py index 148b4538..71ceb44b 100644 --- a/rootly_sdk/models/update_dashboard_data_attributes.py +++ b/rootly_sdk/models/update_dashboard_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -24,43 +26,43 @@ class UpdateDashboardDataAttributes: """ Attributes: - 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): 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: 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 + 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 def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - owner: Unset | str = UNSET + owner: str | Unset = UNSET if not isinstance(self.owner, Unset): owner = self.owner public = self.public - range_: None | Unset | str + range_: None | str | Unset if isinstance(self.range_, Unset): range_ = UNSET else: @@ -68,13 +70,13 @@ def to_dict(self) -> dict[str, Any]: auto_refresh = self.auto_refresh - color: Unset | str = UNSET + color: str | Unset = UNSET if not isinstance(self.color, Unset): color = self.color icon = self.icon - period: Unset | str = UNSET + period: str | Unset = UNSET if not isinstance(self.period, Unset): period = self.period @@ -107,17 +109,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) _owner = d.pop("owner", UNSET) - owner: Unset | UpdateDashboardDataAttributesOwner + owner: UpdateDashboardDataAttributesOwner | Unset if isinstance(_owner, Unset): owner = UNSET else: @@ -125,19 +127,19 @@ def _parse_description(data: object) -> None | Unset | str: public = d.pop("public", UNSET) - def _parse_range_(data: object) -> None | Unset | str: + def _parse_range_(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) range_ = _parse_range_(d.pop("range", UNSET)) auto_refresh = d.pop("auto_refresh", UNSET) _color = d.pop("color", UNSET) - color: Unset | UpdateDashboardDataAttributesColor + color: UpdateDashboardDataAttributesColor | Unset if isinstance(_color, Unset): color = UNSET else: @@ -146,7 +148,7 @@ def _parse_range_(data: object) -> None | Unset | str: icon = d.pop("icon", UNSET) _period = d.pop("period", UNSET) - period: Unset | UpdateDashboardDataAttributesPeriod + period: UpdateDashboardDataAttributesPeriod | Unset if isinstance(_period, Unset): period = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_data_attributes_color.py b/rootly_sdk/models/update_dashboard_data_attributes_color.py index a1050b39..c7956925 100644 --- a/rootly_sdk/models/update_dashboard_data_attributes_color.py +++ b/rootly_sdk/models/update_dashboard_data_attributes_color.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateDashboardDataAttributesColor = Literal["#D7F5E1", "#E9E2FF", "#FAE6E8", "#FAEEE6", "#FCF2CF"] @@ -15,5 +15,5 @@ def check_update_dashboard_data_attributes_color(value: str | None) -> UpdateDas if value is None: return None if value in UPDATE_DASHBOARD_DATA_ATTRIBUTES_COLOR_VALUES: - return cast(UpdateDashboardDataAttributesColor, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_DASHBOARD_DATA_ATTRIBUTES_COLOR_VALUES!r}") diff --git a/rootly_sdk/models/update_dashboard_data_attributes_owner.py b/rootly_sdk/models/update_dashboard_data_attributes_owner.py index 091bd213..7ccfd1da 100644 --- a/rootly_sdk/models/update_dashboard_data_attributes_owner.py +++ b/rootly_sdk/models/update_dashboard_data_attributes_owner.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateDashboardDataAttributesOwner = Literal["team", "user"] @@ -12,5 +12,5 @@ def check_update_dashboard_data_attributes_owner(value: str | None) -> UpdateDas if value is None: return None if value in UPDATE_DASHBOARD_DATA_ATTRIBUTES_OWNER_VALUES: - return cast(UpdateDashboardDataAttributesOwner, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_DASHBOARD_DATA_ATTRIBUTES_OWNER_VALUES!r}") diff --git a/rootly_sdk/models/update_dashboard_data_attributes_period.py b/rootly_sdk/models/update_dashboard_data_attributes_period.py index 311d08ef..d03ff3da 100644 --- a/rootly_sdk/models/update_dashboard_data_attributes_period.py +++ b/rootly_sdk/models/update_dashboard_data_attributes_period.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateDashboardDataAttributesPeriod = Literal["day", "month", "week"] @@ -13,5 +13,5 @@ def check_update_dashboard_data_attributes_period(value: str | None) -> UpdateDa if value is None: return None if value in UPDATE_DASHBOARD_DATA_ATTRIBUTES_PERIOD_VALUES: - return cast(UpdateDashboardDataAttributesPeriod, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_DASHBOARD_DATA_ATTRIBUTES_PERIOD_VALUES!r}") diff --git a/rootly_sdk/models/update_dashboard_data_type.py b/rootly_sdk/models/update_dashboard_data_type.py index cb57b032..623139b1 100644 --- a/rootly_sdk/models/update_dashboard_data_type.py +++ b/rootly_sdk/models/update_dashboard_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateDashboardDataType = Literal["dashboards"] @@ -11,5 +11,5 @@ def check_update_dashboard_data_type(value: str | None) -> UpdateDashboardDataTy if value is None: return None if value in UPDATE_DASHBOARD_DATA_TYPE_VALUES: - return cast(UpdateDashboardDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_DASHBOARD_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_dashboard_panel.py b/rootly_sdk/models/update_dashboard_panel.py index 1d0634fc..3f3a82eb 100644 --- a/rootly_sdk/models/update_dashboard_panel.py +++ b/rootly_sdk/models/update_dashboard_panel.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_dashboard_panel_data import UpdateDashboardPanelData @@ -18,14 +19,13 @@ class UpdateDashboardPanel: data (UpdateDashboardPanelData): """ - data: "UpdateDashboardPanelData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateDashboardPanelData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_dashboard_panel.additional_properties = d return update_dashboard_panel - - @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_dashboard_panel_data.py b/rootly_sdk/models/update_dashboard_panel_data.py index 31d0f4d5..ed54fb72 100644 --- a/rootly_sdk/models/update_dashboard_panel_data.py +++ b/rootly_sdk/models/update_dashboard_panel_data.py @@ -1,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field from ..models.update_dashboard_panel_data_type import ( UpdateDashboardPanelDataType, @@ -21,26 +22,32 @@ class UpdateDashboardPanelData: """ Attributes: - type_ (Union[Unset, UpdateDashboardPanelDataType]): - attributes (Union[Unset, UpdateDashboardPanelDataAttributes]): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. + type_ (UpdateDashboardPanelDataType | Unset): + attributes (UpdateDashboardPanelDataAttributes | Unset): """ - type_: Unset | UpdateDashboardPanelDataType = UNSET - attributes: Union[Unset, "UpdateDashboardPanelDataAttributes"] = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + id: str | Unset = UNSET + type_: UpdateDashboardPanelDataType | Unset = UNSET + attributes: UpdateDashboardPanelDataAttributes | Unset = UNSET def to_dict(self) -> dict[str, Any]: - type_: Unset | str = UNSET + id = self.id + + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id if type_ is not UNSET: field_dict["type"] = type_ if attributes is not UNSET: @@ -53,40 +60,26 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.update_dashboard_panel_data_attributes import UpdateDashboardPanelDataAttributes d = dict(src_dict) + id = d.pop("id", UNSET) + _type_ = d.pop("type", UNSET) - type_: Unset | UpdateDashboardPanelDataType + type_: UpdateDashboardPanelDataType | Unset if isinstance(_type_, Unset): type_ = UNSET else: type_ = check_update_dashboard_panel_data_type(_type_) _attributes = d.pop("attributes", UNSET) - attributes: Unset | UpdateDashboardPanelDataAttributes + attributes: UpdateDashboardPanelDataAttributes | Unset if isinstance(_attributes, Unset): attributes = UNSET else: attributes = UpdateDashboardPanelDataAttributes.from_dict(_attributes) update_dashboard_panel_data = cls( + id=id, type_=type_, attributes=attributes, ) - update_dashboard_panel_data.additional_properties = d return update_dashboard_panel_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_dashboard_panel_data_attributes.py b/rootly_sdk/models/update_dashboard_panel_data_attributes.py index f59d99d7..6025a60e 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -19,31 +21,31 @@ class UpdateDashboardPanelDataAttributes: """ Attributes: - name (Union[None, Unset, str]): The name of the dashboard_panel - params (Union[Unset, UpdateDashboardPanelDataAttributesParams]): - position (Union['UpdateDashboardPanelDataAttributesPositionType0', None, Unset]): + name (None | str | Unset): The name of the dashboard_panel + params (UpdateDashboardPanelDataAttributesParams | Unset): + position (None | Unset | UpdateDashboardPanelDataAttributesPositionType0): """ - name: None | Unset | str = UNSET - params: Union[Unset, "UpdateDashboardPanelDataAttributesParams"] = UNSET - position: Union["UpdateDashboardPanelDataAttributesPositionType0", None, Unset] = UNSET + name: None | str | Unset = UNSET + params: UpdateDashboardPanelDataAttributesParams | Unset = UNSET + position: None | Unset | UpdateDashboardPanelDataAttributesPositionType0 = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_dashboard_panel_data_attributes_position_type_0 import ( UpdateDashboardPanelDataAttributesPositionType0, ) - name: None | Unset | str + name: None | str | Unset if isinstance(self.name, Unset): name = UNSET else: name = self.name - params: Unset | dict[str, Any] = UNSET + params: dict[str, Any] | Unset = UNSET if not isinstance(self.params, Unset): params = self.params.to_dict() - position: None | Unset | dict[str, Any] + position: dict[str, Any] | None | Unset if isinstance(self.position, Unset): position = UNSET elif isinstance(self.position, UpdateDashboardPanelDataAttributesPositionType0): @@ -72,23 +74,23 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> None | Unset | str: + def _parse_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) name = _parse_name(d.pop("name", UNSET)) _params = d.pop("params", UNSET) - params: Unset | UpdateDashboardPanelDataAttributesParams + params: UpdateDashboardPanelDataAttributesParams | Unset if isinstance(_params, Unset): params = UNSET else: params = UpdateDashboardPanelDataAttributesParams.from_dict(_params) - def _parse_position(data: object) -> Union["UpdateDashboardPanelDataAttributesPositionType0", None, Unset]: + def _parse_position(data: object) -> None | Unset | UpdateDashboardPanelDataAttributesPositionType0: if data is None: return data if isinstance(data, Unset): @@ -99,9 +101,9 @@ def _parse_position(data: object) -> Union["UpdateDashboardPanelDataAttributesPo position_type_0 = UpdateDashboardPanelDataAttributesPositionType0.from_dict(data) return position_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["UpdateDashboardPanelDataAttributesPositionType0", None, Unset], data) + return cast(None | Unset | UpdateDashboardPanelDataAttributesPositionType0, 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 2cd1a381..7d2dc52d 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,42 +31,42 @@ class UpdateDashboardPanelDataAttributesParams: """ Attributes: - 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): + description (str | Unset): + table_fields (list[str] | Unset): + legend (UpdateDashboardPanelDataAttributesParamsLegend | Unset): + datalabels (UpdateDashboardPanelDataAttributesParamsDatalabels | Unset): + datasets (list[UpdateDashboardPanelDataAttributesParamsDatasetsItem] | 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - display: Unset | str = UNSET + display: str | Unset = UNSET if not isinstance(self.display, Unset): display = self.display description = self.description - table_fields: Unset | list[str] = UNSET + table_fields: list[str] | Unset = UNSET if not isinstance(self.table_fields, Unset): table_fields = self.table_fields - legend: Unset | dict[str, Any] = UNSET + legend: dict[str, Any] | Unset = UNSET if not isinstance(self.legend, Unset): legend = self.legend.to_dict() - datalabels: Unset | dict[str, Any] = UNSET + datalabels: dict[str, Any] | Unset = UNSET if not isinstance(self.datalabels, Unset): datalabels = self.datalabels.to_dict() - datasets: Unset | list[dict[str, Any]] = UNSET + datasets: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.datasets, Unset): datasets = [] for datasets_item_data in self.datasets: @@ -103,7 +105,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _display = d.pop("display", UNSET) - display: Unset | UpdateDashboardPanelDataAttributesParamsDisplay + display: UpdateDashboardPanelDataAttributesParamsDisplay | Unset if isinstance(_display, Unset): display = UNSET else: @@ -114,25 +116,27 @@ 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: Unset | UpdateDashboardPanelDataAttributesParamsLegend + legend: UpdateDashboardPanelDataAttributesParamsLegend | Unset if isinstance(_legend, Unset): legend = UNSET else: legend = UpdateDashboardPanelDataAttributesParamsLegend.from_dict(_legend) _datalabels = d.pop("datalabels", UNSET) - datalabels: Unset | UpdateDashboardPanelDataAttributesParamsDatalabels + datalabels: UpdateDashboardPanelDataAttributesParamsDatalabels | Unset if isinstance(_datalabels, Unset): datalabels = UNSET else: datalabels = UpdateDashboardPanelDataAttributesParamsDatalabels.from_dict(_datalabels) - datasets = [] _datasets = d.pop("datasets", UNSET) - for datasets_item_data in _datasets or []: - datasets_item = UpdateDashboardPanelDataAttributesParamsDatasetsItem.from_dict(datasets_item_data) + 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) - 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 91983f14..0c83750e 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,10 +15,10 @@ class UpdateDashboardPanelDataAttributesParamsDatalabels: """ Attributes: - enabled (Union[Unset, bool]): + enabled (bool | Unset): """ - enabled: Unset | bool = UNSET + enabled: bool | Unset = UNSET 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 0523caa2..49dd7014 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -29,18 +31,18 @@ class UpdateDashboardPanelDataAttributesParamsDatasetsItem: """ Attributes: - 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): + collection (UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection | Unset): + filter_ (list[UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem] | Unset): + group_by (None | str | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0): + aggregate (None | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0): """ - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,24 +53,24 @@ def to_dict(self) -> dict[str, Any]: UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0, ) - name: None | Unset | str + name: None | str | Unset if isinstance(self.name, Unset): name = UNSET else: name = self.name - collection: Unset | str = UNSET + collection: str | Unset = UNSET if not isinstance(self.collection, Unset): collection = self.collection - filter_: Unset | list[dict[str, Any]] = UNSET + filter_: list[dict[str, Any]] | Unset = 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: None | Unset | dict[str, Any] | str + group_by: dict[str, Any] | None | str | Unset if isinstance(self.group_by, Unset): group_by = UNSET elif isinstance(self.group_by, UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0): @@ -76,7 +78,7 @@ def to_dict(self) -> dict[str, Any]: else: group_by = self.group_by - aggregate: None | Unset | dict[str, Any] + aggregate: dict[str, Any] | None | Unset if isinstance(self.aggregate, Unset): aggregate = UNSET elif isinstance(self.aggregate, UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0): @@ -114,32 +116,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_name(data: object) -> None | Unset | str: + def _parse_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) name = _parse_name(d.pop("name", UNSET)) _collection = d.pop("collection", UNSET) - collection: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection + collection: UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection | Unset 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) - for filter_item_data in _filter_ or []: - filter_item = UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem.from_dict(filter_item_data) + 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) - filter_.append(filter_item) + filter_.append(filter_item) def _parse_group_by( data: object, - ) -> Union["UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0", None, Unset, str]: + ) -> None | str | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0: if data is None: return data if isinstance(data, Unset): @@ -152,17 +156,17 @@ def _parse_group_by( ) return group_by_type_1_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass return cast( - Union["UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0", None, Unset, str], data + None | str | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0, data ) group_by = _parse_group_by(d.pop("group_by", UNSET)) def _parse_aggregate( data: object, - ) -> Union["UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0", None, Unset]: + ) -> None | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0: if data is None: return data if isinstance(data, Unset): @@ -173,9 +177,9 @@ def _parse_aggregate( aggregate_type_0 = UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0.from_dict(data) return aggregate_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0", None, Unset], data) + return cast(None | Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0, 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 2e1d3fbc..4b0c487d 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -17,28 +19,28 @@ class UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0: """ Attributes: - operation (Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation]): - key (Union[None, Unset, str]): - cumulative (Union[None, Unset, bool]): + operation (UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation | Unset): + key (None | str | Unset): + cumulative (bool | None | Unset): """ - operation: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation = UNSET - key: None | Unset | str = UNSET - cumulative: None | Unset | bool = UNSET + operation: UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation | Unset = UNSET + key: None | str | Unset = UNSET + cumulative: bool | None | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: Unset | str = UNSET + operation: str | Unset = UNSET if not isinstance(self.operation, Unset): operation = self.operation - key: None | Unset | str + key: None | str | Unset if isinstance(self.key, Unset): key = UNSET else: key = self.key - cumulative: None | Unset | bool + cumulative: bool | None | Unset if isinstance(self.cumulative, Unset): cumulative = UNSET else: @@ -60,7 +62,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: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation + operation: UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation | Unset if isinstance(_operation, Unset): operation = UNSET else: @@ -68,21 +70,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _operation ) - def _parse_key(data: object) -> None | Unset | str: + def _parse_key(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) key = _parse_key(d.pop("key", UNSET)) - def _parse_cumulative(data: object) -> None | Unset | bool: + def _parse_cumulative(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) cumulative = _parse_cumulative(d.pop("cumulative", UNSET)) diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0_operation.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0_operation.py index 1da9d650..b57e7175 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0_operation.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_aggregate_type_0_operation.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation = Literal["average", "count", "sum"] @@ -17,7 +17,7 @@ def check_update_dashboard_panel_data_attributes_params_datasets_item_aggregate_ if value is None: return None if value in UPDATE_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_AGGREGATE_TYPE_0_OPERATION_VALUES: - return cast(UpdateDashboardPanelDataAttributesParamsDatasetsItemAggregateType0Operation, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_AGGREGATE_TYPE_0_OPERATION_VALUES!r}" ) diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_collection.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_collection.py index 8d627011..18b5508b 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_collection.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_collection.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection = Literal[ "alerts", "incident_action_items", "incident_post_mortems", "incidents", "users" @@ -21,7 +21,7 @@ def check_update_dashboard_panel_data_attributes_params_datasets_item_collection if value is None: return None if value in UPDATE_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_COLLECTION_VALUES: - return cast(UpdateDashboardPanelDataAttributesParamsDatasetsItemCollection, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_COLLECTION_VALUES!r}" ) 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 7c091524..16b2ed1d 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,20 +25,20 @@ class UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItem: """ Attributes: - operation (Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation]): - rules (Union[Unset, list['UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem']]): + operation (UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation | Unset): + rules (list[UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem] | Unset): """ - operation: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation = UNSET - rules: Unset | list["UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem"] = UNSET + operation: UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation | Unset = UNSET + rules: list[UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: Unset | str = UNSET + operation: str | Unset = UNSET if not isinstance(self.operation, Unset): operation = self.operation - rules: Unset | list[dict[str, Any]] = UNSET + rules: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: @@ -61,7 +63,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _operation = d.pop("operation", UNSET) - operation: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation + operation: UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation | Unset if isinstance(_operation, Unset): operation = UNSET else: @@ -69,14 +71,16 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: _operation ) - rules = [] _rules = d.pop("rules", UNSET) - for rules_item_data in _rules or []: - rules_item = UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem.from_dict( - rules_item_data - ) + 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 + ) - 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_operation.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_operation.py index 4917c6f5..4a54b2c0 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_operation.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_operation.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation = Literal["and", "or"] @@ -16,7 +16,7 @@ def check_update_dashboard_panel_data_attributes_params_datasets_item_filter_ite if value is None: return None if value in UPDATE_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_FILTER_ITEM_OPERATION_VALUES: - return cast(UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemOperation, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_FILTER_ITEM_OPERATION_VALUES!r}" ) 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 eaaf8471..982897f3 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -21,24 +23,24 @@ class UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItem: """ Attributes: - operation (Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation]): - condition (Union[Unset, UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition]): - key (Union[Unset, str]): - value (Union[Unset, str]): + operation (UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation | Unset): + condition (UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition | Unset): + key (str | Unset): + value (str | Unset): """ - operation: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation = UNSET - condition: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition = UNSET - key: Unset | str = UNSET - value: Unset | str = UNSET + operation: UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation | Unset = UNSET + condition: UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition | Unset = UNSET + key: str | Unset = UNSET + value: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - operation: Unset | str = UNSET + operation: str | Unset = UNSET if not isinstance(self.operation, Unset): operation = self.operation - condition: Unset | str = UNSET + condition: str | Unset = UNSET if not isinstance(self.condition, Unset): condition = self.condition @@ -64,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) _operation = d.pop("operation", UNSET) - operation: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation + operation: UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation | Unset if isinstance(_operation, Unset): operation = UNSET else: @@ -75,7 +77,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _condition = d.pop("condition", UNSET) - condition: Unset | UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition + condition: UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition | Unset if isinstance(_condition, Unset): condition = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item_condition.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item_condition.py index 727d1933..dbcbffa2 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item_condition.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition = Literal[ "!=", "<=", "=", ">=", "assigned", "contains", "exists", "not_contains", "not_exists", "unassigned" @@ -26,7 +26,7 @@ def check_update_dashboard_panel_data_attributes_params_datasets_item_filter_ite if value is None: return None if value in UPDATE_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_FILTER_ITEM_RULES_ITEM_CONDITION_VALUES: - return cast(UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemCondition, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_FILTER_ITEM_RULES_ITEM_CONDITION_VALUES!r}" ) diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item_operation.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item_operation.py index 40b7526c..4ba7fd32 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item_operation.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_filter_item_rules_item_operation.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation = Literal["and", "or"] @@ -16,7 +16,7 @@ def check_update_dashboard_panel_data_attributes_params_datasets_item_filter_ite if value is None: return None if value in UPDATE_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_FILTER_ITEM_RULES_ITEM_OPERATION_VALUES: - return cast(UpdateDashboardPanelDataAttributesParamsDatasetsItemFilterItemRulesItemOperation, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_FILTER_ITEM_RULES_ITEM_OPERATION_VALUES!r}" ) 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 aaaba96d..b1641d09 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,3 +1,5 @@ +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_datasets_item_group_by_type_1_type_0_key.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0_key.py index 0f922aa8..ba847e60 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0_key.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_datasets_item_group_by_type_1_type_0_key.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0Key = Literal[ "alert_field", "custom_field", "incident_role" @@ -19,7 +19,7 @@ def check_update_dashboard_panel_data_attributes_params_datasets_item_group_by_t if value is None: return None if value in UPDATE_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_GROUP_BY_TYPE_1_TYPE_0_KEY_VALUES: - return cast(UpdateDashboardPanelDataAttributesParamsDatasetsItemGroupByType1Type0Key, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DATASETS_ITEM_GROUP_BY_TYPE_1_TYPE_0_KEY_VALUES!r}" ) diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_display.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_display.py index 99c9588b..76f34696 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_display.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_display.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateDashboardPanelDataAttributesParamsDisplay = Literal[ "aggregate_value", @@ -29,7 +29,7 @@ def check_update_dashboard_panel_data_attributes_params_display( if value is None: return None if value in UPDATE_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DISPLAY_VALUES: - return cast(UpdateDashboardPanelDataAttributesParamsDisplay, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_DISPLAY_VALUES!r}" ) 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 24a0af4a..d9afacec 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -17,14 +19,14 @@ class UpdateDashboardPanelDataAttributesParamsLegend: """ Attributes: - groups (Union[Unset, UpdateDashboardPanelDataAttributesParamsLegendGroups]): Default: 'all'. + groups (UpdateDashboardPanelDataAttributesParamsLegendGroups | Unset): Default: 'all'. """ - groups: Unset | UpdateDashboardPanelDataAttributesParamsLegendGroups = "all" + groups: UpdateDashboardPanelDataAttributesParamsLegendGroups | Unset = "all" additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - groups: Unset | str = UNSET + groups: str | Unset = UNSET if not isinstance(self.groups, Unset): groups = self.groups @@ -40,7 +42,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: Unset | UpdateDashboardPanelDataAttributesParamsLegendGroups + groups: UpdateDashboardPanelDataAttributesParamsLegendGroups | Unset if isinstance(_groups, Unset): groups = UNSET else: diff --git a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_legend_groups.py b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_legend_groups.py index 4c714d22..f6ffed6f 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_attributes_params_legend_groups.py +++ b/rootly_sdk/models/update_dashboard_panel_data_attributes_params_legend_groups.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateDashboardPanelDataAttributesParamsLegendGroups = Literal["all", "charted"] @@ -16,7 +16,7 @@ def check_update_dashboard_panel_data_attributes_params_legend_groups( if value is None: return None if value in UPDATE_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_LEGEND_GROUPS_VALUES: - return cast(UpdateDashboardPanelDataAttributesParamsLegendGroups, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_DASHBOARD_PANEL_DATA_ATTRIBUTES_PARAMS_LEGEND_GROUPS_VALUES!r}" ) 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 2118c2c0..8ce15963 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_dashboard_panel_data_type.py b/rootly_sdk/models/update_dashboard_panel_data_type.py index 63aaf980..20bca9a4 100644 --- a/rootly_sdk/models/update_dashboard_panel_data_type.py +++ b/rootly_sdk/models/update_dashboard_panel_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateDashboardPanelDataType = Literal["dashboard_panels"] @@ -11,5 +11,5 @@ def check_update_dashboard_panel_data_type(value: str | None) -> UpdateDashboard if value is None: return None if value in UPDATE_DASHBOARD_PANEL_DATA_TYPE_VALUES: - return cast(UpdateDashboardPanelDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_DASHBOARD_PANEL_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_datadog_notebook_task_params.py b/rootly_sdk/models/update_datadog_notebook_task_params.py index d67ddc1b..afd34de5 100644 --- a/rootly_sdk/models/update_datadog_notebook_task_params.py +++ b/rootly_sdk/models/update_datadog_notebook_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,27 +28,27 @@ class UpdateDatadogNotebookTaskParams: """ Attributes: file_id (str): The Datadog notebook ID - 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 + 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 """ file_id: str - 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 + 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 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -54,13 +56,13 @@ def to_dict(self) -> dict[str, Any]: content = self.content - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind post_mortem_template_id = self.post_mortem_template_id - template: Unset | dict[str, Any] = UNSET + template: dict[str, Any] | Unset = UNSET if not isinstance(self.template, Unset): template = self.template.to_dict() @@ -94,7 +96,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: Unset | UpdateDatadogNotebookTaskParamsTaskType + task_type: UpdateDatadogNotebookTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -105,7 +107,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: content = d.pop("content", UNSET) _kind = d.pop("kind", UNSET) - kind: Unset | UpdateDatadogNotebookTaskParamsKind + kind: UpdateDatadogNotebookTaskParamsKind | Unset if isinstance(_kind, Unset): kind = UNSET else: @@ -114,7 +116,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: Unset | UpdateDatadogNotebookTaskParamsTemplate + template: UpdateDatadogNotebookTaskParamsTemplate | Unset if isinstance(_template, Unset): template = UNSET else: diff --git a/rootly_sdk/models/update_datadog_notebook_task_params_kind.py b/rootly_sdk/models/update_datadog_notebook_task_params_kind.py index ffbb5654..0c9f3ff2 100644 --- a/rootly_sdk/models/update_datadog_notebook_task_params_kind.py +++ b/rootly_sdk/models/update_datadog_notebook_task_params_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateDatadogNotebookTaskParamsKind = Literal["documentation", "investigation", "postmortem", "report", "runbook"] @@ -15,5 +15,5 @@ def check_update_datadog_notebook_task_params_kind(value: str | None) -> UpdateD if value is None: return None if value in UPDATE_DATADOG_NOTEBOOK_TASK_PARAMS_KIND_VALUES: - return cast(UpdateDatadogNotebookTaskParamsKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_DATADOG_NOTEBOOK_TASK_PARAMS_KIND_VALUES!r}") diff --git a/rootly_sdk/models/update_datadog_notebook_task_params_task_type.py b/rootly_sdk/models/update_datadog_notebook_task_params_task_type.py index 3066c877..d15dc48b 100644 --- a/rootly_sdk/models/update_datadog_notebook_task_params_task_type.py +++ b/rootly_sdk/models/update_datadog_notebook_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateDatadogNotebookTaskParamsTaskType = Literal["update_datadog_notebook"] @@ -13,7 +13,7 @@ def check_update_datadog_notebook_task_params_task_type( if value is None: return None if value in UPDATE_DATADOG_NOTEBOOK_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateDatadogNotebookTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_DATADOG_NOTEBOOK_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 8b3f916d..7946ae4c 100644 --- a/rootly_sdk/models/update_datadog_notebook_task_params_template.py +++ b/rootly_sdk/models/update_datadog_notebook_task_params_template.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateDatadogNotebookTaskParamsTemplate: """The Datadog notebook template to use Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 285ebb2c..9f31d59e 100644 --- a/rootly_sdk/models/update_dropbox_paper_page_task_params.py +++ b/rootly_sdk/models/update_dropbox_paper_page_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -18,23 +20,23 @@ class UpdateDropboxPaperPageTaskParams: """ Attributes: file_id (str): The Dropbox Paper document ID - 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 + 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 """ file_id: str - task_type: Unset | UpdateDropboxPaperPageTaskParamsTaskType = UNSET - title: Unset | str = UNSET - content: Unset | str = UNSET - post_mortem_template_id: Unset | str = UNSET + task_type: UpdateDropboxPaperPageTaskParamsTaskType | Unset = UNSET + title: str | Unset = UNSET + content: str | Unset = UNSET + post_mortem_template_id: str | Unset = 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -68,7 +70,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: Unset | UpdateDropboxPaperPageTaskParamsTaskType + task_type: UpdateDropboxPaperPageTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_dropbox_paper_page_task_params_task_type.py b/rootly_sdk/models/update_dropbox_paper_page_task_params_task_type.py index 61567f4c..06410d97 100644 --- a/rootly_sdk/models/update_dropbox_paper_page_task_params_task_type.py +++ b/rootly_sdk/models/update_dropbox_paper_page_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateDropboxPaperPageTaskParamsTaskType = Literal["update_dropbox_paper_page"] @@ -13,7 +13,7 @@ def check_update_dropbox_paper_page_task_params_task_type( if value is None: return None if value in UPDATE_DROPBOX_PAPER_PAGE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateDropboxPaperPageTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_DROPBOX_PAPER_PAGE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_edge_connector.py b/rootly_sdk/models/update_edge_connector.py index d3a49f74..1a0943b0 100644 --- a/rootly_sdk/models/update_edge_connector.py +++ b/rootly_sdk/models/update_edge_connector.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,7 +20,7 @@ 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]: diff --git a/rootly_sdk/models/update_edge_connector_action.py b/rootly_sdk/models/update_edge_connector_action.py index 03595dc3..8f66a7e3 100644 --- a/rootly_sdk/models/update_edge_connector_action.py +++ b/rootly_sdk/models/update_edge_connector_action.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,7 +20,7 @@ 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]: diff --git a/rootly_sdk/models/update_edge_connector_action_action.py b/rootly_sdk/models/update_edge_connector_action_action.py index 508ccc77..c15966c0 100644 --- a/rootly_sdk/models/update_edge_connector_action_action.py +++ b/rootly_sdk/models/update_edge_connector_action_action.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,24 +23,24 @@ class UpdateEdgeConnectorActionAction: """ Attributes: - name (Union[Unset, str]): - action_type (Union[Unset, UpdateEdgeConnectorActionActionActionType]): - metadata (Union[Unset, UpdateEdgeConnectorActionActionMetadata]): + name (str | Unset): + action_type (UpdateEdgeConnectorActionActionActionType | Unset): + metadata (UpdateEdgeConnectorActionActionMetadata | Unset): """ - name: Unset | str = UNSET - action_type: Unset | UpdateEdgeConnectorActionActionActionType = UNSET - metadata: Union[Unset, "UpdateEdgeConnectorActionActionMetadata"] = UNSET + name: str | Unset = UNSET + action_type: UpdateEdgeConnectorActionActionActionType | Unset = UNSET + metadata: UpdateEdgeConnectorActionActionMetadata | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - action_type: Unset | str = UNSET + action_type: str | Unset = UNSET if not isinstance(self.action_type, Unset): action_type = self.action_type - metadata: Unset | dict[str, Any] = UNSET + metadata: dict[str, Any] | Unset = UNSET if not isinstance(self.metadata, Unset): metadata = self.metadata.to_dict() @@ -62,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: Unset | UpdateEdgeConnectorActionActionActionType + action_type: UpdateEdgeConnectorActionActionActionType | Unset 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: Unset | UpdateEdgeConnectorActionActionMetadata + metadata: UpdateEdgeConnectorActionActionMetadata | Unset if isinstance(_metadata, Unset): metadata = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_action_action_action_type.py b/rootly_sdk/models/update_edge_connector_action_action_action_type.py index 9b57e082..53577a52 100644 --- a/rootly_sdk/models/update_edge_connector_action_action_action_type.py +++ b/rootly_sdk/models/update_edge_connector_action_action_action_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEdgeConnectorActionActionActionType = Literal["http", "script"] @@ -14,7 +14,7 @@ def check_update_edge_connector_action_action_action_type( if value is None: return None if value in UPDATE_EDGE_CONNECTOR_ACTION_ACTION_ACTION_TYPE_VALUES: - return cast(UpdateEdgeConnectorActionActionActionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_EDGE_CONNECTOR_ACTION_ACTION_ACTION_TYPE_VALUES!r}" ) 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 0f536a48..b1551783 100644 --- a/rootly_sdk/models/update_edge_connector_action_action_metadata.py +++ b/rootly_sdk/models/update_edge_connector_action_action_metadata.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 ab2138ac..0e199f8e 100644 --- a/rootly_sdk/models/update_edge_connector_action_body.py +++ b/rootly_sdk/models/update_edge_connector_action_body.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,14 +19,14 @@ class UpdateEdgeConnectorActionBody: """ Attributes: - action (Union[Unset, UpdateEdgeConnectorActionBodyAction]): + action (UpdateEdgeConnectorActionBodyAction | Unset): """ - action: Union[Unset, "UpdateEdgeConnectorActionBodyAction"] = UNSET + action: UpdateEdgeConnectorActionBodyAction | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - action: Unset | dict[str, Any] = UNSET + action: dict[str, Any] | Unset = UNSET if not isinstance(self.action, Unset): action = self.action.to_dict() @@ -42,7 +44,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _action = d.pop("action", UNSET) - action: Unset | UpdateEdgeConnectorActionBodyAction + action: UpdateEdgeConnectorActionBodyAction | Unset 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 5b27c01f..d70768dd 100644 --- a/rootly_sdk/models/update_edge_connector_action_body_action.py +++ b/rootly_sdk/models/update_edge_connector_action_body_action.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,24 +23,24 @@ class UpdateEdgeConnectorActionBodyAction: """ Attributes: - name (Union[Unset, str]): - action_type (Union[Unset, UpdateEdgeConnectorActionBodyActionActionType]): - metadata (Union[Unset, UpdateEdgeConnectorActionBodyActionMetadata]): + name (str | Unset): + action_type (UpdateEdgeConnectorActionBodyActionActionType | Unset): + metadata (UpdateEdgeConnectorActionBodyActionMetadata | Unset): """ - name: Unset | str = UNSET - action_type: Unset | UpdateEdgeConnectorActionBodyActionActionType = UNSET - metadata: Union[Unset, "UpdateEdgeConnectorActionBodyActionMetadata"] = UNSET + name: str | Unset = UNSET + action_type: UpdateEdgeConnectorActionBodyActionActionType | Unset = UNSET + metadata: UpdateEdgeConnectorActionBodyActionMetadata | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: name = self.name - action_type: Unset | str = UNSET + action_type: str | Unset = UNSET if not isinstance(self.action_type, Unset): action_type = self.action_type - metadata: Unset | dict[str, Any] = UNSET + metadata: dict[str, Any] | Unset = UNSET if not isinstance(self.metadata, Unset): metadata = self.metadata.to_dict() @@ -64,14 +66,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: Unset | UpdateEdgeConnectorActionBodyActionActionType + action_type: UpdateEdgeConnectorActionBodyActionActionType | Unset 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: Unset | UpdateEdgeConnectorActionBodyActionMetadata + metadata: UpdateEdgeConnectorActionBodyActionMetadata | Unset if isinstance(_metadata, Unset): metadata = UNSET else: diff --git a/rootly_sdk/models/update_edge_connector_action_body_action_action_type.py b/rootly_sdk/models/update_edge_connector_action_body_action_action_type.py index a6a7247a..1d1c7b11 100644 --- a/rootly_sdk/models/update_edge_connector_action_body_action_action_type.py +++ b/rootly_sdk/models/update_edge_connector_action_body_action_action_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEdgeConnectorActionBodyActionActionType = Literal["http", "script"] @@ -14,7 +14,7 @@ def check_update_edge_connector_action_body_action_action_type( if value is None: return None if value in UPDATE_EDGE_CONNECTOR_ACTION_BODY_ACTION_ACTION_TYPE_VALUES: - return cast(UpdateEdgeConnectorActionBodyActionActionType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_EDGE_CONNECTOR_ACTION_BODY_ACTION_ACTION_TYPE_VALUES!r}" ) 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 507c8764..091eb2e7 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 996b1d4d..a10ff487 100644 --- a/rootly_sdk/models/update_edge_connector_body.py +++ b/rootly_sdk/models/update_edge_connector_body.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -17,14 +19,14 @@ class UpdateEdgeConnectorBody: """ Attributes: - data (Union[Unset, UpdateEdgeConnectorBodyData]): + data (UpdateEdgeConnectorBodyData | Unset): """ - data: Union[Unset, "UpdateEdgeConnectorBodyData"] = UNSET + data: UpdateEdgeConnectorBodyData | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - data: Unset | dict[str, Any] = UNSET + data: dict[str, Any] | Unset = UNSET if not isinstance(self.data, Unset): data = self.data.to_dict() @@ -42,7 +44,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _data = d.pop("data", UNSET) - data: Unset | UpdateEdgeConnectorBodyData + data: UpdateEdgeConnectorBodyData | Unset 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 7e203ba0..445e7799 100644 --- a/rootly_sdk/models/update_edge_connector_body_data.py +++ b/rootly_sdk/models/update_edge_connector_body_data.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,24 +23,24 @@ class UpdateEdgeConnectorBodyData: """ Attributes: - type_ (Union[Unset, UpdateEdgeConnectorBodyDataType]): - id (Union[Unset, str]): - attributes (Union[Unset, UpdateEdgeConnectorBodyDataAttributes]): + type_ (UpdateEdgeConnectorBodyDataType | Unset): + id (str | Unset): + attributes (UpdateEdgeConnectorBodyDataAttributes | Unset): """ - type_: Unset | UpdateEdgeConnectorBodyDataType = UNSET - id: Unset | str = UNSET - attributes: Union[Unset, "UpdateEdgeConnectorBodyDataAttributes"] = UNSET + type_: UpdateEdgeConnectorBodyDataType | Unset = UNSET + id: str | Unset = UNSET + attributes: UpdateEdgeConnectorBodyDataAttributes | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - type_: Unset | str = UNSET + type_: str | Unset = UNSET if not isinstance(self.type_, Unset): type_ = self.type_ id = self.id - attributes: Unset | dict[str, Any] = UNSET + attributes: dict[str, Any] | Unset = UNSET if not isinstance(self.attributes, Unset): attributes = self.attributes.to_dict() @@ -60,7 +62,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _type_ = d.pop("type", UNSET) - type_: Unset | UpdateEdgeConnectorBodyDataType + type_: UpdateEdgeConnectorBodyDataType | Unset if isinstance(_type_, Unset): type_ = UNSET else: @@ -69,7 +71,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) _attributes = d.pop("attributes", UNSET) - attributes: Unset | UpdateEdgeConnectorBodyDataAttributes + attributes: UpdateEdgeConnectorBodyDataAttributes | Unset 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 abde96dc..435b058f 100644 --- a/rootly_sdk/models/update_edge_connector_body_data_attributes.py +++ b/rootly_sdk/models/update_edge_connector_body_data_attributes.py @@ -1,5 +1,8 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast +from uuid import UUID from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -21,18 +24,20 @@ class UpdateEdgeConnectorBodyDataAttributes: """ Attributes: - 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): + description (str | Unset): + status (UpdateEdgeConnectorBodyDataAttributesStatus | Unset): + subscriptions (list[str] | Unset): + owner_group_ids (list[UUID] | Unset): IDs of the teams (groups) that own this connector + filters (UpdateEdgeConnectorBodyDataAttributesFilters | Unset): Event filters """ - name: Unset | str = UNSET - description: Unset | str = UNSET - status: Unset | UpdateEdgeConnectorBodyDataAttributesStatus = UNSET - subscriptions: Unset | list[str] = UNSET - filters: Union[Unset, "UpdateEdgeConnectorBodyDataAttributesFilters"] = UNSET + name: str | Unset = UNSET + description: str | Unset = UNSET + status: UpdateEdgeConnectorBodyDataAttributesStatus | Unset = UNSET + subscriptions: list[str] | Unset = UNSET + owner_group_ids: list[UUID] | Unset = UNSET + filters: UpdateEdgeConnectorBodyDataAttributesFilters | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,15 +45,22 @@ def to_dict(self) -> dict[str, Any]: description = self.description - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status - subscriptions: Unset | list[str] = UNSET + subscriptions: list[str] | Unset = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions - filters: Unset | dict[str, Any] = UNSET + owner_group_ids: list[str] | Unset = UNSET + if not isinstance(self.owner_group_ids, Unset): + owner_group_ids = [] + for owner_group_ids_item_data in self.owner_group_ids: + owner_group_ids_item = str(owner_group_ids_item_data) + owner_group_ids.append(owner_group_ids_item) + + filters: dict[str, Any] | Unset = UNSET if not isinstance(self.filters, Unset): filters = self.filters.to_dict() @@ -63,6 +75,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["status"] = status if subscriptions is not UNSET: field_dict["subscriptions"] = subscriptions + if owner_group_ids is not UNSET: + field_dict["owner_group_ids"] = owner_group_ids if filters is not UNSET: field_dict["filters"] = filters @@ -80,7 +94,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _status = d.pop("status", UNSET) - status: Unset | UpdateEdgeConnectorBodyDataAttributesStatus + status: UpdateEdgeConnectorBodyDataAttributesStatus | Unset if isinstance(_status, Unset): status = UNSET else: @@ -88,8 +102,17 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subscriptions = cast(list[str], d.pop("subscriptions", UNSET)) + _owner_group_ids = d.pop("owner_group_ids", UNSET) + owner_group_ids: list[UUID] | Unset = UNSET + if _owner_group_ids is not UNSET: + owner_group_ids = [] + for owner_group_ids_item_data in _owner_group_ids: + owner_group_ids_item = UUID(owner_group_ids_item_data) + + owner_group_ids.append(owner_group_ids_item) + _filters = d.pop("filters", UNSET) - filters: Unset | UpdateEdgeConnectorBodyDataAttributesFilters + filters: UpdateEdgeConnectorBodyDataAttributesFilters | Unset if isinstance(_filters, Unset): filters = UNSET else: @@ -100,6 +123,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description=description, status=status, subscriptions=subscriptions, + owner_group_ids=owner_group_ids, filters=filters, ) 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 dc0a35cc..c6da5ea2 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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_body_data_attributes_status.py b/rootly_sdk/models/update_edge_connector_body_data_attributes_status.py index 1e0d894f..f52c55be 100644 --- a/rootly_sdk/models/update_edge_connector_body_data_attributes_status.py +++ b/rootly_sdk/models/update_edge_connector_body_data_attributes_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEdgeConnectorBodyDataAttributesStatus = Literal["active", "paused"] @@ -14,7 +14,7 @@ def check_update_edge_connector_body_data_attributes_status( if value is None: return None if value in UPDATE_EDGE_CONNECTOR_BODY_DATA_ATTRIBUTES_STATUS_VALUES: - return cast(UpdateEdgeConnectorBodyDataAttributesStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_EDGE_CONNECTOR_BODY_DATA_ATTRIBUTES_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/update_edge_connector_body_data_type.py b/rootly_sdk/models/update_edge_connector_body_data_type.py index bad5f7ab..058652d6 100644 --- a/rootly_sdk/models/update_edge_connector_body_data_type.py +++ b/rootly_sdk/models/update_edge_connector_body_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEdgeConnectorBodyDataType = Literal["edge_connectors"] @@ -11,5 +11,5 @@ def check_update_edge_connector_body_data_type(value: str | None) -> UpdateEdgeC if value is None: return None if value in UPDATE_EDGE_CONNECTOR_BODY_DATA_TYPE_VALUES: - return cast(UpdateEdgeConnectorBodyDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_EDGE_CONNECTOR_BODY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_edge_connector_edge_connector.py b/rootly_sdk/models/update_edge_connector_edge_connector.py index 3bbc9ead..8357603f 100644 --- a/rootly_sdk/models/update_edge_connector_edge_connector.py +++ b/rootly_sdk/models/update_edge_connector_edge_connector.py @@ -1,5 +1,8 @@ +from __future__ import annotations + 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 @@ -17,16 +20,18 @@ class UpdateEdgeConnectorEdgeConnector: """ Attributes: - name (Union[Unset, str]): - description (Union[Unset, str]): - status (Union[Unset, UpdateEdgeConnectorEdgeConnectorStatus]): - subscriptions (Union[Unset, list[str]]): + name (str | Unset): + description (str | Unset): + status (UpdateEdgeConnectorEdgeConnectorStatus | Unset): + subscriptions (list[str] | Unset): + owner_group_ids (list[UUID] | Unset): """ - name: Unset | str = UNSET - description: Unset | str = UNSET - status: Unset | UpdateEdgeConnectorEdgeConnectorStatus = UNSET - subscriptions: Unset | list[str] = UNSET + name: str | Unset = UNSET + description: str | Unset = UNSET + status: UpdateEdgeConnectorEdgeConnectorStatus | Unset = UNSET + subscriptions: list[str] | Unset = UNSET + owner_group_ids: list[UUID] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -34,14 +39,21 @@ def to_dict(self) -> dict[str, Any]: description = self.description - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status - subscriptions: Unset | list[str] = UNSET + subscriptions: list[str] | Unset = UNSET if not isinstance(self.subscriptions, Unset): subscriptions = self.subscriptions + owner_group_ids: list[str] | Unset = UNSET + if not isinstance(self.owner_group_ids, Unset): + owner_group_ids = [] + for owner_group_ids_item_data in self.owner_group_ids: + owner_group_ids_item = str(owner_group_ids_item_data) + owner_group_ids.append(owner_group_ids_item) + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) @@ -53,6 +65,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["status"] = status if subscriptions is not UNSET: field_dict["subscriptions"] = subscriptions + if owner_group_ids is not UNSET: + field_dict["owner_group_ids"] = owner_group_ids return field_dict @@ -64,7 +78,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _status = d.pop("status", UNSET) - status: Unset | UpdateEdgeConnectorEdgeConnectorStatus + status: UpdateEdgeConnectorEdgeConnectorStatus | Unset if isinstance(_status, Unset): status = UNSET else: @@ -72,11 +86,21 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: subscriptions = cast(list[str], d.pop("subscriptions", UNSET)) + _owner_group_ids = d.pop("owner_group_ids", UNSET) + owner_group_ids: list[UUID] | Unset = UNSET + if _owner_group_ids is not UNSET: + owner_group_ids = [] + for owner_group_ids_item_data in _owner_group_ids: + owner_group_ids_item = UUID(owner_group_ids_item_data) + + owner_group_ids.append(owner_group_ids_item) + update_edge_connector_edge_connector = cls( name=name, description=description, status=status, subscriptions=subscriptions, + owner_group_ids=owner_group_ids, ) update_edge_connector_edge_connector.additional_properties = d diff --git a/rootly_sdk/models/update_edge_connector_edge_connector_status.py b/rootly_sdk/models/update_edge_connector_edge_connector_status.py index bbdf3a18..8420af7f 100644 --- a/rootly_sdk/models/update_edge_connector_edge_connector_status.py +++ b/rootly_sdk/models/update_edge_connector_edge_connector_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEdgeConnectorEdgeConnectorStatus = Literal["active", "paused"] @@ -14,7 +14,7 @@ def check_update_edge_connector_edge_connector_status( if value is None: return None if value in UPDATE_EDGE_CONNECTOR_EDGE_CONNECTOR_STATUS_VALUES: - return cast(UpdateEdgeConnectorEdgeConnectorStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_EDGE_CONNECTOR_EDGE_CONNECTOR_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/update_environment.py b/rootly_sdk/models/update_environment.py index 0af13434..7afa47b1 100644 --- a/rootly_sdk/models/update_environment.py +++ b/rootly_sdk/models/update_environment.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_environment_data import UpdateEnvironmentData @@ -18,14 +19,13 @@ class UpdateEnvironment: data (UpdateEnvironmentData): """ - data: "UpdateEnvironmentData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateEnvironmentData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_environment.additional_properties = d return update_environment - - @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_environment_data.py b/rootly_sdk/models/update_environment_data.py index bb7f5c09..94ab3881 100644 --- a/rootly_sdk/models/update_environment_data.py +++ b/rootly_sdk/models/update_environment_data.py @@ -1,10 +1,12 @@ +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_environment_data_type import UpdateEnvironmentDataType, check_update_environment_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_environment_data_attributes import UpdateEnvironmentDataAttributes @@ -19,25 +21,31 @@ class UpdateEnvironmentData: Attributes: type_ (UpdateEnvironmentDataType): attributes (UpdateEnvironmentDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateEnvironmentDataType - attributes: "UpdateEnvironmentDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateEnvironmentDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateEnvironmentDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_environment_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_environment_data.additional_properties = d return update_environment_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_environment_data_attributes.py b/rootly_sdk/models/update_environment_data_attributes.py index 5964309a..81cdd30d 100644 --- a/rootly_sdk/models/update_environment_data_attributes.py +++ b/rootly_sdk/models/update_environment_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -24,37 +26,37 @@ class UpdateEnvironmentDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + name (str | Unset): The name of the environment + description (None | str | Unset): The description of the environment + public_description (None | str | Unset): The status page 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 associated with this environment - properties (Union[Unset, list['UpdateEnvironmentDataAttributesPropertiesItem']]): Array of property values for - this environment. + properties (list[UpdateEnvironmentDataAttributesPropertiesItem] | Unset): Array of property values for this + environment. """ - 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 + slug: None | str | Unset = UNSET + 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 + 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 def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -62,37 +64,37 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -101,7 +103,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: None | Unset | list[dict[str, Any]] + slack_channels: list[dict[str, Any]] | None | Unset if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -113,7 +115,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: None | Unset | list[dict[str, Any]] + slack_aliases: list[dict[str, Any]] | None | Unset if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -125,7 +127,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: Unset | list[dict[str, Any]] = UNSET + properties: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -174,63 +176,63 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -241,15 +243,15 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> None | Unset | list["UpdateEnvironmentDataAttributesSlackChannelsType0Item"]: + ) -> list[UpdateEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -267,15 +269,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["UpdateEnvironmentDataAttributesSlackChannelsType0Item"], data) + return cast(list[UpdateEnvironmentDataAttributesSlackChannelsType0Item] | None | Unset, data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> None | Unset | list["UpdateEnvironmentDataAttributesSlackAliasesType0Item"]: + ) -> list[UpdateEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -293,18 +295,20 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["UpdateEnvironmentDataAttributesSlackAliasesType0Item"], data) + return cast(list[UpdateEnvironmentDataAttributesSlackAliasesType0Item] | None | Unset, data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - properties = [] _properties = d.pop("properties", UNSET) - for properties_item_data in _properties or []: - properties_item = UpdateEnvironmentDataAttributesPropertiesItem.from_dict(properties_item_data) + 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) - properties.append(properties_item) + properties.append(properties_item) update_environment_data_attributes = cls( slug=slug, 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 c1cc04b9..555c7a02 100644 --- a/rootly_sdk/models/update_environment_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_environment_data_attributes_properties_item.py @@ -1,3 +1,5 @@ +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 cfadccf4..aab090d2 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="UpdateEnvironmentDataAttributesSlackAliasesType0Item") @@ -17,7 +18,6 @@ class UpdateEnvironmentDataAttributesSlackAliasesType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - update_environment_data_attributes_slack_aliases_type_0_item.additional_properties = d return update_environment_data_attributes_slack_aliases_type_0_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_environment_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/update_environment_data_attributes_slack_channels_type_0_item.py index ae4c9d1a..1dacda72 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="UpdateEnvironmentDataAttributesSlackChannelsType0Item") @@ -17,7 +18,6 @@ class UpdateEnvironmentDataAttributesSlackChannelsType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - update_environment_data_attributes_slack_channels_type_0_item.additional_properties = d return update_environment_data_attributes_slack_channels_type_0_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_environment_data_type.py b/rootly_sdk/models/update_environment_data_type.py index f1a07af6..85b7b959 100644 --- a/rootly_sdk/models/update_environment_data_type.py +++ b/rootly_sdk/models/update_environment_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEnvironmentDataType = Literal["environments"] @@ -11,5 +11,5 @@ def check_update_environment_data_type(value: str | None) -> UpdateEnvironmentDa if value is None: return None if value in UPDATE_ENVIRONMENT_DATA_TYPE_VALUES: - return cast(UpdateEnvironmentDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ENVIRONMENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_escalation_policy.py b/rootly_sdk/models/update_escalation_policy.py index d64a1ba0..e72ee246 100644 --- a/rootly_sdk/models/update_escalation_policy.py +++ b/rootly_sdk/models/update_escalation_policy.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_escalation_policy_data import UpdateEscalationPolicyData @@ -18,14 +19,13 @@ class UpdateEscalationPolicy: data (UpdateEscalationPolicyData): """ - data: "UpdateEscalationPolicyData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateEscalationPolicyData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_escalation_policy.additional_properties = d return update_escalation_policy - - @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_escalation_policy_data.py b/rootly_sdk/models/update_escalation_policy_data.py index 69dcce30..1df66281 100644 --- a/rootly_sdk/models/update_escalation_policy_data.py +++ b/rootly_sdk/models/update_escalation_policy_data.py @@ -1,13 +1,15 @@ +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_escalation_policy_data_type import ( UpdateEscalationPolicyDataType, check_update_escalation_policy_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_escalation_policy_data_attributes import UpdateEscalationPolicyDataAttributes @@ -22,25 +24,31 @@ class UpdateEscalationPolicyData: Attributes: type_ (UpdateEscalationPolicyDataType): attributes (UpdateEscalationPolicyDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateEscalationPolicyDataType - attributes: "UpdateEscalationPolicyDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateEscalationPolicyDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateEscalationPolicyDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_escalation_policy_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_escalation_policy_data.additional_properties = d return update_escalation_policy_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_escalation_policy_data_attributes.py b/rootly_sdk/models/update_escalation_policy_data_attributes.py index aad07d04..9cf51994 100644 --- a/rootly_sdk/models/update_escalation_policy_data_attributes.py +++ b/rootly_sdk/models/update_escalation_policy_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -18,21 +20,21 @@ class UpdateEscalationPolicyDataAttributes: """ Attributes: - 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): 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: 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 + 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 def to_dict(self) -> dict[str, Any]: from ..models.update_escalation_policy_data_attributes_business_hours_type_0 import ( @@ -41,7 +43,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -49,15 +51,15 @@ def to_dict(self) -> dict[str, Any]: repeat_count = self.repeat_count - group_ids: Unset | list[str] = UNSET + group_ids: list[str] | Unset = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - service_ids: Unset | list[str] = UNSET + service_ids: list[str] | Unset = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - business_hours: None | Unset | dict[str, Any] + business_hours: dict[str, Any] | None | Unset if isinstance(self.business_hours, Unset): business_hours = UNSET elif isinstance(self.business_hours, UpdateEscalationPolicyDataAttributesBusinessHoursType0): @@ -92,12 +94,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) @@ -109,7 +111,7 @@ def _parse_description(data: object) -> None | Unset | str: def _parse_business_hours( data: object, - ) -> Union["UpdateEscalationPolicyDataAttributesBusinessHoursType0", None, Unset]: + ) -> None | Unset | UpdateEscalationPolicyDataAttributesBusinessHoursType0: if data is None: return data if isinstance(data, Unset): @@ -120,9 +122,9 @@ def _parse_business_hours( business_hours_type_0 = UpdateEscalationPolicyDataAttributesBusinessHoursType0.from_dict(data) return business_hours_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["UpdateEscalationPolicyDataAttributesBusinessHoursType0", None, Unset], data) + return cast(None | Unset | UpdateEscalationPolicyDataAttributesBusinessHoursType0, 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 49ec4302..0f5eaf76 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,8 +1,9 @@ +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.update_escalation_policy_data_attributes_business_hours_type_0_days_type_0_item import ( UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item, @@ -21,26 +22,23 @@ class UpdateEscalationPolicyDataAttributesBusinessHoursType0: """ Attributes: - 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): 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: 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) + time_zone: UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone | Unset = UNSET + days: list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset = UNSET + start_time: None | str | Unset = UNSET + end_time: None | str | Unset = UNSET def to_dict(self) -> dict[str, Any]: - time_zone: Unset | str = UNSET + time_zone: str | Unset = UNSET if not isinstance(self.time_zone, Unset): time_zone = self.time_zone - days: None | Unset | list[str] + days: list[str] | None | Unset if isinstance(self.days, Unset): days = UNSET elif isinstance(self.days, list): @@ -52,20 +50,20 @@ def to_dict(self) -> dict[str, Any]: else: days = self.days - start_time: None | Unset | str + start_time: None | str | Unset if isinstance(self.start_time, Unset): start_time = UNSET else: start_time = self.start_time - end_time: None | Unset | str + end_time: None | str | Unset if isinstance(self.end_time, Unset): end_time = UNSET else: end_time = self.end_time field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if time_zone is not UNSET: field_dict["time_zone"] = time_zone @@ -82,7 +80,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: Unset | UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone + time_zone: UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone | Unset if isinstance(_time_zone, Unset): time_zone = UNSET else: @@ -90,7 +88,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_days( data: object, - ) -> None | Unset | list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item]: + ) -> list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -110,27 +108,27 @@ def _parse_days( days_type_0.append(days_type_0_item) return days_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item], data) + return cast(list[UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item] | None | Unset, data) days = _parse_days(d.pop("days", UNSET)) - def _parse_start_time(data: object) -> None | Unset | str: + def _parse_start_time(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> None | Unset | str: + def _parse_end_time(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) end_time = _parse_end_time(d.pop("end_time", UNSET)) @@ -141,21 +139,4 @@ def _parse_end_time(data: object) -> None | Unset | str: end_time=end_time, ) - update_escalation_policy_data_attributes_business_hours_type_0.additional_properties = d return update_escalation_policy_data_attributes_business_hours_type_0 - - @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_escalation_policy_data_attributes_business_hours_type_0_days_type_0_item.py b/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0_days_type_0_item.py index f42bdd3a..0e3612ea 100644 --- a/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0_days_type_0_item.py +++ b/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0_days_type_0_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item = Literal["F", "M", "R", "S", "T", "U", "W"] @@ -21,7 +21,7 @@ def check_update_escalation_policy_data_attributes_business_hours_type_0_days_ty if value is None: return None if value in UPDATE_ESCALATION_POLICY_DATA_ATTRIBUTES_BUSINESS_HOURS_TYPE_0_DAYS_TYPE_0_ITEM_VALUES: - return cast(UpdateEscalationPolicyDataAttributesBusinessHoursType0DaysType0Item, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_DATA_ATTRIBUTES_BUSINESS_HOURS_TYPE_0_DAYS_TYPE_0_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0_time_zone.py b/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0_time_zone.py index 0381dd71..98836661 100644 --- a/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0_time_zone.py +++ b/rootly_sdk/models/update_escalation_policy_data_attributes_business_hours_type_0_time_zone.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone = Literal[ "Abu Dhabi", @@ -84,6 +84,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -157,6 +158,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -394,6 +396,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -467,6 +470,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -625,7 +629,7 @@ def check_update_escalation_policy_data_attributes_business_hours_type_0_time_zo if value is None: return None if value in UPDATE_ESCALATION_POLICY_DATA_ATTRIBUTES_BUSINESS_HOURS_TYPE_0_TIME_ZONE_VALUES: - return cast(UpdateEscalationPolicyDataAttributesBusinessHoursType0TimeZone, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_DATA_ATTRIBUTES_BUSINESS_HOURS_TYPE_0_TIME_ZONE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_escalation_policy_data_type.py b/rootly_sdk/models/update_escalation_policy_data_type.py index e02c0cdc..16315ede 100644 --- a/rootly_sdk/models/update_escalation_policy_data_type.py +++ b/rootly_sdk/models/update_escalation_policy_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEscalationPolicyDataType = Literal["escalation_policies"] @@ -11,5 +11,5 @@ def check_update_escalation_policy_data_type(value: str | None) -> UpdateEscalat if value is None: return None if value in UPDATE_ESCALATION_POLICY_DATA_TYPE_VALUES: - return cast(UpdateEscalationPolicyDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_escalation_policy_level.py b/rootly_sdk/models/update_escalation_policy_level.py index 4d915225..a6f50be0 100644 --- a/rootly_sdk/models/update_escalation_policy_level.py +++ b/rootly_sdk/models/update_escalation_policy_level.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_escalation_policy_level_data import UpdateEscalationPolicyLevelData @@ -18,14 +19,13 @@ class UpdateEscalationPolicyLevel: data (UpdateEscalationPolicyLevelData): """ - data: "UpdateEscalationPolicyLevelData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateEscalationPolicyLevelData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_escalation_policy_level.additional_properties = d return update_escalation_policy_level - - @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_escalation_policy_level_data.py b/rootly_sdk/models/update_escalation_policy_level_data.py index 93386fa0..8d33df4c 100644 --- a/rootly_sdk/models/update_escalation_policy_level_data.py +++ b/rootly_sdk/models/update_escalation_policy_level_data.py @@ -1,13 +1,15 @@ +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_escalation_policy_level_data_type import ( UpdateEscalationPolicyLevelDataType, check_update_escalation_policy_level_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_escalation_policy_level_data_attributes import UpdateEscalationPolicyLevelDataAttributes @@ -22,25 +24,31 @@ class UpdateEscalationPolicyLevelData: Attributes: type_ (UpdateEscalationPolicyLevelDataType): attributes (UpdateEscalationPolicyLevelDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateEscalationPolicyLevelDataType - attributes: "UpdateEscalationPolicyLevelDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateEscalationPolicyLevelDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateEscalationPolicyLevelDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_escalation_policy_level_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_escalation_policy_level_data.additional_properties = d return update_escalation_policy_level_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_escalation_policy_level_data_attributes.py b/rootly_sdk/models/update_escalation_policy_level_data_attributes.py index 3fdb235e..03ece521 100644 --- a/rootly_sdk/models/update_escalation_policy_level_data_attributes.py +++ b/rootly_sdk/models/update_escalation_policy_level_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -34,49 +36,49 @@ class UpdateEscalationPolicyLevelDataAttributes: """ Attributes: - 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 + 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 belong to. If nothing is specified it will add the level to your default path. - paging_strategy_configuration_strategy (Union[Unset, - UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy]): Default: 'default'. - paging_strategy_configuration_schedule_strategy (Union[Unset, - UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy]): Default: + paging_strategy_configuration_strategy + (UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy | Unset): Default: 'default'. + paging_strategy_configuration_schedule_strategy + (UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy | Unset): 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, - 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 + paging_strategy_configuration_repeats (int | None | Unset): Number of times to rotate through the roster (cycle- + based round robin). + paging_strategy_configuration_repeats_mode + (UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode | Unset): Controls how repeats + are interpreted: 'users' pages exactly N users, 'all' pages everyone once. + paging_strategy_configuration_rotation_scope + (UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope | Unset): Scope of rotation + ordering: active rotation members only, or entire schedule. + paging_strategy_configuration_page_users_count (int | None | Unset): Number of users to page at a time (cycle- + based round robin). + notification_target_params (list[None | + UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0] | Unset): Escalation level's + notification targets """ - delay: Unset | int = UNSET - position: Unset | int = UNSET - escalation_policy_path_id: None | Unset | str = UNSET + delay: int | Unset = UNSET + position: int | Unset = UNSET + escalation_policy_path_id: None | str | Unset = UNSET paging_strategy_configuration_strategy: ( - Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy | Unset ) = "default" paging_strategy_configuration_schedule_strategy: ( - Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy | Unset ) = "on_call_only" - paging_strategy_configuration_repeats: None | Unset | int = UNSET + paging_strategy_configuration_repeats: int | None | Unset = UNSET paging_strategy_configuration_repeats_mode: ( - Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode | Unset ) = UNSET paging_strategy_configuration_rotation_scope: ( - Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope | Unset ) = UNSET - paging_strategy_configuration_page_users_count: None | Unset | int = UNSET + paging_strategy_configuration_page_users_count: int | None | Unset = UNSET notification_target_params: ( - Unset | list[Union["UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0", None]] + list[None | UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0] | Unset ) = UNSET def to_dict(self) -> dict[str, Any]: @@ -88,45 +90,45 @@ def to_dict(self) -> dict[str, Any]: position = self.position - escalation_policy_path_id: None | Unset | str + escalation_policy_path_id: None | str | Unset 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: Unset | str = UNSET + paging_strategy_configuration_strategy: str | Unset = UNSET if not isinstance(self.paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = self.paging_strategy_configuration_strategy - paging_strategy_configuration_schedule_strategy: Unset | str = UNSET + paging_strategy_configuration_schedule_strategy: str | Unset = 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 + paging_strategy_configuration_repeats: int | None | Unset 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 + paging_strategy_configuration_repeats_mode: str | Unset = 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 + paging_strategy_configuration_rotation_scope: str | Unset = 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 + paging_strategy_configuration_page_users_count: int | None | Unset 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 + notification_target_params: list[dict[str, Any] | None] | Unset = 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: None | dict[str, Any] + notification_target_params_item: dict[str, Any] | None if isinstance( notification_target_params_item_data, UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0, @@ -177,18 +179,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 | Unset | str: + def _parse_escalation_policy_path_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: ( - Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy | Unset ) if isinstance(_paging_strategy_configuration_strategy, Unset): paging_strategy_configuration_strategy = UNSET @@ -203,7 +205,7 @@ def _parse_escalation_policy_path_id(data: object) -> None | Unset | str: "paging_strategy_configuration_schedule_strategy", UNSET ) paging_strategy_configuration_schedule_strategy: ( - Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy | Unset ) if isinstance(_paging_strategy_configuration_schedule_strategy, Unset): paging_strategy_configuration_schedule_strategy = UNSET @@ -214,12 +216,12 @@ def _parse_escalation_policy_path_id(data: object) -> None | Unset | str: ) ) - def _parse_paging_strategy_configuration_repeats(data: object) -> None | Unset | int: + def _parse_paging_strategy_configuration_repeats(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) paging_strategy_configuration_repeats = _parse_paging_strategy_configuration_repeats( d.pop("paging_strategy_configuration_repeats", UNSET) @@ -227,7 +229,7 @@ def _parse_paging_strategy_configuration_repeats(data: object) -> None | Unset | _paging_strategy_configuration_repeats_mode = d.pop("paging_strategy_configuration_repeats_mode", UNSET) paging_strategy_configuration_repeats_mode: ( - Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode | Unset ) if isinstance(_paging_strategy_configuration_repeats_mode, Unset): paging_strategy_configuration_repeats_mode = UNSET @@ -240,7 +242,7 @@ def _parse_paging_strategy_configuration_repeats(data: object) -> None | Unset | _paging_strategy_configuration_rotation_scope = d.pop("paging_strategy_configuration_rotation_scope", UNSET) paging_strategy_configuration_rotation_scope: ( - Unset | UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope + UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope | Unset ) if isinstance(_paging_strategy_configuration_rotation_scope, Unset): paging_strategy_configuration_rotation_scope = UNSET @@ -251,45 +253,47 @@ def _parse_paging_strategy_configuration_repeats(data: object) -> None | Unset | ) ) - def _parse_paging_strategy_configuration_page_users_count(data: object) -> None | Unset | int: + def _parse_paging_strategy_configuration_page_users_count(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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) - 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: ( + 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 ) - notification_target_params_item = _parse_notification_target_params_item( - notification_target_params_item_data - ) - - notification_target_params.append(notification_target_params_item) + notification_target_params.append(notification_target_params_item) update_escalation_policy_level_data_attributes = cls( delay=delay, 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 f9f312b1..4bce49a2 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,8 +1,9 @@ +from __future__ import annotations + 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.update_escalation_policy_level_data_attributes_notification_target_params_item_type_0_team_members import ( UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers, @@ -24,27 +25,25 @@ class UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0 id (str): The ID of notification target type_ (UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type): The type of the notification target - team_members (Union[Unset, - UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers]): For targets with - type=team, controls whether to notify admins, all team members, or escalate to team EP. + team_members (UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers | Unset): + For targets with type=team, controls whether to notify admins, all team members, or escalate to team EP. """ id: str type_: UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type - team_members: Unset | UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + team_members: UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers | Unset = UNSET def to_dict(self) -> dict[str, Any]: id = self.id type_: str = self.type_ - team_members: Unset | str = UNSET + team_members: str | Unset = UNSET if not isinstance(self.team_members, Unset): team_members = self.team_members field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -66,7 +65,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _team_members = d.pop("team_members", UNSET) - team_members: Unset | UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers + team_members: UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers | Unset if isinstance(_team_members, Unset): team_members = UNSET else: @@ -80,21 +79,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: team_members=team_members, ) - update_escalation_policy_level_data_attributes_notification_target_params_item_type_0.additional_properties = d return update_escalation_policy_level_data_attributes_notification_target_params_item_type_0 - - @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_escalation_policy_level_data_attributes_notification_target_params_item_type_0_team_members.py b/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0_team_members.py index 42470b7c..20e7fd8b 100644 --- a/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0_team_members.py +++ b/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0_team_members.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers = Literal[ "admins", "all", "escalate" @@ -22,7 +22,7 @@ def check_update_escalation_policy_level_data_attributes_notification_target_par value in UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_NOTIFICATION_TARGET_PARAMS_ITEM_TYPE_0_TEAM_MEMBERS_VALUES ): - return cast(UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0TeamMembers, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_NOTIFICATION_TARGET_PARAMS_ITEM_TYPE_0_TEAM_MEMBERS_VALUES!r}" ) diff --git a/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0_type.py b/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0_type.py index f99027ed..b23ff756 100644 --- a/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0_type.py +++ b/rootly_sdk/models/update_escalation_policy_level_data_attributes_notification_target_params_item_type_0_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type = Literal[ "microsoft_teams_channel", "schedule", "service", "slack_channel", "team", "user" @@ -22,7 +22,7 @@ def check_update_escalation_policy_level_data_attributes_notification_target_par if value is None: return None if value in UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_NOTIFICATION_TARGET_PARAMS_ITEM_TYPE_0_TYPE_VALUES: - return cast(UpdateEscalationPolicyLevelDataAttributesNotificationTargetParamsItemType0Type, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_NOTIFICATION_TARGET_PARAMS_ITEM_TYPE_0_TYPE_VALUES!r}" ) 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 index f2624ee7..4033390c 100644 --- 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 @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRepeatsMode = Literal["all", "users"] @@ -16,7 +16,7 @@ def check_update_escalation_policy_level_data_attributes_paging_strategy_configu 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) + return 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 index 545a7600..7c5a472b 100644 --- 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 @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationRotationScope = Literal[ "active_rotation", "entire_schedule" @@ -18,7 +18,7 @@ def check_update_escalation_policy_level_data_attributes_paging_strategy_configu 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) + return 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_level_data_attributes_paging_strategy_configuration_schedule_strategy.py b/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_schedule_strategy.py index 6b198ff8..3a806400 100644 --- a/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_schedule_strategy.py +++ b/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_schedule_strategy.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy = Literal[ "everyone", "on_call_only" @@ -18,7 +18,7 @@ def check_update_escalation_policy_level_data_attributes_paging_strategy_configu if value is None: return None if value in UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_SCHEDULE_STRATEGY_VALUES: - return cast(UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationScheduleStrategy, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_SCHEDULE_STRATEGY_VALUES!r}" ) diff --git a/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_strategy.py b/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_strategy.py index 1253fcf6..c17034fd 100644 --- a/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_strategy.py +++ b/rootly_sdk/models/update_escalation_policy_level_data_attributes_paging_strategy_configuration_strategy.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy = Literal[ "alert", "cycle", "default", "random" @@ -20,7 +20,7 @@ def check_update_escalation_policy_level_data_attributes_paging_strategy_configu if value is None: return None if value in UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_STRATEGY_VALUES: - return cast(UpdateEscalationPolicyLevelDataAttributesPagingStrategyConfigurationStrategy, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_LEVEL_DATA_ATTRIBUTES_PAGING_STRATEGY_CONFIGURATION_STRATEGY_VALUES!r}" ) diff --git a/rootly_sdk/models/update_escalation_policy_level_data_type.py b/rootly_sdk/models/update_escalation_policy_level_data_type.py index bb0ce589..f6c6d074 100644 --- a/rootly_sdk/models/update_escalation_policy_level_data_type.py +++ b/rootly_sdk/models/update_escalation_policy_level_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEscalationPolicyLevelDataType = Literal["escalation_levels"] @@ -11,5 +11,5 @@ def check_update_escalation_policy_level_data_type(value: str | None) -> UpdateE if value is None: return None if value in UPDATE_ESCALATION_POLICY_LEVEL_DATA_TYPE_VALUES: - return cast(UpdateEscalationPolicyLevelDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_LEVEL_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_escalation_policy_path.py b/rootly_sdk/models/update_escalation_policy_path.py index 7eb93c3a..2fbfd5a4 100644 --- a/rootly_sdk/models/update_escalation_policy_path.py +++ b/rootly_sdk/models/update_escalation_policy_path.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_escalation_policy_path_data import UpdateEscalationPolicyPathData @@ -18,14 +19,13 @@ class UpdateEscalationPolicyPath: data (UpdateEscalationPolicyPathData): """ - data: "UpdateEscalationPolicyPathData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateEscalationPolicyPathData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_escalation_policy_path.additional_properties = d return update_escalation_policy_path - - @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_escalation_policy_path_data.py b/rootly_sdk/models/update_escalation_policy_path_data.py index b207fa28..c88b80ee 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data.py +++ b/rootly_sdk/models/update_escalation_policy_path_data.py @@ -1,13 +1,15 @@ +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_escalation_policy_path_data_type import ( UpdateEscalationPolicyPathDataType, check_update_escalation_policy_path_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_escalation_policy_path_data_attributes import UpdateEscalationPolicyPathDataAttributes @@ -22,25 +24,31 @@ class UpdateEscalationPolicyPathData: Attributes: type_ (UpdateEscalationPolicyPathDataType): attributes (UpdateEscalationPolicyPathDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateEscalationPolicyPathDataType - attributes: "UpdateEscalationPolicyPathDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateEscalationPolicyPathDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateEscalationPolicyPathDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_escalation_policy_path_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_escalation_policy_path_data.additional_properties = d return update_escalation_policy_path_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_escalation_policy_path_data_attributes.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes.py index d5c61ae4..c20d1573 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -15,10 +17,18 @@ UpdateEscalationPolicyPathDataAttributesNotificationType, check_update_escalation_policy_path_data_attributes_notification_type, ) +from ..models.update_escalation_policy_path_data_attributes_notification_type_fallback import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeFallback, + check_update_escalation_policy_path_data_attributes_notification_type_fallback, +) from ..models.update_escalation_policy_path_data_attributes_path_type import ( UpdateEscalationPolicyPathDataAttributesPathType, check_update_escalation_policy_path_data_attributes_path_type, ) +from ..models.update_escalation_policy_path_data_attributes_retrigger_timeout_minutes import ( + UpdateEscalationPolicyPathDataAttributesRetriggerTimeoutMinutes, + check_update_escalation_policy_path_data_attributes_retrigger_timeout_minutes, +) from ..models.update_escalation_policy_path_data_attributes_time_restriction_time_zone import ( UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone, check_update_escalation_policy_path_data_attributes_time_restriction_time_zone, @@ -26,77 +36,14 @@ from ..types import UNSET, Unset if TYPE_CHECKING: - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_0 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType0, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_1 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType1, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_2 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType2, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_3 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType3, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_4 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType4, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_5 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType5, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_6 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType6, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_7 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType7, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_0 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_1 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_2 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_3 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_4 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_5 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_6 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_7 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_0 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_1 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_2 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_3 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_4 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_5 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_6 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_7 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7, + from ..models.escalation_path_rule_alert_urgency import EscalationPathRuleAlertUrgency + from ..models.escalation_path_rule_deferral_window import EscalationPathRuleDeferralWindow + from ..models.escalation_path_rule_field import EscalationPathRuleField + from ..models.escalation_path_rule_json_path import EscalationPathRuleJsonPath + from ..models.escalation_path_rule_service import EscalationPathRuleService + from ..models.escalation_path_rule_working_hour import EscalationPathRuleWorkingHour + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItem, ) from ..models.update_escalation_policy_path_data_attributes_time_restrictions_item import ( UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem, @@ -110,212 +57,120 @@ class UpdateEscalationPolicyPathDataAttributes: """ Attributes: - 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 + 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 after_deferral_behavior is execute_path. - 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 + 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). + retrigger_timeout_minutes (UpdateEscalationPolicyPathDataAttributesRetriggerTimeoutMinutes | Unset): Re-trigger + acknowledged alerts on this path after N minutes; null inherits the urgency/workspace default, -1 = never. + rules (list[EscalationPathRuleAlertUrgency | EscalationPathRuleDeferralWindow | EscalationPathRuleField | + EscalationPathRuleJsonPath | EscalationPathRuleService | EscalationPathRuleWorkingHour | None] | Unset): + Escalation path conditions + notification_type_rules (list[UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItem] | Unset): Rules + deciding whether an alert pages audible or quiet, evaluated in order — the first matching rule's + notification_type wins, otherwise notification_type_fallback applies. When present, the path's notification_type + is aligned to notification_type_fallback. Only available when notification type conditions are enabled for the + team. + notification_type_fallback (UpdateEscalationPolicyPathDataAttributesNotificationTypeFallback | Unset): Paged + when no notification type rule matches. Considered only when notification_type_rules are present — the path's + notification_type is aligned to it; without rules it is aligned to notification_type instead. Only available + when notification type conditions are enabled for the team. Default: 'audible'. + time_restriction_time_zone (UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone | Unset): Time zone + used for time restrictions. + time_restrictions (list[UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem] | Unset): If time restrictions are set, alerts will follow this path when they arrive within the specified time ranges and meet the rules. """ - 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 + 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 + retrigger_timeout_minutes: UpdateEscalationPolicyPathDataAttributesRetriggerTimeoutMinutes | Unset = UNSET rules: ( - 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", - ] + list[ + EscalationPathRuleAlertUrgency + | EscalationPathRuleDeferralWindow + | EscalationPathRuleField + | EscalationPathRuleJsonPath + | EscalationPathRuleService + | EscalationPathRuleWorkingHour + | None ] + | Unset ) = UNSET - time_restriction_time_zone: Unset | UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone = UNSET - time_restrictions: Unset | list["UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem"] = UNSET + notification_type_rules: list[UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItem] | Unset = UNSET + notification_type_fallback: UpdateEscalationPolicyPathDataAttributesNotificationTypeFallback | Unset = "audible" + time_restriction_time_zone: UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone | Unset = UNSET + time_restrictions: list[UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem] | Unset = UNSET def to_dict(self) -> dict[str, Any]: - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_0 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType0, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_1 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType1, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_2 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType2, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_3 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType3, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_4 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType4, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_5 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType5, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_6 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType6, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_7 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType7, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_0 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_1 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_2 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_3 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_4 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_5 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_6 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_7 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_0 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_1 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_2 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_3 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_4 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_5 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_6 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6, - ) + from ..models.escalation_path_rule_alert_urgency import EscalationPathRuleAlertUrgency + from ..models.escalation_path_rule_deferral_window import EscalationPathRuleDeferralWindow + from ..models.escalation_path_rule_field import EscalationPathRuleField + from ..models.escalation_path_rule_json_path import EscalationPathRuleJsonPath + from ..models.escalation_path_rule_service import EscalationPathRuleService + from ..models.escalation_path_rule_working_hour import EscalationPathRuleWorkingHour name = self.name - notification_type: Unset | str = UNSET + notification_type: str | Unset = UNSET if not isinstance(self.notification_type, Unset): notification_type = self.notification_type - path_type: Unset | str = UNSET + path_type: str | Unset = UNSET if not isinstance(self.path_type, Unset): path_type = self.path_type - after_deferral_behavior: Unset | str = UNSET + after_deferral_behavior: str | Unset = UNSET if not isinstance(self.after_deferral_behavior, Unset): after_deferral_behavior = self.after_deferral_behavior - after_deferral_path_id: None | Unset | str + after_deferral_path_id: None | str | Unset if isinstance(self.after_deferral_path_id, Unset): after_deferral_path_id = UNSET else: after_deferral_path_id = self.after_deferral_path_id - default: None | Unset | bool + default: bool | None | Unset if isinstance(self.default, Unset): default = UNSET else: default = self.default - match_mode: Unset | str = UNSET + match_mode: str | Unset = UNSET if not isinstance(self.match_mode, Unset): match_mode = self.match_mode position = self.position - repeat: None | Unset | bool + repeat: bool | None | Unset if isinstance(self.repeat, Unset): repeat = UNSET else: repeat = self.repeat - repeat_count: None | Unset | int + repeat_count: int | None | Unset if isinstance(self.repeat_count, Unset): repeat_count = UNSET else: @@ -323,73 +178,47 @@ 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: int | Unset = UNSET + if not isinstance(self.retrigger_timeout_minutes, Unset): retrigger_timeout_minutes = self.retrigger_timeout_minutes - rules: Unset | list[dict[str, Any]] = UNSET + rules: list[dict[str, Any] | None] | Unset = UNSET if not isinstance(self.rules, Unset): rules = [] for rules_item_data in self.rules: - rules_item: dict[str, Any] - if isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType0): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType1): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType2): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType3): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType4): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType5): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType6): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType7): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0): - rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1): + rules_item: dict[str, Any] | None + if isinstance(rules_item_data, EscalationPathRuleAlertUrgency): rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2): + elif isinstance(rules_item_data, EscalationPathRuleWorkingHour): rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3): + elif isinstance(rules_item_data, EscalationPathRuleJsonPath): rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4): + elif isinstance(rules_item_data, EscalationPathRuleField): rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5): + elif isinstance(rules_item_data, EscalationPathRuleService): rules_item = rules_item_data.to_dict() - elif isinstance(rules_item_data, UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6): + elif isinstance(rules_item_data, EscalationPathRuleDeferralWindow): rules_item = rules_item_data.to_dict() else: - rules_item = rules_item_data.to_dict() - + rules_item = rules_item_data rules.append(rules_item) - time_restriction_time_zone: Unset | str = UNSET + notification_type_rules: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.notification_type_rules, Unset): + notification_type_rules = [] + for notification_type_rules_item_data in self.notification_type_rules: + notification_type_rules_item = notification_type_rules_item_data.to_dict() + notification_type_rules.append(notification_type_rules_item) + + notification_type_fallback: str | Unset = UNSET + if not isinstance(self.notification_type_fallback, Unset): + notification_type_fallback = self.notification_type_fallback + + time_restriction_time_zone: str | Unset = UNSET if not isinstance(self.time_restriction_time_zone, Unset): time_restriction_time_zone = self.time_restriction_time_zone - time_restrictions: Unset | list[dict[str, Any]] = UNSET + time_restrictions: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.time_restrictions, Unset): time_restrictions = [] for time_restrictions_item_data in self.time_restrictions: @@ -425,6 +254,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["retrigger_timeout_minutes"] = retrigger_timeout_minutes if rules is not UNSET: field_dict["rules"] = rules + if notification_type_rules is not UNSET: + field_dict["notification_type_rules"] = notification_type_rules + if notification_type_fallback is not UNSET: + field_dict["notification_type_fallback"] = notification_type_fallback if time_restriction_time_zone is not UNSET: field_dict["time_restriction_time_zone"] = time_restriction_time_zone if time_restrictions is not UNSET: @@ -434,77 +267,14 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_0 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType0, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_1 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType1, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_2 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType2, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_3 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType3, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_4 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType4, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_5 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType5, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_6 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType6, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_7 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType7, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_0 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_1 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_2 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_3 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_4 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_5 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_6 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_7 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_0 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_1 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_2 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_3 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_4 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_5 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_6 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6, - ) - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_7 import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7, + from ..models.escalation_path_rule_alert_urgency import EscalationPathRuleAlertUrgency + from ..models.escalation_path_rule_deferral_window import EscalationPathRuleDeferralWindow + from ..models.escalation_path_rule_field import EscalationPathRuleField + from ..models.escalation_path_rule_json_path import EscalationPathRuleJsonPath + from ..models.escalation_path_rule_service import EscalationPathRuleService + from ..models.escalation_path_rule_working_hour import EscalationPathRuleWorkingHour + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItem, ) from ..models.update_escalation_policy_path_data_attributes_time_restrictions_item import ( UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem, @@ -514,7 +284,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: Unset | UpdateEscalationPolicyPathDataAttributesNotificationType + notification_type: UpdateEscalationPolicyPathDataAttributesNotificationType | Unset if isinstance(_notification_type, Unset): notification_type = UNSET else: @@ -523,14 +293,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: ) _path_type = d.pop("path_type", UNSET) - path_type: Unset | UpdateEscalationPolicyPathDataAttributesPathType + path_type: UpdateEscalationPolicyPathDataAttributesPathType | Unset 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: Unset | UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior + after_deferral_behavior: UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior | Unset if isinstance(_after_deferral_behavior, Unset): after_deferral_behavior = UNSET else: @@ -538,26 +308,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 | Unset | str: + def _parse_after_deferral_path_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) after_deferral_path_id = _parse_after_deferral_path_id(d.pop("after_deferral_path_id", UNSET)) - def _parse_default(data: object) -> None | Unset | bool: + def _parse_default(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) default = _parse_default(d.pop("default", UNSET)) _match_mode = d.pop("match_mode", UNSET) - match_mode: Unset | UpdateEscalationPolicyPathDataAttributesMatchMode + match_mode: UpdateEscalationPolicyPathDataAttributesMatchMode | Unset if isinstance(_match_mode, Unset): match_mode = UNSET else: @@ -565,293 +335,152 @@ def _parse_default(data: object) -> None | Unset | bool: position = d.pop("position", UNSET) - def _parse_repeat(data: object) -> None | Unset | bool: + def _parse_repeat(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) repeat = _parse_repeat(d.pop("repeat", UNSET)) - def _parse_repeat_count(data: object) -> None | Unset | int: + def _parse_repeat_count(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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)) + _retrigger_timeout_minutes = d.pop("retrigger_timeout_minutes", UNSET) + retrigger_timeout_minutes: UpdateEscalationPolicyPathDataAttributesRetriggerTimeoutMinutes | Unset + if isinstance(_retrigger_timeout_minutes, Unset): + retrigger_timeout_minutes = UNSET + else: + retrigger_timeout_minutes = check_update_escalation_policy_path_data_attributes_retrigger_timeout_minutes( + _retrigger_timeout_minutes + ) - rules = [] _rules = d.pop("rules", UNSET) - 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_8_type_0 = UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0.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 = 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 - ) - - 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 - ) - - 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 + rules: ( + list[ + EscalationPathRuleAlertUrgency + | EscalationPathRuleDeferralWindow + | EscalationPathRuleField + | EscalationPathRuleJsonPath + | EscalationPathRuleService + | EscalationPathRuleWorkingHour + | None + ] + | Unset + ) = UNSET + if _rules is not UNSET: + rules = [] + for rules_item_data in _rules: + + def _parse_rules_item( + data: object, + ) -> ( + EscalationPathRuleAlertUrgency + | EscalationPathRuleDeferralWindow + | EscalationPathRuleField + | EscalationPathRuleJsonPath + | EscalationPathRuleService + | EscalationPathRuleWorkingHour + | None + ): + if data is None: + return data + try: + if not isinstance(data, dict): + raise TypeError() + rules_item_type_0 = EscalationPathRuleAlertUrgency.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 = EscalationPathRuleWorkingHour.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 = EscalationPathRuleJsonPath.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 = EscalationPathRuleField.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 = EscalationPathRuleService.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 = EscalationPathRuleDeferralWindow.from_dict(data) + + return rules_item_type_5 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast( + EscalationPathRuleAlertUrgency + | EscalationPathRuleDeferralWindow + | EscalationPathRuleField + | EscalationPathRuleJsonPath + | EscalationPathRuleService + | EscalationPathRuleWorkingHour + | None, + 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 - ) + rules_item = _parse_rules_item(rules_item_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 - ) + rules.append(rules_item) - 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 + _notification_type_rules = d.pop("notification_type_rules", UNSET) + notification_type_rules: list[UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItem] | Unset = UNSET + if _notification_type_rules is not UNSET: + notification_type_rules = [] + for notification_type_rules_item_data in _notification_type_rules: + notification_type_rules_item = ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItem.from_dict( + notification_type_rules_item_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 + notification_type_rules.append(notification_type_rules_item) - rules_item = _parse_rules_item(rules_item_data) - - rules.append(rules_item) + _notification_type_fallback = d.pop("notification_type_fallback", UNSET) + notification_type_fallback: UpdateEscalationPolicyPathDataAttributesNotificationTypeFallback | Unset + if isinstance(_notification_type_fallback, Unset): + notification_type_fallback = UNSET + else: + notification_type_fallback = check_update_escalation_policy_path_data_attributes_notification_type_fallback( + _notification_type_fallback + ) _time_restriction_time_zone = d.pop("time_restriction_time_zone", UNSET) - time_restriction_time_zone: Unset | UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone + time_restriction_time_zone: UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone | Unset if isinstance(_time_restriction_time_zone, Unset): time_restriction_time_zone = UNSET else: @@ -859,14 +488,16 @@ def _parse_rules_item( _time_restriction_time_zone ) - time_restrictions = [] _time_restrictions = d.pop("time_restrictions", UNSET) - for time_restrictions_item_data in _time_restrictions or []: - time_restrictions_item = UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem.from_dict( - time_restrictions_item_data - ) + 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 + ) - time_restrictions.append(time_restrictions_item) + time_restrictions.append(time_restrictions_item) update_escalation_policy_path_data_attributes = cls( name=name, @@ -882,6 +513,8 @@ def _parse_rules_item( initial_delay=initial_delay, retrigger_timeout_minutes=retrigger_timeout_minutes, rules=rules, + notification_type_rules=notification_type_rules, + notification_type_fallback=notification_type_fallback, time_restriction_time_zone=time_restriction_time_zone, time_restrictions=time_restrictions, ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_after_deferral_behavior.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_after_deferral_behavior.py index a47e84e2..7329ef3a 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_after_deferral_behavior.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_after_deferral_behavior.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior = Literal["execute_path", "re_evaluate"] @@ -16,7 +16,7 @@ def check_update_escalation_policy_path_data_attributes_after_deferral_behavior( if value is None: return None if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_AFTER_DEFERRAL_BEHAVIOR_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesAfterDeferralBehavior, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_AFTER_DEFERRAL_BEHAVIOR_VALUES!r}" ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_match_mode.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_match_mode.py index b47e87a2..844d7ec8 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_match_mode.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_match_mode.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEscalationPolicyPathDataAttributesMatchMode = Literal["match-all-rules", "match-any-rule"] @@ -16,7 +16,7 @@ def check_update_escalation_policy_path_data_attributes_match_mode( if value is None: return None if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_MATCH_MODE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesMatchMode, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_MATCH_MODE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type.py index 6123f742..4248ccdb 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEscalationPolicyPathDataAttributesNotificationType = Literal["audible", "quiet"] @@ -16,7 +16,7 @@ def check_update_escalation_policy_path_data_attributes_notification_type( if value is None: return None if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesNotificationType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_fallback.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_fallback.py new file mode 100644 index 00000000..d95f4d33 --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_fallback.py @@ -0,0 +1,22 @@ +from typing import Literal + +UpdateEscalationPolicyPathDataAttributesNotificationTypeFallback = Literal["audible", "quiet"] + +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_FALLBACK_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeFallback +] = { + "audible", + "quiet", +} + + +def check_update_escalation_policy_path_data_attributes_notification_type_fallback( + value: str | None, +) -> UpdateEscalationPolicyPathDataAttributesNotificationTypeFallback | None: + if value is None: + return None + if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_FALLBACK_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_FALLBACK_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item.py new file mode 100644 index 00000000..20a330a0 --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item.py @@ -0,0 +1,335 @@ +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_escalation_policy_path_data_attributes_notification_type_rules_item_match_mode import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemMatchMode, + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_match_mode, +) +from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_notification_type import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemNotificationType, + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_notification_type, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_service import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemService, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours, + ) + + +T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItem") + + +@_attrs_define +class UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItem: + """ + Attributes: + conditions (list[UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField | + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource | + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency | + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow | + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath | + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents | + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemService | + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours]): Conditions combined per + match_mode, at least one per rule. A deferral_window condition matches when the alert falls inside its time + blocks. + notification_type (UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemNotificationType | Unset): + Outcome when this rule matches Default: 'audible'. + match_mode (UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemMatchMode | Unset): Whether all or + any of the rule's conditions must match Default: 'match-all-rules'. + """ + + conditions: list[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField + | UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource + | UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency + | UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow + | UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath + | UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents + | UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemService + | UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours + ] + notification_type: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemNotificationType | Unset = ( + "audible" + ) + match_mode: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemMatchMode | Unset = "match-all-rules" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_service import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemService, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours, + ) + + conditions = [] + for conditions_item_data in self.conditions: + conditions_item: dict[str, Any] + if isinstance( + conditions_item_data, UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency + ): + conditions_item = conditions_item_data.to_dict() + elif isinstance( + conditions_item_data, UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours + ): + conditions_item = conditions_item_data.to_dict() + elif isinstance( + conditions_item_data, UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath + ): + conditions_item = conditions_item_data.to_dict() + elif isinstance( + conditions_item_data, UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField + ): + conditions_item = conditions_item_data.to_dict() + elif isinstance( + conditions_item_data, UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemService + ): + conditions_item = conditions_item_data.to_dict() + elif isinstance( + conditions_item_data, UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow + ): + conditions_item = conditions_item_data.to_dict() + elif isinstance( + conditions_item_data, UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource + ): + conditions_item = conditions_item_data.to_dict() + else: + conditions_item = conditions_item_data.to_dict() + + conditions.append(conditions_item) + + notification_type: str | Unset = UNSET + if not isinstance(self.notification_type, Unset): + notification_type = self.notification_type + + match_mode: str | Unset = UNSET + if not isinstance(self.match_mode, Unset): + match_mode = self.match_mode + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "conditions": conditions, + } + ) + if notification_type is not UNSET: + field_dict["notification_type"] = notification_type + if match_mode is not UNSET: + field_dict["match_mode"] = match_mode + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_service import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemService, + ) + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours, + ) + + d = dict(src_dict) + conditions = [] + _conditions = d.pop("conditions") + for conditions_item_data in _conditions: + + def _parse_conditions_item( + data: object, + ) -> ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField + | UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource + | UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency + | UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow + | UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath + | UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents + | UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemService + | UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours + ): + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_alert_urgency = ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency.from_dict(data) + ) + + return conditions_item_alert_urgency + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_working_hours = ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours.from_dict(data) + ) + + return conditions_item_working_hours + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_json_path = ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath.from_dict(data) + ) + + return conditions_item_json_path + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_alert_field = ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField.from_dict(data) + ) + + return conditions_item_alert_field + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_service = ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemService.from_dict(data) + ) + + return conditions_item_service + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_deferral_window = ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow.from_dict(data) + ) + + return conditions_item_deferral_window + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + conditions_item_alert_source = ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource.from_dict(data) + ) + + return conditions_item_alert_source + except (TypeError, ValueError, AttributeError, KeyError): + pass + if not isinstance(data, dict): + raise TypeError() + conditions_item_related_incidents = ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents.from_dict(data) + ) + + return conditions_item_related_incidents + + conditions_item = _parse_conditions_item(conditions_item_data) + + conditions.append(conditions_item) + + _notification_type = d.pop("notification_type", UNSET) + notification_type: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemNotificationType | Unset + if isinstance(_notification_type, Unset): + notification_type = UNSET + else: + notification_type = ( + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_notification_type( + _notification_type + ) + ) + + _match_mode = d.pop("match_mode", UNSET) + match_mode: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemMatchMode | Unset + if isinstance(_match_mode, Unset): + match_mode = UNSET + else: + match_mode = check_update_escalation_policy_path_data_attributes_notification_type_rules_item_match_mode( + _match_mode + ) + + update_escalation_policy_path_data_attributes_notification_type_rules_item = cls( + conditions=conditions, + notification_type=notification_type, + match_mode=match_mode, + ) + + update_escalation_policy_path_data_attributes_notification_type_rules_item.additional_properties = d + return update_escalation_policy_path_data_attributes_notification_type_rules_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_escalation_policy_path_data_attributes_rules_item_type_9_type_3.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field.py similarity index 51% rename from rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3.py rename to rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field.py index ef4214fe..2efe07d0 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_notification_type_rules_item_alert_field.py @@ -1,40 +1,42 @@ +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.update_escalation_policy_path_data_attributes_rules_item_type_9_type_3_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3Operator, - check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_3_operator, +from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_operator import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldOperator, + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_operator, ) -from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_3_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_3_rule_type, +from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_rule_type import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldRuleType, + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_rule_type, ) from ..types import UNSET, Unset -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3") +T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField") @_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3: +class UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertField: """ Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3RuleType): The type of the escalation path - rule + rule_type (UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldRuleType): The type of the + escalation path rule fieldable_type (str): The type of the fieldable (e.g., AlertField) fieldable_id (str): The ID of the alert field - operator (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3Operator): How the alert field value should - be matched - values (Union[Unset, list[str]]): Values to match against + operator (UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldOperator): How the alert + field value should be matched + values (list[str] | Unset): Values to match against """ - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3RuleType + rule_type: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldRuleType fieldable_type: str fieldable_id: str - operator: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3Operator - values: Unset | list[str] = UNSET + operator: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldOperator + values: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -46,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values @@ -68,21 +70,25 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_3_rule_type( - d.pop("rule_type") + rule_type = ( + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_rule_type( + d.pop("rule_type") + ) ) fieldable_type = d.pop("fieldable_type") fieldable_id = d.pop("fieldable_id") - operator = check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_3_operator( - d.pop("operator") + operator = ( + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_operator( + d.pop("operator") + ) ) values = cast(list[str], d.pop("values", UNSET)) - update_escalation_policy_path_data_attributes_rules_item_type_9_type_3 = cls( + update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field = cls( rule_type=rule_type, fieldable_type=fieldable_type, fieldable_id=fieldable_id, @@ -90,8 +96,8 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: values=values, ) - update_escalation_policy_path_data_attributes_rules_item_type_9_type_3.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_9_type_3 + update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field.additional_properties = d + return update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_operator.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_operator.py new file mode 100644 index 00000000..7dc5e8df --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_operator.py @@ -0,0 +1,49 @@ +from typing import Literal + +UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldOperator = Literal[ + "contains", + "contains_key", + "does_not_contain", + "does_not_contain_key", + "does_not_match", + "does_not_start_with", + "is", + "is_empty", + "is_not", + "is_not_empty", + "is_not_one_of", + "is_one_of", + "matches", + "starts_with", +] + +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_FIELD_OPERATOR_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldOperator +] = { + "contains", + "contains_key", + "does_not_contain", + "does_not_contain_key", + "does_not_match", + "does_not_start_with", + "is", + "is_empty", + "is_not", + "is_not_empty", + "is_not_one_of", + "is_one_of", + "matches", + "starts_with", +} + + +def check_update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_operator( + value: str | None, +) -> UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldOperator | None: + if value is None: + return None + if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_FIELD_OPERATOR_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_FIELD_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_rule_type.py new file mode 100644 index 00000000..dd279246 --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_rule_type.py @@ -0,0 +1,21 @@ +from typing import Literal + +UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldRuleType = Literal["field"] + +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_FIELD_RULE_TYPE_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldRuleType +] = { + "field", +} + + +def check_update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_field_rule_type( + value: str | None, +) -> UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertFieldRuleType | None: + if value is None: + return None + if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_FIELD_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_FIELD_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source.py new file mode 100644 index 00000000..2df5412b --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source.py @@ -0,0 +1,96 @@ +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.update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_operator import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceOperator, + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_operator, +) +from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_rule_type import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceRuleType, + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_rule_type, +) + +T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource") + + +@_attrs_define +class UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSource: + """ + Attributes: + rule_type (UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceRuleType): The type of + the escalation path rule + operator (UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceOperator): How the alert + source should be matched + values (list[str]): Alert source values to match against (e.g., manual, datadog) + """ + + rule_type: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceRuleType + operator: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceOperator + values: list[str] + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + rule_type: str = self.rule_type + + operator: str = self.operator + + values = self.values + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "rule_type": rule_type, + "operator": operator, + "values": values, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + rule_type = ( + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_rule_type( + d.pop("rule_type") + ) + ) + + operator = ( + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_operator( + d.pop("operator") + ) + ) + + values = cast(list[str], d.pop("values")) + + update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source = cls( + rule_type=rule_type, + operator=operator, + values=values, + ) + + update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source.additional_properties = d + return update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source + + @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_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_operator.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_operator.py new file mode 100644 index 00000000..158e1485 --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_operator.py @@ -0,0 +1,26 @@ +from typing import Literal + +UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceOperator = Literal[ + "is", "is_not", "is_not_one_of", "is_one_of" +] + +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_SOURCE_OPERATOR_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceOperator +] = { + "is", + "is_not", + "is_not_one_of", + "is_one_of", +} + + +def check_update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_operator( + value: str | None, +) -> UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceOperator | None: + if value is None: + return None + if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_SOURCE_OPERATOR_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_SOURCE_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_rule_type.py new file mode 100644 index 00000000..65928952 --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_rule_type.py @@ -0,0 +1,24 @@ +from typing import Literal + +UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceRuleType = Literal["source"] + +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_SOURCE_RULE_TYPE_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceRuleType +] = { + "source", +} + + +def check_update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_source_rule_type( + value: str | None, +) -> UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertSourceRuleType | None: + if value is None: + return None + if ( + value + in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_SOURCE_RULE_TYPE_VALUES + ): + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_SOURCE_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency.py new file mode 100644 index 00000000..f917a289 --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency.py @@ -0,0 +1,107 @@ +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.update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_operator import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyOperator, + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_operator, +) +from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_rule_type import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyRuleType, + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_rule_type, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency") + + +@_attrs_define +class UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgency: + """ + Attributes: + rule_type (UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyRuleType): The type of + the escalation path rule + urgency_ids (list[str]): Alert urgency ids for which this escalation path should be used + operator (UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyOperator | Unset): How + the alert's urgency should be matched. is and is_not take exactly one id Default: 'is_one_of'. + """ + + rule_type: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyRuleType + urgency_ids: list[str] + operator: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyOperator | Unset = ( + "is_one_of" + ) + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + rule_type: str = self.rule_type + + urgency_ids = self.urgency_ids + + operator: str | Unset = UNSET + if not isinstance(self.operator, Unset): + operator = self.operator + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "rule_type": rule_type, + "urgency_ids": urgency_ids, + } + ) + if operator is not UNSET: + field_dict["operator"] = operator + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + rule_type = ( + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_rule_type( + d.pop("rule_type") + ) + ) + + urgency_ids = cast(list[str], d.pop("urgency_ids")) + + _operator = d.pop("operator", UNSET) + operator: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyOperator | Unset + if isinstance(_operator, Unset): + operator = UNSET + else: + operator = ( + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_operator( + _operator + ) + ) + + update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency = cls( + rule_type=rule_type, + urgency_ids=urgency_ids, + operator=operator, + ) + + update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency.additional_properties = d + return update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency + + @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_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_operator.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_operator.py new file mode 100644 index 00000000..ffbaa45d --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_operator.py @@ -0,0 +1,29 @@ +from typing import Literal + +UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyOperator = Literal[ + "is", "is_not", "is_not_one_of", "is_one_of" +] + +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_URGENCY_OPERATOR_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyOperator +] = { + "is", + "is_not", + "is_not_one_of", + "is_one_of", +} + + +def check_update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_operator( + value: str | None, +) -> UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyOperator | None: + if value is None: + return None + if ( + value + in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_URGENCY_OPERATOR_VALUES + ): + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_URGENCY_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_rule_type.py new file mode 100644 index 00000000..86c7ec4c --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_rule_type.py @@ -0,0 +1,24 @@ +from typing import Literal + +UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyRuleType = Literal["alert_urgency"] + +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_URGENCY_RULE_TYPE_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyRuleType +] = { + "alert_urgency", +} + + +def check_update_escalation_policy_path_data_attributes_notification_type_rules_item_alert_urgency_rule_type( + value: str | None, +) -> UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemAlertUrgencyRuleType | None: + if value is None: + return None + if ( + value + in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_URGENCY_RULE_TYPE_VALUES + ): + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_ALERT_URGENCY_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window.py new file mode 100644 index 00000000..14420c84 --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window.py @@ -0,0 +1,120 @@ +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_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_rule_type import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowRuleType, + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_rule_type, +) +from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_zone import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeZone, + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_zone, +) + +if TYPE_CHECKING: + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_blocks_item import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeBlocksItem, + ) + + +T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow") + + +@_attrs_define +class UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindow: + """ + Attributes: + rule_type (UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowRuleType): The type of + the escalation path rule + time_zone (UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeZone): Time zone + for the deferral window + time_blocks + (list[UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeBlocksItem]): Time + windows during which alerts are deferred + """ + + rule_type: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowRuleType + time_zone: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeZone + time_blocks: list[UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeBlocksItem] + 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 + + time_blocks = [] + for time_blocks_item_data in self.time_blocks: + time_blocks_item = time_blocks_item_data.to_dict() + time_blocks.append(time_blocks_item) + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "rule_type": rule_type, + "time_zone": time_zone, + "time_blocks": time_blocks, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_blocks_item import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeBlocksItem, + ) + + d = dict(src_dict) + rule_type = ( + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_rule_type( + d.pop("rule_type") + ) + ) + + time_zone = ( + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_zone( + d.pop("time_zone") + ) + ) + + time_blocks = [] + _time_blocks = d.pop("time_blocks") + for time_blocks_item_data in _time_blocks: + time_blocks_item = ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeBlocksItem.from_dict( + time_blocks_item_data + ) + ) + + time_blocks.append(time_blocks_item) + + update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window = cls( + rule_type=rule_type, + time_zone=time_zone, + time_blocks=time_blocks, + ) + + update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window.additional_properties = d + return update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window + + @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_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_rule_type.py new file mode 100644 index 00000000..3b257b3c --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_rule_type.py @@ -0,0 +1,24 @@ +from typing import Literal + +UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowRuleType = Literal["deferral_window"] + +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_DEFERRAL_WINDOW_RULE_TYPE_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowRuleType +] = { + "deferral_window", +} + + +def check_update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_rule_type( + value: str | None, +) -> UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowRuleType | None: + if value is None: + return None + if ( + value + in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_DEFERRAL_WINDOW_RULE_TYPE_VALUES + ): + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_DEFERRAL_WINDOW_RULE_TYPE_VALUES!r}" + ) 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_notification_type_rules_item_deferral_window_time_blocks_item.py similarity index 52% rename from rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.py rename to rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_blocks_item.py index 1bc78b6f..c24f94ea 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_notification_type_rules_item_deferral_window_time_blocks_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -6,40 +8,48 @@ from ..types import UNSET, Unset -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem") +T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeBlocksItem") @_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem: +class UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeBlocksItem: """ Attributes: - 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]): + id (str | Unset): Unique ID of the time block + 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): Order of this time block, starting at 1. Defaults to the block's 1-based position + in time_blocks when omitted. + ends_next_day (bool | Unset): Whether the window crosses midnight. Derived from start_time and end_time; + accepted and ignored on write. """ - 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 + id: str | Unset = UNSET + 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 + ends_next_day: bool | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: + id = self.id + monday = self.monday tuesday = self.tuesday @@ -60,15 +70,19 @@ def to_dict(self) -> dict[str, Any]: all_day = self.all_day - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position + ends_next_day = self.ends_next_day + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update({}) + if id is not UNSET: + field_dict["id"] = id if monday is not UNSET: field_dict["monday"] = monday if tuesday is not UNSET: @@ -91,12 +105,16 @@ def to_dict(self) -> dict[str, Any]: field_dict["all_day"] = all_day if position is not UNSET: field_dict["position"] = position + if ends_next_day is not UNSET: + field_dict["ends_next_day"] = ends_next_day 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) + monday = d.pop("monday", UNSET) tuesday = d.pop("tuesday", UNSET) @@ -117,31 +135,39 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: all_day = d.pop("all_day", UNSET) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item = cls( - monday=monday, - tuesday=tuesday, - wednesday=wednesday, - thursday=thursday, - friday=friday, - saturday=saturday, - sunday=sunday, - start_time=start_time, - end_time=end_time, - all_day=all_day, - position=position, + ends_next_day = d.pop("ends_next_day", UNSET) + + update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_blocks_item = ( + cls( + id=id, + monday=monday, + tuesday=tuesday, + wednesday=wednesday, + thursday=thursday, + friday=friday, + saturday=saturday, + sunday=sunday, + start_time=start_time, + end_time=end_time, + all_day=all_day, + position=position, + ends_next_day=ends_next_day, + ) ) - update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item + update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_blocks_item.additional_properties = d + return ( + update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_blocks_item + ) @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5_time_zone.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_zone.py similarity index 93% rename from rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5_time_zone.py rename to rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_zone.py index b30f976b..5180fdcd 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5_time_zone.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_zone.py @@ -1,6 +1,6 @@ -from typing import Literal, cast +from typing import Literal -UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeZone = Literal[ +UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeZone = Literal[ "Abu Dhabi", "Adelaide", "Africa/Algiers", @@ -84,6 +84,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -157,6 +158,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -308,8 +310,8 @@ "Zurich", ] -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_5_TIME_ZONE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeZone +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_DEFERRAL_WINDOW_TIME_ZONE_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeZone ] = { "Abu Dhabi", "Adelaide", @@ -394,6 +396,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -467,6 +470,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -619,13 +623,16 @@ } -def check_update_escalation_policy_path_data_attributes_rules_item_type_5_time_zone( +def check_update_escalation_policy_path_data_attributes_notification_type_rules_item_deferral_window_time_zone( value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeZone | None: +) -> UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemDeferralWindowTimeZone | None: if value is None: return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_5_TIME_ZONE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeZone, value) + if ( + value + in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_DEFERRAL_WINDOW_TIME_ZONE_VALUES + ): + return value raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_5_TIME_ZONE_VALUES!r}" + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_DEFERRAL_WINDOW_TIME_ZONE_VALUES!r}" ) 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_notification_type_rules_item_json_path.py similarity index 51% rename from rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2.py rename to rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path.py index d3282b15..3cfc102a 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_notification_type_rules_item_json_path.py @@ -1,40 +1,42 @@ +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.update_escalation_policy_path_data_attributes_rules_item_type_8_type_2_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2Operator, - check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_2_operator, +from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_operator import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathOperator, + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_operator, ) -from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_2_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_2_rule_type, +from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_rule_type import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathRuleType, + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_rule_type, ) from ..types import UNSET, Unset -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2") +T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath") @_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2: +class UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPath: """ Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2RuleType): The type of the escalation path - rule + rule_type (UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathRuleType): The type of the + escalation path rule json_path (str): JSON path to extract value from payload - operator (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2Operator): How JSON path value should be - matched - 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) + operator (UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathOperator): 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) """ - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2RuleType + rule_type: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathRuleType json_path: str - operator: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2Operator - value: None | Unset | str = UNSET - values: Unset | list[str] = UNSET + operator: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathOperator + value: None | str | Unset = UNSET + values: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,13 +46,13 @@ def to_dict(self) -> dict[str, Any]: operator: str = self.operator - value: None | Unset | str + value: None | str | Unset if isinstance(self.value, Unset): value = UNSET else: value = self.value - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values @@ -73,28 +75,30 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_2_rule_type( - d.pop("rule_type") + rule_type = ( + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_rule_type( + d.pop("rule_type") + ) ) json_path = d.pop("json_path") - operator = check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_2_operator( + operator = check_update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_operator( d.pop("operator") ) - def _parse_value(data: object) -> None | Unset | str: + def _parse_value(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) value = _parse_value(d.pop("value", UNSET)) values = cast(list[str], d.pop("values", UNSET)) - update_escalation_policy_path_data_attributes_rules_item_type_8_type_2 = cls( + update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path = cls( rule_type=rule_type, json_path=json_path, operator=operator, @@ -102,8 +106,8 @@ def _parse_value(data: object) -> None | Unset | str: values=values, ) - update_escalation_policy_path_data_attributes_rules_item_type_8_type_2.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_8_type_2 + update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path.additional_properties = d + return update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_operator.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_operator.py new file mode 100644 index 00000000..f60df7f7 --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_operator.py @@ -0,0 +1,49 @@ +from typing import Literal + +UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathOperator = Literal[ + "contains", + "contains_key", + "does_not_contain", + "does_not_contain_key", + "does_not_match", + "does_not_start_with", + "is", + "is_not", + "is_not_one_of", + "is_not_set", + "is_one_of", + "is_set", + "matches", + "starts_with", +] + +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_JSON_PATH_OPERATOR_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathOperator +] = { + "contains", + "contains_key", + "does_not_contain", + "does_not_contain_key", + "does_not_match", + "does_not_start_with", + "is", + "is_not", + "is_not_one_of", + "is_not_set", + "is_one_of", + "is_set", + "matches", + "starts_with", +} + + +def check_update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_operator( + value: str | None, +) -> UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathOperator | None: + if value is None: + return None + if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_JSON_PATH_OPERATOR_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_JSON_PATH_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_rule_type.py new file mode 100644 index 00000000..4e3cd4cc --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_rule_type.py @@ -0,0 +1,21 @@ +from typing import Literal + +UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathRuleType = Literal["json_path"] + +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_JSON_PATH_RULE_TYPE_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathRuleType +] = { + "json_path", +} + + +def check_update_escalation_policy_path_data_attributes_notification_type_rules_item_json_path_rule_type( + value: str | None, +) -> UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemJSONPathRuleType | None: + if value is None: + return None + if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_JSON_PATH_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_JSON_PATH_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_match_mode.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_match_mode.py new file mode 100644 index 00000000..c469d55f --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_match_mode.py @@ -0,0 +1,24 @@ +from typing import Literal + +UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemMatchMode = Literal[ + "match-all-rules", "match-any-rule" +] + +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_MATCH_MODE_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemMatchMode +] = { + "match-all-rules", + "match-any-rule", +} + + +def check_update_escalation_policy_path_data_attributes_notification_type_rules_item_match_mode( + value: str | None, +) -> UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemMatchMode | None: + if value is None: + return None + if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_MATCH_MODE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_MATCH_MODE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_notification_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_notification_type.py new file mode 100644 index 00000000..a1b19a61 --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_notification_type.py @@ -0,0 +1,22 @@ +from typing import Literal + +UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemNotificationType = Literal["audible", "quiet"] + +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_NOTIFICATION_TYPE_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemNotificationType +] = { + "audible", + "quiet", +} + + +def check_update_escalation_policy_path_data_attributes_notification_type_rules_item_notification_type( + value: str | None, +) -> UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemNotificationType | None: + if value is None: + return None + if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_NOTIFICATION_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_NOTIFICATION_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents.py new file mode 100644 index 00000000..09b9bb2a --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents.py @@ -0,0 +1,86 @@ +from __future__ import annotations + +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.update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_operator import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsOperator, + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_operator, +) +from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_rule_type import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsRuleType, + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_rule_type, +) + +T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents") + + +@_attrs_define +class UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidents: + """ + Attributes: + rule_type (UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsRuleType): The type + of the escalation path rule + operator (UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsOperator): Whether + the alert must (or must not) have related incidents + """ + + rule_type: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsRuleType + operator: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsOperator + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + rule_type: str = self.rule_type + + operator: str = self.operator + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "rule_type": rule_type, + "operator": operator, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + rule_type = check_update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_rule_type( + d.pop("rule_type") + ) + + operator = ( + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_operator( + d.pop("operator") + ) + ) + + update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents = cls( + rule_type=rule_type, + operator=operator, + ) + + update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents.additional_properties = d + return update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents + + @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_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_operator.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_operator.py new file mode 100644 index 00000000..faa47226 --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_operator.py @@ -0,0 +1,27 @@ +from typing import Literal + +UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsOperator = Literal[ + "is_not_set", "is_set" +] + +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_RELATED_INCIDENTS_OPERATOR_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsOperator +] = { + "is_not_set", + "is_set", +} + + +def check_update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_operator( + value: str | None, +) -> UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsOperator | None: + if value is None: + return None + if ( + value + in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_RELATED_INCIDENTS_OPERATOR_VALUES + ): + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_RELATED_INCIDENTS_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_rule_type.py new file mode 100644 index 00000000..5af663af --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_rule_type.py @@ -0,0 +1,24 @@ +from typing import Literal + +UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsRuleType = Literal["related_incidents"] + +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_RELATED_INCIDENTS_RULE_TYPE_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsRuleType +] = { + "related_incidents", +} + + +def check_update_escalation_policy_path_data_attributes_notification_type_rules_item_related_incidents_rule_type( + value: str | None, +) -> UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemRelatedIncidentsRuleType | None: + if value is None: + return None + if ( + value + in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_RELATED_INCIDENTS_RULE_TYPE_VALUES + ): + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_RELATED_INCIDENTS_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_service.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_service.py new file mode 100644 index 00000000..c4f7baac --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_service.py @@ -0,0 +1,103 @@ +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.update_escalation_policy_path_data_attributes_notification_type_rules_item_service_operator import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceOperator, + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_service_operator, +) +from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_service_rule_type import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceRuleType, + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_service_rule_type, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemService") + + +@_attrs_define +class UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemService: + """ + Attributes: + rule_type (UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceRuleType): The type of the + escalation path rule + service_ids (list[str]): Service ids for which this escalation path should be used + operator (UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceOperator | Unset): How the + alert's services should be matched. is and is_not take exactly one id Default: 'is_one_of'. + """ + + rule_type: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceRuleType + service_ids: list[str] + operator: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceOperator | Unset = "is_one_of" + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + rule_type: str = self.rule_type + + service_ids = self.service_ids + + operator: str | Unset = UNSET + if not isinstance(self.operator, Unset): + operator = self.operator + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "rule_type": rule_type, + "service_ids": service_ids, + } + ) + if operator is not UNSET: + field_dict["operator"] = operator + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + rule_type = check_update_escalation_policy_path_data_attributes_notification_type_rules_item_service_rule_type( + d.pop("rule_type") + ) + + service_ids = cast(list[str], d.pop("service_ids")) + + _operator = d.pop("operator", UNSET) + operator: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceOperator | Unset + if isinstance(_operator, Unset): + operator = UNSET + else: + operator = ( + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_service_operator( + _operator + ) + ) + + update_escalation_policy_path_data_attributes_notification_type_rules_item_service = cls( + rule_type=rule_type, + service_ids=service_ids, + operator=operator, + ) + + update_escalation_policy_path_data_attributes_notification_type_rules_item_service.additional_properties = d + return update_escalation_policy_path_data_attributes_notification_type_rules_item_service + + @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_escalation_policy_path_data_attributes_notification_type_rules_item_service_operator.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_service_operator.py new file mode 100644 index 00000000..0411347e --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_service_operator.py @@ -0,0 +1,26 @@ +from typing import Literal + +UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceOperator = Literal[ + "is", "is_not", "is_not_one_of", "is_one_of" +] + +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_SERVICE_OPERATOR_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceOperator +] = { + "is", + "is_not", + "is_not_one_of", + "is_one_of", +} + + +def check_update_escalation_policy_path_data_attributes_notification_type_rules_item_service_operator( + value: str | None, +) -> UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceOperator | None: + if value is None: + return None + if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_SERVICE_OPERATOR_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_SERVICE_OPERATOR_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_service_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_service_rule_type.py new file mode 100644 index 00000000..dc257600 --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_service_rule_type.py @@ -0,0 +1,21 @@ +from typing import Literal + +UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceRuleType = Literal["service"] + +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_SERVICE_RULE_TYPE_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceRuleType +] = { + "service", +} + + +def check_update_escalation_policy_path_data_attributes_notification_type_rules_item_service_rule_type( + value: str | None, +) -> UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemServiceRuleType | None: + if value is None: + return None + if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_SERVICE_RULE_TYPE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_SERVICE_RULE_TYPE_VALUES!r}" + ) 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_notification_type_rules_item_working_hours.py similarity index 57% rename from rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_1.py rename to rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours.py index 0ffe6200..e1e411cc 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_notification_type_rules_item_working_hours.py @@ -1,27 +1,29 @@ +from __future__ import annotations + 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.update_escalation_policy_path_data_attributes_rules_item_type_9_type_1_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_1_rule_type, +from ..models.update_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours_rule_type import ( + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHoursRuleType, + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours_rule_type, ) -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1") +T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours") @_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1: +class UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHours: """ Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1RuleType): The type of the escalation path - rule + rule_type (UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHoursRuleType): The type of + the escalation path rule within_working_hour (bool): Whether the escalation path should be used within working hours """ - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1RuleType + rule_type: UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHoursRuleType within_working_hour: bool additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) @@ -44,19 +46,21 @@ def to_dict(self) -> dict[str, Any]: @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_1_rule_type( - d.pop("rule_type") + rule_type = ( + check_update_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours_rule_type( + d.pop("rule_type") + ) ) within_working_hour = d.pop("within_working_hour") - update_escalation_policy_path_data_attributes_rules_item_type_9_type_1 = cls( + update_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours = cls( rule_type=rule_type, within_working_hour=within_working_hour, ) - update_escalation_policy_path_data_attributes_rules_item_type_9_type_1.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_9_type_1 + update_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours.additional_properties = d + return update_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours @property def additional_keys(self) -> list[str]: diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours_rule_type.py new file mode 100644 index 00000000..503e4a77 --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours_rule_type.py @@ -0,0 +1,24 @@ +from typing import Literal + +UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHoursRuleType = Literal["working_hour"] + +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_WORKING_HOURS_RULE_TYPE_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHoursRuleType +] = { + "working_hour", +} + + +def check_update_escalation_policy_path_data_attributes_notification_type_rules_item_working_hours_rule_type( + value: str | None, +) -> UpdateEscalationPolicyPathDataAttributesNotificationTypeRulesItemWorkingHoursRuleType | None: + if value is None: + return None + if ( + value + in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_WORKING_HOURS_RULE_TYPE_VALUES + ): + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_NOTIFICATION_TYPE_RULES_ITEM_WORKING_HOURS_RULE_TYPE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_path_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_path_type.py index c8496b6e..7c4e4549 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_path_type.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_path_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEscalationPolicyPathDataAttributesPathType = Literal["deferral", "escalation"] @@ -16,7 +16,7 @@ def check_update_escalation_policy_path_data_attributes_path_type( if value is None: return None if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_PATH_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesPathType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_PATH_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_retrigger_timeout_minutes.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_retrigger_timeout_minutes.py new file mode 100644 index 00000000..97b6d8dd --- /dev/null +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_retrigger_timeout_minutes.py @@ -0,0 +1,35 @@ +from typing import Literal + +UpdateEscalationPolicyPathDataAttributesRetriggerTimeoutMinutes = Literal[ + -1, 10, 20, 30, 40, 50, 60, 90, 120, 180, 240, 300, 360, 720, 1440 +] + +UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RETRIGGER_TIMEOUT_MINUTES_VALUES: set[ + UpdateEscalationPolicyPathDataAttributesRetriggerTimeoutMinutes +] = { + -1, + 10, + 20, + 30, + 40, + 50, + 60, + 90, + 120, + 180, + 240, + 300, + 360, + 720, + 1440, +} + + +def check_update_escalation_policy_path_data_attributes_retrigger_timeout_minutes( + value: int, +) -> UpdateEscalationPolicyPathDataAttributesRetriggerTimeoutMinutes: + if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RETRIGGER_TIMEOUT_MINUTES_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RETRIGGER_TIMEOUT_MINUTES_VALUES!r}" + ) 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 deleted file mode 100644 index 91fcac99..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_0.py +++ /dev/null @@ -1,72 +0,0 @@ -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.update_escalation_policy_path_data_attributes_rules_item_type_0_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType0RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_0_rule_type, -) - -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType0") - - -@_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType0: - """ - Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType0RuleType): The type of the escalation path rule - urgency_ids (list[str]): Alert urgency ids for which this escalation path should be used - """ - - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType0RuleType - urgency_ids: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - urgency_ids = self.urgency_ids - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "urgency_ids": urgency_ids, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_0_rule_type(d.pop("rule_type")) - - urgency_ids = cast(list[str], d.pop("urgency_ids")) - - update_escalation_policy_path_data_attributes_rules_item_type_0 = cls( - rule_type=rule_type, - urgency_ids=urgency_ids, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_0.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_0 - - @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_escalation_policy_path_data_attributes_rules_item_type_0_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_0_rule_type.py deleted file mode 100644 index 18fa4ac9..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_0_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType0RuleType = Literal["alert_urgency"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_0_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType0RuleType -] = { - "alert_urgency", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_0_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType0RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_0_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType0RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_0_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index b8a8ef1d..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_1.py +++ /dev/null @@ -1,72 +0,0 @@ -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.update_escalation_policy_path_data_attributes_rules_item_type_1_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType1RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_1_rule_type, -) - -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType1") - - -@_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType1: - """ - Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType1RuleType): The type of the escalation path rule - within_working_hour (bool): Whether the escalation path should be used within working hours - """ - - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType1RuleType - within_working_hour: bool - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - within_working_hour = self.within_working_hour - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "within_working_hour": within_working_hour, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_1_rule_type(d.pop("rule_type")) - - within_working_hour = d.pop("within_working_hour") - - update_escalation_policy_path_data_attributes_rules_item_type_1 = cls( - rule_type=rule_type, - within_working_hour=within_working_hour, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_1.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_1 - - @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_escalation_policy_path_data_attributes_rules_item_type_1_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_1_rule_type.py deleted file mode 100644 index 2a5324d2..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_1_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType1RuleType = Literal["working_hour"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_1_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType1RuleType -] = { - "working_hour", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_1_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType1RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_1_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType1RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_1_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 0f849085..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_2.py +++ /dev/null @@ -1,116 +0,0 @@ -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.update_escalation_policy_path_data_attributes_rules_item_type_2_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType2Operator, - check_update_escalation_policy_path_data_attributes_rules_item_type_2_operator, -) -from ..models.update_escalation_policy_path_data_attributes_rules_item_type_2_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType2RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_2_rule_type, -) -from ..types import UNSET, Unset - -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType2") - - -@_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType2: - """ - Attributes: - 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 (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 | 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]: - rule_type: str = self.rule_type - - json_path = self.json_path - - operator: str = self.operator - - value: None | Unset | str - if isinstance(self.value, Unset): - value = UNSET - else: - value = self.value - - values: Unset | list[str] = UNSET - if not isinstance(self.values, Unset): - values = self.values - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "json_path": json_path, - "operator": operator, - } - ) - if value is not UNSET: - field_dict["value"] = value - if values is not UNSET: - field_dict["values"] = values - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_2_rule_type(d.pop("rule_type")) - - json_path = d.pop("json_path") - - operator = check_update_escalation_policy_path_data_attributes_rules_item_type_2_operator(d.pop("operator")) - - def _parse_value(data: object) -> None | Unset | str: - if data is None: - return data - if isinstance(data, Unset): - return data - return cast(None | Unset | str, data) - - value = _parse_value(d.pop("value", UNSET)) - - values = cast(list[str], d.pop("values", UNSET)) - - update_escalation_policy_path_data_attributes_rules_item_type_2 = cls( - rule_type=rule_type, - json_path=json_path, - operator=operator, - value=value, - values=values, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_2.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_2 - - @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_escalation_policy_path_data_attributes_rules_item_type_2_operator.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_2_operator.py deleted file mode 100644 index 10f4f284..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_2_operator.py +++ /dev/null @@ -1,49 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType2Operator = Literal[ - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_not", - "is_not_one_of", - "is_not_set", - "is_one_of", - "is_set", - "matches", - "starts_with", -] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_2_OPERATOR_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType2Operator -] = { - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_not", - "is_not_one_of", - "is_not_set", - "is_one_of", - "is_set", - "matches", - "starts_with", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_2_operator( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType2Operator | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_2_OPERATOR_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType2Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_2_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_2_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_2_rule_type.py deleted file mode 100644 index 8e3e688d..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_2_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType2RuleType = Literal["json_path"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_2_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType2RuleType -] = { - "json_path", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_2_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType2RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_2_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType2RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_2_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 0b645f2f..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_3.py +++ /dev/null @@ -1,105 +0,0 @@ -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.update_escalation_policy_path_data_attributes_rules_item_type_3_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType3Operator, - check_update_escalation_policy_path_data_attributes_rules_item_type_3_operator, -) -from ..models.update_escalation_policy_path_data_attributes_rules_item_type_3_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType3RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_3_rule_type, -) -from ..types import UNSET, Unset - -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType3") - - -@_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType3: - """ - Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType3RuleType): The type of the escalation path rule - fieldable_type (str): The type of the fieldable (e.g., AlertField) - fieldable_id (str): The ID of the alert field - operator (UpdateEscalationPolicyPathDataAttributesRulesItemType3Operator): How the alert field value should be - matched - values (Union[Unset, list[str]]): Values to match against - """ - - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType3RuleType - fieldable_type: str - fieldable_id: str - operator: UpdateEscalationPolicyPathDataAttributesRulesItemType3Operator - values: Unset | list[str] = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - fieldable_type = self.fieldable_type - - fieldable_id = self.fieldable_id - - operator: str = self.operator - - values: Unset | list[str] = UNSET - if not isinstance(self.values, Unset): - values = self.values - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "fieldable_type": fieldable_type, - "fieldable_id": fieldable_id, - "operator": operator, - } - ) - if values is not UNSET: - field_dict["values"] = values - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_3_rule_type(d.pop("rule_type")) - - fieldable_type = d.pop("fieldable_type") - - fieldable_id = d.pop("fieldable_id") - - operator = check_update_escalation_policy_path_data_attributes_rules_item_type_3_operator(d.pop("operator")) - - values = cast(list[str], d.pop("values", UNSET)) - - update_escalation_policy_path_data_attributes_rules_item_type_3 = cls( - rule_type=rule_type, - fieldable_type=fieldable_type, - fieldable_id=fieldable_id, - operator=operator, - values=values, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_3.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_3 - - @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_escalation_policy_path_data_attributes_rules_item_type_3_operator.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_3_operator.py deleted file mode 100644 index 3d098863..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_3_operator.py +++ /dev/null @@ -1,49 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType3Operator = Literal[ - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_empty", - "is_not", - "is_not_empty", - "is_not_one_of", - "is_one_of", - "matches", - "starts_with", -] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_3_OPERATOR_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType3Operator -] = { - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_empty", - "is_not", - "is_not_empty", - "is_not_one_of", - "is_one_of", - "matches", - "starts_with", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_3_operator( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType3Operator | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_3_OPERATOR_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType3Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_3_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_3_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_3_rule_type.py deleted file mode 100644 index 0b2e52e1..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_3_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType3RuleType = Literal["field"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_3_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType3RuleType -] = { - "field", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_3_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType3RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_3_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType3RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_3_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 41b5d14a..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_4.py +++ /dev/null @@ -1,72 +0,0 @@ -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.update_escalation_policy_path_data_attributes_rules_item_type_4_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType4RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_4_rule_type, -) - -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType4") - - -@_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType4: - """ - Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType4RuleType): The type of the escalation path rule - service_ids (list[str]): Service ids for which this escalation path should be used - """ - - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType4RuleType - service_ids: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - service_ids = self.service_ids - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "service_ids": service_ids, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_4_rule_type(d.pop("rule_type")) - - service_ids = cast(list[str], d.pop("service_ids")) - - update_escalation_policy_path_data_attributes_rules_item_type_4 = cls( - rule_type=rule_type, - service_ids=service_ids, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_4.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_4 - - @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_escalation_policy_path_data_attributes_rules_item_type_4_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_4_rule_type.py deleted file mode 100644 index b893e3d8..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_4_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType4RuleType = Literal["service"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_4_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType4RuleType -] = { - "service", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_4_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType4RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_4_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType4RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_4_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 1f1da033..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5.py +++ /dev/null @@ -1,105 +0,0 @@ -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_escalation_policy_path_data_attributes_rules_item_type_5_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType5RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_5_rule_type, -) -from ..models.update_escalation_policy_path_data_attributes_rules_item_type_5_time_zone import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeZone, - check_update_escalation_policy_path_data_attributes_rules_item_type_5_time_zone, -) - -if TYPE_CHECKING: - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem, - ) - - -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType5") - - -@_attrs_define -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 - which alerts are deferred - """ - - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType5RuleType - time_zone: UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeZone - 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 - - time_blocks = [] - for time_blocks_item_data in self.time_blocks: - time_blocks_item = time_blocks_item_data.to_dict() - time_blocks.append(time_blocks_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "time_zone": time_zone, - "time_blocks": time_blocks, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_5_time_blocks_item import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem, - ) - - d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_5_rule_type(d.pop("rule_type")) - - time_zone = check_update_escalation_policy_path_data_attributes_rules_item_type_5_time_zone(d.pop("time_zone")) - - time_blocks = [] - _time_blocks = d.pop("time_blocks") - for time_blocks_item_data in _time_blocks: - time_blocks_item = UpdateEscalationPolicyPathDataAttributesRulesItemType5TimeBlocksItem.from_dict( - time_blocks_item_data - ) - - time_blocks.append(time_blocks_item) - - update_escalation_policy_path_data_attributes_rules_item_type_5 = cls( - rule_type=rule_type, - time_zone=time_zone, - time_blocks=time_blocks, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_5.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_5 - - @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_escalation_policy_path_data_attributes_rules_item_type_5_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5_rule_type.py deleted file mode 100644 index 0415d0cf..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_5_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType5RuleType = Literal["deferral_window"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_5_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType5RuleType -] = { - "deferral_window", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_5_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType5RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_5_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType5RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_5_RULE_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_6_operator.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_6_operator.py deleted file mode 100644 index 10f5c4d1..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_6_operator.py +++ /dev/null @@ -1,24 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType6Operator = Literal["is", "is_not", "is_not_one_of", "is_one_of"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_6_OPERATOR_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType6Operator -] = { - "is", - "is_not", - "is_not_one_of", - "is_one_of", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_6_operator( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType6Operator | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_6_OPERATOR_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType6Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_6_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_6_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_6_rule_type.py deleted file mode 100644 index 23f8cc8f..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_6_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType6RuleType = Literal["source"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_6_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType6RuleType -] = { - "source", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_6_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType6RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_6_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType6RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_6_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index a394755a..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_7.py +++ /dev/null @@ -1,77 +0,0 @@ -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.update_escalation_policy_path_data_attributes_rules_item_type_7_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType7Operator, - check_update_escalation_policy_path_data_attributes_rules_item_type_7_operator, -) -from ..models.update_escalation_policy_path_data_attributes_rules_item_type_7_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType7RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_7_rule_type, -) - -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType7") - - -@_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType7: - """ - Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType7RuleType): The type of the escalation path rule - operator (UpdateEscalationPolicyPathDataAttributesRulesItemType7Operator): Whether the alert must (or must not) - have related incidents - """ - - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType7RuleType - operator: UpdateEscalationPolicyPathDataAttributesRulesItemType7Operator - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - operator: str = self.operator - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "operator": operator, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_7_rule_type(d.pop("rule_type")) - - operator = check_update_escalation_policy_path_data_attributes_rules_item_type_7_operator(d.pop("operator")) - - update_escalation_policy_path_data_attributes_rules_item_type_7 = cls( - rule_type=rule_type, - operator=operator, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_7.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_7 - - @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_escalation_policy_path_data_attributes_rules_item_type_7_operator.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_7_operator.py deleted file mode 100644 index b84a4019..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_7_operator.py +++ /dev/null @@ -1,22 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType7Operator = Literal["is_not_set", "is_set"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_7_OPERATOR_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType7Operator -] = { - "is_not_set", - "is_set", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_7_operator( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType7Operator | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_7_OPERATOR_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType7Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_7_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_7_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_7_rule_type.py deleted file mode 100644 index c1a6fff4..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_7_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType7RuleType = Literal["related_incidents"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_7_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType7RuleType -] = { - "related_incidents", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_7_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType7RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_7_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType7RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_7_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 15ecf4f7..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_0.py +++ /dev/null @@ -1,75 +0,0 @@ -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.update_escalation_policy_path_data_attributes_rules_item_type_8_type_0_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_0_rule_type, -) - -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0") - - -@_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0: - """ - Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0RuleType): The type of the escalation path - rule - urgency_ids (list[str]): Alert urgency ids for which this escalation path should be used - """ - - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0RuleType - urgency_ids: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - urgency_ids = self.urgency_ids - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "urgency_ids": urgency_ids, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_0_rule_type( - d.pop("rule_type") - ) - - urgency_ids = cast(list[str], d.pop("urgency_ids")) - - update_escalation_policy_path_data_attributes_rules_item_type_8_type_0 = cls( - rule_type=rule_type, - urgency_ids=urgency_ids, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_8_type_0.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_8_type_0 - - @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_escalation_policy_path_data_attributes_rules_item_type_8_type_0_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_0_rule_type.py deleted file mode 100644 index e203a644..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_0_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0RuleType = Literal["alert_urgency"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_0_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0RuleType -] = { - "alert_urgency", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_0_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_0_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType8Type0RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_0_RULE_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_1_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_1_rule_type.py deleted file mode 100644 index b161a7bc..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_1_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1RuleType = Literal["working_hour"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_1_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1RuleType -] = { - "working_hour", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_1_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_1_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType8Type1RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_1_RULE_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2_operator.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2_operator.py deleted file mode 100644 index 567782af..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2_operator.py +++ /dev/null @@ -1,49 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2Operator = Literal[ - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_not", - "is_not_one_of", - "is_not_set", - "is_one_of", - "is_set", - "matches", - "starts_with", -] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_2_OPERATOR_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2Operator -] = { - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_not", - "is_not_one_of", - "is_not_set", - "is_one_of", - "is_set", - "matches", - "starts_with", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_2_operator( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2Operator | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_2_OPERATOR_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_2_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2_rule_type.py deleted file mode 100644 index 9a352a36..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_2_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2RuleType = Literal["json_path"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_2_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2RuleType -] = { - "json_path", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_2_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_2_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType8Type2RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_2_RULE_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3_operator.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3_operator.py deleted file mode 100644 index 883a9cd9..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3_operator.py +++ /dev/null @@ -1,49 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3Operator = Literal[ - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_empty", - "is_not", - "is_not_empty", - "is_not_one_of", - "is_one_of", - "matches", - "starts_with", -] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_3_OPERATOR_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3Operator -] = { - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_empty", - "is_not", - "is_not_empty", - "is_not_one_of", - "is_one_of", - "matches", - "starts_with", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_3_operator( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3Operator | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_3_OPERATOR_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_3_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3_rule_type.py deleted file mode 100644 index 78a62ee9..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_3_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3RuleType = Literal["field"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_3_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3RuleType -] = { - "field", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_3_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_3_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType8Type3RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_3_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 3915505f..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_4.py +++ /dev/null @@ -1,75 +0,0 @@ -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.update_escalation_policy_path_data_attributes_rules_item_type_8_type_4_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_4_rule_type, -) - -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4") - - -@_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4: - """ - Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4RuleType): The type of the escalation path - rule - service_ids (list[str]): Service ids for which this escalation path should be used - """ - - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4RuleType - service_ids: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - service_ids = self.service_ids - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "service_ids": service_ids, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_4_rule_type( - d.pop("rule_type") - ) - - service_ids = cast(list[str], d.pop("service_ids")) - - update_escalation_policy_path_data_attributes_rules_item_type_8_type_4 = cls( - rule_type=rule_type, - service_ids=service_ids, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_8_type_4.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_8_type_4 - - @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_escalation_policy_path_data_attributes_rules_item_type_8_type_4_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_4_rule_type.py deleted file mode 100644 index 395ab7c6..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_4_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4RuleType = Literal["service"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_4_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4RuleType -] = { - "service", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_4_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_4_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType8Type4RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_4_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index d2b190a0..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5.py +++ /dev/null @@ -1,111 +0,0 @@ -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_escalation_policy_path_data_attributes_rules_item_type_8_type_5_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_rule_type, -) -from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_zone import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeZone, - check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_zone, -) - -if TYPE_CHECKING: - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_item import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem, - ) - - -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5") - - -@_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5: - """ - Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5RuleType): The type of the escalation path - rule - time_zone (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeZone): Time zone for the deferral - window - time_blocks (list['UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem']): Time windows - during which alerts are deferred - """ - - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5RuleType - time_zone: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeZone - 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 - - time_blocks = [] - for time_blocks_item_data in self.time_blocks: - time_blocks_item = time_blocks_item_data.to_dict() - time_blocks.append(time_blocks_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "time_zone": time_zone, - "time_blocks": time_blocks, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_item import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem, - ) - - d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_rule_type( - d.pop("rule_type") - ) - - time_zone = check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_zone( - d.pop("time_zone") - ) - - time_blocks = [] - _time_blocks = d.pop("time_blocks") - for time_blocks_item_data in _time_blocks: - time_blocks_item = UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem.from_dict( - time_blocks_item_data - ) - - time_blocks.append(time_blocks_item) - - update_escalation_policy_path_data_attributes_rules_item_type_8_type_5 = cls( - rule_type=rule_type, - time_zone=time_zone, - time_blocks=time_blocks, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_8_type_5.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_8_type_5 - - @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_escalation_policy_path_data_attributes_rules_item_type_8_type_5_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_rule_type.py deleted file mode 100644 index 2ea2d52c..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5RuleType = Literal["deferral_window"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_5_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5RuleType -] = { - "deferral_window", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_5_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_5_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 0e8296e6..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_item.py +++ /dev/null @@ -1,160 +0,0 @@ -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="UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem") - - -@_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeBlocksItem: - """ - Attributes: - 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: 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]: - monday = self.monday - - tuesday = self.tuesday - - wednesday = self.wednesday - - thursday = self.thursday - - friday = self.friday - - saturday = self.saturday - - sunday = self.sunday - - start_time = self.start_time - - end_time = self.end_time - - all_day = self.all_day - - position: None | Unset | int - if isinstance(self.position, Unset): - position = UNSET - else: - position = self.position - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if monday is not UNSET: - field_dict["monday"] = monday - if tuesday is not UNSET: - field_dict["tuesday"] = tuesday - if wednesday is not UNSET: - field_dict["wednesday"] = wednesday - if thursday is not UNSET: - field_dict["thursday"] = thursday - if friday is not UNSET: - field_dict["friday"] = friday - if saturday is not UNSET: - field_dict["saturday"] = saturday - if sunday is not UNSET: - field_dict["sunday"] = sunday - if start_time is not UNSET: - field_dict["start_time"] = start_time - if end_time is not UNSET: - field_dict["end_time"] = end_time - if all_day is not UNSET: - field_dict["all_day"] = all_day - 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) - monday = d.pop("monday", UNSET) - - tuesday = d.pop("tuesday", UNSET) - - wednesday = d.pop("wednesday", UNSET) - - thursday = d.pop("thursday", UNSET) - - friday = d.pop("friday", UNSET) - - saturday = d.pop("saturday", UNSET) - - sunday = d.pop("sunday", UNSET) - - start_time = d.pop("start_time", UNSET) - - end_time = d.pop("end_time", UNSET) - - all_day = d.pop("all_day", 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)) - - update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_item = cls( - monday=monday, - tuesday=tuesday, - wednesday=wednesday, - thursday=thursday, - friday=friday, - saturday=saturday, - sunday=sunday, - start_time=start_time, - end_time=end_time, - all_day=all_day, - position=position, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_item.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_blocks_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_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_zone.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_zone.py deleted file mode 100644 index c0d3f443..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_zone.py +++ /dev/null @@ -1,631 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeZone = Literal[ - "Abu Dhabi", - "Adelaide", - "Africa/Algiers", - "Africa/Cairo", - "Africa/Casablanca", - "Africa/Harare", - "Africa/Johannesburg", - "Africa/Monrovia", - "Africa/Nairobi", - "Alaska", - "Almaty", - "America/Adak", - "America/Argentina/Buenos_Aires", - "America/Asuncion", - "America/Atka", - "America/Bogota", - "America/Caracas", - "America/Chicago", - "America/Chihuahua", - "America/Denver", - "America/Guatemala", - "America/Guyana", - "America/Halifax", - "America/Indiana/Indianapolis", - "America/Juneau", - "America/La_Paz", - "America/Lima", - "America/Los_Angeles", - "America/Mazatlan", - "America/Mexico_City", - "America/Miquelon", - "America/Monterrey", - "America/Montevideo", - "America/New_York", - "America/Nuuk", - "America/Phoenix", - "America/Puerto_Rico", - "America/Regina", - "America/Santiago", - "America/Sao_Paulo", - "America/St_Johns", - "America/Tijuana", - "America/Vancouver", - "American Samoa", - "Amsterdam", - "Arizona", - "Asia/Almaty", - "Asia/Baghdad", - "Asia/Baku", - "Asia/Bangkok", - "Asia/Chongqing", - "Asia/Colombo", - "Asia/Dhaka", - "Asia/Hong_Kong", - "Asia/Irkutsk", - "Asia/Jakarta", - "Asia/Jerusalem", - "Asia/Kabul", - "Asia/Kamchatka", - "Asia/Karachi", - "Asia/Kathmandu", - "Asia/Kolkata", - "Asia/Krasnoyarsk", - "Asia/Kuala_Lumpur", - "Asia/Kuwait", - "Asia/Magadan", - "Asia/Muscat", - "Asia/Novosibirsk", - "Asia/Rangoon", - "Asia/Riyadh", - "Asia/Seoul", - "Asia/Shanghai", - "Asia/Singapore", - "Asia/Srednekolymsk", - "Asia/Taipei", - "Asia/Tashkent", - "Asia/Tbilisi", - "Asia/Tehran", - "Asia/Tokyo", - "Asia/Ulaanbaatar", - "Asia/Urumqi", - "Asia/Vladivostok", - "Asia/Yakutsk", - "Asia/Yekaterinburg", - "Asia/Yerevan", - "Astana", - "Asuncion", - "Athens", - "Atlantic Time (Canada)", - "Atlantic/Azores", - "Atlantic/Cape_Verde", - "Atlantic/South_Georgia", - "Auckland", - "Australia/Adelaide", - "Australia/Brisbane", - "Australia/Canberra", - "Australia/Darwin", - "Australia/Eucla", - "Australia/Hobart", - "Australia/LHI", - "Australia/Lord_Howe", - "Australia/Melbourne", - "Australia/Perth", - "Australia/Sydney", - "Azores", - "Baghdad", - "Baku", - "Bangkok", - "Beijing", - "Belgrade", - "Berlin", - "Bern", - "Bogota", - "Brasilia", - "Bratislava", - "Brisbane", - "Brussels", - "Bucharest", - "Budapest", - "Buenos Aires", - "Cairo", - "Canada/Pacific", - "Canberra", - "Cape Verde Is.", - "Caracas", - "Casablanca", - "Central America", - "Central Time (US & Canada)", - "Chatham Is.", - "Chennai", - "Chihuahua", - "Chile/EasterIsland", - "Chongqing", - "Copenhagen", - "Darwin", - "Dhaka", - "Dublin", - "Eastern Time (US & Canada)", - "Edinburgh", - "Ekaterinburg", - "Etc/GMT+12", - "Etc/UTC", - "Europe/Amsterdam", - "Europe/Athens", - "Europe/Belgrade", - "Europe/Berlin", - "Europe/Bratislava", - "Europe/Brussels", - "Europe/Bucharest", - "Europe/Budapest", - "Europe/Copenhagen", - "Europe/Dublin", - "Europe/Helsinki", - "Europe/Istanbul", - "Europe/Kaliningrad", - "Europe/Kiev", - "Europe/Lisbon", - "Europe/Ljubljana", - "Europe/London", - "Europe/Madrid", - "Europe/Minsk", - "Europe/Moscow", - "Europe/Paris", - "Europe/Prague", - "Europe/Riga", - "Europe/Rome", - "Europe/Samara", - "Europe/Sarajevo", - "Europe/Skopje", - "Europe/Sofia", - "Europe/Stockholm", - "Europe/Tallinn", - "Europe/Vienna", - "Europe/Vilnius", - "Europe/Volgograd", - "Europe/Warsaw", - "Europe/Zagreb", - "Europe/Zurich", - "Fiji", - "Georgetown", - "Greenland", - "Guadalajara", - "Guam", - "Hanoi", - "Harare", - "Hawaii", - "Helsinki", - "Hobart", - "Hong Kong", - "Indiana (East)", - "International Date Line West", - "Irkutsk", - "Islamabad", - "Istanbul", - "Jakarta", - "Jerusalem", - "Kabul", - "Kaliningrad", - "Kamchatka", - "Karachi", - "Kathmandu", - "Kolkata", - "Krasnoyarsk", - "Kuala Lumpur", - "Kuwait", - "Kyiv", - "La Paz", - "Lima", - "Lisbon", - "Ljubljana", - "London", - "Madrid", - "Magadan", - "Marshall Is.", - "Mazatlan", - "Melbourne", - "Mexico City", - "Mid-Atlantic", - "Midway Island", - "Minsk", - "Monrovia", - "Monterrey", - "Montevideo", - "Moscow", - "Mountain Time (US & Canada)", - "Mumbai", - "Muscat", - "Nairobi", - "New Caledonia", - "New Delhi", - "Newfoundland", - "Novosibirsk", - "Nuku'alofa", - "Osaka", - "Pacific Time (US & Canada)", - "Pacific/Apia", - "Pacific/Auckland", - "Pacific/Chatham", - "Pacific/Easter", - "Pacific/Fakaofo", - "Pacific/Fiji", - "Pacific/Gambier", - "Pacific/Guadalcanal", - "Pacific/Guam", - "Pacific/Honolulu", - "Pacific/Kiritimati", - "Pacific/Majuro", - "Pacific/Marquesas", - "Pacific/Midway", - "Pacific/Norfolk", - "Pacific/Noumea", - "Pacific/Pago_Pago", - "Pacific/Pitcairn", - "Pacific/Port_Moresby", - "Pacific/Tongatapu", - "Paris", - "Perth", - "Port Moresby", - "Prague", - "Pretoria", - "Puerto Rico", - "Quito", - "Rangoon", - "Riga", - "Riyadh", - "Rome", - "Samara", - "Samoa", - "Santiago", - "Sapporo", - "Sarajevo", - "Saskatchewan", - "Seoul", - "Singapore", - "Skopje", - "Sofia", - "Solomon Is.", - "Srednekolymsk", - "Sri Jayawardenepura", - "St. Petersburg", - "Stockholm", - "Sydney", - "Taipei", - "Tallinn", - "Tashkent", - "Tbilisi", - "Tehran", - "Tijuana", - "Tokelau Is.", - "Tokyo", - "Ulaanbaatar", - "Urumqi", - "US/Aleutian", - "UTC", - "Vienna", - "Vilnius", - "Vladivostok", - "Volgograd", - "Warsaw", - "Wellington", - "West Central Africa", - "Yakutsk", - "Yerevan", - "Zagreb", - "Zurich", -] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_5_TIME_ZONE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeZone -] = { - "Abu Dhabi", - "Adelaide", - "Africa/Algiers", - "Africa/Cairo", - "Africa/Casablanca", - "Africa/Harare", - "Africa/Johannesburg", - "Africa/Monrovia", - "Africa/Nairobi", - "Alaska", - "Almaty", - "America/Adak", - "America/Argentina/Buenos_Aires", - "America/Asuncion", - "America/Atka", - "America/Bogota", - "America/Caracas", - "America/Chicago", - "America/Chihuahua", - "America/Denver", - "America/Guatemala", - "America/Guyana", - "America/Halifax", - "America/Indiana/Indianapolis", - "America/Juneau", - "America/La_Paz", - "America/Lima", - "America/Los_Angeles", - "America/Mazatlan", - "America/Mexico_City", - "America/Miquelon", - "America/Monterrey", - "America/Montevideo", - "America/New_York", - "America/Nuuk", - "America/Phoenix", - "America/Puerto_Rico", - "America/Regina", - "America/Santiago", - "America/Sao_Paulo", - "America/St_Johns", - "America/Tijuana", - "America/Vancouver", - "American Samoa", - "Amsterdam", - "Arizona", - "Asia/Almaty", - "Asia/Baghdad", - "Asia/Baku", - "Asia/Bangkok", - "Asia/Chongqing", - "Asia/Colombo", - "Asia/Dhaka", - "Asia/Hong_Kong", - "Asia/Irkutsk", - "Asia/Jakarta", - "Asia/Jerusalem", - "Asia/Kabul", - "Asia/Kamchatka", - "Asia/Karachi", - "Asia/Kathmandu", - "Asia/Kolkata", - "Asia/Krasnoyarsk", - "Asia/Kuala_Lumpur", - "Asia/Kuwait", - "Asia/Magadan", - "Asia/Muscat", - "Asia/Novosibirsk", - "Asia/Rangoon", - "Asia/Riyadh", - "Asia/Seoul", - "Asia/Shanghai", - "Asia/Singapore", - "Asia/Srednekolymsk", - "Asia/Taipei", - "Asia/Tashkent", - "Asia/Tbilisi", - "Asia/Tehran", - "Asia/Tokyo", - "Asia/Ulaanbaatar", - "Asia/Urumqi", - "Asia/Vladivostok", - "Asia/Yakutsk", - "Asia/Yekaterinburg", - "Asia/Yerevan", - "Astana", - "Asuncion", - "Athens", - "Atlantic Time (Canada)", - "Atlantic/Azores", - "Atlantic/Cape_Verde", - "Atlantic/South_Georgia", - "Auckland", - "Australia/Adelaide", - "Australia/Brisbane", - "Australia/Canberra", - "Australia/Darwin", - "Australia/Eucla", - "Australia/Hobart", - "Australia/LHI", - "Australia/Lord_Howe", - "Australia/Melbourne", - "Australia/Perth", - "Australia/Sydney", - "Azores", - "Baghdad", - "Baku", - "Bangkok", - "Beijing", - "Belgrade", - "Berlin", - "Bern", - "Bogota", - "Brasilia", - "Bratislava", - "Brisbane", - "Brussels", - "Bucharest", - "Budapest", - "Buenos Aires", - "Cairo", - "Canada/Pacific", - "Canberra", - "Cape Verde Is.", - "Caracas", - "Casablanca", - "Central America", - "Central Time (US & Canada)", - "Chatham Is.", - "Chennai", - "Chihuahua", - "Chile/EasterIsland", - "Chongqing", - "Copenhagen", - "Darwin", - "Dhaka", - "Dublin", - "Eastern Time (US & Canada)", - "Edinburgh", - "Ekaterinburg", - "Etc/GMT+12", - "Etc/UTC", - "Europe/Amsterdam", - "Europe/Athens", - "Europe/Belgrade", - "Europe/Berlin", - "Europe/Bratislava", - "Europe/Brussels", - "Europe/Bucharest", - "Europe/Budapest", - "Europe/Copenhagen", - "Europe/Dublin", - "Europe/Helsinki", - "Europe/Istanbul", - "Europe/Kaliningrad", - "Europe/Kiev", - "Europe/Lisbon", - "Europe/Ljubljana", - "Europe/London", - "Europe/Madrid", - "Europe/Minsk", - "Europe/Moscow", - "Europe/Paris", - "Europe/Prague", - "Europe/Riga", - "Europe/Rome", - "Europe/Samara", - "Europe/Sarajevo", - "Europe/Skopje", - "Europe/Sofia", - "Europe/Stockholm", - "Europe/Tallinn", - "Europe/Vienna", - "Europe/Vilnius", - "Europe/Volgograd", - "Europe/Warsaw", - "Europe/Zagreb", - "Europe/Zurich", - "Fiji", - "Georgetown", - "Greenland", - "Guadalajara", - "Guam", - "Hanoi", - "Harare", - "Hawaii", - "Helsinki", - "Hobart", - "Hong Kong", - "Indiana (East)", - "International Date Line West", - "Irkutsk", - "Islamabad", - "Istanbul", - "Jakarta", - "Jerusalem", - "Kabul", - "Kaliningrad", - "Kamchatka", - "Karachi", - "Kathmandu", - "Kolkata", - "Krasnoyarsk", - "Kuala Lumpur", - "Kuwait", - "Kyiv", - "La Paz", - "Lima", - "Lisbon", - "Ljubljana", - "London", - "Madrid", - "Magadan", - "Marshall Is.", - "Mazatlan", - "Melbourne", - "Mexico City", - "Mid-Atlantic", - "Midway Island", - "Minsk", - "Monrovia", - "Monterrey", - "Montevideo", - "Moscow", - "Mountain Time (US & Canada)", - "Mumbai", - "Muscat", - "Nairobi", - "New Caledonia", - "New Delhi", - "Newfoundland", - "Novosibirsk", - "Nuku'alofa", - "Osaka", - "Pacific Time (US & Canada)", - "Pacific/Apia", - "Pacific/Auckland", - "Pacific/Chatham", - "Pacific/Easter", - "Pacific/Fakaofo", - "Pacific/Fiji", - "Pacific/Gambier", - "Pacific/Guadalcanal", - "Pacific/Guam", - "Pacific/Honolulu", - "Pacific/Kiritimati", - "Pacific/Majuro", - "Pacific/Marquesas", - "Pacific/Midway", - "Pacific/Norfolk", - "Pacific/Noumea", - "Pacific/Pago_Pago", - "Pacific/Pitcairn", - "Pacific/Port_Moresby", - "Pacific/Tongatapu", - "Paris", - "Perth", - "Port Moresby", - "Prague", - "Pretoria", - "Puerto Rico", - "Quito", - "Rangoon", - "Riga", - "Riyadh", - "Rome", - "Samara", - "Samoa", - "Santiago", - "Sapporo", - "Sarajevo", - "Saskatchewan", - "Seoul", - "Singapore", - "Skopje", - "Sofia", - "Solomon Is.", - "Srednekolymsk", - "Sri Jayawardenepura", - "St. Petersburg", - "Stockholm", - "Sydney", - "Taipei", - "Tallinn", - "Tashkent", - "Tbilisi", - "Tehran", - "Tijuana", - "Tokelau Is.", - "Tokyo", - "Ulaanbaatar", - "Urumqi", - "US/Aleutian", - "UTC", - "Vienna", - "Vilnius", - "Vladivostok", - "Volgograd", - "Warsaw", - "Wellington", - "West Central Africa", - "Yakutsk", - "Yerevan", - "Zagreb", - "Zurich", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_5_time_zone( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeZone | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_5_TIME_ZONE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType8Type5TimeZone, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_5_TIME_ZONE_VALUES!r}" - ) 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 deleted file mode 100644 index de81d342..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_6.py +++ /dev/null @@ -1,90 +0,0 @@ -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.update_escalation_policy_path_data_attributes_rules_item_type_8_type_6_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6Operator, - check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_6_operator, -) -from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_6_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_6_rule_type, -) - -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6") - - -@_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6: - """ - Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6RuleType): The type of the escalation path - rule - operator (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6Operator): How the alert source should be - matched - values (list[str]): Alert source values to match against (e.g., manual, datadog) - """ - - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6RuleType - operator: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6Operator - values: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - operator: str = self.operator - - values = self.values - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "operator": operator, - "values": values, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_6_rule_type( - d.pop("rule_type") - ) - - operator = check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_6_operator( - d.pop("operator") - ) - - values = cast(list[str], d.pop("values")) - - update_escalation_policy_path_data_attributes_rules_item_type_8_type_6 = cls( - rule_type=rule_type, - operator=operator, - values=values, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_8_type_6.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_8_type_6 - - @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_escalation_policy_path_data_attributes_rules_item_type_8_type_6_operator.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_6_operator.py deleted file mode 100644 index 4e4b0282..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_6_operator.py +++ /dev/null @@ -1,26 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6Operator = Literal[ - "is", "is_not", "is_not_one_of", "is_one_of" -] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_6_OPERATOR_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6Operator -] = { - "is", - "is_not", - "is_not_one_of", - "is_one_of", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_6_operator( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6Operator | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_6_OPERATOR_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_6_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_6_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_6_rule_type.py deleted file mode 100644 index 404f4bbe..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_6_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6RuleType = Literal["source"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_6_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6RuleType -] = { - "source", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_6_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_6_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType8Type6RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_6_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 9d4a69b4..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_7.py +++ /dev/null @@ -1,82 +0,0 @@ -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.update_escalation_policy_path_data_attributes_rules_item_type_8_type_7_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7Operator, - check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_7_operator, -) -from ..models.update_escalation_policy_path_data_attributes_rules_item_type_8_type_7_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_7_rule_type, -) - -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7") - - -@_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7: - """ - Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7RuleType): The type of the escalation path - rule - operator (UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7Operator): Whether the alert must (or must - not) have related incidents - """ - - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7RuleType - operator: UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7Operator - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - operator: str = self.operator - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "operator": operator, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_7_rule_type( - d.pop("rule_type") - ) - - operator = check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_7_operator( - d.pop("operator") - ) - - update_escalation_policy_path_data_attributes_rules_item_type_8_type_7 = cls( - rule_type=rule_type, - operator=operator, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_8_type_7.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_8_type_7 - - @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_escalation_policy_path_data_attributes_rules_item_type_8_type_7_operator.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_7_operator.py deleted file mode 100644 index 01c28e7c..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_7_operator.py +++ /dev/null @@ -1,22 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7Operator = Literal["is_not_set", "is_set"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_7_OPERATOR_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7Operator -] = { - "is_not_set", - "is_set", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_7_operator( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7Operator | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_7_OPERATOR_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_7_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_7_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_7_rule_type.py deleted file mode 100644 index 84e3acde..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_8_type_7_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7RuleType = Literal["related_incidents"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_7_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7RuleType -] = { - "related_incidents", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_8_type_7_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_7_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType8Type7RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_8_TYPE_7_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 23817a6a..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_0.py +++ /dev/null @@ -1,75 +0,0 @@ -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.update_escalation_policy_path_data_attributes_rules_item_type_9_type_0_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_0_rule_type, -) - -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0") - - -@_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0: - """ - Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0RuleType): The type of the escalation path - rule - urgency_ids (list[str]): Alert urgency ids for which this escalation path should be used - """ - - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0RuleType - urgency_ids: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - urgency_ids = self.urgency_ids - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "urgency_ids": urgency_ids, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_0_rule_type( - d.pop("rule_type") - ) - - urgency_ids = cast(list[str], d.pop("urgency_ids")) - - update_escalation_policy_path_data_attributes_rules_item_type_9_type_0 = cls( - rule_type=rule_type, - urgency_ids=urgency_ids, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_9_type_0.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_9_type_0 - - @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_escalation_policy_path_data_attributes_rules_item_type_9_type_0_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_0_rule_type.py deleted file mode 100644 index 08916373..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_0_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0RuleType = Literal["alert_urgency"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_0_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0RuleType -] = { - "alert_urgency", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_0_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_0_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType9Type0RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_0_RULE_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_1_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_1_rule_type.py deleted file mode 100644 index ce787dbe..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_1_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1RuleType = Literal["working_hour"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_1_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1RuleType -] = { - "working_hour", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_1_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_1_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType9Type1RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_1_RULE_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2_operator.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2_operator.py deleted file mode 100644 index 0421cf9b..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2_operator.py +++ /dev/null @@ -1,49 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2Operator = Literal[ - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_not", - "is_not_one_of", - "is_not_set", - "is_one_of", - "is_set", - "matches", - "starts_with", -] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_2_OPERATOR_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2Operator -] = { - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_not", - "is_not_one_of", - "is_not_set", - "is_one_of", - "is_set", - "matches", - "starts_with", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_2_operator( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2Operator | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_2_OPERATOR_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_2_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2_rule_type.py deleted file mode 100644 index 0764370d..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_2_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2RuleType = Literal["json_path"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_2_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2RuleType -] = { - "json_path", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_2_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_2_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType9Type2RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_2_RULE_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3_operator.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3_operator.py deleted file mode 100644 index b5cb0f97..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3_operator.py +++ /dev/null @@ -1,49 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3Operator = Literal[ - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_empty", - "is_not", - "is_not_empty", - "is_not_one_of", - "is_one_of", - "matches", - "starts_with", -] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_3_OPERATOR_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3Operator -] = { - "contains", - "contains_key", - "does_not_contain", - "does_not_contain_key", - "does_not_match", - "does_not_start_with", - "is", - "is_empty", - "is_not", - "is_not_empty", - "is_not_one_of", - "is_one_of", - "matches", - "starts_with", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_3_operator( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3Operator | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_3_OPERATOR_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_3_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3_rule_type.py deleted file mode 100644 index 89acf824..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_3_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3RuleType = Literal["field"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_3_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3RuleType -] = { - "field", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_3_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_3_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType9Type3RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_3_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 0f5a8320..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_4.py +++ /dev/null @@ -1,75 +0,0 @@ -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.update_escalation_policy_path_data_attributes_rules_item_type_9_type_4_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_4_rule_type, -) - -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4") - - -@_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4: - """ - Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4RuleType): The type of the escalation path - rule - service_ids (list[str]): Service ids for which this escalation path should be used - """ - - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4RuleType - service_ids: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - service_ids = self.service_ids - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "service_ids": service_ids, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_4_rule_type( - d.pop("rule_type") - ) - - service_ids = cast(list[str], d.pop("service_ids")) - - update_escalation_policy_path_data_attributes_rules_item_type_9_type_4 = cls( - rule_type=rule_type, - service_ids=service_ids, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_9_type_4.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_9_type_4 - - @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_escalation_policy_path_data_attributes_rules_item_type_9_type_4_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_4_rule_type.py deleted file mode 100644 index 56647954..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_4_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4RuleType = Literal["service"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_4_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4RuleType -] = { - "service", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_4_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_4_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType9Type4RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_4_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index ffdf6426..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5.py +++ /dev/null @@ -1,111 +0,0 @@ -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_escalation_policy_path_data_attributes_rules_item_type_9_type_5_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_rule_type, -) -from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_zone import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeZone, - check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_zone, -) - -if TYPE_CHECKING: - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_item import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem, - ) - - -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5") - - -@_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5: - """ - Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5RuleType): The type of the escalation path - rule - time_zone (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeZone): Time zone for the deferral - window - time_blocks (list['UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem']): Time windows - during which alerts are deferred - """ - - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5RuleType - time_zone: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeZone - 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 - - time_blocks = [] - for time_blocks_item_data in self.time_blocks: - time_blocks_item = time_blocks_item_data.to_dict() - time_blocks.append(time_blocks_item) - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "time_zone": time_zone, - "time_blocks": time_blocks, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_item import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem, - ) - - d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_rule_type( - d.pop("rule_type") - ) - - time_zone = check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_zone( - d.pop("time_zone") - ) - - time_blocks = [] - _time_blocks = d.pop("time_blocks") - for time_blocks_item_data in _time_blocks: - time_blocks_item = UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem.from_dict( - time_blocks_item_data - ) - - time_blocks.append(time_blocks_item) - - update_escalation_policy_path_data_attributes_rules_item_type_9_type_5 = cls( - rule_type=rule_type, - time_zone=time_zone, - time_blocks=time_blocks, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_9_type_5.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_9_type_5 - - @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_escalation_policy_path_data_attributes_rules_item_type_9_type_5_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_rule_type.py deleted file mode 100644 index fda6f2e2..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5RuleType = Literal["deferral_window"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_5_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5RuleType -] = { - "deferral_window", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_5_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_5_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index 615fb586..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_item.py +++ /dev/null @@ -1,160 +0,0 @@ -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="UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem") - - -@_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeBlocksItem: - """ - Attributes: - 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: 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]: - monday = self.monday - - tuesday = self.tuesday - - wednesday = self.wednesday - - thursday = self.thursday - - friday = self.friday - - saturday = self.saturday - - sunday = self.sunday - - start_time = self.start_time - - end_time = self.end_time - - all_day = self.all_day - - position: None | Unset | int - if isinstance(self.position, Unset): - position = UNSET - else: - position = self.position - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update({}) - if monday is not UNSET: - field_dict["monday"] = monday - if tuesday is not UNSET: - field_dict["tuesday"] = tuesday - if wednesday is not UNSET: - field_dict["wednesday"] = wednesday - if thursday is not UNSET: - field_dict["thursday"] = thursday - if friday is not UNSET: - field_dict["friday"] = friday - if saturday is not UNSET: - field_dict["saturday"] = saturday - if sunday is not UNSET: - field_dict["sunday"] = sunday - if start_time is not UNSET: - field_dict["start_time"] = start_time - if end_time is not UNSET: - field_dict["end_time"] = end_time - if all_day is not UNSET: - field_dict["all_day"] = all_day - 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) - monday = d.pop("monday", UNSET) - - tuesday = d.pop("tuesday", UNSET) - - wednesday = d.pop("wednesday", UNSET) - - thursday = d.pop("thursday", UNSET) - - friday = d.pop("friday", UNSET) - - saturday = d.pop("saturday", UNSET) - - sunday = d.pop("sunday", UNSET) - - start_time = d.pop("start_time", UNSET) - - end_time = d.pop("end_time", UNSET) - - all_day = d.pop("all_day", 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)) - - update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_item = cls( - monday=monday, - tuesday=tuesday, - wednesday=wednesday, - thursday=thursday, - friday=friday, - saturday=saturday, - sunday=sunday, - start_time=start_time, - end_time=end_time, - all_day=all_day, - position=position, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_item.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_blocks_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_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_zone.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_zone.py deleted file mode 100644 index df6b5c1c..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_zone.py +++ /dev/null @@ -1,631 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeZone = Literal[ - "Abu Dhabi", - "Adelaide", - "Africa/Algiers", - "Africa/Cairo", - "Africa/Casablanca", - "Africa/Harare", - "Africa/Johannesburg", - "Africa/Monrovia", - "Africa/Nairobi", - "Alaska", - "Almaty", - "America/Adak", - "America/Argentina/Buenos_Aires", - "America/Asuncion", - "America/Atka", - "America/Bogota", - "America/Caracas", - "America/Chicago", - "America/Chihuahua", - "America/Denver", - "America/Guatemala", - "America/Guyana", - "America/Halifax", - "America/Indiana/Indianapolis", - "America/Juneau", - "America/La_Paz", - "America/Lima", - "America/Los_Angeles", - "America/Mazatlan", - "America/Mexico_City", - "America/Miquelon", - "America/Monterrey", - "America/Montevideo", - "America/New_York", - "America/Nuuk", - "America/Phoenix", - "America/Puerto_Rico", - "America/Regina", - "America/Santiago", - "America/Sao_Paulo", - "America/St_Johns", - "America/Tijuana", - "America/Vancouver", - "American Samoa", - "Amsterdam", - "Arizona", - "Asia/Almaty", - "Asia/Baghdad", - "Asia/Baku", - "Asia/Bangkok", - "Asia/Chongqing", - "Asia/Colombo", - "Asia/Dhaka", - "Asia/Hong_Kong", - "Asia/Irkutsk", - "Asia/Jakarta", - "Asia/Jerusalem", - "Asia/Kabul", - "Asia/Kamchatka", - "Asia/Karachi", - "Asia/Kathmandu", - "Asia/Kolkata", - "Asia/Krasnoyarsk", - "Asia/Kuala_Lumpur", - "Asia/Kuwait", - "Asia/Magadan", - "Asia/Muscat", - "Asia/Novosibirsk", - "Asia/Rangoon", - "Asia/Riyadh", - "Asia/Seoul", - "Asia/Shanghai", - "Asia/Singapore", - "Asia/Srednekolymsk", - "Asia/Taipei", - "Asia/Tashkent", - "Asia/Tbilisi", - "Asia/Tehran", - "Asia/Tokyo", - "Asia/Ulaanbaatar", - "Asia/Urumqi", - "Asia/Vladivostok", - "Asia/Yakutsk", - "Asia/Yekaterinburg", - "Asia/Yerevan", - "Astana", - "Asuncion", - "Athens", - "Atlantic Time (Canada)", - "Atlantic/Azores", - "Atlantic/Cape_Verde", - "Atlantic/South_Georgia", - "Auckland", - "Australia/Adelaide", - "Australia/Brisbane", - "Australia/Canberra", - "Australia/Darwin", - "Australia/Eucla", - "Australia/Hobart", - "Australia/LHI", - "Australia/Lord_Howe", - "Australia/Melbourne", - "Australia/Perth", - "Australia/Sydney", - "Azores", - "Baghdad", - "Baku", - "Bangkok", - "Beijing", - "Belgrade", - "Berlin", - "Bern", - "Bogota", - "Brasilia", - "Bratislava", - "Brisbane", - "Brussels", - "Bucharest", - "Budapest", - "Buenos Aires", - "Cairo", - "Canada/Pacific", - "Canberra", - "Cape Verde Is.", - "Caracas", - "Casablanca", - "Central America", - "Central Time (US & Canada)", - "Chatham Is.", - "Chennai", - "Chihuahua", - "Chile/EasterIsland", - "Chongqing", - "Copenhagen", - "Darwin", - "Dhaka", - "Dublin", - "Eastern Time (US & Canada)", - "Edinburgh", - "Ekaterinburg", - "Etc/GMT+12", - "Etc/UTC", - "Europe/Amsterdam", - "Europe/Athens", - "Europe/Belgrade", - "Europe/Berlin", - "Europe/Bratislava", - "Europe/Brussels", - "Europe/Bucharest", - "Europe/Budapest", - "Europe/Copenhagen", - "Europe/Dublin", - "Europe/Helsinki", - "Europe/Istanbul", - "Europe/Kaliningrad", - "Europe/Kiev", - "Europe/Lisbon", - "Europe/Ljubljana", - "Europe/London", - "Europe/Madrid", - "Europe/Minsk", - "Europe/Moscow", - "Europe/Paris", - "Europe/Prague", - "Europe/Riga", - "Europe/Rome", - "Europe/Samara", - "Europe/Sarajevo", - "Europe/Skopje", - "Europe/Sofia", - "Europe/Stockholm", - "Europe/Tallinn", - "Europe/Vienna", - "Europe/Vilnius", - "Europe/Volgograd", - "Europe/Warsaw", - "Europe/Zagreb", - "Europe/Zurich", - "Fiji", - "Georgetown", - "Greenland", - "Guadalajara", - "Guam", - "Hanoi", - "Harare", - "Hawaii", - "Helsinki", - "Hobart", - "Hong Kong", - "Indiana (East)", - "International Date Line West", - "Irkutsk", - "Islamabad", - "Istanbul", - "Jakarta", - "Jerusalem", - "Kabul", - "Kaliningrad", - "Kamchatka", - "Karachi", - "Kathmandu", - "Kolkata", - "Krasnoyarsk", - "Kuala Lumpur", - "Kuwait", - "Kyiv", - "La Paz", - "Lima", - "Lisbon", - "Ljubljana", - "London", - "Madrid", - "Magadan", - "Marshall Is.", - "Mazatlan", - "Melbourne", - "Mexico City", - "Mid-Atlantic", - "Midway Island", - "Minsk", - "Monrovia", - "Monterrey", - "Montevideo", - "Moscow", - "Mountain Time (US & Canada)", - "Mumbai", - "Muscat", - "Nairobi", - "New Caledonia", - "New Delhi", - "Newfoundland", - "Novosibirsk", - "Nuku'alofa", - "Osaka", - "Pacific Time (US & Canada)", - "Pacific/Apia", - "Pacific/Auckland", - "Pacific/Chatham", - "Pacific/Easter", - "Pacific/Fakaofo", - "Pacific/Fiji", - "Pacific/Gambier", - "Pacific/Guadalcanal", - "Pacific/Guam", - "Pacific/Honolulu", - "Pacific/Kiritimati", - "Pacific/Majuro", - "Pacific/Marquesas", - "Pacific/Midway", - "Pacific/Norfolk", - "Pacific/Noumea", - "Pacific/Pago_Pago", - "Pacific/Pitcairn", - "Pacific/Port_Moresby", - "Pacific/Tongatapu", - "Paris", - "Perth", - "Port Moresby", - "Prague", - "Pretoria", - "Puerto Rico", - "Quito", - "Rangoon", - "Riga", - "Riyadh", - "Rome", - "Samara", - "Samoa", - "Santiago", - "Sapporo", - "Sarajevo", - "Saskatchewan", - "Seoul", - "Singapore", - "Skopje", - "Sofia", - "Solomon Is.", - "Srednekolymsk", - "Sri Jayawardenepura", - "St. Petersburg", - "Stockholm", - "Sydney", - "Taipei", - "Tallinn", - "Tashkent", - "Tbilisi", - "Tehran", - "Tijuana", - "Tokelau Is.", - "Tokyo", - "Ulaanbaatar", - "Urumqi", - "US/Aleutian", - "UTC", - "Vienna", - "Vilnius", - "Vladivostok", - "Volgograd", - "Warsaw", - "Wellington", - "West Central Africa", - "Yakutsk", - "Yerevan", - "Zagreb", - "Zurich", -] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_5_TIME_ZONE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeZone -] = { - "Abu Dhabi", - "Adelaide", - "Africa/Algiers", - "Africa/Cairo", - "Africa/Casablanca", - "Africa/Harare", - "Africa/Johannesburg", - "Africa/Monrovia", - "Africa/Nairobi", - "Alaska", - "Almaty", - "America/Adak", - "America/Argentina/Buenos_Aires", - "America/Asuncion", - "America/Atka", - "America/Bogota", - "America/Caracas", - "America/Chicago", - "America/Chihuahua", - "America/Denver", - "America/Guatemala", - "America/Guyana", - "America/Halifax", - "America/Indiana/Indianapolis", - "America/Juneau", - "America/La_Paz", - "America/Lima", - "America/Los_Angeles", - "America/Mazatlan", - "America/Mexico_City", - "America/Miquelon", - "America/Monterrey", - "America/Montevideo", - "America/New_York", - "America/Nuuk", - "America/Phoenix", - "America/Puerto_Rico", - "America/Regina", - "America/Santiago", - "America/Sao_Paulo", - "America/St_Johns", - "America/Tijuana", - "America/Vancouver", - "American Samoa", - "Amsterdam", - "Arizona", - "Asia/Almaty", - "Asia/Baghdad", - "Asia/Baku", - "Asia/Bangkok", - "Asia/Chongqing", - "Asia/Colombo", - "Asia/Dhaka", - "Asia/Hong_Kong", - "Asia/Irkutsk", - "Asia/Jakarta", - "Asia/Jerusalem", - "Asia/Kabul", - "Asia/Kamchatka", - "Asia/Karachi", - "Asia/Kathmandu", - "Asia/Kolkata", - "Asia/Krasnoyarsk", - "Asia/Kuala_Lumpur", - "Asia/Kuwait", - "Asia/Magadan", - "Asia/Muscat", - "Asia/Novosibirsk", - "Asia/Rangoon", - "Asia/Riyadh", - "Asia/Seoul", - "Asia/Shanghai", - "Asia/Singapore", - "Asia/Srednekolymsk", - "Asia/Taipei", - "Asia/Tashkent", - "Asia/Tbilisi", - "Asia/Tehran", - "Asia/Tokyo", - "Asia/Ulaanbaatar", - "Asia/Urumqi", - "Asia/Vladivostok", - "Asia/Yakutsk", - "Asia/Yekaterinburg", - "Asia/Yerevan", - "Astana", - "Asuncion", - "Athens", - "Atlantic Time (Canada)", - "Atlantic/Azores", - "Atlantic/Cape_Verde", - "Atlantic/South_Georgia", - "Auckland", - "Australia/Adelaide", - "Australia/Brisbane", - "Australia/Canberra", - "Australia/Darwin", - "Australia/Eucla", - "Australia/Hobart", - "Australia/LHI", - "Australia/Lord_Howe", - "Australia/Melbourne", - "Australia/Perth", - "Australia/Sydney", - "Azores", - "Baghdad", - "Baku", - "Bangkok", - "Beijing", - "Belgrade", - "Berlin", - "Bern", - "Bogota", - "Brasilia", - "Bratislava", - "Brisbane", - "Brussels", - "Bucharest", - "Budapest", - "Buenos Aires", - "Cairo", - "Canada/Pacific", - "Canberra", - "Cape Verde Is.", - "Caracas", - "Casablanca", - "Central America", - "Central Time (US & Canada)", - "Chatham Is.", - "Chennai", - "Chihuahua", - "Chile/EasterIsland", - "Chongqing", - "Copenhagen", - "Darwin", - "Dhaka", - "Dublin", - "Eastern Time (US & Canada)", - "Edinburgh", - "Ekaterinburg", - "Etc/GMT+12", - "Etc/UTC", - "Europe/Amsterdam", - "Europe/Athens", - "Europe/Belgrade", - "Europe/Berlin", - "Europe/Bratislava", - "Europe/Brussels", - "Europe/Bucharest", - "Europe/Budapest", - "Europe/Copenhagen", - "Europe/Dublin", - "Europe/Helsinki", - "Europe/Istanbul", - "Europe/Kaliningrad", - "Europe/Kiev", - "Europe/Lisbon", - "Europe/Ljubljana", - "Europe/London", - "Europe/Madrid", - "Europe/Minsk", - "Europe/Moscow", - "Europe/Paris", - "Europe/Prague", - "Europe/Riga", - "Europe/Rome", - "Europe/Samara", - "Europe/Sarajevo", - "Europe/Skopje", - "Europe/Sofia", - "Europe/Stockholm", - "Europe/Tallinn", - "Europe/Vienna", - "Europe/Vilnius", - "Europe/Volgograd", - "Europe/Warsaw", - "Europe/Zagreb", - "Europe/Zurich", - "Fiji", - "Georgetown", - "Greenland", - "Guadalajara", - "Guam", - "Hanoi", - "Harare", - "Hawaii", - "Helsinki", - "Hobart", - "Hong Kong", - "Indiana (East)", - "International Date Line West", - "Irkutsk", - "Islamabad", - "Istanbul", - "Jakarta", - "Jerusalem", - "Kabul", - "Kaliningrad", - "Kamchatka", - "Karachi", - "Kathmandu", - "Kolkata", - "Krasnoyarsk", - "Kuala Lumpur", - "Kuwait", - "Kyiv", - "La Paz", - "Lima", - "Lisbon", - "Ljubljana", - "London", - "Madrid", - "Magadan", - "Marshall Is.", - "Mazatlan", - "Melbourne", - "Mexico City", - "Mid-Atlantic", - "Midway Island", - "Minsk", - "Monrovia", - "Monterrey", - "Montevideo", - "Moscow", - "Mountain Time (US & Canada)", - "Mumbai", - "Muscat", - "Nairobi", - "New Caledonia", - "New Delhi", - "Newfoundland", - "Novosibirsk", - "Nuku'alofa", - "Osaka", - "Pacific Time (US & Canada)", - "Pacific/Apia", - "Pacific/Auckland", - "Pacific/Chatham", - "Pacific/Easter", - "Pacific/Fakaofo", - "Pacific/Fiji", - "Pacific/Gambier", - "Pacific/Guadalcanal", - "Pacific/Guam", - "Pacific/Honolulu", - "Pacific/Kiritimati", - "Pacific/Majuro", - "Pacific/Marquesas", - "Pacific/Midway", - "Pacific/Norfolk", - "Pacific/Noumea", - "Pacific/Pago_Pago", - "Pacific/Pitcairn", - "Pacific/Port_Moresby", - "Pacific/Tongatapu", - "Paris", - "Perth", - "Port Moresby", - "Prague", - "Pretoria", - "Puerto Rico", - "Quito", - "Rangoon", - "Riga", - "Riyadh", - "Rome", - "Samara", - "Samoa", - "Santiago", - "Sapporo", - "Sarajevo", - "Saskatchewan", - "Seoul", - "Singapore", - "Skopje", - "Sofia", - "Solomon Is.", - "Srednekolymsk", - "Sri Jayawardenepura", - "St. Petersburg", - "Stockholm", - "Sydney", - "Taipei", - "Tallinn", - "Tashkent", - "Tbilisi", - "Tehran", - "Tijuana", - "Tokelau Is.", - "Tokyo", - "Ulaanbaatar", - "Urumqi", - "US/Aleutian", - "UTC", - "Vienna", - "Vilnius", - "Vladivostok", - "Volgograd", - "Warsaw", - "Wellington", - "West Central Africa", - "Yakutsk", - "Yerevan", - "Zagreb", - "Zurich", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_5_time_zone( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeZone | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_5_TIME_ZONE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType9Type5TimeZone, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_5_TIME_ZONE_VALUES!r}" - ) 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 deleted file mode 100644 index 8e63d912..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_6.py +++ /dev/null @@ -1,90 +0,0 @@ -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.update_escalation_policy_path_data_attributes_rules_item_type_9_type_6_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6Operator, - check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_6_operator, -) -from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_6_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_6_rule_type, -) - -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6") - - -@_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6: - """ - Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6RuleType): The type of the escalation path - rule - operator (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6Operator): How the alert source should be - matched - values (list[str]): Alert source values to match against (e.g., manual, datadog) - """ - - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6RuleType - operator: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6Operator - values: list[str] - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - operator: str = self.operator - - values = self.values - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "operator": operator, - "values": values, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_6_rule_type( - d.pop("rule_type") - ) - - operator = check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_6_operator( - d.pop("operator") - ) - - values = cast(list[str], d.pop("values")) - - update_escalation_policy_path_data_attributes_rules_item_type_9_type_6 = cls( - rule_type=rule_type, - operator=operator, - values=values, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_9_type_6.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_9_type_6 - - @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_escalation_policy_path_data_attributes_rules_item_type_9_type_6_operator.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_6_operator.py deleted file mode 100644 index ea7e5971..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_6_operator.py +++ /dev/null @@ -1,26 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6Operator = Literal[ - "is", "is_not", "is_not_one_of", "is_one_of" -] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_6_OPERATOR_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6Operator -] = { - "is", - "is_not", - "is_not_one_of", - "is_one_of", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_6_operator( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6Operator | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_6_OPERATOR_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_6_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_6_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_6_rule_type.py deleted file mode 100644 index fcf6bdc3..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_6_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6RuleType = Literal["source"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_6_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6RuleType -] = { - "source", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_6_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_6_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType9Type6RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_6_RULE_TYPE_VALUES!r}" - ) 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 deleted file mode 100644 index b45ee2eb..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_7.py +++ /dev/null @@ -1,82 +0,0 @@ -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.update_escalation_policy_path_data_attributes_rules_item_type_9_type_7_operator import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7Operator, - check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_7_operator, -) -from ..models.update_escalation_policy_path_data_attributes_rules_item_type_9_type_7_rule_type import ( - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7RuleType, - check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_7_rule_type, -) - -T = TypeVar("T", bound="UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7") - - -@_attrs_define -class UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7: - """ - Attributes: - rule_type (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7RuleType): The type of the escalation path - rule - operator (UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7Operator): Whether the alert must (or must - not) have related incidents - """ - - rule_type: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7RuleType - operator: UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7Operator - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) - - def to_dict(self) -> dict[str, Any]: - rule_type: str = self.rule_type - - operator: str = self.operator - - field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) - field_dict.update( - { - "rule_type": rule_type, - "operator": operator, - } - ) - - return field_dict - - @classmethod - def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: - d = dict(src_dict) - rule_type = check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_7_rule_type( - d.pop("rule_type") - ) - - operator = check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_7_operator( - d.pop("operator") - ) - - update_escalation_policy_path_data_attributes_rules_item_type_9_type_7 = cls( - rule_type=rule_type, - operator=operator, - ) - - update_escalation_policy_path_data_attributes_rules_item_type_9_type_7.additional_properties = d - return update_escalation_policy_path_data_attributes_rules_item_type_9_type_7 - - @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_escalation_policy_path_data_attributes_rules_item_type_9_type_7_operator.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_7_operator.py deleted file mode 100644 index 285dd52f..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_7_operator.py +++ /dev/null @@ -1,22 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7Operator = Literal["is_not_set", "is_set"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_7_OPERATOR_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7Operator -] = { - "is_not_set", - "is_set", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_7_operator( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7Operator | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_7_OPERATOR_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7Operator, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_7_OPERATOR_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_7_rule_type.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_7_rule_type.py deleted file mode 100644 index 042dcc4b..00000000 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_rules_item_type_9_type_7_rule_type.py +++ /dev/null @@ -1,21 +0,0 @@ -from typing import Literal, cast - -UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7RuleType = Literal["related_incidents"] - -UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_7_RULE_TYPE_VALUES: set[ - UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7RuleType -] = { - "related_incidents", -} - - -def check_update_escalation_policy_path_data_attributes_rules_item_type_9_type_7_rule_type( - value: str | None, -) -> UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7RuleType | None: - if value is None: - return None - if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_7_RULE_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesRulesItemType9Type7RuleType, value) - raise TypeError( - f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_RULES_ITEM_TYPE_9_TYPE_7_RULE_TYPE_VALUES!r}" - ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restriction_time_zone.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restriction_time_zone.py index c33abf02..ec402718 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restriction_time_zone.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restriction_time_zone.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone = Literal[ "Abu Dhabi", @@ -84,6 +84,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -157,6 +158,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -394,6 +396,7 @@ "Asia/Urumqi", "Asia/Vladivostok", "Asia/Yakutsk", + "Asia/Yangon", "Asia/Yekaterinburg", "Asia/Yerevan", "Astana", @@ -467,6 +470,7 @@ "Europe/Istanbul", "Europe/Kaliningrad", "Europe/Kiev", + "Europe/Kyiv", "Europe/Lisbon", "Europe/Ljubljana", "Europe/London", @@ -625,7 +629,7 @@ def check_update_escalation_policy_path_data_attributes_time_restriction_time_zo if value is None: return None if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_TIME_RESTRICTION_TIME_ZONE_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesTimeRestrictionTimeZone, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_TIME_RESTRICTION_TIME_ZONE_VALUES!r}" ) 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 e729e6f7..8b7b3396 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,8 +1,9 @@ +from __future__ import annotations + 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.update_escalation_policy_path_data_attributes_time_restrictions_item_end_day import ( UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay, @@ -21,33 +22,32 @@ class UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItem: """ Attributes: - 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): + start_time (str | Unset): Formatted as HH:MM + end_day (UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay | Unset): + end_time (str | Unset): Formatted as HH:MM """ - 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) + start_day: UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay | Unset = UNSET + start_time: str | Unset = UNSET + end_day: UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay | Unset = UNSET + end_time: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: - start_day: Unset | str = UNSET + start_day: str | Unset = UNSET if not isinstance(self.start_day, Unset): start_day = self.start_day start_time = self.start_time - end_day: Unset | str = UNSET + end_day: str | Unset = UNSET if not isinstance(self.end_day, Unset): end_day = self.end_day end_time = self.end_time field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if start_day is not UNSET: field_dict["start_day"] = start_day @@ -64,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: Unset | UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay + start_day: UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay | Unset if isinstance(_start_day, Unset): start_day = UNSET else: @@ -73,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: Unset | UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay + end_day: UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay | Unset if isinstance(_end_day, Unset): end_day = UNSET else: @@ -88,21 +88,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: end_time=end_time, ) - update_escalation_policy_path_data_attributes_time_restrictions_item.additional_properties = d return update_escalation_policy_path_data_attributes_time_restrictions_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_escalation_policy_path_data_attributes_time_restrictions_item_end_day.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item_end_day.py index a65e45d5..b43649a3 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item_end_day.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item_end_day.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay = Literal[ "friday", "monday", "saturday", "sunday", "thursday", "tuesday", "wednesday" @@ -23,7 +23,7 @@ def check_update_escalation_policy_path_data_attributes_time_restrictions_item_e if value is None: return None if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_TIME_RESTRICTIONS_ITEM_END_DAY_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemEndDay, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_TIME_RESTRICTIONS_ITEM_END_DAY_VALUES!r}" ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item_start_day.py b/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item_start_day.py index 43a2c64c..0b0e9d37 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item_start_day.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_attributes_time_restrictions_item_start_day.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay = Literal[ "friday", "monday", "saturday", "sunday", "thursday", "tuesday", "wednesday" @@ -23,7 +23,7 @@ def check_update_escalation_policy_path_data_attributes_time_restrictions_item_s if value is None: return None if value in UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_TIME_RESTRICTIONS_ITEM_START_DAY_VALUES: - return cast(UpdateEscalationPolicyPathDataAttributesTimeRestrictionsItemStartDay, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_ATTRIBUTES_TIME_RESTRICTIONS_ITEM_START_DAY_VALUES!r}" ) diff --git a/rootly_sdk/models/update_escalation_policy_path_data_type.py b/rootly_sdk/models/update_escalation_policy_path_data_type.py index 7b64d9c4..9b656ef9 100644 --- a/rootly_sdk/models/update_escalation_policy_path_data_type.py +++ b/rootly_sdk/models/update_escalation_policy_path_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateEscalationPolicyPathDataType = Literal["escalation_paths"] @@ -11,5 +11,5 @@ def check_update_escalation_policy_path_data_type(value: str | None) -> UpdateEs if value is None: return None if value in UPDATE_ESCALATION_POLICY_PATH_DATA_TYPE_VALUES: - return cast(UpdateEscalationPolicyPathDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ESCALATION_POLICY_PATH_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_form_field.py b/rootly_sdk/models/update_form_field.py index 0d06144e..6dc4676e 100644 --- a/rootly_sdk/models/update_form_field.py +++ b/rootly_sdk/models/update_form_field.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_form_field_data import UpdateFormFieldData @@ -18,14 +19,13 @@ class UpdateFormField: data (UpdateFormFieldData): """ - data: "UpdateFormFieldData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateFormFieldData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_form_field.additional_properties = d return update_form_field - - @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_form_field_data.py b/rootly_sdk/models/update_form_field_data.py index e404f75d..9ac449d9 100644 --- a/rootly_sdk/models/update_form_field_data.py +++ b/rootly_sdk/models/update_form_field_data.py @@ -1,10 +1,12 @@ +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_form_field_data_type import UpdateFormFieldDataType, check_update_form_field_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_form_field_data_attributes import UpdateFormFieldDataAttributes @@ -19,25 +21,31 @@ class UpdateFormFieldData: Attributes: type_ (UpdateFormFieldDataType): attributes (UpdateFormFieldDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateFormFieldDataType - attributes: "UpdateFormFieldDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateFormFieldDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateFormFieldDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_form_field_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_form_field_data.additional_properties = d return update_form_field_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_form_field_data_attributes.py b/rootly_sdk/models/update_form_field_data_attributes.py index 055611ae..9dd008f3 100644 --- a/rootly_sdk/models/update_form_field_data_attributes.py +++ b/rootly_sdk/models/update_form_field_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -24,57 +26,57 @@ class UpdateFormFieldDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + 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 reference-kind catalog properties are supported. """ - 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 + slug: None | str | Unset = UNSET + 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 def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind - input_kind: Unset | str = UNSET + input_kind: str | Unset = UNSET if not isinstance(self.input_kind, Unset): input_kind = self.input_kind - value_kind: Unset | str = UNSET + value_kind: str | Unset = UNSET if not isinstance(self.value_kind, Unset): value_kind = self.value_kind - value_kind_catalog_id: None | Unset | str + value_kind_catalog_id: None | str | Unset if isinstance(self.value_kind_catalog_id, Unset): value_kind_catalog_id = UNSET else: @@ -82,17 +84,17 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - shown: Unset | list[str] = UNSET + shown: list[str] | Unset = UNSET if not isinstance(self.shown, Unset): shown = self.shown - required: Unset | list[str] = UNSET + required: list[str] | Unset = UNSET if not isinstance(self.required, Unset): required = self.required @@ -100,11 +102,11 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - default_values: Unset | list[str] = UNSET + default_values: list[str] | Unset = UNSET if not isinstance(self.default_values, Unset): default_values = self.default_values - auto_set_by_catalog_property_id: None | Unset | str + auto_set_by_catalog_property_id: None | str | Unset if isinstance(self.auto_set_by_catalog_property_id, Unset): auto_set_by_catalog_property_id = UNSET else: @@ -146,53 +148,53 @@ 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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) _kind = d.pop("kind", UNSET) - kind: Unset | UpdateFormFieldDataAttributesKind + kind: UpdateFormFieldDataAttributesKind | Unset 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: Unset | UpdateFormFieldDataAttributesInputKind + input_kind: UpdateFormFieldDataAttributesInputKind | Unset 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: Unset | UpdateFormFieldDataAttributesValueKind + value_kind: UpdateFormFieldDataAttributesValueKind | Unset 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 | Unset | str: + def _parse_value_kind_catalog_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) @@ -206,12 +208,12 @@ def _parse_description(data: object) -> None | Unset | str: default_values = cast(list[str], d.pop("default_values", UNSET)) - def _parse_auto_set_by_catalog_property_id(data: object) -> None | Unset | str: + def _parse_auto_set_by_catalog_property_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) auto_set_by_catalog_property_id = _parse_auto_set_by_catalog_property_id( d.pop("auto_set_by_catalog_property_id", UNSET) diff --git a/rootly_sdk/models/update_form_field_data_attributes_input_kind.py b/rootly_sdk/models/update_form_field_data_attributes_input_kind.py index 7a5a1d83..1344afab 100644 --- a/rootly_sdk/models/update_form_field_data_attributes_input_kind.py +++ b/rootly_sdk/models/update_form_field_data_attributes_input_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateFormFieldDataAttributesInputKind = Literal[ "checkbox", "date", "datetime", "multi_select", "number", "rich_text", "select", "tags", "text", "textarea" @@ -24,7 +24,7 @@ def check_update_form_field_data_attributes_input_kind( if value is None: return None if value in UPDATE_FORM_FIELD_DATA_ATTRIBUTES_INPUT_KIND_VALUES: - return cast(UpdateFormFieldDataAttributesInputKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_FORM_FIELD_DATA_ATTRIBUTES_INPUT_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/update_form_field_data_attributes_kind.py b/rootly_sdk/models/update_form_field_data_attributes_kind.py index ba40572f..97e3c680 100644 --- a/rootly_sdk/models/update_form_field_data_attributes_kind.py +++ b/rootly_sdk/models/update_form_field_data_attributes_kind.py @@ -1,8 +1,9 @@ -from typing import Literal, cast +from typing import Literal UpdateFormFieldDataAttributesKind = Literal[ "acknowledged_at", "attach_alerts", + "cancellation_message", "causes", "closed_at", "custom", @@ -37,6 +38,7 @@ UPDATE_FORM_FIELD_DATA_ATTRIBUTES_KIND_VALUES: set[UpdateFormFieldDataAttributesKind] = { "acknowledged_at", "attach_alerts", + "cancellation_message", "causes", "closed_at", "custom", @@ -73,5 +75,5 @@ def check_update_form_field_data_attributes_kind(value: str | None) -> UpdateFor if value is None: return None if value in UPDATE_FORM_FIELD_DATA_ATTRIBUTES_KIND_VALUES: - return cast(UpdateFormFieldDataAttributesKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_FORM_FIELD_DATA_ATTRIBUTES_KIND_VALUES!r}") diff --git a/rootly_sdk/models/update_form_field_data_attributes_value_kind.py b/rootly_sdk/models/update_form_field_data_attributes_value_kind.py index 03756870..e74edf95 100644 --- a/rootly_sdk/models/update_form_field_data_attributes_value_kind.py +++ b/rootly_sdk/models/update_form_field_data_attributes_value_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateFormFieldDataAttributesValueKind = Literal[ "catalog_entity", "cause", "environment", "functionality", "group", "incident_type", "inherit", "service", "user" @@ -23,7 +23,7 @@ def check_update_form_field_data_attributes_value_kind( if value is None: return None if value in UPDATE_FORM_FIELD_DATA_ATTRIBUTES_VALUE_KIND_VALUES: - return cast(UpdateFormFieldDataAttributesValueKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_FORM_FIELD_DATA_ATTRIBUTES_VALUE_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/update_form_field_data_type.py b/rootly_sdk/models/update_form_field_data_type.py index a5e92f21..188ad525 100644 --- a/rootly_sdk/models/update_form_field_data_type.py +++ b/rootly_sdk/models/update_form_field_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateFormFieldDataType = Literal["form_fields"] @@ -11,5 +11,5 @@ def check_update_form_field_data_type(value: str | None) -> UpdateFormFieldDataT if value is None: return None if value in UPDATE_FORM_FIELD_DATA_TYPE_VALUES: - return cast(UpdateFormFieldDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_FORM_FIELD_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_form_field_option.py b/rootly_sdk/models/update_form_field_option.py index 82cc645a..f73c0aed 100644 --- a/rootly_sdk/models/update_form_field_option.py +++ b/rootly_sdk/models/update_form_field_option.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_form_field_option_data import UpdateFormFieldOptionData @@ -18,14 +19,13 @@ class UpdateFormFieldOption: data (UpdateFormFieldOptionData): """ - data: "UpdateFormFieldOptionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateFormFieldOptionData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_form_field_option.additional_properties = d return update_form_field_option - - @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_form_field_option_data.py b/rootly_sdk/models/update_form_field_option_data.py index 648a9210..5a84c6b9 100644 --- a/rootly_sdk/models/update_form_field_option_data.py +++ b/rootly_sdk/models/update_form_field_option_data.py @@ -1,13 +1,15 @@ +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_form_field_option_data_type import ( UpdateFormFieldOptionDataType, check_update_form_field_option_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_form_field_option_data_attributes import UpdateFormFieldOptionDataAttributes @@ -22,25 +24,31 @@ class UpdateFormFieldOptionData: Attributes: type_ (UpdateFormFieldOptionDataType): attributes (UpdateFormFieldOptionDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateFormFieldOptionDataType - attributes: "UpdateFormFieldOptionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateFormFieldOptionDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateFormFieldOptionDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_form_field_option_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_form_field_option_data.additional_properties = d return update_form_field_option_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_form_field_option_data_attributes.py b/rootly_sdk/models/update_form_field_option_data_attributes.py index 592e45ed..884652f0 100644 --- a/rootly_sdk/models/update_form_field_option_data_attributes.py +++ b/rootly_sdk/models/update_form_field_option_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -12,16 +14,16 @@ class UpdateFormFieldOptionDataAttributes: """ Attributes: - 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): 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: Unset | str = UNSET - color: Unset | str = UNSET - default: Unset | bool = UNSET - position: Unset | int = UNSET + value: str | Unset = UNSET + color: str | Unset = UNSET + default: bool | Unset = UNSET + position: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: value = self.value diff --git a/rootly_sdk/models/update_form_field_option_data_type.py b/rootly_sdk/models/update_form_field_option_data_type.py index 739999ec..2c3bd88d 100644 --- a/rootly_sdk/models/update_form_field_option_data_type.py +++ b/rootly_sdk/models/update_form_field_option_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateFormFieldOptionDataType = Literal["form_field_options"] @@ -11,5 +11,5 @@ def check_update_form_field_option_data_type(value: str | None) -> UpdateFormFie if value is None: return None if value in UPDATE_FORM_FIELD_OPTION_DATA_TYPE_VALUES: - return cast(UpdateFormFieldOptionDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_FORM_FIELD_OPTION_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_form_field_placement.py b/rootly_sdk/models/update_form_field_placement.py index f9a2844c..79bd5980 100644 --- a/rootly_sdk/models/update_form_field_placement.py +++ b/rootly_sdk/models/update_form_field_placement.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_form_field_placement_data import UpdateFormFieldPlacementData @@ -18,14 +19,13 @@ class UpdateFormFieldPlacement: data (UpdateFormFieldPlacementData): """ - data: "UpdateFormFieldPlacementData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateFormFieldPlacementData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_form_field_placement.additional_properties = d return update_form_field_placement - - @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_form_field_placement_condition.py b/rootly_sdk/models/update_form_field_placement_condition.py index 3788132c..5fa95245 100644 --- a/rootly_sdk/models/update_form_field_placement_condition.py +++ b/rootly_sdk/models/update_form_field_placement_condition.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_form_field_placement_condition_data import UpdateFormFieldPlacementConditionData @@ -18,14 +19,13 @@ class UpdateFormFieldPlacementCondition: data (UpdateFormFieldPlacementConditionData): """ - data: "UpdateFormFieldPlacementConditionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateFormFieldPlacementConditionData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_form_field_placement_condition.additional_properties = d return update_form_field_placement_condition - - @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_form_field_placement_condition_data.py b/rootly_sdk/models/update_form_field_placement_condition_data.py index d01736b0..9bed1c43 100644 --- a/rootly_sdk/models/update_form_field_placement_condition_data.py +++ b/rootly_sdk/models/update_form_field_placement_condition_data.py @@ -1,13 +1,15 @@ +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_form_field_placement_condition_data_type import ( UpdateFormFieldPlacementConditionDataType, check_update_form_field_placement_condition_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_form_field_placement_condition_data_attributes import ( @@ -24,25 +26,31 @@ class UpdateFormFieldPlacementConditionData: Attributes: type_ (UpdateFormFieldPlacementConditionDataType): attributes (UpdateFormFieldPlacementConditionDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateFormFieldPlacementConditionDataType - attributes: "UpdateFormFieldPlacementConditionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateFormFieldPlacementConditionDataAttributes + id: str | Unset = 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 @@ -57,26 +65,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateFormFieldPlacementConditionDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_form_field_placement_condition_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_form_field_placement_condition_data.additional_properties = d return update_form_field_placement_condition_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_form_field_placement_condition_data_attributes.py b/rootly_sdk/models/update_form_field_placement_condition_data_attributes.py index f7498f29..abca4c89 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,22 +22,22 @@ class UpdateFormFieldPlacementConditionDataAttributes: """ Attributes: - 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): 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: Unset | UpdateFormFieldPlacementConditionDataAttributesConditioned = UNSET - position: Unset | int = UNSET - form_field_id: Unset | str = UNSET - comparison: Unset | UpdateFormFieldPlacementConditionDataAttributesComparison = UNSET - values: Unset | list[str] = UNSET + conditioned: UpdateFormFieldPlacementConditionDataAttributesConditioned | Unset = UNSET + position: int | Unset = UNSET + form_field_id: str | Unset = UNSET + comparison: UpdateFormFieldPlacementConditionDataAttributesComparison | Unset = UNSET + values: list[str] | Unset = UNSET def to_dict(self) -> dict[str, Any]: - conditioned: Unset | str = UNSET + conditioned: str | Unset = UNSET if not isinstance(self.conditioned, Unset): conditioned = self.conditioned @@ -43,11 +45,11 @@ def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id - comparison: Unset | str = UNSET + comparison: str | Unset = UNSET if not isinstance(self.comparison, Unset): comparison = self.comparison - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values @@ -71,7 +73,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: Unset | UpdateFormFieldPlacementConditionDataAttributesConditioned + conditioned: UpdateFormFieldPlacementConditionDataAttributesConditioned | Unset if isinstance(_conditioned, Unset): conditioned = UNSET else: @@ -82,7 +84,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: Unset | UpdateFormFieldPlacementConditionDataAttributesComparison + comparison: UpdateFormFieldPlacementConditionDataAttributesComparison | Unset if isinstance(_comparison, Unset): comparison = UNSET else: diff --git a/rootly_sdk/models/update_form_field_placement_condition_data_attributes_comparison.py b/rootly_sdk/models/update_form_field_placement_condition_data_attributes_comparison.py index 6a781c92..83719e85 100644 --- a/rootly_sdk/models/update_form_field_placement_condition_data_attributes_comparison.py +++ b/rootly_sdk/models/update_form_field_placement_condition_data_attributes_comparison.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateFormFieldPlacementConditionDataAttributesComparison = Literal["equal", "is_not_set", "is_set", "not_equal"] @@ -18,7 +18,7 @@ def check_update_form_field_placement_condition_data_attributes_comparison( if value is None: return None if value in UPDATE_FORM_FIELD_PLACEMENT_CONDITION_DATA_ATTRIBUTES_COMPARISON_VALUES: - return cast(UpdateFormFieldPlacementConditionDataAttributesComparison, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_FORM_FIELD_PLACEMENT_CONDITION_DATA_ATTRIBUTES_COMPARISON_VALUES!r}" ) diff --git a/rootly_sdk/models/update_form_field_placement_condition_data_attributes_conditioned.py b/rootly_sdk/models/update_form_field_placement_condition_data_attributes_conditioned.py index 76b6d41a..e7fdec2a 100644 --- a/rootly_sdk/models/update_form_field_placement_condition_data_attributes_conditioned.py +++ b/rootly_sdk/models/update_form_field_placement_condition_data_attributes_conditioned.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateFormFieldPlacementConditionDataAttributesConditioned = Literal["placement", "required"] @@ -16,7 +16,7 @@ def check_update_form_field_placement_condition_data_attributes_conditioned( if value is None: return None if value in UPDATE_FORM_FIELD_PLACEMENT_CONDITION_DATA_ATTRIBUTES_CONDITIONED_VALUES: - return cast(UpdateFormFieldPlacementConditionDataAttributesConditioned, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_FORM_FIELD_PLACEMENT_CONDITION_DATA_ATTRIBUTES_CONDITIONED_VALUES!r}" ) diff --git a/rootly_sdk/models/update_form_field_placement_condition_data_type.py b/rootly_sdk/models/update_form_field_placement_condition_data_type.py index 4ac59bcc..b74ef4f6 100644 --- a/rootly_sdk/models/update_form_field_placement_condition_data_type.py +++ b/rootly_sdk/models/update_form_field_placement_condition_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateFormFieldPlacementConditionDataType = Literal["form_field_placement_conditions"] @@ -13,7 +13,7 @@ def check_update_form_field_placement_condition_data_type( if value is None: return None if value in UPDATE_FORM_FIELD_PLACEMENT_CONDITION_DATA_TYPE_VALUES: - return cast(UpdateFormFieldPlacementConditionDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_FORM_FIELD_PLACEMENT_CONDITION_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_form_field_placement_data.py b/rootly_sdk/models/update_form_field_placement_data.py index 63c89523..7f847f20 100644 --- a/rootly_sdk/models/update_form_field_placement_data.py +++ b/rootly_sdk/models/update_form_field_placement_data.py @@ -1,13 +1,15 @@ +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_form_field_placement_data_type import ( UpdateFormFieldPlacementDataType, check_update_form_field_placement_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_form_field_placement_data_attributes import UpdateFormFieldPlacementDataAttributes @@ -22,25 +24,31 @@ class UpdateFormFieldPlacementData: Attributes: type_ (UpdateFormFieldPlacementDataType): attributes (UpdateFormFieldPlacementDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateFormFieldPlacementDataType - attributes: "UpdateFormFieldPlacementDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateFormFieldPlacementDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateFormFieldPlacementDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_form_field_placement_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_form_field_placement_data.additional_properties = d return update_form_field_placement_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_form_field_placement_data_attributes.py b/rootly_sdk/models/update_form_field_placement_data_attributes.py index ab3ed2c6..f3f9caed 100644 --- a/rootly_sdk/models/update_form_field_placement_data_attributes.py +++ b/rootly_sdk/models/update_form_field_placement_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -20,25 +22,25 @@ class UpdateFormFieldPlacementDataAttributes: """ Attributes: - 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 + form_set_id (str | Unset): 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 | 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 evaluating multiple form_field_placement_conditions with conditioned=required - 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. + 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. """ - 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 + 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 def to_dict(self) -> dict[str, Any]: form_set_id = self.form_set_id @@ -49,11 +51,11 @@ def to_dict(self) -> dict[str, Any]: required = self.required - required_operator: Unset | str = UNSET + required_operator: str | Unset = UNSET if not isinstance(self.required_operator, Unset): required_operator = self.required_operator - placement_operator: Unset | str = UNSET + placement_operator: str | Unset = UNSET if not isinstance(self.placement_operator, Unset): placement_operator = self.placement_operator @@ -91,14 +93,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: Unset | UpdateFormFieldPlacementDataAttributesRequiredOperator + required_operator: UpdateFormFieldPlacementDataAttributesRequiredOperator | Unset 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: Unset | UpdateFormFieldPlacementDataAttributesPlacementOperator + placement_operator: UpdateFormFieldPlacementDataAttributesPlacementOperator | Unset if isinstance(_placement_operator, Unset): placement_operator = UNSET else: diff --git a/rootly_sdk/models/update_form_field_placement_data_attributes_placement_operator.py b/rootly_sdk/models/update_form_field_placement_data_attributes_placement_operator.py index 48f3f004..6bbe2009 100644 --- a/rootly_sdk/models/update_form_field_placement_data_attributes_placement_operator.py +++ b/rootly_sdk/models/update_form_field_placement_data_attributes_placement_operator.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateFormFieldPlacementDataAttributesPlacementOperator = Literal["and", "or"] @@ -16,7 +16,7 @@ def check_update_form_field_placement_data_attributes_placement_operator( if value is None: return None if value in UPDATE_FORM_FIELD_PLACEMENT_DATA_ATTRIBUTES_PLACEMENT_OPERATOR_VALUES: - return cast(UpdateFormFieldPlacementDataAttributesPlacementOperator, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_FORM_FIELD_PLACEMENT_DATA_ATTRIBUTES_PLACEMENT_OPERATOR_VALUES!r}" ) diff --git a/rootly_sdk/models/update_form_field_placement_data_attributes_required_operator.py b/rootly_sdk/models/update_form_field_placement_data_attributes_required_operator.py index 5cbc2790..a729d80c 100644 --- a/rootly_sdk/models/update_form_field_placement_data_attributes_required_operator.py +++ b/rootly_sdk/models/update_form_field_placement_data_attributes_required_operator.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateFormFieldPlacementDataAttributesRequiredOperator = Literal["and", "or"] @@ -16,7 +16,7 @@ def check_update_form_field_placement_data_attributes_required_operator( if value is None: return None if value in UPDATE_FORM_FIELD_PLACEMENT_DATA_ATTRIBUTES_REQUIRED_OPERATOR_VALUES: - return cast(UpdateFormFieldPlacementDataAttributesRequiredOperator, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_FORM_FIELD_PLACEMENT_DATA_ATTRIBUTES_REQUIRED_OPERATOR_VALUES!r}" ) diff --git a/rootly_sdk/models/update_form_field_placement_data_type.py b/rootly_sdk/models/update_form_field_placement_data_type.py index 9490831d..978fb7e6 100644 --- a/rootly_sdk/models/update_form_field_placement_data_type.py +++ b/rootly_sdk/models/update_form_field_placement_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateFormFieldPlacementDataType = Literal["form_field_placements"] @@ -11,5 +11,5 @@ def check_update_form_field_placement_data_type(value: str | None) -> UpdateForm if value is None: return None if value in UPDATE_FORM_FIELD_PLACEMENT_DATA_TYPE_VALUES: - return cast(UpdateFormFieldPlacementDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_FORM_FIELD_PLACEMENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_form_field_position.py b/rootly_sdk/models/update_form_field_position.py index e25ddb92..711d5993 100644 --- a/rootly_sdk/models/update_form_field_position.py +++ b/rootly_sdk/models/update_form_field_position.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_form_field_position_data import UpdateFormFieldPositionData @@ -18,14 +19,13 @@ class UpdateFormFieldPosition: data (UpdateFormFieldPositionData): """ - data: "UpdateFormFieldPositionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateFormFieldPositionData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_form_field_position.additional_properties = d return update_form_field_position - - @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_form_field_position_data.py b/rootly_sdk/models/update_form_field_position_data.py index 282ebd4d..a852b1f6 100644 --- a/rootly_sdk/models/update_form_field_position_data.py +++ b/rootly_sdk/models/update_form_field_position_data.py @@ -1,13 +1,15 @@ +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_form_field_position_data_type import ( UpdateFormFieldPositionDataType, check_update_form_field_position_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_form_field_position_data_attributes import UpdateFormFieldPositionDataAttributes @@ -22,25 +24,31 @@ class UpdateFormFieldPositionData: Attributes: type_ (UpdateFormFieldPositionDataType): attributes (UpdateFormFieldPositionDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateFormFieldPositionDataType - attributes: "UpdateFormFieldPositionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateFormFieldPositionDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateFormFieldPositionDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_form_field_position_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_form_field_position_data.additional_properties = d return update_form_field_position_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_form_field_position_data_attributes.py b/rootly_sdk/models/update_form_field_position_data_attributes.py index 11487ec7..bc7b1105 100644 --- a/rootly_sdk/models/update_form_field_position_data_attributes.py +++ b/rootly_sdk/models/update_form_field_position_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -16,19 +18,19 @@ class UpdateFormFieldPositionDataAttributes: """ Attributes: - 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): 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: Unset | str = UNSET - form: Unset | UpdateFormFieldPositionDataAttributesForm = UNSET - position: Unset | int = UNSET + form_field_id: str | Unset = UNSET + form: UpdateFormFieldPositionDataAttributesForm | Unset = UNSET + position: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id - form: Unset | str = UNSET + form: str | Unset = UNSET if not isinstance(self.form, Unset): form = self.form @@ -52,7 +54,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: Unset | UpdateFormFieldPositionDataAttributesForm + form: UpdateFormFieldPositionDataAttributesForm | Unset 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 3c58189c..abee902f 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 @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateFormFieldPositionDataAttributesForm = Literal[ "incident_post_mortem", @@ -55,7 +55,7 @@ def check_update_form_field_position_data_attributes_form( if value is None: return None if value in UPDATE_FORM_FIELD_POSITION_DATA_ATTRIBUTES_FORM_VALUES: - return cast(UpdateFormFieldPositionDataAttributesForm, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_FORM_FIELD_POSITION_DATA_ATTRIBUTES_FORM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_form_field_position_data_type.py b/rootly_sdk/models/update_form_field_position_data_type.py index 0ee80ae6..855718a1 100644 --- a/rootly_sdk/models/update_form_field_position_data_type.py +++ b/rootly_sdk/models/update_form_field_position_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateFormFieldPositionDataType = Literal["form_field_positions"] @@ -11,5 +11,5 @@ def check_update_form_field_position_data_type(value: str | None) -> UpdateFormF if value is None: return None if value in UPDATE_FORM_FIELD_POSITION_DATA_TYPE_VALUES: - return cast(UpdateFormFieldPositionDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_FORM_FIELD_POSITION_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_form_set.py b/rootly_sdk/models/update_form_set.py index e0ff9a8b..2a0e1d48 100644 --- a/rootly_sdk/models/update_form_set.py +++ b/rootly_sdk/models/update_form_set.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_form_set_data import UpdateFormSetData @@ -18,14 +19,13 @@ class UpdateFormSet: data (UpdateFormSetData): """ - data: "UpdateFormSetData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateFormSetData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_form_set.additional_properties = d return update_form_set - - @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_form_set_condition.py b/rootly_sdk/models/update_form_set_condition.py index 97080641..7ac4c6b4 100644 --- a/rootly_sdk/models/update_form_set_condition.py +++ b/rootly_sdk/models/update_form_set_condition.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_form_set_condition_data import UpdateFormSetConditionData @@ -18,14 +19,13 @@ class UpdateFormSetCondition: data (UpdateFormSetConditionData): """ - data: "UpdateFormSetConditionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateFormSetConditionData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_form_set_condition.additional_properties = d return update_form_set_condition - - @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_form_set_condition_data.py b/rootly_sdk/models/update_form_set_condition_data.py index c95eb31c..b572ef23 100644 --- a/rootly_sdk/models/update_form_set_condition_data.py +++ b/rootly_sdk/models/update_form_set_condition_data.py @@ -1,13 +1,15 @@ +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_form_set_condition_data_type import ( UpdateFormSetConditionDataType, check_update_form_set_condition_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_form_set_condition_data_attributes import UpdateFormSetConditionDataAttributes @@ -22,25 +24,31 @@ class UpdateFormSetConditionData: Attributes: type_ (UpdateFormSetConditionDataType): attributes (UpdateFormSetConditionDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateFormSetConditionDataType - attributes: "UpdateFormSetConditionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateFormSetConditionDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateFormSetConditionDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_form_set_condition_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_form_set_condition_data.additional_properties = d return update_form_set_condition_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_form_set_condition_data_attributes.py b/rootly_sdk/models/update_form_set_condition_data_attributes.py index 6a6f053b..cbaa334a 100644 --- a/rootly_sdk/models/update_form_set_condition_data_attributes.py +++ b/rootly_sdk/models/update_form_set_condition_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,23 +18,23 @@ class UpdateFormSetConditionDataAttributes: """ Attributes: - 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): The form field this condition applies. + comparison (UpdateFormSetConditionDataAttributesComparison | Unset): The condition comparison. + values (list[str] | Unset): The values for comparison. """ - form_field_id: Unset | str = UNSET - comparison: Unset | UpdateFormSetConditionDataAttributesComparison = UNSET - values: Unset | list[str] = UNSET + form_field_id: str | Unset = UNSET + comparison: UpdateFormSetConditionDataAttributesComparison | Unset = UNSET + values: list[str] | Unset = UNSET def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id - comparison: Unset | str = UNSET + comparison: str | Unset = UNSET if not isinstance(self.comparison, Unset): comparison = self.comparison - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values @@ -54,7 +56,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: Unset | UpdateFormSetConditionDataAttributesComparison + comparison: UpdateFormSetConditionDataAttributesComparison | Unset if isinstance(_comparison, Unset): comparison = UNSET else: diff --git a/rootly_sdk/models/update_form_set_condition_data_attributes_comparison.py b/rootly_sdk/models/update_form_set_condition_data_attributes_comparison.py index 4843b186..4cb107ad 100644 --- a/rootly_sdk/models/update_form_set_condition_data_attributes_comparison.py +++ b/rootly_sdk/models/update_form_set_condition_data_attributes_comparison.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateFormSetConditionDataAttributesComparison = Literal["equal"] @@ -13,7 +13,7 @@ def check_update_form_set_condition_data_attributes_comparison( if value is None: return None if value in UPDATE_FORM_SET_CONDITION_DATA_ATTRIBUTES_COMPARISON_VALUES: - return cast(UpdateFormSetConditionDataAttributesComparison, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_FORM_SET_CONDITION_DATA_ATTRIBUTES_COMPARISON_VALUES!r}" ) diff --git a/rootly_sdk/models/update_form_set_condition_data_type.py b/rootly_sdk/models/update_form_set_condition_data_type.py index 30828f2d..ab88ec52 100644 --- a/rootly_sdk/models/update_form_set_condition_data_type.py +++ b/rootly_sdk/models/update_form_set_condition_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateFormSetConditionDataType = Literal["form_set_conditions"] @@ -11,5 +11,5 @@ def check_update_form_set_condition_data_type(value: str | None) -> UpdateFormSe if value is None: return None if value in UPDATE_FORM_SET_CONDITION_DATA_TYPE_VALUES: - return cast(UpdateFormSetConditionDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_FORM_SET_CONDITION_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_form_set_data.py b/rootly_sdk/models/update_form_set_data.py index b22a2180..1303a808 100644 --- a/rootly_sdk/models/update_form_set_data.py +++ b/rootly_sdk/models/update_form_set_data.py @@ -1,10 +1,12 @@ +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_form_set_data_type import UpdateFormSetDataType, check_update_form_set_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_form_set_data_attributes import UpdateFormSetDataAttributes @@ -19,25 +21,31 @@ class UpdateFormSetData: Attributes: type_ (UpdateFormSetDataType): attributes (UpdateFormSetDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateFormSetDataType - attributes: "UpdateFormSetDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateFormSetDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateFormSetDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_form_set_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_form_set_data.additional_properties = d return update_form_set_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_form_set_data_attributes.py b/rootly_sdk/models/update_form_set_data_attributes.py index e9bc5ab6..edc4297e 100644 --- a/rootly_sdk/models/update_form_set_data_attributes.py +++ b/rootly_sdk/models/update_form_set_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,11 +14,11 @@ class UpdateFormSetDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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`, + 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`, `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`, @@ -25,12 +27,12 @@ class UpdateFormSetDataAttributes: `google_chat_update_incident_form`, `microsoft_teams_new_incident_form` """ - slug: None | Unset | str = UNSET - name: Unset | str = UNSET - forms: Unset | list[str] = UNSET + slug: None | str | Unset = UNSET + name: str | Unset = UNSET + forms: list[str] | Unset = UNSET def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -38,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - forms: Unset | list[str] = UNSET + forms: list[str] | Unset = UNSET if not isinstance(self.forms, Unset): forms = self.forms @@ -58,12 +60,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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) diff --git a/rootly_sdk/models/update_form_set_data_type.py b/rootly_sdk/models/update_form_set_data_type.py index deaeaf6d..0807f146 100644 --- a/rootly_sdk/models/update_form_set_data_type.py +++ b/rootly_sdk/models/update_form_set_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateFormSetDataType = Literal["form_sets"] @@ -11,5 +11,5 @@ def check_update_form_set_data_type(value: str | None) -> UpdateFormSetDataType if value is None: return None if value in UPDATE_FORM_SET_DATA_TYPE_VALUES: - return cast(UpdateFormSetDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_FORM_SET_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_functionality.py b/rootly_sdk/models/update_functionality.py index 501a15ac..2275aaa6 100644 --- a/rootly_sdk/models/update_functionality.py +++ b/rootly_sdk/models/update_functionality.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_functionality_data import UpdateFunctionalityData @@ -18,14 +19,13 @@ class UpdateFunctionality: data (UpdateFunctionalityData): """ - data: "UpdateFunctionalityData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateFunctionalityData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_functionality.additional_properties = d return update_functionality - - @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_functionality_data.py b/rootly_sdk/models/update_functionality_data.py index 3bd9d4e7..8d2f5c2d 100644 --- a/rootly_sdk/models/update_functionality_data.py +++ b/rootly_sdk/models/update_functionality_data.py @@ -1,10 +1,12 @@ +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_functionality_data_type import UpdateFunctionalityDataType, check_update_functionality_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_functionality_data_attributes import UpdateFunctionalityDataAttributes @@ -19,25 +21,31 @@ class UpdateFunctionalityData: Attributes: type_ (UpdateFunctionalityDataType): attributes (UpdateFunctionalityDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateFunctionalityDataType - attributes: "UpdateFunctionalityDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateFunctionalityDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateFunctionalityDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_functionality_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_functionality_data.additional_properties = d return update_functionality_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_functionality_data_attributes.py b/rootly_sdk/models/update_functionality_data_attributes.py index 81ef1a0e..4c8992c2 100644 --- a/rootly_sdk/models/update_functionality_data_attributes.py +++ b/rootly_sdk/models/update_functionality_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -24,62 +26,62 @@ class UpdateFunctionalityDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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: + name (str | Unset): The name of the functionality + description (None | str | Unset): The description of the functionality + public_description (None | str | Unset): The status page 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: :namespace/:kind/:entity_name - 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. + 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. Empty array removes + all; omitting or null leaves unchanged. + owner_user_ids (list[int] | None | Unset): Owner Users associated with this functionality. Empty array removes + all; omitting or null leaves unchanged. + 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. """ - 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 + slug: None | str | Unset = UNSET + 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 def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -87,19 +89,19 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -108,61 +110,61 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | Unset | str + backstage_id: None | str | Unset if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | Unset | str + pagerduty_id: None | str | Unset if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | Unset | str + opsgenie_id: None | str | Unset if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - opsgenie_team_id: None | Unset | str + opsgenie_team_id: None | str | Unset if isinstance(self.opsgenie_team_id, Unset): opsgenie_team_id = UNSET else: opsgenie_team_id = self.opsgenie_team_id - cortex_id: None | Unset | str + cortex_id: None | str | Unset if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | Unset | str + service_now_ci_sys_id: None | str | Unset 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: None | Unset | list[str] + environment_ids: list[str] | None | Unset if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -171,7 +173,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -180,7 +182,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: None | Unset | list[str] + owner_group_ids: list[str] | None | Unset if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -189,7 +191,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: None | Unset | list[int] + owner_user_ids: list[int] | None | Unset if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -198,13 +200,13 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - escalation_policy_id: None | Unset | str + escalation_policy_id: None | str | Unset if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - slack_channels: None | Unset | list[dict[str, Any]] + slack_channels: list[dict[str, Any]] | None | Unset if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -216,7 +218,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: None | Unset | list[dict[str, Any]] + slack_aliases: list[dict[str, Any]] | None | Unset if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -228,7 +230,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: Unset | list[dict[str, Any]] = UNSET + properties: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -299,36 +301,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -339,94 +341,94 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | Unset | str: + def _parse_backstage_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | Unset | str: + def _parse_pagerduty_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | Unset | str: + def _parse_opsgenie_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_opsgenie_team_id(data: object) -> None | Unset | str: + def _parse_opsgenie_team_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_team_id = _parse_opsgenie_team_id(d.pop("opsgenie_team_id", UNSET)) - def _parse_cortex_id(data: object) -> None | Unset | str: + def _parse_cortex_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: + def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) -> None | Unset | list[str]: + def _parse_environment_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -437,13 +439,13 @@ def _parse_environment_ids(data: object) -> None | Unset | list[str]: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -454,13 +456,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: + def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -471,13 +473,13 @@ def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: owner_group_ids_type_0 = cast(list[str], data) return owner_group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: + def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -488,24 +490,24 @@ def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: owner_user_ids_type_0 = cast(list[int], data) return owner_user_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[int], data) + return cast(list[int] | None | Unset, data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_escalation_policy_id(data: object) -> None | Unset | str: + def _parse_escalation_policy_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) def _parse_slack_channels( data: object, - ) -> None | Unset | list["UpdateFunctionalityDataAttributesSlackChannelsType0Item"]: + ) -> list[UpdateFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -523,15 +525,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["UpdateFunctionalityDataAttributesSlackChannelsType0Item"], data) + return cast(list[UpdateFunctionalityDataAttributesSlackChannelsType0Item] | None | Unset, data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> None | Unset | list["UpdateFunctionalityDataAttributesSlackAliasesType0Item"]: + ) -> list[UpdateFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -549,18 +551,20 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["UpdateFunctionalityDataAttributesSlackAliasesType0Item"], data) + return cast(list[UpdateFunctionalityDataAttributesSlackAliasesType0Item] | None | Unset, data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - properties = [] _properties = d.pop("properties", UNSET) - for properties_item_data in _properties or []: - properties_item = UpdateFunctionalityDataAttributesPropertiesItem.from_dict(properties_item_data) + 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) - properties.append(properties_item) + properties.append(properties_item) update_functionality_data_attributes = cls( slug=slug, 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 65940fe9..8d1806bc 100644 --- a/rootly_sdk/models/update_functionality_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_functionality_data_attributes_properties_item.py @@ -1,3 +1,5 @@ +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 0570fa7e..3519e0d1 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="UpdateFunctionalityDataAttributesSlackAliasesType0Item") @@ -17,7 +18,6 @@ class UpdateFunctionalityDataAttributesSlackAliasesType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - update_functionality_data_attributes_slack_aliases_type_0_item.additional_properties = d return update_functionality_data_attributes_slack_aliases_type_0_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_functionality_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/update_functionality_data_attributes_slack_channels_type_0_item.py index 7c94915e..27714ab4 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="UpdateFunctionalityDataAttributesSlackChannelsType0Item") @@ -17,7 +18,6 @@ class UpdateFunctionalityDataAttributesSlackChannelsType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - update_functionality_data_attributes_slack_channels_type_0_item.additional_properties = d return update_functionality_data_attributes_slack_channels_type_0_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_functionality_data_type.py b/rootly_sdk/models/update_functionality_data_type.py index efb86bd2..3cc6d14a 100644 --- a/rootly_sdk/models/update_functionality_data_type.py +++ b/rootly_sdk/models/update_functionality_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateFunctionalityDataType = Literal["functionalities"] @@ -11,5 +11,5 @@ def check_update_functionality_data_type(value: str | None) -> UpdateFunctionali if value is None: return None if value in UPDATE_FUNCTIONALITY_DATA_TYPE_VALUES: - return cast(UpdateFunctionalityDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_FUNCTIONALITY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_github_issue_task_params.py b/rootly_sdk/models/update_github_issue_task_params.py index 1bd52cf9..12050631 100644 --- a/rootly_sdk/models/update_github_issue_task_params.py +++ b/rootly_sdk/models/update_github_issue_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -30,29 +32,29 @@ class UpdateGithubIssueTaskParams: Attributes: issue_id (str): The issue id completion (UpdateGithubIssueTaskParamsCompletion): - 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 + 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 valid JSON """ issue_id: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -60,11 +62,11 @@ def to_dict(self) -> dict[str, Any]: completion = self.completion.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - repository: Unset | dict[str, Any] = UNSET + repository: dict[str, Any] | Unset = UNSET if not isinstance(self.repository, Unset): repository = self.repository.to_dict() @@ -72,22 +74,22 @@ def to_dict(self) -> dict[str, Any]: body = self.body - labels: Unset | list[dict[str, Any]] = UNSET + labels: list[dict[str, Any]] | Unset = 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: Unset | str = UNSET + labels_mode: str | Unset = UNSET if not isinstance(self.labels_mode, Unset): labels_mode = self.labels_mode - issue_type: Unset | dict[str, Any] = UNSET + issue_type: dict[str, Any] | Unset = UNSET if not isinstance(self.issue_type, Unset): issue_type = self.issue_type.to_dict() - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -133,14 +135,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: Unset | UpdateGithubIssueTaskParamsTaskType + task_type: UpdateGithubIssueTaskParamsTaskType | Unset 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: Unset | UpdateGithubIssueTaskParamsRepository + repository: UpdateGithubIssueTaskParamsRepository | Unset if isinstance(_repository, Unset): repository = UNSET else: @@ -150,33 +152,35 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: body = d.pop("body", UNSET) - labels = [] _labels = d.pop("labels", UNSET) - for labels_item_data in _labels or []: - labels_item = UpdateGithubIssueTaskParamsLabelsItem.from_dict(labels_item_data) + 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) - labels.append(labels_item) + labels.append(labels_item) _labels_mode = d.pop("labels_mode", UNSET) - labels_mode: Unset | UpdateGithubIssueTaskParamsLabelsMode + labels_mode: UpdateGithubIssueTaskParamsLabelsMode | Unset 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: Unset | UpdateGithubIssueTaskParamsIssueType + issue_type: UpdateGithubIssueTaskParamsIssueType | Unset if isinstance(_issue_type, Unset): issue_type = UNSET else: issue_type = UpdateGithubIssueTaskParamsIssueType.from_dict(_issue_type) - def _parse_custom_fields_mapping(data: object) -> None | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 003e9917..2aaafc3b 100644 --- a/rootly_sdk/models/update_github_issue_task_params_completion.py +++ b/rootly_sdk/models/update_github_issue_task_params_completion.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class UpdateGithubIssueTaskParamsCompletion: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 70e2dbaa..2699f2b5 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateGithubIssueTaskParamsIssueType: """The issue type Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 913a6763..c905b808 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class UpdateGithubIssueTaskParamsLabelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_mode.py b/rootly_sdk/models/update_github_issue_task_params_labels_mode.py index f304aa5f..b6d36ef2 100644 --- a/rootly_sdk/models/update_github_issue_task_params_labels_mode.py +++ b/rootly_sdk/models/update_github_issue_task_params_labels_mode.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateGithubIssueTaskParamsLabelsMode = Literal["append", "replace"] @@ -14,7 +14,7 @@ def check_update_github_issue_task_params_labels_mode( if value is None: return None if value in UPDATE_GITHUB_ISSUE_TASK_PARAMS_LABELS_MODE_VALUES: - return cast(UpdateGithubIssueTaskParamsLabelsMode, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_GITHUB_ISSUE_TASK_PARAMS_LABELS_MODE_VALUES!r}" ) 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 1d2587b7..541866c5 100644 --- a/rootly_sdk/models/update_github_issue_task_params_repository.py +++ b/rootly_sdk/models/update_github_issue_task_params_repository.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateGithubIssueTaskParamsRepository: """The repository (used for loading labels and issue types) Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/update_github_issue_task_params_task_type.py index 52d5cb5b..ee912c5f 100644 --- a/rootly_sdk/models/update_github_issue_task_params_task_type.py +++ b/rootly_sdk/models/update_github_issue_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateGithubIssueTaskParamsTaskType = Literal["update_github_issue"] @@ -11,5 +11,5 @@ def check_update_github_issue_task_params_task_type(value: str | None) -> Update if value is None: return None if value in UPDATE_GITHUB_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateGithubIssueTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_GITHUB_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_gitlab_issue_task_params.py b/rootly_sdk/models/update_gitlab_issue_task_params.py index 691d232a..7261e458 100644 --- a/rootly_sdk/models/update_gitlab_issue_task_params.py +++ b/rootly_sdk/models/update_gitlab_issue_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,22 +29,22 @@ class UpdateGitlabIssueTaskParams: Attributes: issue_id (str): The issue id completion (UpdateGitlabIssueTaskParamsCompletion): - 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 + 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 """ issue_id: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -50,11 +52,11 @@ def to_dict(self) -> dict[str, Any]: completion = self.completion.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - issue_type: Unset | str = UNSET + issue_type: str | Unset = UNSET if not isinstance(self.issue_type, Unset): issue_type = self.issue_type @@ -99,14 +101,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: Unset | UpdateGitlabIssueTaskParamsTaskType + task_type: UpdateGitlabIssueTaskParamsTaskType | Unset 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: Unset | UpdateGitlabIssueTaskParamsIssueType + issue_type: UpdateGitlabIssueTaskParamsIssueType | Unset 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 c563e990..0fef7627 100644 --- a/rootly_sdk/models/update_gitlab_issue_task_params_completion.py +++ b/rootly_sdk/models/update_gitlab_issue_task_params_completion.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class UpdateGitlabIssueTaskParamsCompletion: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_issue_type.py b/rootly_sdk/models/update_gitlab_issue_task_params_issue_type.py index 49df0da1..d3af2da9 100644 --- a/rootly_sdk/models/update_gitlab_issue_task_params_issue_type.py +++ b/rootly_sdk/models/update_gitlab_issue_task_params_issue_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateGitlabIssueTaskParamsIssueType = Literal["incident", "issue", "task", "test_case"] @@ -14,7 +14,7 @@ def check_update_gitlab_issue_task_params_issue_type(value: str | None) -> Updat if value is None: return None if value in UPDATE_GITLAB_ISSUE_TASK_PARAMS_ISSUE_TYPE_VALUES: - return cast(UpdateGitlabIssueTaskParamsIssueType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_GITLAB_ISSUE_TASK_PARAMS_ISSUE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_gitlab_issue_task_params_task_type.py b/rootly_sdk/models/update_gitlab_issue_task_params_task_type.py index b3463094..9a1fa573 100644 --- a/rootly_sdk/models/update_gitlab_issue_task_params_task_type.py +++ b/rootly_sdk/models/update_gitlab_issue_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateGitlabIssueTaskParamsTaskType = Literal["update_gitlab_issue"] @@ -11,5 +11,5 @@ def check_update_gitlab_issue_task_params_task_type(value: str | None) -> Update if value is None: return None if value in UPDATE_GITLAB_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateGitlabIssueTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_GITLAB_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES!r}") 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 81eeceb0..d247ea44 100644 --- a/rootly_sdk/models/update_google_calendar_event_task_params.py +++ b/rootly_sdk/models/update_google_calendar_event_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -28,52 +30,52 @@ class UpdateGoogleCalendarEventTaskParams: """ Attributes: event_id (str): The event ID - 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 + 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 conference type attached to the meeting - post_to_incident_timeline (Union[Unset, bool]): - post_to_slack_channels (Union[Unset, list['UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem']]): + post_to_incident_timeline (bool | Unset): + post_to_slack_channels (list[UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem] | Unset): """ event_id: str - 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 + 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 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - calendar_id: None | Unset | str + calendar_id: None | str | Unset if isinstance(self.calendar_id, Unset): calendar_id = UNSET else: @@ -97,19 +99,19 @@ def to_dict(self) -> dict[str, Any]: can_guests_invite_others = self.can_guests_invite_others - attendees: Unset | list[str] = UNSET + attendees: list[str] | Unset = UNSET if not isinstance(self.attendees, Unset): attendees = self.attendees replace_attendees = self.replace_attendees - conference_solution_key: Unset | str = UNSET + conference_solution_key: str | Unset = 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: Unset | list[dict[str, Any]] = UNSET + post_to_slack_channels: list[dict[str, Any]] | Unset = 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: @@ -168,18 +170,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: Unset | UpdateGoogleCalendarEventTaskParamsTaskType + task_type: UpdateGoogleCalendarEventTaskParamsTaskType | Unset 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 | Unset | str: + def _parse_calendar_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) calendar_id = _parse_calendar_id(d.pop("calendar_id", UNSET)) @@ -206,7 +208,7 @@ def _parse_calendar_id(data: object) -> None | Unset | str: replace_attendees = d.pop("replace_attendees", UNSET) _conference_solution_key = d.pop("conference_solution_key", UNSET) - conference_solution_key: Unset | UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey + conference_solution_key: UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey | Unset if isinstance(_conference_solution_key, Unset): conference_solution_key = UNSET else: @@ -216,14 +218,16 @@ def _parse_calendar_id(data: object) -> None | Unset | 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) - 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: 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 + ) - 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_conference_solution_key.py b/rootly_sdk/models/update_google_calendar_event_task_params_conference_solution_key.py index 801b5927..8a37a2c7 100644 --- a/rootly_sdk/models/update_google_calendar_event_task_params_conference_solution_key.py +++ b/rootly_sdk/models/update_google_calendar_event_task_params_conference_solution_key.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey = Literal[ "addOn", "eventHangout", "eventNamedHangout", "hangoutsMeet" @@ -20,7 +20,7 @@ def check_update_google_calendar_event_task_params_conference_solution_key( if value is None: return None if value in UPDATE_GOOGLE_CALENDAR_EVENT_TASK_PARAMS_CONFERENCE_SOLUTION_KEY_VALUES: - return cast(UpdateGoogleCalendarEventTaskParamsConferenceSolutionKey, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_GOOGLE_CALENDAR_EVENT_TASK_PARAMS_CONFERENCE_SOLUTION_KEY_VALUES!r}" ) 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 e92620d2..81404c8a 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class UpdateGoogleCalendarEventTaskParamsPostToSlackChannelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/update_google_calendar_event_task_params_task_type.py index 270785e0..2cb67518 100644 --- a/rootly_sdk/models/update_google_calendar_event_task_params_task_type.py +++ b/rootly_sdk/models/update_google_calendar_event_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateGoogleCalendarEventTaskParamsTaskType = Literal["create_google_calendar_event"] @@ -13,7 +13,7 @@ def check_update_google_calendar_event_task_params_task_type( if value is None: return None if value in UPDATE_GOOGLE_CALENDAR_EVENT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateGoogleCalendarEventTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_GOOGLE_CALENDAR_EVENT_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 9e20b3d5..239baba8 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -25,12 +27,12 @@ class UpdateGoogleChatSpaceDescriptionTaskParams: Attributes: space (UpdateGoogleChatSpaceDescriptionTaskParamsSpace): description (str): The space description. Supports liquid markup - task_type (Union[Unset, UpdateGoogleChatSpaceDescriptionTaskParamsTaskType]): + task_type (UpdateGoogleChatSpaceDescriptionTaskParamsTaskType | Unset): """ - space: "UpdateGoogleChatSpaceDescriptionTaskParamsSpace" + space: UpdateGoogleChatSpaceDescriptionTaskParamsSpace description: str - task_type: Unset | UpdateGoogleChatSpaceDescriptionTaskParamsTaskType = UNSET + task_type: UpdateGoogleChatSpaceDescriptionTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: description = self.description - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -67,7 +69,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: Unset | UpdateGoogleChatSpaceDescriptionTaskParamsTaskType + task_type: UpdateGoogleChatSpaceDescriptionTaskParamsTaskType | Unset 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 ca1a54af..42c6ff4f 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class UpdateGoogleChatSpaceDescriptionTaskParamsSpace: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/update_google_chat_space_description_task_params_task_type.py index 32b9b84a..ad0b15d4 100644 --- a/rootly_sdk/models/update_google_chat_space_description_task_params_task_type.py +++ b/rootly_sdk/models/update_google_chat_space_description_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateGoogleChatSpaceDescriptionTaskParamsTaskType = Literal["update_google_chat_space_description"] @@ -15,7 +15,7 @@ def check_update_google_chat_space_description_task_params_task_type( if value is None: return None if value in UPDATE_GOOGLE_CHAT_SPACE_DESCRIPTION_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateGoogleChatSpaceDescriptionTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_GOOGLE_CHAT_SPACE_DESCRIPTION_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 adc6e256..37fc989b 100644 --- a/rootly_sdk/models/update_google_docs_page_task_params.py +++ b/rootly_sdk/models/update_google_docs_page_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -18,31 +20,31 @@ class UpdateGoogleDocsPageTaskParams: """ Attributes: file_id (str): The Google Doc file ID - 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. + 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. + include_follow_ups (bool | Unset): Default: True. """ file_id: str - 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 + 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 + include_follow_ups: bool | Unset = 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -92,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: Unset | UpdateGoogleDocsPageTaskParamsTaskType + task_type: UpdateGoogleDocsPageTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_google_docs_page_task_params_task_type.py b/rootly_sdk/models/update_google_docs_page_task_params_task_type.py index b6124f26..2875cbff 100644 --- a/rootly_sdk/models/update_google_docs_page_task_params_task_type.py +++ b/rootly_sdk/models/update_google_docs_page_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateGoogleDocsPageTaskParamsTaskType = Literal["update_google_docs_page"] @@ -13,7 +13,7 @@ def check_update_google_docs_page_task_params_task_type( if value is None: return None if value in UPDATE_GOOGLE_DOCS_PAGE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateGoogleDocsPageTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_GOOGLE_DOCS_PAGE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_heartbeat.py b/rootly_sdk/models/update_heartbeat.py index a8c09301..a7e764d9 100644 --- a/rootly_sdk/models/update_heartbeat.py +++ b/rootly_sdk/models/update_heartbeat.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_heartbeat_data import UpdateHeartbeatData @@ -18,14 +19,13 @@ class UpdateHeartbeat: data (UpdateHeartbeatData): """ - data: "UpdateHeartbeatData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateHeartbeatData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_heartbeat.additional_properties = d return update_heartbeat - - @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_heartbeat_data.py b/rootly_sdk/models/update_heartbeat_data.py index b5696242..b6b47e61 100644 --- a/rootly_sdk/models/update_heartbeat_data.py +++ b/rootly_sdk/models/update_heartbeat_data.py @@ -1,10 +1,12 @@ +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_heartbeat_data_type import UpdateHeartbeatDataType, check_update_heartbeat_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_heartbeat_data_attributes import UpdateHeartbeatDataAttributes @@ -19,25 +21,31 @@ class UpdateHeartbeatData: Attributes: type_ (UpdateHeartbeatDataType): attributes (UpdateHeartbeatDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateHeartbeatDataType - attributes: "UpdateHeartbeatDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateHeartbeatDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateHeartbeatDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_heartbeat_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_heartbeat_data.additional_properties = d return update_heartbeat_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_heartbeat_data_attributes.py b/rootly_sdk/models/update_heartbeat_data_attributes.py index e605b3c1..6b0b4180 100644 --- a/rootly_sdk/models/update_heartbeat_data_attributes.py +++ b/rootly_sdk/models/update_heartbeat_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,36 +22,36 @@ class UpdateHeartbeatDataAttributes: """ Attributes: - 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 + 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 notification target. Please contact support if you encounter issues using `Functionality` as a target type. - 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. + 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. """ - 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 + 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 def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -57,13 +59,13 @@ def to_dict(self) -> dict[str, Any]: alert_summary = self.alert_summary - alert_description: None | Unset | str + alert_description: None | str | Unset if isinstance(self.alert_description, Unset): alert_description = UNSET else: alert_description = self.alert_description - alert_urgency_id: None | Unset | str + alert_urgency_id: None | str | Unset if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: @@ -71,17 +73,17 @@ def to_dict(self) -> dict[str, Any]: interval = self.interval - interval_unit: Unset | str = UNSET + interval_unit: str | Unset = UNSET if not isinstance(self.interval_unit, Unset): interval_unit = self.interval_unit notification_target_id = self.notification_target_id - notification_target_type: Unset | str = UNSET + notification_target_type: str | Unset = UNSET if not isinstance(self.notification_target_type, Unset): notification_target_type = self.notification_target_type - owner_group_ids: Unset | list[str] = UNSET + owner_group_ids: list[str] | Unset = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids @@ -120,39 +122,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) alert_summary = d.pop("alert_summary", UNSET) - def _parse_alert_description(data: object) -> None | Unset | str: + def _parse_alert_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) alert_description = _parse_alert_description(d.pop("alert_description", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | Unset | str: + def _parse_alert_urgency_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: Unset | UpdateHeartbeatDataAttributesIntervalUnit + interval_unit: UpdateHeartbeatDataAttributesIntervalUnit | Unset if isinstance(_interval_unit, Unset): interval_unit = UNSET else: @@ -161,7 +163,7 @@ def _parse_alert_urgency_id(data: object) -> None | Unset | str: notification_target_id = d.pop("notification_target_id", UNSET) _notification_target_type = d.pop("notification_target_type", UNSET) - notification_target_type: Unset | UpdateHeartbeatDataAttributesNotificationTargetType + notification_target_type: UpdateHeartbeatDataAttributesNotificationTargetType | Unset if isinstance(_notification_target_type, Unset): notification_target_type = UNSET else: diff --git a/rootly_sdk/models/update_heartbeat_data_attributes_interval_unit.py b/rootly_sdk/models/update_heartbeat_data_attributes_interval_unit.py index 26f41323..c422eeba 100644 --- a/rootly_sdk/models/update_heartbeat_data_attributes_interval_unit.py +++ b/rootly_sdk/models/update_heartbeat_data_attributes_interval_unit.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateHeartbeatDataAttributesIntervalUnit = Literal["days", "hours", "minutes"] @@ -15,7 +15,7 @@ def check_update_heartbeat_data_attributes_interval_unit( if value is None: return None if value in UPDATE_HEARTBEAT_DATA_ATTRIBUTES_INTERVAL_UNIT_VALUES: - return cast(UpdateHeartbeatDataAttributesIntervalUnit, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_HEARTBEAT_DATA_ATTRIBUTES_INTERVAL_UNIT_VALUES!r}" ) diff --git a/rootly_sdk/models/update_heartbeat_data_attributes_notification_target_type.py b/rootly_sdk/models/update_heartbeat_data_attributes_notification_target_type.py index a57400a6..8822135f 100644 --- a/rootly_sdk/models/update_heartbeat_data_attributes_notification_target_type.py +++ b/rootly_sdk/models/update_heartbeat_data_attributes_notification_target_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateHeartbeatDataAttributesNotificationTargetType = Literal[ "EscalationPolicy", "Functionality", "Group", "Service", "User" @@ -21,7 +21,7 @@ def check_update_heartbeat_data_attributes_notification_target_type( if value is None: return None if value in UPDATE_HEARTBEAT_DATA_ATTRIBUTES_NOTIFICATION_TARGET_TYPE_VALUES: - return cast(UpdateHeartbeatDataAttributesNotificationTargetType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_HEARTBEAT_DATA_ATTRIBUTES_NOTIFICATION_TARGET_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_heartbeat_data_type.py b/rootly_sdk/models/update_heartbeat_data_type.py index f6168e59..7f623033 100644 --- a/rootly_sdk/models/update_heartbeat_data_type.py +++ b/rootly_sdk/models/update_heartbeat_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateHeartbeatDataType = Literal["heartbeats"] @@ -11,5 +11,5 @@ def check_update_heartbeat_data_type(value: str | None) -> UpdateHeartbeatDataTy if value is None: return None if value in UPDATE_HEARTBEAT_DATA_TYPE_VALUES: - return cast(UpdateHeartbeatDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_HEARTBEAT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_incident.py b/rootly_sdk/models/update_incident.py index 8539fba1..ae9a7f40 100644 --- a/rootly_sdk/models/update_incident.py +++ b/rootly_sdk/models/update_incident.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_incident_data import UpdateIncidentData @@ -18,14 +19,13 @@ class UpdateIncident: data (UpdateIncidentData): """ - data: "UpdateIncidentData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateIncidentData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_incident.additional_properties = d return update_incident - - @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_incident_action_item.py b/rootly_sdk/models/update_incident_action_item.py index cd2fc2ac..02baccb9 100644 --- a/rootly_sdk/models/update_incident_action_item.py +++ b/rootly_sdk/models/update_incident_action_item.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_incident_action_item_data import UpdateIncidentActionItemData @@ -18,14 +19,13 @@ class UpdateIncidentActionItem: data (UpdateIncidentActionItemData): """ - data: "UpdateIncidentActionItemData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateIncidentActionItemData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_incident_action_item.additional_properties = d return update_incident_action_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_incident_action_item_data.py b/rootly_sdk/models/update_incident_action_item_data.py index 12a47e8c..bd0fa8ed 100644 --- a/rootly_sdk/models/update_incident_action_item_data.py +++ b/rootly_sdk/models/update_incident_action_item_data.py @@ -1,13 +1,15 @@ +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_incident_action_item_data_type import ( UpdateIncidentActionItemDataType, check_update_incident_action_item_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_incident_action_item_data_attributes import UpdateIncidentActionItemDataAttributes @@ -22,25 +24,31 @@ class UpdateIncidentActionItemData: Attributes: type_ (UpdateIncidentActionItemDataType): attributes (UpdateIncidentActionItemDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateIncidentActionItemDataType - attributes: "UpdateIncidentActionItemDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateIncidentActionItemDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateIncidentActionItemDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_incident_action_item_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_incident_action_item_data.additional_properties = d return update_incident_action_item_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_incident_action_item_data_attributes.py b/rootly_sdk/models/update_incident_action_item_data_attributes.py index e4bda19b..987adebb 100644 --- a/rootly_sdk/models/update_incident_action_item_data_attributes.py +++ b/rootly_sdk/models/update_incident_action_item_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -30,57 +32,57 @@ class UpdateIncidentActionItemDataAttributes: """ Attributes: - 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): 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: 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"] = ( + 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 = ( UNSET ) def to_dict(self) -> dict[str, Any]: summary = self.summary - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind - assigned_to_user_id: None | Unset | int + assigned_to_user_id: int | None | Unset 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: None | Unset | list[str] + assigned_to_group_ids: list[str] | None | Unset if isinstance(self.assigned_to_group_ids, Unset): assigned_to_group_ids = UNSET elif isinstance(self.assigned_to_group_ids, list): @@ -89,39 +91,39 @@ def to_dict(self) -> dict[str, Any]: else: assigned_to_group_ids = self.assigned_to_group_ids - priority: Unset | str = UNSET + priority: str | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status - due_date: None | Unset | str + due_date: None | str | Unset if isinstance(self.due_date, Unset): due_date = UNSET else: due_date = self.due_date - jira_issue_id: None | Unset | str + jira_issue_id: None | str | Unset if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_key: None | Unset | str + jira_issue_key: None | str | Unset if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_url: None | Unset | str + jira_issue_url: None | str | Unset if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - form_field_selections: None | Unset | list[dict[str, Any]] + form_field_selections: list[dict[str, Any]] | None | Unset if isinstance(self.form_field_selections, Unset): form_field_selections = UNSET elif isinstance(self.form_field_selections, list): @@ -172,32 +174,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) _kind = d.pop("kind", UNSET) - kind: Unset | UpdateIncidentActionItemDataAttributesKind + kind: UpdateIncidentActionItemDataAttributesKind | Unset 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) -> None | Unset | int: + def _parse_assigned_to_user_id(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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) -> None | Unset | list[str]: + def _parse_assigned_to_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -208,65 +210,65 @@ def _parse_assigned_to_group_ids(data: object) -> None | Unset | list[str]: assigned_to_group_ids_type_0 = cast(list[str], data) return assigned_to_group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) assigned_to_group_ids = _parse_assigned_to_group_ids(d.pop("assigned_to_group_ids", UNSET)) _priority = d.pop("priority", UNSET) - priority: Unset | UpdateIncidentActionItemDataAttributesPriority + priority: UpdateIncidentActionItemDataAttributesPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: priority = check_update_incident_action_item_data_attributes_priority(_priority) _status = d.pop("status", UNSET) - status: Unset | UpdateIncidentActionItemDataAttributesStatus + status: UpdateIncidentActionItemDataAttributesStatus | Unset if isinstance(_status, Unset): status = UNSET else: status = check_update_incident_action_item_data_attributes_status(_status) - def _parse_due_date(data: object) -> None | Unset | str: + def _parse_due_date(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) due_date = _parse_due_date(d.pop("due_date", UNSET)) - def _parse_jira_issue_id(data: object) -> None | Unset | str: + def _parse_jira_issue_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_key(data: object) -> None | Unset | str: + def _parse_jira_issue_key(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_url(data: object) -> None | Unset | str: + def _parse_jira_issue_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) def _parse_form_field_selections( data: object, - ) -> None | Unset | list["UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item"]: + ) -> list[UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -286,9 +288,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item"], data) + return cast(list[UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item] | None | Unset, 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 1285dd67..95df1e5a 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,42 +15,41 @@ class UpdateIncidentActionItemDataAttributesFormFieldSelectionsType0Item: """ Attributes: form_field_id (str): ID of the custom field - 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 + 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 """ form_field_id: str - 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 + 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 def to_dict(self) -> dict[str, Any]: form_field_id = self.form_field_id id = self.id - value: None | Unset | list[str] | str + value: list[str] | None | str | Unset if isinstance(self.value, Unset): value = UNSET elif isinstance(self.value, list): @@ -57,43 +58,43 @@ def to_dict(self) -> dict[str, Any]: else: value = self.value - selected_option_ids: Unset | list[str] = UNSET + selected_option_ids: list[str] | Unset = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_user_ids: Unset | list[int] = UNSET + selected_user_ids: list[int] | Unset = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_group_ids: Unset | list[str] = UNSET + selected_group_ids: list[str] | Unset = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_service_ids: Unset | list[str] = UNSET + selected_service_ids: list[str] | Unset = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: Unset | list[str] = UNSET + selected_functionality_ids: list[str] | Unset = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_catalog_entity_ids: list[str] | Unset = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_environment_ids: Unset | list[str] = UNSET + selected_environment_ids: list[str] | Unset = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: Unset | list[str] = UNSET + selected_cause_ids: list[str] | Unset = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: Unset | list[str] = UNSET + selected_incident_type_ids: list[str] | Unset = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids - field_destroy: None | Unset | bool + field_destroy: bool | None | Unset if isinstance(self.field_destroy, Unset): field_destroy = UNSET else: @@ -140,7 +141,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: id = d.pop("id", UNSET) - def _parse_value(data: object) -> None | Unset | list[str] | str: + def _parse_value(data: object) -> list[str] | None | str | Unset: if data is None: return data if isinstance(data, Unset): @@ -151,9 +152,9 @@ def _parse_value(data: object) -> None | Unset | list[str] | str: value_type_1 = cast(list[str], data) return value_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str] | str, data) + return cast(list[str] | None | str | Unset, data) value = _parse_value(d.pop("value", UNSET)) @@ -175,12 +176,12 @@ def _parse_value(data: object) -> None | Unset | list[str] | str: selected_incident_type_ids = cast(list[str], d.pop("selected_incident_type_ids", UNSET)) - def _parse_field_destroy(data: object) -> None | Unset | bool: + def _parse_field_destroy(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) field_destroy = _parse_field_destroy(d.pop("_destroy", UNSET)) diff --git a/rootly_sdk/models/update_incident_action_item_data_attributes_kind.py b/rootly_sdk/models/update_incident_action_item_data_attributes_kind.py index 5efa851f..cb738be0 100644 --- a/rootly_sdk/models/update_incident_action_item_data_attributes_kind.py +++ b/rootly_sdk/models/update_incident_action_item_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentActionItemDataAttributesKind = Literal["follow_up", "task"] @@ -14,7 +14,7 @@ def check_update_incident_action_item_data_attributes_kind( if value is None: return None if value in UPDATE_INCIDENT_ACTION_ITEM_DATA_ATTRIBUTES_KIND_VALUES: - return cast(UpdateIncidentActionItemDataAttributesKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_ACTION_ITEM_DATA_ATTRIBUTES_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_action_item_data_attributes_priority.py b/rootly_sdk/models/update_incident_action_item_data_attributes_priority.py index 66cd3c6e..0ea0148a 100644 --- a/rootly_sdk/models/update_incident_action_item_data_attributes_priority.py +++ b/rootly_sdk/models/update_incident_action_item_data_attributes_priority.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentActionItemDataAttributesPriority = Literal["high", "low", "medium"] @@ -15,7 +15,7 @@ def check_update_incident_action_item_data_attributes_priority( if value is None: return None if value in UPDATE_INCIDENT_ACTION_ITEM_DATA_ATTRIBUTES_PRIORITY_VALUES: - return cast(UpdateIncidentActionItemDataAttributesPriority, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_ACTION_ITEM_DATA_ATTRIBUTES_PRIORITY_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_action_item_data_attributes_status.py b/rootly_sdk/models/update_incident_action_item_data_attributes_status.py index c466d496..5c88241d 100644 --- a/rootly_sdk/models/update_incident_action_item_data_attributes_status.py +++ b/rootly_sdk/models/update_incident_action_item_data_attributes_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentActionItemDataAttributesStatus = Literal["cancelled", "done", "in_progress", "open"] @@ -16,7 +16,7 @@ def check_update_incident_action_item_data_attributes_status( if value is None: return None if value in UPDATE_INCIDENT_ACTION_ITEM_DATA_ATTRIBUTES_STATUS_VALUES: - return cast(UpdateIncidentActionItemDataAttributesStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_ACTION_ITEM_DATA_ATTRIBUTES_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_action_item_data_type.py b/rootly_sdk/models/update_incident_action_item_data_type.py index 02ccd7b6..542ea429 100644 --- a/rootly_sdk/models/update_incident_action_item_data_type.py +++ b/rootly_sdk/models/update_incident_action_item_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentActionItemDataType = Literal["incident_action_items"] @@ -11,5 +11,5 @@ def check_update_incident_action_item_data_type(value: str | None) -> UpdateInci if value is None: return None if value in UPDATE_INCIDENT_ACTION_ITEM_DATA_TYPE_VALUES: - return cast(UpdateIncidentActionItemDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_ACTION_ITEM_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_incident_custom_field_selection.py b/rootly_sdk/models/update_incident_custom_field_selection.py index 3690992c..43d07f79 100644 --- a/rootly_sdk/models/update_incident_custom_field_selection.py +++ b/rootly_sdk/models/update_incident_custom_field_selection.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_incident_custom_field_selection_data import UpdateIncidentCustomFieldSelectionData @@ -18,14 +19,13 @@ class UpdateIncidentCustomFieldSelection: data (UpdateIncidentCustomFieldSelectionData): """ - data: "UpdateIncidentCustomFieldSelectionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateIncidentCustomFieldSelectionData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_incident_custom_field_selection.additional_properties = d return update_incident_custom_field_selection - - @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_incident_custom_field_selection_data.py b/rootly_sdk/models/update_incident_custom_field_selection_data.py index a439389b..c24fd65c 100644 --- a/rootly_sdk/models/update_incident_custom_field_selection_data.py +++ b/rootly_sdk/models/update_incident_custom_field_selection_data.py @@ -1,13 +1,15 @@ +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_incident_custom_field_selection_data_type import ( UpdateIncidentCustomFieldSelectionDataType, check_update_incident_custom_field_selection_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_incident_custom_field_selection_data_attributes import ( @@ -24,25 +26,31 @@ class UpdateIncidentCustomFieldSelectionData: Attributes: type_ (UpdateIncidentCustomFieldSelectionDataType): attributes (UpdateIncidentCustomFieldSelectionDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateIncidentCustomFieldSelectionDataType - attributes: "UpdateIncidentCustomFieldSelectionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateIncidentCustomFieldSelectionDataAttributes + id: str | Unset = 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 @@ -57,26 +65,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateIncidentCustomFieldSelectionDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_incident_custom_field_selection_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_incident_custom_field_selection_data.additional_properties = d return update_incident_custom_field_selection_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_incident_custom_field_selection_data_attributes.py b/rootly_sdk/models/update_incident_custom_field_selection_data_attributes.py index ddd3fa07..04f6d0da 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,21 +14,21 @@ class UpdateIncidentCustomFieldSelectionDataAttributes: """ Attributes: - value (Union[None, Unset, str]): The selected value for text kind custom fields - selected_option_ids (Union[Unset, list[int]]): + value (None | str | Unset): The selected value for text kind custom fields + selected_option_ids (list[int] | Unset): """ - value: None | Unset | str = UNSET - selected_option_ids: Unset | list[int] = UNSET + value: None | str | Unset = UNSET + selected_option_ids: list[int] | Unset = UNSET def to_dict(self) -> dict[str, Any]: - value: None | Unset | str + value: None | str | Unset if isinstance(self.value, Unset): value = UNSET else: value = self.value - selected_option_ids: Unset | list[int] = UNSET + selected_option_ids: list[int] | Unset = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids @@ -44,12 +46,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 | Unset | str: + def _parse_value(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/update_incident_custom_field_selection_data_type.py b/rootly_sdk/models/update_incident_custom_field_selection_data_type.py index 76ae6458..88a779f9 100644 --- a/rootly_sdk/models/update_incident_custom_field_selection_data_type.py +++ b/rootly_sdk/models/update_incident_custom_field_selection_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentCustomFieldSelectionDataType = Literal["incident_custom_field_selections"] @@ -13,7 +13,7 @@ def check_update_incident_custom_field_selection_data_type( if value is None: return None if value in UPDATE_INCIDENT_CUSTOM_FIELD_SELECTION_DATA_TYPE_VALUES: - return cast(UpdateIncidentCustomFieldSelectionDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_CUSTOM_FIELD_SELECTION_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_data.py b/rootly_sdk/models/update_incident_data.py index 6f4da343..39a852a2 100644 --- a/rootly_sdk/models/update_incident_data.py +++ b/rootly_sdk/models/update_incident_data.py @@ -1,10 +1,12 @@ +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_incident_data_type import UpdateIncidentDataType, check_update_incident_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_incident_data_attributes import UpdateIncidentDataAttributes @@ -19,25 +21,31 @@ class UpdateIncidentData: Attributes: type_ (UpdateIncidentDataType): attributes (UpdateIncidentDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateIncidentDataType - attributes: "UpdateIncidentDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateIncidentDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateIncidentDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_incident_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_incident_data.additional_properties = d return update_incident_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_incident_data_attributes.py b/rootly_sdk/models/update_incident_data_attributes.py index 0d2246cf..bc7016c3 100644 --- a/rootly_sdk/models/update_incident_data_attributes.py +++ b/rootly_sdk/models/update_incident_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -24,146 +26,152 @@ class UpdateIncidentDataAttributes: """ Attributes: - 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: + 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: {"platform":"osx", "version": "1.29"} - 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? + 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 + linear_issue_key (None | str | Unset): Linear issue key + linear_issue_id (None | str | Unset): Linear issue ID + linear_issue_url (None | str | Unset): Linear 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? """ - 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 + 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 + linear_issue_key: None | str | Unset = UNSET + linear_issue_id: None | str | Unset = UNSET + linear_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 def to_dict(self) -> dict[str, Any]: from ..models.update_incident_data_attributes_labels_type_0 import UpdateIncidentDataAttributesLabelsType0 - title: None | Unset | str + title: None | str | Unset if isinstance(self.title, Unset): title = UNSET else: title = self.title - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind - parent_incident_id: None | Unset | str + parent_incident_id: None | str | Unset if isinstance(self.parent_incident_id, Unset): parent_incident_id = UNSET else: parent_incident_id = self.parent_incident_id - duplicate_incident_id: None | Unset | str + duplicate_incident_id: None | str | Unset if isinstance(self.duplicate_incident_id, Unset): duplicate_incident_id = UNSET else: duplicate_incident_id = self.duplicate_incident_id - summary: None | Unset | str + summary: None | str | Unset if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status - private: None | Unset | bool + private: bool | None | Unset if isinstance(self.private, Unset): private = UNSET else: private = self.private - severity_id: None | Unset | str + severity_id: None | str | Unset if isinstance(self.severity_id, Unset): severity_id = UNSET else: severity_id = self.severity_id - public_title: None | Unset | str + public_title: None | str | Unset if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - alert_ids: None | Unset | list[str] + alert_ids: list[str] | None | Unset if isinstance(self.alert_ids, Unset): alert_ids = UNSET elif isinstance(self.alert_ids, list): @@ -172,7 +180,7 @@ def to_dict(self) -> dict[str, Any]: else: alert_ids = self.alert_ids - environment_ids: None | Unset | list[str] + environment_ids: list[str] | None | Unset if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -181,7 +189,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - incident_type_ids: None | Unset | list[str] + incident_type_ids: list[str] | None | Unset if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -190,7 +198,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_type_ids = self.incident_type_ids - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -199,7 +207,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: None | Unset | list[str] + functionality_ids: list[str] | None | Unset if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -208,7 +216,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - muted_service_ids: None | Unset | list[str] + muted_service_ids: list[str] | None | Unset if isinstance(self.muted_service_ids, Unset): muted_service_ids = UNSET elif isinstance(self.muted_service_ids, list): @@ -217,7 +225,7 @@ def to_dict(self) -> dict[str, Any]: else: muted_service_ids = self.muted_service_ids - group_ids: None | Unset | list[str] + group_ids: list[str] | None | Unset if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -226,7 +234,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - cause_ids: None | Unset | list[str] + cause_ids: list[str] | None | Unset if isinstance(self.cause_ids, Unset): cause_ids = UNSET elif isinstance(self.cause_ids, list): @@ -235,7 +243,7 @@ def to_dict(self) -> dict[str, Any]: else: cause_ids = self.cause_ids - labels: None | Unset | dict[str, Any] + labels: dict[str, Any] | None | Unset if isinstance(self.labels, Unset): labels = UNSET elif isinstance(self.labels, UpdateIncidentDataAttributesLabelsType0): @@ -243,133 +251,151 @@ def to_dict(self) -> dict[str, Any]: else: labels = self.labels - slack_channel_id: None | Unset | str + slack_channel_id: None | str | Unset if isinstance(self.slack_channel_id, Unset): slack_channel_id = UNSET else: slack_channel_id = self.slack_channel_id - slack_channel_name: None | Unset | str + slack_channel_name: None | str | Unset if isinstance(self.slack_channel_name, Unset): slack_channel_name = UNSET else: slack_channel_name = self.slack_channel_name - slack_channel_url: None | Unset | str + slack_channel_url: None | str | Unset if isinstance(self.slack_channel_url, Unset): slack_channel_url = UNSET else: slack_channel_url = self.slack_channel_url - slack_channel_archived: None | Unset | bool + slack_channel_archived: bool | None | Unset if isinstance(self.slack_channel_archived, Unset): slack_channel_archived = UNSET else: slack_channel_archived = self.slack_channel_archived - google_drive_parent_id: None | Unset | str + google_drive_parent_id: None | str | Unset 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 | Unset | str + google_drive_url: None | str | Unset if isinstance(self.google_drive_url, Unset): google_drive_url = UNSET else: google_drive_url = self.google_drive_url - jira_issue_key: None | Unset | str + jira_issue_key: None | str | Unset if isinstance(self.jira_issue_key, Unset): jira_issue_key = UNSET else: jira_issue_key = self.jira_issue_key - jira_issue_id: None | Unset | str + jira_issue_id: None | str | Unset if isinstance(self.jira_issue_id, Unset): jira_issue_id = UNSET else: jira_issue_id = self.jira_issue_id - jira_issue_url: None | Unset | str + jira_issue_url: None | str | Unset if isinstance(self.jira_issue_url, Unset): jira_issue_url = UNSET else: jira_issue_url = self.jira_issue_url - scheduled_for: None | Unset | str + linear_issue_key: None | str | Unset + if isinstance(self.linear_issue_key, Unset): + linear_issue_key = UNSET + else: + linear_issue_key = self.linear_issue_key + + linear_issue_id: None | str | Unset + 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 + if isinstance(self.linear_issue_url, Unset): + linear_issue_url = UNSET + else: + linear_issue_url = self.linear_issue_url + + scheduled_for: None | str | Unset if isinstance(self.scheduled_for, Unset): scheduled_for = UNSET else: scheduled_for = self.scheduled_for - scheduled_until: None | Unset | str + scheduled_until: None | str | Unset if isinstance(self.scheduled_until, Unset): scheduled_until = UNSET else: scheduled_until = self.scheduled_until - in_triage_at: None | Unset | str + in_triage_at: None | str | Unset if isinstance(self.in_triage_at, Unset): in_triage_at = UNSET else: in_triage_at = self.in_triage_at - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - detected_at: None | Unset | str + detected_at: None | str | Unset if isinstance(self.detected_at, Unset): detected_at = UNSET else: detected_at = self.detected_at - acknowledged_at: None | Unset | str + acknowledged_at: None | str | Unset if isinstance(self.acknowledged_at, Unset): acknowledged_at = UNSET else: acknowledged_at = self.acknowledged_at - mitigated_at: None | Unset | str + mitigated_at: None | str | Unset if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: None | Unset | str + resolved_at: None | str | Unset if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: resolved_at = self.resolved_at - closed_at: None | Unset | str + closed_at: None | str | Unset if isinstance(self.closed_at, Unset): closed_at = UNSET else: closed_at = self.closed_at - cancelled_at: None | Unset | str + cancelled_at: None | str | Unset if isinstance(self.cancelled_at, Unset): cancelled_at = UNSET else: cancelled_at = self.cancelled_at - mitigation_message: None | Unset | str + mitigation_message: None | str | Unset if isinstance(self.mitigation_message, Unset): mitigation_message = UNSET else: mitigation_message = self.mitigation_message - resolution_message: None | Unset | str + resolution_message: None | str | Unset if isinstance(self.resolution_message, Unset): resolution_message = UNSET else: resolution_message = self.resolution_message - cancellation_message: None | Unset | str + cancellation_message: None | str | Unset if isinstance(self.cancellation_message, Unset): cancellation_message = UNSET else: @@ -432,6 +458,12 @@ def to_dict(self) -> dict[str, Any]: field_dict["jira_issue_id"] = jira_issue_id if jira_issue_url is not UNSET: field_dict["jira_issue_url"] = jira_issue_url + if linear_issue_key is not UNSET: + field_dict["linear_issue_key"] = linear_issue_key + if linear_issue_id is not UNSET: + field_dict["linear_issue_id"] = linear_issue_id + if linear_issue_url is not UNSET: + field_dict["linear_issue_url"] = linear_issue_url if scheduled_for is not UNSET: field_dict["scheduled_for"] = scheduled_for if scheduled_until is not UNSET: @@ -467,84 +499,84 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_title(data: object) -> None | Unset | str: + def _parse_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) title = _parse_title(d.pop("title", UNSET)) _kind = d.pop("kind", UNSET) - kind: Unset | UpdateIncidentDataAttributesKind + kind: UpdateIncidentDataAttributesKind | Unset if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_incident_data_attributes_kind(_kind) - def _parse_parent_incident_id(data: object) -> None | Unset | str: + def _parse_parent_incident_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) parent_incident_id = _parse_parent_incident_id(d.pop("parent_incident_id", UNSET)) - def _parse_duplicate_incident_id(data: object) -> None | Unset | str: + def _parse_duplicate_incident_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) duplicate_incident_id = _parse_duplicate_incident_id(d.pop("duplicate_incident_id", UNSET)) - def _parse_summary(data: object) -> None | Unset | str: + def _parse_summary(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) summary = _parse_summary(d.pop("summary", UNSET)) _status = d.pop("status", UNSET) - status: Unset | UpdateIncidentDataAttributesStatus + status: UpdateIncidentDataAttributesStatus | Unset if isinstance(_status, Unset): status = UNSET else: status = check_update_incident_data_attributes_status(_status) - def _parse_private(data: object) -> None | Unset | bool: + def _parse_private(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) private = _parse_private(d.pop("private", UNSET)) - def _parse_severity_id(data: object) -> None | Unset | str: + def _parse_severity_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) severity_id = _parse_severity_id(d.pop("severity_id", UNSET)) - def _parse_public_title(data: object) -> None | Unset | str: + def _parse_public_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_alert_ids(data: object) -> None | Unset | list[str]: + def _parse_alert_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -555,13 +587,13 @@ def _parse_alert_ids(data: object) -> None | Unset | list[str]: alert_ids_type_0 = cast(list[str], data) return alert_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) alert_ids = _parse_alert_ids(d.pop("alert_ids", UNSET)) - def _parse_environment_ids(data: object) -> None | Unset | list[str]: + def _parse_environment_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -572,13 +604,13 @@ def _parse_environment_ids(data: object) -> None | Unset | list[str]: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: + def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -589,13 +621,13 @@ def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -606,13 +638,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> None | Unset | list[str]: + def _parse_functionality_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -623,13 +655,13 @@ def _parse_functionality_ids(data: object) -> None | Unset | list[str]: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_muted_service_ids(data: object) -> None | Unset | list[str]: + def _parse_muted_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -640,13 +672,13 @@ def _parse_muted_service_ids(data: object) -> None | Unset | list[str]: muted_service_ids_type_0 = cast(list[str], data) return muted_service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) muted_service_ids = _parse_muted_service_ids(d.pop("muted_service_ids", UNSET)) - def _parse_group_ids(data: object) -> None | Unset | list[str]: + def _parse_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -657,13 +689,13 @@ def _parse_group_ids(data: object) -> None | Unset | list[str]: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_cause_ids(data: object) -> None | Unset | list[str]: + def _parse_cause_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -674,13 +706,13 @@ def _parse_cause_ids(data: object) -> None | Unset | list[str]: cause_ids_type_0 = cast(list[str], data) return cause_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) cause_ids = _parse_cause_ids(d.pop("cause_ids", UNSET)) - def _parse_labels(data: object) -> Union["UpdateIncidentDataAttributesLabelsType0", None, Unset]: + def _parse_labels(data: object) -> None | Unset | UpdateIncidentDataAttributesLabelsType0: if data is None: return data if isinstance(data, Unset): @@ -691,207 +723,234 @@ def _parse_labels(data: object) -> Union["UpdateIncidentDataAttributesLabelsType labels_type_0 = UpdateIncidentDataAttributesLabelsType0.from_dict(data) return labels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["UpdateIncidentDataAttributesLabelsType0", None, Unset], data) + return cast(None | Unset | UpdateIncidentDataAttributesLabelsType0, data) labels = _parse_labels(d.pop("labels", UNSET)) - def _parse_slack_channel_id(data: object) -> None | Unset | str: + def _parse_slack_channel_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slack_channel_id = _parse_slack_channel_id(d.pop("slack_channel_id", UNSET)) - def _parse_slack_channel_name(data: object) -> None | Unset | str: + def _parse_slack_channel_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slack_channel_name = _parse_slack_channel_name(d.pop("slack_channel_name", UNSET)) - def _parse_slack_channel_url(data: object) -> None | Unset | str: + def _parse_slack_channel_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slack_channel_url = _parse_slack_channel_url(d.pop("slack_channel_url", UNSET)) - def _parse_slack_channel_archived(data: object) -> None | Unset | bool: + def _parse_slack_channel_archived(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) slack_channel_archived = _parse_slack_channel_archived(d.pop("slack_channel_archived", UNSET)) - def _parse_google_drive_parent_id(data: object) -> None | Unset | str: + def _parse_google_drive_parent_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_google_drive_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) google_drive_url = _parse_google_drive_url(d.pop("google_drive_url", UNSET)) - def _parse_jira_issue_key(data: object) -> None | Unset | str: + def _parse_jira_issue_key(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) jira_issue_key = _parse_jira_issue_key(d.pop("jira_issue_key", UNSET)) - def _parse_jira_issue_id(data: object) -> None | Unset | str: + def _parse_jira_issue_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) jira_issue_id = _parse_jira_issue_id(d.pop("jira_issue_id", UNSET)) - def _parse_jira_issue_url(data: object) -> None | Unset | str: + def _parse_jira_issue_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) - def _parse_scheduled_for(data: object) -> None | Unset | str: + def _parse_linear_issue_key(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + linear_issue_key = _parse_linear_issue_key(d.pop("linear_issue_key", UNSET)) + + def _parse_linear_issue_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + linear_issue_id = _parse_linear_issue_id(d.pop("linear_issue_id", UNSET)) + + def _parse_linear_issue_url(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + linear_issue_url = _parse_linear_issue_url(d.pop("linear_issue_url", UNSET)) + + def _parse_scheduled_for(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) scheduled_for = _parse_scheduled_for(d.pop("scheduled_for", UNSET)) - def _parse_scheduled_until(data: object) -> None | Unset | str: + def _parse_scheduled_until(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) scheduled_until = _parse_scheduled_until(d.pop("scheduled_until", UNSET)) - def _parse_in_triage_at(data: object) -> None | Unset | str: + def _parse_in_triage_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) in_triage_at = _parse_in_triage_at(d.pop("in_triage_at", UNSET)) - def _parse_started_at(data: object) -> None | Unset | str: + def _parse_started_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_detected_at(data: object) -> None | Unset | str: + def _parse_detected_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) detected_at = _parse_detected_at(d.pop("detected_at", UNSET)) - def _parse_acknowledged_at(data: object) -> None | Unset | str: + def _parse_acknowledged_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) acknowledged_at = _parse_acknowledged_at(d.pop("acknowledged_at", UNSET)) - def _parse_mitigated_at(data: object) -> None | Unset | str: + def _parse_mitigated_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> None | Unset | str: + def _parse_resolved_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) - def _parse_closed_at(data: object) -> None | Unset | str: + def _parse_closed_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) closed_at = _parse_closed_at(d.pop("closed_at", UNSET)) - def _parse_cancelled_at(data: object) -> None | Unset | str: + def _parse_cancelled_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) cancelled_at = _parse_cancelled_at(d.pop("cancelled_at", UNSET)) - def _parse_mitigation_message(data: object) -> None | Unset | str: + def _parse_mitigation_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) mitigation_message = _parse_mitigation_message(d.pop("mitigation_message", UNSET)) - def _parse_resolution_message(data: object) -> None | Unset | str: + def _parse_resolution_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) resolution_message = _parse_resolution_message(d.pop("resolution_message", UNSET)) - def _parse_cancellation_message(data: object) -> None | Unset | str: + def _parse_cancellation_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) cancellation_message = _parse_cancellation_message(d.pop("cancellation_message", UNSET)) @@ -923,6 +982,9 @@ def _parse_cancellation_message(data: object) -> None | Unset | str: jira_issue_key=jira_issue_key, jira_issue_id=jira_issue_id, jira_issue_url=jira_issue_url, + linear_issue_key=linear_issue_key, + linear_issue_id=linear_issue_id, + linear_issue_url=linear_issue_url, scheduled_for=scheduled_for, scheduled_until=scheduled_until, in_triage_at=in_triage_at, diff --git a/rootly_sdk/models/update_incident_data_attributes_kind.py b/rootly_sdk/models/update_incident_data_attributes_kind.py index 725f0b9b..d8749f54 100644 --- a/rootly_sdk/models/update_incident_data_attributes_kind.py +++ b/rootly_sdk/models/update_incident_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentDataAttributesKind = Literal[ "backfilled", "example", "example_sub", "normal", "normal_sub", "scheduled", "scheduled_sub", "test", "test_sub" @@ -21,5 +21,5 @@ def check_update_incident_data_attributes_kind(value: str | None) -> UpdateIncid if value is None: return None if value in UPDATE_INCIDENT_DATA_ATTRIBUTES_KIND_VALUES: - return cast(UpdateIncidentDataAttributesKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_DATA_ATTRIBUTES_KIND_VALUES!r}") 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 cd7027c9..3bbf882a 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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_data_attributes_status.py b/rootly_sdk/models/update_incident_data_attributes_status.py index c5d03264..90e6cf90 100644 --- a/rootly_sdk/models/update_incident_data_attributes_status.py +++ b/rootly_sdk/models/update_incident_data_attributes_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentDataAttributesStatus = Literal[ "acknowledged", @@ -33,5 +33,5 @@ def check_update_incident_data_attributes_status(value: str | None) -> UpdateInc if value is None: return None if value in UPDATE_INCIDENT_DATA_ATTRIBUTES_STATUS_VALUES: - return cast(UpdateIncidentDataAttributesStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_DATA_ATTRIBUTES_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/update_incident_data_type.py b/rootly_sdk/models/update_incident_data_type.py index 6f8d9d25..d1d2ebcd 100644 --- a/rootly_sdk/models/update_incident_data_type.py +++ b/rootly_sdk/models/update_incident_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentDataType = Literal["incidents"] @@ -11,5 +11,5 @@ def check_update_incident_data_type(value: str | None) -> UpdateIncidentDataType if value is None: return None if value in UPDATE_INCIDENT_DATA_TYPE_VALUES: - return cast(UpdateIncidentDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_incident_event.py b/rootly_sdk/models/update_incident_event.py index ab56ae88..0f032460 100644 --- a/rootly_sdk/models/update_incident_event.py +++ b/rootly_sdk/models/update_incident_event.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_incident_event_data import UpdateIncidentEventData @@ -18,14 +19,13 @@ class UpdateIncidentEvent: data (UpdateIncidentEventData): """ - data: "UpdateIncidentEventData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateIncidentEventData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_incident_event.additional_properties = d return update_incident_event - - @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_incident_event_data.py b/rootly_sdk/models/update_incident_event_data.py index cc26fc06..19efcdb6 100644 --- a/rootly_sdk/models/update_incident_event_data.py +++ b/rootly_sdk/models/update_incident_event_data.py @@ -1,10 +1,12 @@ +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_incident_event_data_type import UpdateIncidentEventDataType, check_update_incident_event_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_incident_event_data_attributes import UpdateIncidentEventDataAttributes @@ -19,25 +21,31 @@ class UpdateIncidentEventData: Attributes: type_ (UpdateIncidentEventDataType): attributes (UpdateIncidentEventDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateIncidentEventDataType - attributes: "UpdateIncidentEventDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateIncidentEventDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateIncidentEventDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_incident_event_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_incident_event_data.additional_properties = d return update_incident_event_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_incident_event_data_attributes.py b/rootly_sdk/models/update_incident_event_data_attributes.py index 07151a8c..1d966e3c 100644 --- a/rootly_sdk/models/update_incident_event_data_attributes.py +++ b/rootly_sdk/models/update_incident_event_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -16,18 +18,17 @@ class UpdateIncidentEventDataAttributes: """ Attributes: - event (Union[Unset, str]): The summary of the incident event - visibility (Union[Unset, UpdateIncidentEventDataAttributesVisibility]): The visibility of the incident action - item + event (str | Unset): The summary of the incident event + visibility (UpdateIncidentEventDataAttributesVisibility | Unset): The visibility of the incident action item """ - event: Unset | str = UNSET - visibility: Unset | UpdateIncidentEventDataAttributesVisibility = UNSET + event: str | Unset = UNSET + visibility: UpdateIncidentEventDataAttributesVisibility | Unset = UNSET def to_dict(self) -> dict[str, Any]: event = self.event - visibility: Unset | str = UNSET + visibility: str | Unset = UNSET if not isinstance(self.visibility, Unset): visibility = self.visibility @@ -47,7 +48,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: event = d.pop("event", UNSET) _visibility = d.pop("visibility", UNSET) - visibility: Unset | UpdateIncidentEventDataAttributesVisibility + visibility: UpdateIncidentEventDataAttributesVisibility | Unset if isinstance(_visibility, Unset): visibility = UNSET else: diff --git a/rootly_sdk/models/update_incident_event_data_attributes_visibility.py b/rootly_sdk/models/update_incident_event_data_attributes_visibility.py index 327c9694..e834fb36 100644 --- a/rootly_sdk/models/update_incident_event_data_attributes_visibility.py +++ b/rootly_sdk/models/update_incident_event_data_attributes_visibility.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentEventDataAttributesVisibility = Literal["external", "internal"] @@ -14,7 +14,7 @@ def check_update_incident_event_data_attributes_visibility( if value is None: return None if value in UPDATE_INCIDENT_EVENT_DATA_ATTRIBUTES_VISIBILITY_VALUES: - return cast(UpdateIncidentEventDataAttributesVisibility, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_EVENT_DATA_ATTRIBUTES_VISIBILITY_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_event_data_type.py b/rootly_sdk/models/update_incident_event_data_type.py index f2ed7e2c..989a8118 100644 --- a/rootly_sdk/models/update_incident_event_data_type.py +++ b/rootly_sdk/models/update_incident_event_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentEventDataType = Literal["incident_events"] @@ -11,5 +11,5 @@ def check_update_incident_event_data_type(value: str | None) -> UpdateIncidentEv if value is None: return None if value in UPDATE_INCIDENT_EVENT_DATA_TYPE_VALUES: - return cast(UpdateIncidentEventDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_EVENT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_incident_event_functionality.py b/rootly_sdk/models/update_incident_event_functionality.py index 1991760e..c0a3fb2f 100644 --- a/rootly_sdk/models/update_incident_event_functionality.py +++ b/rootly_sdk/models/update_incident_event_functionality.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_incident_event_functionality_data import UpdateIncidentEventFunctionalityData @@ -18,14 +19,13 @@ class UpdateIncidentEventFunctionality: data (UpdateIncidentEventFunctionalityData): """ - data: "UpdateIncidentEventFunctionalityData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateIncidentEventFunctionalityData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_incident_event_functionality.additional_properties = d return update_incident_event_functionality - - @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_incident_event_functionality_data.py b/rootly_sdk/models/update_incident_event_functionality_data.py index 66eacd0d..539f5110 100644 --- a/rootly_sdk/models/update_incident_event_functionality_data.py +++ b/rootly_sdk/models/update_incident_event_functionality_data.py @@ -1,13 +1,15 @@ +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_incident_event_functionality_data_type import ( UpdateIncidentEventFunctionalityDataType, check_update_incident_event_functionality_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_incident_event_functionality_data_attributes import ( @@ -24,25 +26,31 @@ class UpdateIncidentEventFunctionalityData: Attributes: type_ (UpdateIncidentEventFunctionalityDataType): attributes (UpdateIncidentEventFunctionalityDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateIncidentEventFunctionalityDataType - attributes: "UpdateIncidentEventFunctionalityDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateIncidentEventFunctionalityDataAttributes + id: str | Unset = 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 @@ -57,26 +65,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateIncidentEventFunctionalityDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_incident_event_functionality_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_incident_event_functionality_data.additional_properties = d return update_incident_event_functionality_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_incident_event_functionality_data_attributes.py b/rootly_sdk/models/update_incident_event_functionality_data_attributes.py index e036a562..3dd37190 100644 --- a/rootly_sdk/models/update_incident_event_functionality_data_attributes.py +++ b/rootly_sdk/models/update_incident_event_functionality_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_incident_event_functionality_data_attributes_status.py b/rootly_sdk/models/update_incident_event_functionality_data_attributes_status.py index dd149623..e999a522 100644 --- a/rootly_sdk/models/update_incident_event_functionality_data_attributes_status.py +++ b/rootly_sdk/models/update_incident_event_functionality_data_attributes_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentEventFunctionalityDataAttributesStatus = Literal["major_outage", "operational", "partial_outage"] @@ -17,7 +17,7 @@ def check_update_incident_event_functionality_data_attributes_status( if value is None: return None if value in UPDATE_INCIDENT_EVENT_FUNCTIONALITY_DATA_ATTRIBUTES_STATUS_VALUES: - return cast(UpdateIncidentEventFunctionalityDataAttributesStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_EVENT_FUNCTIONALITY_DATA_ATTRIBUTES_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_event_functionality_data_type.py b/rootly_sdk/models/update_incident_event_functionality_data_type.py index be6c3143..256ad4b2 100644 --- a/rootly_sdk/models/update_incident_event_functionality_data_type.py +++ b/rootly_sdk/models/update_incident_event_functionality_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentEventFunctionalityDataType = Literal["incident_event_functionalities"] @@ -13,7 +13,7 @@ def check_update_incident_event_functionality_data_type( if value is None: return None if value in UPDATE_INCIDENT_EVENT_FUNCTIONALITY_DATA_TYPE_VALUES: - return cast(UpdateIncidentEventFunctionalityDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_EVENT_FUNCTIONALITY_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_event_service.py b/rootly_sdk/models/update_incident_event_service.py index 4c582722..1c55e64d 100644 --- a/rootly_sdk/models/update_incident_event_service.py +++ b/rootly_sdk/models/update_incident_event_service.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_incident_event_service_data import UpdateIncidentEventServiceData @@ -18,14 +19,13 @@ class UpdateIncidentEventService: data (UpdateIncidentEventServiceData): """ - data: "UpdateIncidentEventServiceData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateIncidentEventServiceData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_incident_event_service.additional_properties = d return update_incident_event_service - - @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_incident_event_service_data.py b/rootly_sdk/models/update_incident_event_service_data.py index 39489ed7..64d450d0 100644 --- a/rootly_sdk/models/update_incident_event_service_data.py +++ b/rootly_sdk/models/update_incident_event_service_data.py @@ -1,13 +1,15 @@ +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_incident_event_service_data_type import ( UpdateIncidentEventServiceDataType, check_update_incident_event_service_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_incident_event_service_data_attributes import UpdateIncidentEventServiceDataAttributes @@ -22,25 +24,31 @@ class UpdateIncidentEventServiceData: Attributes: type_ (UpdateIncidentEventServiceDataType): attributes (UpdateIncidentEventServiceDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateIncidentEventServiceDataType - attributes: "UpdateIncidentEventServiceDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateIncidentEventServiceDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateIncidentEventServiceDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_incident_event_service_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_incident_event_service_data.additional_properties = d return update_incident_event_service_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_incident_event_service_data_attributes.py b/rootly_sdk/models/update_incident_event_service_data_attributes.py index 0d8cd5d6..d5f3207b 100644 --- a/rootly_sdk/models/update_incident_event_service_data_attributes.py +++ b/rootly_sdk/models/update_incident_event_service_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_incident_event_service_data_attributes_status.py b/rootly_sdk/models/update_incident_event_service_data_attributes_status.py index f1fcf63c..c26f0fe2 100644 --- a/rootly_sdk/models/update_incident_event_service_data_attributes_status.py +++ b/rootly_sdk/models/update_incident_event_service_data_attributes_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentEventServiceDataAttributesStatus = Literal["major_outage", "operational", "partial_outage"] @@ -15,7 +15,7 @@ def check_update_incident_event_service_data_attributes_status( if value is None: return None if value in UPDATE_INCIDENT_EVENT_SERVICE_DATA_ATTRIBUTES_STATUS_VALUES: - return cast(UpdateIncidentEventServiceDataAttributesStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_EVENT_SERVICE_DATA_ATTRIBUTES_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_event_service_data_type.py b/rootly_sdk/models/update_incident_event_service_data_type.py index bfcb0e78..b4ade883 100644 --- a/rootly_sdk/models/update_incident_event_service_data_type.py +++ b/rootly_sdk/models/update_incident_event_service_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentEventServiceDataType = Literal["incident_event_services"] @@ -11,5 +11,5 @@ def check_update_incident_event_service_data_type(value: str | None) -> UpdateIn if value is None: return None if value in UPDATE_INCIDENT_EVENT_SERVICE_DATA_TYPE_VALUES: - return cast(UpdateIncidentEventServiceDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_EVENT_SERVICE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_incident_feedback.py b/rootly_sdk/models/update_incident_feedback.py index c74c81a1..23e2e6c6 100644 --- a/rootly_sdk/models/update_incident_feedback.py +++ b/rootly_sdk/models/update_incident_feedback.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_incident_feedback_data import UpdateIncidentFeedbackData @@ -18,14 +19,13 @@ class UpdateIncidentFeedback: data (UpdateIncidentFeedbackData): """ - data: "UpdateIncidentFeedbackData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateIncidentFeedbackData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_incident_feedback.additional_properties = d return update_incident_feedback - - @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_incident_feedback_data.py b/rootly_sdk/models/update_incident_feedback_data.py index d8e341a9..c6464d6e 100644 --- a/rootly_sdk/models/update_incident_feedback_data.py +++ b/rootly_sdk/models/update_incident_feedback_data.py @@ -1,13 +1,15 @@ +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_incident_feedback_data_type import ( UpdateIncidentFeedbackDataType, check_update_incident_feedback_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_incident_feedback_data_attributes import UpdateIncidentFeedbackDataAttributes @@ -22,25 +24,31 @@ class UpdateIncidentFeedbackData: Attributes: type_ (UpdateIncidentFeedbackDataType): attributes (UpdateIncidentFeedbackDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateIncidentFeedbackDataType - attributes: "UpdateIncidentFeedbackDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateIncidentFeedbackDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateIncidentFeedbackDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_incident_feedback_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_incident_feedback_data.additional_properties = d return update_incident_feedback_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_incident_feedback_data_attributes.py b/rootly_sdk/models/update_incident_feedback_data_attributes.py index 952fc058..4d9558c6 100644 --- a/rootly_sdk/models/update_incident_feedback_data_attributes.py +++ b/rootly_sdk/models/update_incident_feedback_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -16,19 +18,19 @@ class UpdateIncidentFeedbackDataAttributes: """ Attributes: - 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): The feedback of the incident feedback + rating (UpdateIncidentFeedbackDataAttributesRating | Unset): The rating of the incident feedback + anonymous (bool | Unset): Is the feedback anonymous? """ - feedback: Unset | str = UNSET - rating: Unset | UpdateIncidentFeedbackDataAttributesRating = UNSET - anonymous: Unset | bool = UNSET + feedback: str | Unset = UNSET + rating: UpdateIncidentFeedbackDataAttributesRating | Unset = UNSET + anonymous: bool | Unset = UNSET def to_dict(self) -> dict[str, Any]: feedback = self.feedback - rating: Unset | int = UNSET + rating: int | Unset = UNSET if not isinstance(self.rating, Unset): rating = self.rating @@ -52,7 +54,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: feedback = d.pop("feedback", UNSET) _rating = d.pop("rating", UNSET) - rating: Unset | UpdateIncidentFeedbackDataAttributesRating + rating: UpdateIncidentFeedbackDataAttributesRating | Unset if isinstance(_rating, Unset): rating = UNSET else: diff --git a/rootly_sdk/models/update_incident_feedback_data_attributes_rating.py b/rootly_sdk/models/update_incident_feedback_data_attributes_rating.py index ebd1620a..4bbc717c 100644 --- a/rootly_sdk/models/update_incident_feedback_data_attributes_rating.py +++ b/rootly_sdk/models/update_incident_feedback_data_attributes_rating.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentFeedbackDataAttributesRating = Literal[0, 1, 2, 3, 4] @@ -13,7 +13,7 @@ def check_update_incident_feedback_data_attributes_rating(value: int) -> UpdateIncidentFeedbackDataAttributesRating: if value in UPDATE_INCIDENT_FEEDBACK_DATA_ATTRIBUTES_RATING_VALUES: - return cast(UpdateIncidentFeedbackDataAttributesRating, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_FEEDBACK_DATA_ATTRIBUTES_RATING_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_feedback_data_type.py b/rootly_sdk/models/update_incident_feedback_data_type.py index d03bd6d5..2bc112f2 100644 --- a/rootly_sdk/models/update_incident_feedback_data_type.py +++ b/rootly_sdk/models/update_incident_feedback_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentFeedbackDataType = Literal["incident_feedbacks"] @@ -11,5 +11,5 @@ def check_update_incident_feedback_data_type(value: str | None) -> UpdateInciden if value is None: return None if value in UPDATE_INCIDENT_FEEDBACK_DATA_TYPE_VALUES: - return cast(UpdateIncidentFeedbackDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_FEEDBACK_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_incident_form_field_selection.py b/rootly_sdk/models/update_incident_form_field_selection.py index d26e8ead..b3a6a3c0 100644 --- a/rootly_sdk/models/update_incident_form_field_selection.py +++ b/rootly_sdk/models/update_incident_form_field_selection.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_incident_form_field_selection_data import UpdateIncidentFormFieldSelectionData @@ -18,14 +19,13 @@ class UpdateIncidentFormFieldSelection: data (UpdateIncidentFormFieldSelectionData): """ - data: "UpdateIncidentFormFieldSelectionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateIncidentFormFieldSelectionData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_incident_form_field_selection.additional_properties = d return update_incident_form_field_selection - - @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_incident_form_field_selection_data.py b/rootly_sdk/models/update_incident_form_field_selection_data.py index 863405d5..e6024706 100644 --- a/rootly_sdk/models/update_incident_form_field_selection_data.py +++ b/rootly_sdk/models/update_incident_form_field_selection_data.py @@ -1,13 +1,15 @@ +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_incident_form_field_selection_data_type import ( UpdateIncidentFormFieldSelectionDataType, check_update_incident_form_field_selection_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_incident_form_field_selection_data_attributes import ( @@ -24,25 +26,31 @@ class UpdateIncidentFormFieldSelectionData: Attributes: type_ (UpdateIncidentFormFieldSelectionDataType): attributes (UpdateIncidentFormFieldSelectionDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateIncidentFormFieldSelectionDataType - attributes: "UpdateIncidentFormFieldSelectionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateIncidentFormFieldSelectionDataAttributes + id: str | Unset = 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 @@ -57,26 +65,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateIncidentFormFieldSelectionDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_incident_form_field_selection_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_incident_form_field_selection_data.additional_properties = d return update_incident_form_field_selection_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_incident_form_field_selection_data_attributes.py b/rootly_sdk/models/update_incident_form_field_selection_data_attributes.py index 9f4884c4..db5ea2f0 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,69 +14,69 @@ class UpdateIncidentFormFieldSelectionDataAttributes: """ Attributes: - 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): 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: 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 + 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 def to_dict(self) -> dict[str, Any]: - value: None | Unset | str + value: None | str | Unset if isinstance(self.value, Unset): value = UNSET else: value = self.value - selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_catalog_entity_ids: list[str] | Unset = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_group_ids: Unset | list[str] = UNSET + selected_group_ids: list[str] | Unset = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: Unset | list[str] = UNSET + selected_option_ids: list[str] | Unset = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: Unset | list[str] = UNSET + selected_service_ids: list[str] | Unset = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_functionality_ids: Unset | list[str] = UNSET + selected_functionality_ids: list[str] | Unset = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_user_ids: Unset | list[int] = UNSET + selected_user_ids: list[int] | Unset = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_environment_ids: Unset | list[str] = UNSET + selected_environment_ids: list[str] | Unset = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_cause_ids: Unset | list[str] = UNSET + selected_cause_ids: list[str] | Unset = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_incident_type_ids: Unset | list[str] = UNSET + selected_incident_type_ids: list[str] | Unset = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -108,12 +110,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 | Unset | str: + def _parse_value(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) value = _parse_value(d.pop("value", UNSET)) diff --git a/rootly_sdk/models/update_incident_form_field_selection_data_type.py b/rootly_sdk/models/update_incident_form_field_selection_data_type.py index 074b557c..56803550 100644 --- a/rootly_sdk/models/update_incident_form_field_selection_data_type.py +++ b/rootly_sdk/models/update_incident_form_field_selection_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentFormFieldSelectionDataType = Literal["incident_form_field_selections"] @@ -13,7 +13,7 @@ def check_update_incident_form_field_selection_data_type( if value is None: return None if value in UPDATE_INCIDENT_FORM_FIELD_SELECTION_DATA_TYPE_VALUES: - return cast(UpdateIncidentFormFieldSelectionDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_FORM_FIELD_SELECTION_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_permission_set.py b/rootly_sdk/models/update_incident_permission_set.py index 5632a471..b465c0c9 100644 --- a/rootly_sdk/models/update_incident_permission_set.py +++ b/rootly_sdk/models/update_incident_permission_set.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_incident_permission_set_data import UpdateIncidentPermissionSetData @@ -18,14 +19,13 @@ class UpdateIncidentPermissionSet: data (UpdateIncidentPermissionSetData): """ - data: "UpdateIncidentPermissionSetData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateIncidentPermissionSetData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_incident_permission_set.additional_properties = d return update_incident_permission_set - - @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_incident_permission_set_boolean.py b/rootly_sdk/models/update_incident_permission_set_boolean.py index d8a4cb37..d956d9b9 100644 --- a/rootly_sdk/models/update_incident_permission_set_boolean.py +++ b/rootly_sdk/models/update_incident_permission_set_boolean.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_incident_permission_set_boolean_data import UpdateIncidentPermissionSetBooleanData @@ -18,14 +19,13 @@ class UpdateIncidentPermissionSetBoolean: data (UpdateIncidentPermissionSetBooleanData): """ - data: "UpdateIncidentPermissionSetBooleanData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateIncidentPermissionSetBooleanData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_incident_permission_set_boolean.additional_properties = d return update_incident_permission_set_boolean - - @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_incident_permission_set_boolean_data.py b/rootly_sdk/models/update_incident_permission_set_boolean_data.py index 91b0126a..37d17e48 100644 --- a/rootly_sdk/models/update_incident_permission_set_boolean_data.py +++ b/rootly_sdk/models/update_incident_permission_set_boolean_data.py @@ -1,13 +1,15 @@ +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_incident_permission_set_boolean_data_type import ( UpdateIncidentPermissionSetBooleanDataType, check_update_incident_permission_set_boolean_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_incident_permission_set_boolean_data_attributes import ( @@ -24,25 +26,31 @@ class UpdateIncidentPermissionSetBooleanData: Attributes: type_ (UpdateIncidentPermissionSetBooleanDataType): attributes (UpdateIncidentPermissionSetBooleanDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateIncidentPermissionSetBooleanDataType - attributes: "UpdateIncidentPermissionSetBooleanDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateIncidentPermissionSetBooleanDataAttributes + id: str | Unset = 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 @@ -57,26 +65,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateIncidentPermissionSetBooleanDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_incident_permission_set_boolean_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_incident_permission_set_boolean_data.additional_properties = d return update_incident_permission_set_boolean_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_incident_permission_set_boolean_data_attributes.py b/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes.py index 09ba597e..51bc6a2a 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -22,19 +24,19 @@ class UpdateIncidentPermissionSetBooleanDataAttributes: """ Attributes: - kind (Union[Unset, UpdateIncidentPermissionSetBooleanDataAttributesKind]): - private (Union[Unset, bool]): - enabled (Union[Unset, bool]): - severity_params (Union[Unset, UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams]): + kind (UpdateIncidentPermissionSetBooleanDataAttributesKind | Unset): + private (bool | Unset): + enabled (bool | Unset): + severity_params (UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams | Unset): """ - kind: Unset | UpdateIncidentPermissionSetBooleanDataAttributesKind = UNSET - private: Unset | bool = UNSET - enabled: Unset | bool = UNSET - severity_params: Union[Unset, "UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams"] = UNSET + kind: UpdateIncidentPermissionSetBooleanDataAttributesKind | Unset = UNSET + private: bool | Unset = UNSET + enabled: bool | Unset = UNSET + severity_params: UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams | Unset = UNSET def to_dict(self) -> dict[str, Any]: - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - severity_params: Unset | dict[str, Any] = UNSET + severity_params: dict[str, Any] | Unset = UNSET if not isinstance(self.severity_params, Unset): severity_params = self.severity_params.to_dict() @@ -68,7 +70,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _kind = d.pop("kind", UNSET) - kind: Unset | UpdateIncidentPermissionSetBooleanDataAttributesKind + kind: UpdateIncidentPermissionSetBooleanDataAttributesKind | Unset if isinstance(_kind, Unset): kind = UNSET else: @@ -79,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: Unset | UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams + severity_params: UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams | Unset if isinstance(_severity_params, Unset): severity_params = UNSET else: diff --git a/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes_kind.py b/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes_kind.py index f85dcb10..98b7348d 100644 --- a/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes_kind.py +++ b/rootly_sdk/models/update_incident_permission_set_boolean_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentPermissionSetBooleanDataAttributesKind = Literal[ "assign_incident_roles", @@ -39,7 +39,7 @@ def check_update_incident_permission_set_boolean_data_attributes_kind( if value is None: return None if value in UPDATE_INCIDENT_PERMISSION_SET_BOOLEAN_DATA_ATTRIBUTES_KIND_VALUES: - return cast(UpdateIncidentPermissionSetBooleanDataAttributesKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_PERMISSION_SET_BOOLEAN_DATA_ATTRIBUTES_KIND_VALUES!r}" ) 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 1c6c224e..e46cc900 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,8 +1,9 @@ +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 ..types import UNSET, Unset @@ -13,19 +14,18 @@ class UpdateIncidentPermissionSetBooleanDataAttributesSeverityParams: """ Attributes: - 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 + 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 matching severity """ - 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) + fully_enabled: bool | Unset = True + applies_to_unassigned: bool | Unset = True + create_enabled: bool | Unset = False + severity_ids: list[str] | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: fully_enabled = self.fully_enabled @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: create_enabled = self.create_enabled - severity_ids: None | Unset | list[str] + severity_ids: list[str] | None | Unset if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: severity_ids = self.severity_ids field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if fully_enabled is not UNSET: field_dict["fully_enabled"] = fully_enabled @@ -66,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) -> None | Unset | list[str]: + def _parse_severity_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -77,9 +77,9 @@ def _parse_severity_ids(data: object) -> None | Unset | list[str]: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) @@ -90,21 +90,4 @@ def _parse_severity_ids(data: object) -> None | Unset | list[str]: severity_ids=severity_ids, ) - update_incident_permission_set_boolean_data_attributes_severity_params.additional_properties = d return update_incident_permission_set_boolean_data_attributes_severity_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/update_incident_permission_set_boolean_data_type.py b/rootly_sdk/models/update_incident_permission_set_boolean_data_type.py index c3144991..29139c0b 100644 --- a/rootly_sdk/models/update_incident_permission_set_boolean_data_type.py +++ b/rootly_sdk/models/update_incident_permission_set_boolean_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentPermissionSetBooleanDataType = Literal["incident_permission_set_booleans"] @@ -13,7 +13,7 @@ def check_update_incident_permission_set_boolean_data_type( if value is None: return None if value in UPDATE_INCIDENT_PERMISSION_SET_BOOLEAN_DATA_TYPE_VALUES: - return cast(UpdateIncidentPermissionSetBooleanDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_PERMISSION_SET_BOOLEAN_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_permission_set_data.py b/rootly_sdk/models/update_incident_permission_set_data.py index 36c413c4..5b921db5 100644 --- a/rootly_sdk/models/update_incident_permission_set_data.py +++ b/rootly_sdk/models/update_incident_permission_set_data.py @@ -1,13 +1,15 @@ +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_incident_permission_set_data_type import ( UpdateIncidentPermissionSetDataType, check_update_incident_permission_set_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_incident_permission_set_data_attributes import UpdateIncidentPermissionSetDataAttributes @@ -22,25 +24,31 @@ class UpdateIncidentPermissionSetData: Attributes: type_ (UpdateIncidentPermissionSetDataType): attributes (UpdateIncidentPermissionSetDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateIncidentPermissionSetDataType - attributes: "UpdateIncidentPermissionSetDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateIncidentPermissionSetDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateIncidentPermissionSetDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_incident_permission_set_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_incident_permission_set_data.additional_properties = d return update_incident_permission_set_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_incident_permission_set_data_attributes.py b/rootly_sdk/models/update_incident_permission_set_data_attributes.py index 10626000..5fad2de6 100644 --- a/rootly_sdk/models/update_incident_permission_set_data_attributes.py +++ b/rootly_sdk/models/update_incident_permission_set_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -20,28 +22,28 @@ class UpdateIncidentPermissionSetDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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): 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: None | Unset | str = UNSET - name: Unset | str = UNSET - description: None | Unset | str = UNSET + slug: None | str | Unset = UNSET + name: str | Unset = UNSET + description: None | str | Unset = UNSET private_incident_permissions: ( - Unset | list[UpdateIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] + list[UpdateIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem] | Unset ) = UNSET public_incident_permissions: ( - Unset | list[UpdateIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] + list[UpdateIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem] | Unset ) = UNSET def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -49,20 +51,20 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - private_incident_permissions: Unset | list[str] = UNSET + private_incident_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + public_incident_permissions: list[str] | Unset = UNSET if not isinstance(self.public_incident_permissions, Unset): public_incident_permissions = [] for public_incident_permissions_item_data in self.public_incident_permissions: @@ -89,47 +91,55 @@ 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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - private_incident_permissions = [] _private_incident_permissions = d.pop("private_incident_permissions", UNSET) - 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: ( + 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 + ) ) - ) - 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) - 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: ( + 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 + ) ) - ) - 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, diff --git a/rootly_sdk/models/update_incident_permission_set_data_attributes_private_incident_permissions_item.py b/rootly_sdk/models/update_incident_permission_set_data_attributes_private_incident_permissions_item.py index 15705254..ed8d9f88 100644 --- a/rootly_sdk/models/update_incident_permission_set_data_attributes_private_incident_permissions_item.py +++ b/rootly_sdk/models/update_incident_permission_set_data_attributes_private_incident_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_incident_permission_set_data_attributes_private_incident_permis if value is None: return None if value in UPDATE_INCIDENT_PERMISSION_SET_DATA_ATTRIBUTES_PRIVATE_INCIDENT_PERMISSIONS_ITEM_VALUES: - return cast(UpdateIncidentPermissionSetDataAttributesPrivateIncidentPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_PERMISSION_SET_DATA_ATTRIBUTES_PRIVATE_INCIDENT_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_permission_set_data_attributes_public_incident_permissions_item.py b/rootly_sdk/models/update_incident_permission_set_data_attributes_public_incident_permissions_item.py index ce079aa7..81c38f99 100644 --- a/rootly_sdk/models/update_incident_permission_set_data_attributes_public_incident_permissions_item.py +++ b/rootly_sdk/models/update_incident_permission_set_data_attributes_public_incident_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_incident_permission_set_data_attributes_public_incident_permiss if value is None: return None if value in UPDATE_INCIDENT_PERMISSION_SET_DATA_ATTRIBUTES_PUBLIC_INCIDENT_PERMISSIONS_ITEM_VALUES: - return cast(UpdateIncidentPermissionSetDataAttributesPublicIncidentPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_PERMISSION_SET_DATA_ATTRIBUTES_PUBLIC_INCIDENT_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_permission_set_data_type.py b/rootly_sdk/models/update_incident_permission_set_data_type.py index 7b300848..0579a3f3 100644 --- a/rootly_sdk/models/update_incident_permission_set_data_type.py +++ b/rootly_sdk/models/update_incident_permission_set_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentPermissionSetDataType = Literal["incident_permission_sets"] @@ -11,5 +11,5 @@ def check_update_incident_permission_set_data_type(value: str | None) -> UpdateI if value is None: return None if value in UPDATE_INCIDENT_PERMISSION_SET_DATA_TYPE_VALUES: - return cast(UpdateIncidentPermissionSetDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_PERMISSION_SET_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_incident_permission_set_resource.py b/rootly_sdk/models/update_incident_permission_set_resource.py index f0cec4e5..020acb21 100644 --- a/rootly_sdk/models/update_incident_permission_set_resource.py +++ b/rootly_sdk/models/update_incident_permission_set_resource.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_incident_permission_set_resource_data import UpdateIncidentPermissionSetResourceData @@ -18,14 +19,13 @@ class UpdateIncidentPermissionSetResource: data (UpdateIncidentPermissionSetResourceData): """ - data: "UpdateIncidentPermissionSetResourceData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateIncidentPermissionSetResourceData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_incident_permission_set_resource.additional_properties = d return update_incident_permission_set_resource - - @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_incident_permission_set_resource_data.py b/rootly_sdk/models/update_incident_permission_set_resource_data.py index 2f7048c5..5ff2c46c 100644 --- a/rootly_sdk/models/update_incident_permission_set_resource_data.py +++ b/rootly_sdk/models/update_incident_permission_set_resource_data.py @@ -1,13 +1,15 @@ +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_incident_permission_set_resource_data_type import ( UpdateIncidentPermissionSetResourceDataType, check_update_incident_permission_set_resource_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_incident_permission_set_resource_data_attributes import ( @@ -24,25 +26,31 @@ class UpdateIncidentPermissionSetResourceData: Attributes: type_ (UpdateIncidentPermissionSetResourceDataType): attributes (UpdateIncidentPermissionSetResourceDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateIncidentPermissionSetResourceDataType - attributes: "UpdateIncidentPermissionSetResourceDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateIncidentPermissionSetResourceDataAttributes + id: str | Unset = 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 @@ -57,26 +65,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateIncidentPermissionSetResourceDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_incident_permission_set_resource_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_incident_permission_set_resource_data.additional_properties = d return update_incident_permission_set_resource_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_incident_permission_set_resource_data_attributes.py b/rootly_sdk/models/update_incident_permission_set_resource_data_attributes.py index a1a06597..f47741a6 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,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -22,21 +24,21 @@ class UpdateIncidentPermissionSetResourceDataAttributes: """ Attributes: - 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): + private (bool | Unset): + resource_id (str | Unset): + resource_type (str | Unset): + severity_params (UpdateIncidentPermissionSetResourceDataAttributesSeverityParams | 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 + kind: UpdateIncidentPermissionSetResourceDataAttributesKind | Unset = UNSET + private: bool | Unset = UNSET + resource_id: str | Unset = UNSET + resource_type: str | Unset = UNSET + severity_params: UpdateIncidentPermissionSetResourceDataAttributesSeverityParams | Unset = UNSET def to_dict(self) -> dict[str, Any]: - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -46,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: resource_type = self.resource_type - severity_params: Unset | dict[str, Any] = UNSET + severity_params: dict[str, Any] | Unset = UNSET if not isinstance(self.severity_params, Unset): severity_params = self.severity_params.to_dict() @@ -74,7 +76,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _kind = d.pop("kind", UNSET) - kind: Unset | UpdateIncidentPermissionSetResourceDataAttributesKind + kind: UpdateIncidentPermissionSetResourceDataAttributesKind | Unset if isinstance(_kind, Unset): kind = UNSET else: @@ -87,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: Unset | UpdateIncidentPermissionSetResourceDataAttributesSeverityParams + severity_params: UpdateIncidentPermissionSetResourceDataAttributesSeverityParams | Unset if isinstance(_severity_params, Unset): severity_params = UNSET else: diff --git a/rootly_sdk/models/update_incident_permission_set_resource_data_attributes_kind.py b/rootly_sdk/models/update_incident_permission_set_resource_data_attributes_kind.py index 72f3e378..777fa8c5 100644 --- a/rootly_sdk/models/update_incident_permission_set_resource_data_attributes_kind.py +++ b/rootly_sdk/models/update_incident_permission_set_resource_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentPermissionSetResourceDataAttributesKind = Literal[ "incident_types", "severities", "statuses", "sub_statuses" @@ -20,7 +20,7 @@ def check_update_incident_permission_set_resource_data_attributes_kind( if value is None: return None if value in UPDATE_INCIDENT_PERMISSION_SET_RESOURCE_DATA_ATTRIBUTES_KIND_VALUES: - return cast(UpdateIncidentPermissionSetResourceDataAttributesKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_PERMISSION_SET_RESOURCE_DATA_ATTRIBUTES_KIND_VALUES!r}" ) 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 eb5ea221..d0bf11cf 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,8 +1,9 @@ +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 ..types import UNSET, Unset @@ -13,19 +14,18 @@ class UpdateIncidentPermissionSetResourceDataAttributesSeverityParams: """ Attributes: - 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 + 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 matching severity """ - 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) + fully_enabled: bool | Unset = True + create_enabled: bool | Unset = False + applies_to_unassigned: bool | Unset = True + severity_ids: list[str] | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: fully_enabled = self.fully_enabled @@ -34,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: applies_to_unassigned = self.applies_to_unassigned - severity_ids: None | Unset | list[str] + severity_ids: list[str] | None | Unset if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -44,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: severity_ids = self.severity_ids field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if fully_enabled is not UNSET: field_dict["fully_enabled"] = fully_enabled @@ -66,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) -> None | Unset | list[str]: + def _parse_severity_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -77,9 +77,9 @@ def _parse_severity_ids(data: object) -> None | Unset | list[str]: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) @@ -90,21 +90,4 @@ def _parse_severity_ids(data: object) -> None | Unset | list[str]: severity_ids=severity_ids, ) - update_incident_permission_set_resource_data_attributes_severity_params.additional_properties = d return update_incident_permission_set_resource_data_attributes_severity_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/update_incident_permission_set_resource_data_type.py b/rootly_sdk/models/update_incident_permission_set_resource_data_type.py index bed0830e..5facdef4 100644 --- a/rootly_sdk/models/update_incident_permission_set_resource_data_type.py +++ b/rootly_sdk/models/update_incident_permission_set_resource_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentPermissionSetResourceDataType = Literal["incident_permission_set_resources"] @@ -13,7 +13,7 @@ def check_update_incident_permission_set_resource_data_type( if value is None: return None if value in UPDATE_INCIDENT_PERMISSION_SET_RESOURCE_DATA_TYPE_VALUES: - return cast(UpdateIncidentPermissionSetResourceDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_PERMISSION_SET_RESOURCE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_post_mortem.py b/rootly_sdk/models/update_incident_post_mortem.py index 72c00f08..5bb39b4b 100644 --- a/rootly_sdk/models/update_incident_post_mortem.py +++ b/rootly_sdk/models/update_incident_post_mortem.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_incident_post_mortem_data import UpdateIncidentPostMortemData @@ -18,14 +19,13 @@ class UpdateIncidentPostMortem: data (UpdateIncidentPostMortemData): """ - data: "UpdateIncidentPostMortemData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateIncidentPostMortemData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_incident_post_mortem.additional_properties = d return update_incident_post_mortem - - @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_incident_post_mortem_data.py b/rootly_sdk/models/update_incident_post_mortem_data.py index fd65235d..8ef97b8b 100644 --- a/rootly_sdk/models/update_incident_post_mortem_data.py +++ b/rootly_sdk/models/update_incident_post_mortem_data.py @@ -1,13 +1,15 @@ +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_incident_post_mortem_data_type import ( UpdateIncidentPostMortemDataType, check_update_incident_post_mortem_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_incident_post_mortem_data_attributes import UpdateIncidentPostMortemDataAttributes @@ -22,25 +24,31 @@ class UpdateIncidentPostMortemData: Attributes: type_ (UpdateIncidentPostMortemDataType): attributes (UpdateIncidentPostMortemDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateIncidentPostMortemDataType - attributes: "UpdateIncidentPostMortemDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateIncidentPostMortemDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateIncidentPostMortemDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_incident_post_mortem_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_incident_post_mortem_data.additional_properties = d return update_incident_post_mortem_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_incident_post_mortem_data_attributes.py b/rootly_sdk/models/update_incident_post_mortem_data_attributes.py index 231645bc..14f83509 100644 --- a/rootly_sdk/models/update_incident_post_mortem_data_attributes.py +++ b/rootly_sdk/models/update_incident_post_mortem_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,61 +18,70 @@ class UpdateIncidentPostMortemDataAttributes: """ Attributes: - 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): The title of the incident retrospective + content (None | str | Unset): The content (body) of the incident retrospective, as HTML. Rejected with a 409 + once the retrospective has been opened in the collaborative editor. + 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: 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 + title: str | Unset = UNSET + content: None | 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 def to_dict(self) -> dict[str, Any]: title = self.title - status: Unset | str = UNSET + content: None | str | Unset + if isinstance(self.content, Unset): + content = UNSET + else: + content = self.content + + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - mitigated_at: None | Unset | str + mitigated_at: None | str | Unset if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: None | Unset | str + resolved_at: None | str | Unset if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: @@ -96,7 +107,7 @@ def to_dict(self) -> dict[str, Any]: show_action_items = self.show_action_items - cause_ids: None | Unset | list[str] + cause_ids: list[str] | None | Unset if isinstance(self.cause_ids, Unset): cause_ids = UNSET elif isinstance(self.cause_ids, list): @@ -110,6 +121,8 @@ def to_dict(self) -> dict[str, Any]: field_dict.update({}) if title is not UNSET: field_dict["title"] = title + if content is not UNSET: + field_dict["content"] = content if status is not UNSET: field_dict["status"] = status if started_at is not UNSET: @@ -148,37 +161,46 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) title = d.pop("title", UNSET) + def _parse_content(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + content = _parse_content(d.pop("content", UNSET)) + _status = d.pop("status", UNSET) - status: Unset | UpdateIncidentPostMortemDataAttributesStatus + status: UpdateIncidentPostMortemDataAttributesStatus | Unset if isinstance(_status, Unset): status = UNSET else: status = check_update_incident_post_mortem_data_attributes_status(_status) - def _parse_started_at(data: object) -> None | Unset | str: + def _parse_started_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_mitigated_at(data: object) -> None | Unset | str: + def _parse_mitigated_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> None | Unset | str: + def _parse_resolved_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) @@ -202,7 +224,7 @@ def _parse_resolved_at(data: object) -> None | Unset | str: show_action_items = d.pop("show_action_items", UNSET) - def _parse_cause_ids(data: object) -> None | Unset | list[str]: + def _parse_cause_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -213,14 +235,15 @@ def _parse_cause_ids(data: object) -> None | Unset | list[str]: cause_ids_type_0 = cast(list[str], data) return cause_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) cause_ids = _parse_cause_ids(d.pop("cause_ids", UNSET)) update_incident_post_mortem_data_attributes = cls( title=title, + content=content, status=status, started_at=started_at, mitigated_at=mitigated_at, diff --git a/rootly_sdk/models/update_incident_post_mortem_data_attributes_status.py b/rootly_sdk/models/update_incident_post_mortem_data_attributes_status.py index 2189ace9..53689591 100644 --- a/rootly_sdk/models/update_incident_post_mortem_data_attributes_status.py +++ b/rootly_sdk/models/update_incident_post_mortem_data_attributes_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentPostMortemDataAttributesStatus = Literal["draft", "published"] @@ -14,7 +14,7 @@ def check_update_incident_post_mortem_data_attributes_status( if value is None: return None if value in UPDATE_INCIDENT_POST_MORTEM_DATA_ATTRIBUTES_STATUS_VALUES: - return cast(UpdateIncidentPostMortemDataAttributesStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_POST_MORTEM_DATA_ATTRIBUTES_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_post_mortem_data_type.py b/rootly_sdk/models/update_incident_post_mortem_data_type.py index 5016bbc7..28a419b3 100644 --- a/rootly_sdk/models/update_incident_post_mortem_data_type.py +++ b/rootly_sdk/models/update_incident_post_mortem_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentPostMortemDataType = Literal["incident_post_mortems"] @@ -11,5 +11,5 @@ def check_update_incident_post_mortem_data_type(value: str | None) -> UpdateInci if value is None: return None if value in UPDATE_INCIDENT_POST_MORTEM_DATA_TYPE_VALUES: - return cast(UpdateIncidentPostMortemDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_POST_MORTEM_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_incident_postmortem_task_params.py b/rootly_sdk/models/update_incident_postmortem_task_params.py index 8d742a44..5a56484c 100644 --- a/rootly_sdk/models/update_incident_postmortem_task_params.py +++ b/rootly_sdk/models/update_incident_postmortem_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,31 +20,31 @@ class UpdateIncidentPostmortemTaskParams: """ Attributes: postmortem_id (str): UUID of the retrospective that needs to be updated - task_type (Union[Unset, UpdateIncidentPostmortemTaskParamsTaskType]): - title (Union[None, Unset, str]): The incident title - status (Union[None, Unset, str]): + task_type (UpdateIncidentPostmortemTaskParamsTaskType | Unset): + title (None | str | Unset): The incident title + status (None | str | Unset): """ postmortem_id: str - task_type: Unset | UpdateIncidentPostmortemTaskParamsTaskType = UNSET - title: None | Unset | str = UNSET - status: None | Unset | str = UNSET + task_type: UpdateIncidentPostmortemTaskParamsTaskType | Unset = UNSET + title: None | str | Unset = UNSET + status: None | str | Unset = 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - title: None | Unset | str + title: None | str | Unset if isinstance(self.title, Unset): title = UNSET else: title = self.title - status: None | Unset | str + status: None | str | Unset if isinstance(self.status, Unset): status = UNSET else: @@ -70,27 +72,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: Unset | UpdateIncidentPostmortemTaskParamsTaskType + task_type: UpdateIncidentPostmortemTaskParamsTaskType | Unset 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 | Unset | str: + def _parse_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_status(data: object) -> None | Unset | str: + def _parse_status(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) status = _parse_status(d.pop("status", UNSET)) diff --git a/rootly_sdk/models/update_incident_postmortem_task_params_task_type.py b/rootly_sdk/models/update_incident_postmortem_task_params_task_type.py index fdc44547..38fdbd62 100644 --- a/rootly_sdk/models/update_incident_postmortem_task_params_task_type.py +++ b/rootly_sdk/models/update_incident_postmortem_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentPostmortemTaskParamsTaskType = Literal["update_incident_postmortem"] @@ -13,7 +13,7 @@ def check_update_incident_postmortem_task_params_task_type( if value is None: return None if value in UPDATE_INCIDENT_POSTMORTEM_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateIncidentPostmortemTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_POSTMORTEM_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_retrospective_step.py b/rootly_sdk/models/update_incident_retrospective_step.py index 827c9e77..635ef24d 100644 --- a/rootly_sdk/models/update_incident_retrospective_step.py +++ b/rootly_sdk/models/update_incident_retrospective_step.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_incident_retrospective_step_data import UpdateIncidentRetrospectiveStepData @@ -18,14 +19,13 @@ class UpdateIncidentRetrospectiveStep: data (UpdateIncidentRetrospectiveStepData): """ - data: "UpdateIncidentRetrospectiveStepData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateIncidentRetrospectiveStepData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_incident_retrospective_step.additional_properties = d return update_incident_retrospective_step - - @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_incident_retrospective_step_data.py b/rootly_sdk/models/update_incident_retrospective_step_data.py index 2f3cfdce..610224a8 100644 --- a/rootly_sdk/models/update_incident_retrospective_step_data.py +++ b/rootly_sdk/models/update_incident_retrospective_step_data.py @@ -1,13 +1,15 @@ +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_incident_retrospective_step_data_type import ( UpdateIncidentRetrospectiveStepDataType, check_update_incident_retrospective_step_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_incident_retrospective_step_data_attributes import ( @@ -24,25 +26,31 @@ class UpdateIncidentRetrospectiveStepData: Attributes: type_ (UpdateIncidentRetrospectiveStepDataType): attributes (UpdateIncidentRetrospectiveStepDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateIncidentRetrospectiveStepDataType - attributes: "UpdateIncidentRetrospectiveStepDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateIncidentRetrospectiveStepDataAttributes + id: str | Unset = 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 @@ -57,26 +65,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateIncidentRetrospectiveStepDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_incident_retrospective_step_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_incident_retrospective_step_data.additional_properties = d return update_incident_retrospective_step_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_incident_retrospective_step_data_attributes.py b/rootly_sdk/models/update_incident_retrospective_step_data_attributes.py index 9b8c22d6..f9ada1a8 100644 --- a/rootly_sdk/models/update_incident_retrospective_step_data_attributes.py +++ b/rootly_sdk/models/update_incident_retrospective_step_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,38 +18,37 @@ class UpdateIncidentRetrospectiveStepDataAttributes: """ Attributes: - 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): 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: 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 + 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 def to_dict(self) -> dict[str, Any]: title = self.title - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - due_date: None | Unset | str + due_date: None | str | Unset if isinstance(self.due_date, Unset): due_date = UNSET else: due_date = self.due_date - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -55,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: skippable = self.skippable - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status @@ -82,37 +83,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_due_date(data: object) -> None | Unset | str: + def _parse_due_date(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) due_date = _parse_due_date(d.pop("due_date", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) skippable = d.pop("skippable", UNSET) _status = d.pop("status", UNSET) - status: Unset | UpdateIncidentRetrospectiveStepDataAttributesStatus + status: UpdateIncidentRetrospectiveStepDataAttributesStatus | Unset if isinstance(_status, Unset): status = UNSET else: diff --git a/rootly_sdk/models/update_incident_retrospective_step_data_attributes_status.py b/rootly_sdk/models/update_incident_retrospective_step_data_attributes_status.py index 49207170..c628a0de 100644 --- a/rootly_sdk/models/update_incident_retrospective_step_data_attributes_status.py +++ b/rootly_sdk/models/update_incident_retrospective_step_data_attributes_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentRetrospectiveStepDataAttributesStatus = Literal["completed", "in_progress", "skipped", "todo"] @@ -18,7 +18,7 @@ def check_update_incident_retrospective_step_data_attributes_status( if value is None: return None if value in UPDATE_INCIDENT_RETROSPECTIVE_STEP_DATA_ATTRIBUTES_STATUS_VALUES: - return cast(UpdateIncidentRetrospectiveStepDataAttributesStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_RETROSPECTIVE_STEP_DATA_ATTRIBUTES_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_retrospective_step_data_type.py b/rootly_sdk/models/update_incident_retrospective_step_data_type.py index bb8b1e26..74efe1cf 100644 --- a/rootly_sdk/models/update_incident_retrospective_step_data_type.py +++ b/rootly_sdk/models/update_incident_retrospective_step_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentRetrospectiveStepDataType = Literal["incident_retrospective_steps"] @@ -13,7 +13,7 @@ def check_update_incident_retrospective_step_data_type( if value is None: return None if value in UPDATE_INCIDENT_RETROSPECTIVE_STEP_DATA_TYPE_VALUES: - return cast(UpdateIncidentRetrospectiveStepDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_RETROSPECTIVE_STEP_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_role.py b/rootly_sdk/models/update_incident_role.py index 49bef496..972fc033 100644 --- a/rootly_sdk/models/update_incident_role.py +++ b/rootly_sdk/models/update_incident_role.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_incident_role_data import UpdateIncidentRoleData @@ -18,14 +19,13 @@ class UpdateIncidentRole: data (UpdateIncidentRoleData): """ - data: "UpdateIncidentRoleData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateIncidentRoleData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_incident_role.additional_properties = d return update_incident_role - - @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_incident_role_data.py b/rootly_sdk/models/update_incident_role_data.py index 7265f0ef..e3309fff 100644 --- a/rootly_sdk/models/update_incident_role_data.py +++ b/rootly_sdk/models/update_incident_role_data.py @@ -1,10 +1,12 @@ +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_incident_role_data_type import UpdateIncidentRoleDataType, check_update_incident_role_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_incident_role_data_attributes import UpdateIncidentRoleDataAttributes @@ -19,25 +21,31 @@ class UpdateIncidentRoleData: Attributes: type_ (UpdateIncidentRoleDataType): attributes (UpdateIncidentRoleDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateIncidentRoleDataType - attributes: "UpdateIncidentRoleDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateIncidentRoleDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateIncidentRoleDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_incident_role_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_incident_role_data.additional_properties = d return update_incident_role_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_incident_role_data_attributes.py b/rootly_sdk/models/update_incident_role_data_attributes.py index 4282bbfb..3200e57b 100644 --- a/rootly_sdk/models/update_incident_role_data_attributes.py +++ b/rootly_sdk/models/update_incident_role_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,28 +14,28 @@ class UpdateIncidentRoleDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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): 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: 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 + slug: None | str | Unset = UNSET + 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 def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -41,19 +43,19 @@ def to_dict(self) -> dict[str, Any]: name = self.name - summary: None | Unset | str + summary: None | str | Unset if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -91,41 +93,41 @@ 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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_summary(data: object) -> None | Unset | str: + def _parse_summary(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_incident_role_data_type.py b/rootly_sdk/models/update_incident_role_data_type.py index 4561d4e1..8cea153b 100644 --- a/rootly_sdk/models/update_incident_role_data_type.py +++ b/rootly_sdk/models/update_incident_role_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentRoleDataType = Literal["incident_roles"] @@ -11,5 +11,5 @@ def check_update_incident_role_data_type(value: str | None) -> UpdateIncidentRol if value is None: return None if value in UPDATE_INCIDENT_ROLE_DATA_TYPE_VALUES: - return cast(UpdateIncidentRoleDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_ROLE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_incident_role_task.py b/rootly_sdk/models/update_incident_role_task.py index 4e894747..fcfdd665 100644 --- a/rootly_sdk/models/update_incident_role_task.py +++ b/rootly_sdk/models/update_incident_role_task.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_incident_role_task_data import UpdateIncidentRoleTaskData @@ -18,14 +19,13 @@ class UpdateIncidentRoleTask: data (UpdateIncidentRoleTaskData): """ - data: "UpdateIncidentRoleTaskData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateIncidentRoleTaskData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_incident_role_task.additional_properties = d return update_incident_role_task - - @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_incident_role_task_data.py b/rootly_sdk/models/update_incident_role_task_data.py index e9c545b9..1ee6b3d6 100644 --- a/rootly_sdk/models/update_incident_role_task_data.py +++ b/rootly_sdk/models/update_incident_role_task_data.py @@ -1,13 +1,15 @@ +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_incident_role_task_data_type import ( UpdateIncidentRoleTaskDataType, check_update_incident_role_task_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_incident_role_task_data_attributes import UpdateIncidentRoleTaskDataAttributes @@ -22,25 +24,31 @@ class UpdateIncidentRoleTaskData: Attributes: type_ (UpdateIncidentRoleTaskDataType): attributes (UpdateIncidentRoleTaskDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateIncidentRoleTaskDataType - attributes: "UpdateIncidentRoleTaskDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateIncidentRoleTaskDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateIncidentRoleTaskDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_incident_role_task_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_incident_role_task_data.additional_properties = d return update_incident_role_task_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_incident_role_task_data_attributes.py b/rootly_sdk/models/update_incident_role_task_data_attributes.py index 877ac36e..2fda2b91 100644 --- a/rootly_sdk/models/update_incident_role_task_data_attributes.py +++ b/rootly_sdk/models/update_incident_role_task_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,25 +18,25 @@ class UpdateIncidentRoleTaskDataAttributes: """ Attributes: - 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): 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: Unset | str = UNSET - description: None | Unset | str = UNSET - priority: Unset | UpdateIncidentRoleTaskDataAttributesPriority = UNSET + task: str | Unset = UNSET + description: None | str | Unset = UNSET + priority: UpdateIncidentRoleTaskDataAttributesPriority | Unset = UNSET def to_dict(self) -> dict[str, Any]: task = self.task - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - priority: Unset | str = UNSET + priority: str | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -55,17 +57,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) _priority = d.pop("priority", UNSET) - priority: Unset | UpdateIncidentRoleTaskDataAttributesPriority + priority: UpdateIncidentRoleTaskDataAttributesPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/update_incident_role_task_data_attributes_priority.py b/rootly_sdk/models/update_incident_role_task_data_attributes_priority.py index 222fdd9b..73f83d70 100644 --- a/rootly_sdk/models/update_incident_role_task_data_attributes_priority.py +++ b/rootly_sdk/models/update_incident_role_task_data_attributes_priority.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentRoleTaskDataAttributesPriority = Literal["high", "low", "medium"] @@ -15,7 +15,7 @@ def check_update_incident_role_task_data_attributes_priority( if value is None: return None if value in UPDATE_INCIDENT_ROLE_TASK_DATA_ATTRIBUTES_PRIORITY_VALUES: - return cast(UpdateIncidentRoleTaskDataAttributesPriority, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_ROLE_TASK_DATA_ATTRIBUTES_PRIORITY_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_role_task_data_type.py b/rootly_sdk/models/update_incident_role_task_data_type.py index 5cc278a2..ad1a7dfb 100644 --- a/rootly_sdk/models/update_incident_role_task_data_type.py +++ b/rootly_sdk/models/update_incident_role_task_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentRoleTaskDataType = Literal["incident_role_tasks"] @@ -11,5 +11,5 @@ def check_update_incident_role_task_data_type(value: str | None) -> UpdateIncide if value is None: return None if value in UPDATE_INCIDENT_ROLE_TASK_DATA_TYPE_VALUES: - return cast(UpdateIncidentRoleTaskDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_ROLE_TASK_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_incident_status_page_event.py b/rootly_sdk/models/update_incident_status_page_event.py index a1a6fb34..58d53f5d 100644 --- a/rootly_sdk/models/update_incident_status_page_event.py +++ b/rootly_sdk/models/update_incident_status_page_event.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_incident_status_page_event_data import UpdateIncidentStatusPageEventData @@ -18,14 +19,13 @@ class UpdateIncidentStatusPageEvent: data (UpdateIncidentStatusPageEventData): """ - data: "UpdateIncidentStatusPageEventData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateIncidentStatusPageEventData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_incident_status_page_event.additional_properties = d return update_incident_status_page_event - - @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_incident_status_page_event_data.py b/rootly_sdk/models/update_incident_status_page_event_data.py index 1d378c39..c12ed364 100644 --- a/rootly_sdk/models/update_incident_status_page_event_data.py +++ b/rootly_sdk/models/update_incident_status_page_event_data.py @@ -1,13 +1,15 @@ +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_incident_status_page_event_data_type import ( UpdateIncidentStatusPageEventDataType, check_update_incident_status_page_event_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_incident_status_page_event_data_attributes import UpdateIncidentStatusPageEventDataAttributes @@ -22,25 +24,31 @@ class UpdateIncidentStatusPageEventData: Attributes: type_ (UpdateIncidentStatusPageEventDataType): attributes (UpdateIncidentStatusPageEventDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateIncidentStatusPageEventDataType - attributes: "UpdateIncidentStatusPageEventDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateIncidentStatusPageEventDataAttributes + id: str | Unset = 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 @@ -55,26 +63,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateIncidentStatusPageEventDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_incident_status_page_event_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_incident_status_page_event_data.additional_properties = d return update_incident_status_page_event_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_incident_status_page_event_data_attributes.py b/rootly_sdk/models/update_incident_status_page_event_data_attributes.py index a768cbf3..d7a5fb17 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,9 +1,10 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast from attrs import define as _attrs_define -from dateutil.parser import isoparse from ..models.update_incident_status_page_event_data_attributes_status import ( UpdateIncidentStatusPageEventDataAttributesStatus, @@ -18,44 +19,44 @@ class UpdateIncidentStatusPageEventDataAttributes: """ Attributes: - 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): 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: 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 + 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 def to_dict(self) -> dict[str, Any]: event = self.event status_page_id = self.status_page_id - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status - notify_subscribers: None | Unset | bool + notify_subscribers: bool | None | Unset if isinstance(self.notify_subscribers, Unset): notify_subscribers = UNSET else: notify_subscribers = self.notify_subscribers - should_tweet: None | Unset | bool + should_tweet: bool | None | Unset if isinstance(self.should_tweet, Unset): should_tweet = UNSET else: should_tweet = self.should_tweet - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -89,31 +90,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: Unset | UpdateIncidentStatusPageEventDataAttributesStatus + status: UpdateIncidentStatusPageEventDataAttributesStatus | Unset if isinstance(_status, Unset): status = UNSET else: status = check_update_incident_status_page_event_data_attributes_status(_status) - def _parse_notify_subscribers(data: object) -> None | Unset | bool: + def _parse_notify_subscribers(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) notify_subscribers = _parse_notify_subscribers(d.pop("notify_subscribers", UNSET)) - def _parse_should_tweet(data: object) -> None | Unset | bool: + def _parse_should_tweet(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) should_tweet = _parse_should_tweet(d.pop("should_tweet", UNSET)) - def _parse_started_at(data: object) -> None | Unset | datetime.datetime: + def _parse_started_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -121,12 +122,12 @@ def _parse_started_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - started_at_type_0 = isoparse(data) + started_at_type_0 = datetime.datetime.fromisoformat(data) return started_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) diff --git a/rootly_sdk/models/update_incident_status_page_event_data_attributes_status.py b/rootly_sdk/models/update_incident_status_page_event_data_attributes_status.py index 5f6db741..7babd171 100644 --- a/rootly_sdk/models/update_incident_status_page_event_data_attributes_status.py +++ b/rootly_sdk/models/update_incident_status_page_event_data_attributes_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentStatusPageEventDataAttributesStatus = Literal[ "completed", "identified", "in_progress", "investigating", "monitoring", "resolved", "scheduled" @@ -23,7 +23,7 @@ def check_update_incident_status_page_event_data_attributes_status( if value is None: return None if value in UPDATE_INCIDENT_STATUS_PAGE_EVENT_DATA_ATTRIBUTES_STATUS_VALUES: - return cast(UpdateIncidentStatusPageEventDataAttributesStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_STATUS_PAGE_EVENT_DATA_ATTRIBUTES_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_status_page_event_data_type.py b/rootly_sdk/models/update_incident_status_page_event_data_type.py index 55639c0c..8272a4ea 100644 --- a/rootly_sdk/models/update_incident_status_page_event_data_type.py +++ b/rootly_sdk/models/update_incident_status_page_event_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentStatusPageEventDataType = Literal["incident_status_page_events"] @@ -13,7 +13,7 @@ def check_update_incident_status_page_event_data_type( if value is None: return None if value in UPDATE_INCIDENT_STATUS_PAGE_EVENT_DATA_TYPE_VALUES: - return cast(UpdateIncidentStatusPageEventDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_STATUS_PAGE_EVENT_DATA_TYPE_VALUES!r}" ) 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 dca1d18e..552fe4a7 100644 --- a/rootly_sdk/models/update_incident_status_timestamp_task_params.py +++ b/rootly_sdk/models/update_incident_status_timestamp_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -19,12 +21,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 (Union[Unset, UpdateIncidentStatusTimestampTaskParamsTaskType]): + task_type (UpdateIncidentStatusTimestampTaskParamsTaskType | Unset): """ sub_status_id: str assigned_at: str - task_type: Unset | UpdateIncidentStatusTimestampTaskParamsTaskType = UNSET + task_type: UpdateIncidentStatusTimestampTaskParamsTaskType | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -32,7 +34,7 @@ def to_dict(self) -> dict[str, Any]: assigned_at = self.assigned_at - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -57,7 +59,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: Unset | UpdateIncidentStatusTimestampTaskParamsTaskType + task_type: UpdateIncidentStatusTimestampTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_incident_status_timestamp_task_params_task_type.py b/rootly_sdk/models/update_incident_status_timestamp_task_params_task_type.py index 7c8afe4c..e0ebd0c3 100644 --- a/rootly_sdk/models/update_incident_status_timestamp_task_params_task_type.py +++ b/rootly_sdk/models/update_incident_status_timestamp_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentStatusTimestampTaskParamsTaskType = Literal["update_status"] @@ -13,7 +13,7 @@ def check_update_incident_status_timestamp_task_params_task_type( if value is None: return None if value in UPDATE_INCIDENT_STATUS_TIMESTAMP_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateIncidentStatusTimestampTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_STATUS_TIMESTAMP_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_sub_status.py b/rootly_sdk/models/update_incident_sub_status.py index 1e107b9b..90f7a310 100644 --- a/rootly_sdk/models/update_incident_sub_status.py +++ b/rootly_sdk/models/update_incident_sub_status.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_incident_sub_status_data import UpdateIncidentSubStatusData @@ -18,14 +19,13 @@ class UpdateIncidentSubStatus: data (UpdateIncidentSubStatusData): """ - data: "UpdateIncidentSubStatusData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateIncidentSubStatusData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_incident_sub_status.additional_properties = d return update_incident_sub_status - - @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_incident_sub_status_data.py b/rootly_sdk/models/update_incident_sub_status_data.py index 36c0e79c..f9b3b3ef 100644 --- a/rootly_sdk/models/update_incident_sub_status_data.py +++ b/rootly_sdk/models/update_incident_sub_status_data.py @@ -1,13 +1,15 @@ +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_incident_sub_status_data_type import ( UpdateIncidentSubStatusDataType, check_update_incident_sub_status_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_incident_sub_status_data_attributes import UpdateIncidentSubStatusDataAttributes @@ -22,25 +24,31 @@ class UpdateIncidentSubStatusData: Attributes: type_ (UpdateIncidentSubStatusDataType): attributes (UpdateIncidentSubStatusDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateIncidentSubStatusDataType - attributes: "UpdateIncidentSubStatusDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateIncidentSubStatusDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateIncidentSubStatusDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_incident_sub_status_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_incident_sub_status_data.additional_properties = d return update_incident_sub_status_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_incident_sub_status_data_attributes.py b/rootly_sdk/models/update_incident_sub_status_data_attributes.py index bac58bb0..b3b42330 100644 --- a/rootly_sdk/models/update_incident_sub_status_data_attributes.py +++ b/rootly_sdk/models/update_incident_sub_status_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,23 +14,23 @@ class UpdateIncidentSubStatusDataAttributes: """ Attributes: - 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): 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: Unset | str = UNSET - assigned_at: Unset | str = UNSET - assigned_by_user_id: None | Unset | int = UNSET + sub_status_id: str | Unset = UNSET + assigned_at: str | Unset = UNSET + assigned_by_user_id: int | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: sub_status_id = self.sub_status_id assigned_at = self.assigned_at - assigned_by_user_id: None | Unset | int + assigned_by_user_id: int | None | Unset if isinstance(self.assigned_by_user_id, Unset): assigned_by_user_id = UNSET else: @@ -53,12 +55,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) -> None | Unset | int: + def _parse_assigned_by_user_id(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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_sub_status_data_type.py b/rootly_sdk/models/update_incident_sub_status_data_type.py index 07fe3a94..d1002340 100644 --- a/rootly_sdk/models/update_incident_sub_status_data_type.py +++ b/rootly_sdk/models/update_incident_sub_status_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentSubStatusDataType = Literal["incident_sub_statuses"] @@ -11,5 +11,5 @@ def check_update_incident_sub_status_data_type(value: str | None) -> UpdateIncid if value is None: return None if value in UPDATE_INCIDENT_SUB_STATUS_DATA_TYPE_VALUES: - return cast(UpdateIncidentSubStatusDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_SUB_STATUS_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_incident_task_params.py b/rootly_sdk/models/update_incident_task_params.py index 65baa1d0..e2d5cdc3 100644 --- a/rootly_sdk/models/update_incident_task_params.py +++ b/rootly_sdk/models/update_incident_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -22,84 +24,84 @@ class UpdateIncidentTaskParams: """ Attributes: incident_id (str): The incident id to update or id of any attribute on the incident - 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 + 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 valid JSON. Use 'services', 'functionalities', or 'groups' keys with arrays of names/slugs for name/slug lookup """ incident_id: str - 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 + 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 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - attribute_to_query_by: Unset | str = UNSET + attribute_to_query_by: str | Unset = UNSET if not isinstance(self.attribute_to_query_by, Unset): attribute_to_query_by = self.attribute_to_query_by - title: None | Unset | str + title: None | str | Unset if isinstance(self.title, Unset): title = UNSET else: title = self.title - summary: None | Unset | str + summary: None | str | Unset if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - status: None | Unset | str + status: None | str | Unset if isinstance(self.status, Unset): status = UNSET else: status = self.status - severity_id: None | Unset | str + severity_id: None | str | Unset if isinstance(self.severity_id, Unset): severity_id = UNSET else: severity_id = self.severity_id - incident_type_ids: None | Unset | list[str] + incident_type_ids: list[str] | None | Unset if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -108,7 +110,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_type_ids = self.incident_type_ids - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -117,7 +119,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: None | Unset | list[str] + functionality_ids: list[str] | None | Unset if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -126,7 +128,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - environment_ids: None | Unset | list[str] + environment_ids: list[str] | None | Unset if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -135,7 +137,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - group_ids: None | Unset | list[str] + group_ids: list[str] | None | Unset if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -144,31 +146,31 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - detected_at: None | Unset | str + detected_at: None | str | Unset if isinstance(self.detected_at, Unset): detected_at = UNSET else: detected_at = self.detected_at - acknowledged_at: None | Unset | str + acknowledged_at: None | str | Unset if isinstance(self.acknowledged_at, Unset): acknowledged_at = UNSET else: acknowledged_at = self.acknowledged_at - mitigated_at: None | Unset | str + mitigated_at: None | str | Unset if isinstance(self.mitigated_at, Unset): mitigated_at = UNSET else: mitigated_at = self.mitigated_at - resolved_at: None | Unset | str + resolved_at: None | str | Unset if isinstance(self.resolved_at, Unset): resolved_at = UNSET else: @@ -176,7 +178,7 @@ def to_dict(self) -> dict[str, Any]: private = self.private - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -234,56 +236,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: Unset | UpdateIncidentTaskParamsTaskType + task_type: UpdateIncidentTaskParamsTaskType | Unset 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: Unset | UpdateIncidentTaskParamsAttributeToQueryBy + attribute_to_query_by: UpdateIncidentTaskParamsAttributeToQueryBy | Unset 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 | Unset | str: + def _parse_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) title = _parse_title(d.pop("title", UNSET)) - def _parse_summary(data: object) -> None | Unset | str: + def _parse_summary(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_status(data: object) -> None | Unset | str: + def _parse_status(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) status = _parse_status(d.pop("status", UNSET)) - def _parse_severity_id(data: object) -> None | Unset | str: + def _parse_severity_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) severity_id = _parse_severity_id(d.pop("severity_id", UNSET)) - def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: + def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -294,13 +296,13 @@ def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -311,13 +313,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> None | Unset | list[str]: + def _parse_functionality_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -328,13 +330,13 @@ def _parse_functionality_ids(data: object) -> None | Unset | list[str]: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_environment_ids(data: object) -> None | Unset | list[str]: + def _parse_environment_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -345,13 +347,13 @@ def _parse_environment_ids(data: object) -> None | Unset | list[str]: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_group_ids(data: object) -> None | Unset | list[str]: + def _parse_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -362,65 +364,65 @@ def _parse_group_ids(data: object) -> None | Unset | list[str]: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_started_at(data: object) -> None | Unset | str: + def _parse_started_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_detected_at(data: object) -> None | Unset | str: + def _parse_detected_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) detected_at = _parse_detected_at(d.pop("detected_at", UNSET)) - def _parse_acknowledged_at(data: object) -> None | Unset | str: + def _parse_acknowledged_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) acknowledged_at = _parse_acknowledged_at(d.pop("acknowledged_at", UNSET)) - def _parse_mitigated_at(data: object) -> None | Unset | str: + def _parse_mitigated_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) mitigated_at = _parse_mitigated_at(d.pop("mitigated_at", UNSET)) - def _parse_resolved_at(data: object) -> None | Unset | str: + def _parse_resolved_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) resolved_at = _parse_resolved_at(d.pop("resolved_at", UNSET)) private = d.pop("private", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) diff --git a/rootly_sdk/models/update_incident_task_params_attribute_to_query_by.py b/rootly_sdk/models/update_incident_task_params_attribute_to_query_by.py index 926eb757..27c69f44 100644 --- a/rootly_sdk/models/update_incident_task_params_attribute_to_query_by.py +++ b/rootly_sdk/models/update_incident_task_params_attribute_to_query_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentTaskParamsAttributeToQueryBy = Literal[ "airtable_record_id", @@ -53,7 +53,7 @@ def check_update_incident_task_params_attribute_to_query_by( if value is None: return None if value in UPDATE_INCIDENT_TASK_PARAMS_ATTRIBUTE_TO_QUERY_BY_VALUES: - return cast(UpdateIncidentTaskParamsAttributeToQueryBy, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_TASK_PARAMS_ATTRIBUTE_TO_QUERY_BY_VALUES!r}" ) diff --git a/rootly_sdk/models/update_incident_task_params_task_type.py b/rootly_sdk/models/update_incident_task_params_task_type.py index 3bad4339..9190b16e 100644 --- a/rootly_sdk/models/update_incident_task_params_task_type.py +++ b/rootly_sdk/models/update_incident_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentTaskParamsTaskType = Literal["update_incident"] @@ -11,5 +11,5 @@ def check_update_incident_task_params_task_type(value: str | None) -> UpdateInci if value is None: return None if value in UPDATE_INCIDENT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateIncidentTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_incident_type.py b/rootly_sdk/models/update_incident_type.py index 5f929508..57a68b30 100644 --- a/rootly_sdk/models/update_incident_type.py +++ b/rootly_sdk/models/update_incident_type.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_incident_type_data import UpdateIncidentTypeData @@ -18,14 +19,13 @@ class UpdateIncidentType: data (UpdateIncidentTypeData): """ - data: "UpdateIncidentTypeData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateIncidentTypeData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_incident_type.additional_properties = d return update_incident_type - - @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_incident_type_data.py b/rootly_sdk/models/update_incident_type_data.py index db52b409..7ce16839 100644 --- a/rootly_sdk/models/update_incident_type_data.py +++ b/rootly_sdk/models/update_incident_type_data.py @@ -1,10 +1,12 @@ +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_incident_type_data_type import UpdateIncidentTypeDataType, check_update_incident_type_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_incident_type_data_attributes import UpdateIncidentTypeDataAttributes @@ -19,25 +21,31 @@ class UpdateIncidentTypeData: Attributes: type_ (UpdateIncidentTypeDataType): attributes (UpdateIncidentTypeDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateIncidentTypeDataType - attributes: "UpdateIncidentTypeDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateIncidentTypeDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateIncidentTypeDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_incident_type_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_incident_type_data.additional_properties = d return update_incident_type_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_incident_type_data_attributes.py b/rootly_sdk/models/update_incident_type_data_attributes.py index 4559b0ec..3c9e3917 100644 --- a/rootly_sdk/models/update_incident_type_data_attributes.py +++ b/rootly_sdk/models/update_incident_type_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -24,35 +26,35 @@ class UpdateIncidentTypeDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + name (str | Unset): The name of the incident type + description (None | str | Unset): The description of the incident type + public_description (None | str | Unset): The status page 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 associated with this incident type - properties (Union[Unset, list['UpdateIncidentTypeDataAttributesPropertiesItem']]): Array of property values for - this incident type. + properties (list[UpdateIncidentTypeDataAttributesPropertiesItem] | Unset): Array of property values for this + incident type. """ - 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 + slug: None | str | Unset = UNSET + 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 + 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 def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -60,31 +62,31 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -93,7 +95,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: None | Unset | list[dict[str, Any]] + slack_channels: list[dict[str, Any]] | None | Unset if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -105,7 +107,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: None | Unset | list[dict[str, Any]] + slack_aliases: list[dict[str, Any]] | None | Unset if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -117,7 +119,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - properties: Unset | list[dict[str, Any]] = UNSET + properties: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -164,54 +166,54 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -222,15 +224,15 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> None | Unset | list["UpdateIncidentTypeDataAttributesSlackChannelsType0Item"]: + ) -> list[UpdateIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -248,15 +250,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["UpdateIncidentTypeDataAttributesSlackChannelsType0Item"], data) + return cast(list[UpdateIncidentTypeDataAttributesSlackChannelsType0Item] | None | Unset, data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> None | Unset | list["UpdateIncidentTypeDataAttributesSlackAliasesType0Item"]: + ) -> list[UpdateIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -274,18 +276,20 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["UpdateIncidentTypeDataAttributesSlackAliasesType0Item"], data) + return cast(list[UpdateIncidentTypeDataAttributesSlackAliasesType0Item] | None | Unset, data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - properties = [] _properties = d.pop("properties", UNSET) - for properties_item_data in _properties or []: - properties_item = UpdateIncidentTypeDataAttributesPropertiesItem.from_dict(properties_item_data) + 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) - properties.append(properties_item) + properties.append(properties_item) update_incident_type_data_attributes = cls( slug=slug, 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 de4e59f0..b4e47094 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,3 +1,5 @@ +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 8d6b5b13..895e9af6 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="UpdateIncidentTypeDataAttributesSlackAliasesType0Item") @@ -17,7 +18,6 @@ class UpdateIncidentTypeDataAttributesSlackAliasesType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - update_incident_type_data_attributes_slack_aliases_type_0_item.additional_properties = d return update_incident_type_data_attributes_slack_aliases_type_0_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_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 b62bba36..bf2421a3 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="UpdateIncidentTypeDataAttributesSlackChannelsType0Item") @@ -17,7 +18,6 @@ class UpdateIncidentTypeDataAttributesSlackChannelsType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - update_incident_type_data_attributes_slack_channels_type_0_item.additional_properties = d return update_incident_type_data_attributes_slack_channels_type_0_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_incident_type_data_type.py b/rootly_sdk/models/update_incident_type_data_type.py index fb808b26..99f6b8ff 100644 --- a/rootly_sdk/models/update_incident_type_data_type.py +++ b/rootly_sdk/models/update_incident_type_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateIncidentTypeDataType = Literal["incident_types"] @@ -11,5 +11,5 @@ def check_update_incident_type_data_type(value: str | None) -> UpdateIncidentTyp if value is None: return None if value in UPDATE_INCIDENT_TYPE_DATA_TYPE_VALUES: - return cast(UpdateIncidentTypeDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_INCIDENT_TYPE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_jira_issue_task_params.py b/rootly_sdk/models/update_jira_issue_task_params.py index 05e65d09..d6f8a757 100644 --- a/rootly_sdk/models/update_jira_issue_task_params.py +++ b/rootly_sdk/models/update_jira_issue_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,42 +27,42 @@ class UpdateJiraIssueTaskParams: Attributes: issue_id (str): The issue id project_key (str): The project key - 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 + 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 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. + update_payload (None | str | Unset): Update payload. Can contain liquid markup and need to be valid JSON + retry_count (int | Unset): Number of times to retry on rate-limit (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. """ issue_id: str project_key: str - 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 + 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 + retry_count: int | Unset = 0 + retry_wait_time: int | Unset = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -68,11 +70,11 @@ def to_dict(self) -> dict[str, Any]: project_key = self.project_key - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type - integration: Unset | dict[str, Any] = UNSET + integration: dict[str, Any] | Unset = UNSET if not isinstance(self.integration, Unset): integration = self.integration.to_dict() @@ -88,21 +90,21 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - priority: Unset | dict[str, Any] = UNSET + priority: dict[str, Any] | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - status: Unset | dict[str, Any] = UNSET + status: dict[str, Any] | Unset = UNSET if not isinstance(self.status, Unset): status = self.status.to_dict() - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - update_payload: None | Unset | str + update_payload: None | str | Unset if isinstance(self.update_payload, Unset): update_payload = UNSET else: @@ -163,14 +165,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: Unset | UpdateJiraIssueTaskParamsTaskType + task_type: UpdateJiraIssueTaskParamsTaskType | Unset 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: Unset | UpdateJiraIssueTaskParamsIntegration + integration: UpdateJiraIssueTaskParamsIntegration | Unset if isinstance(_integration, Unset): integration = UNSET else: @@ -189,34 +191,34 @@ 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: Unset | UpdateJiraIssueTaskParamsPriority + priority: UpdateJiraIssueTaskParamsPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: priority = UpdateJiraIssueTaskParamsPriority.from_dict(_priority) _status = d.pop("status", UNSET) - status: Unset | UpdateJiraIssueTaskParamsStatus + status: UpdateJiraIssueTaskParamsStatus | Unset if isinstance(_status, Unset): status = UNSET else: status = UpdateJiraIssueTaskParamsStatus.from_dict(_status) - def _parse_custom_fields_mapping(data: object) -> None | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_update_payload(data: object) -> None | Unset | str: + def _parse_update_payload(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) update_payload = _parse_update_payload(d.pop("update_payload", UNSET)) 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 238ad0fc..1e6f0b85 100644 --- a/rootly_sdk/models/update_jira_issue_task_params_integration.py +++ b/rootly_sdk/models/update_jira_issue_task_params_integration.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateJiraIssueTaskParamsIntegration: """Specify integration id if you have more than one Jira instance Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 f932d3d4..da36b28e 100644 --- a/rootly_sdk/models/update_jira_issue_task_params_priority.py +++ b/rootly_sdk/models/update_jira_issue_task_params_priority.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateJiraIssueTaskParamsPriority: """The priority id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 f7e32704..83ca7fdf 100644 --- a/rootly_sdk/models/update_jira_issue_task_params_status.py +++ b/rootly_sdk/models/update_jira_issue_task_params_status.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateJiraIssueTaskParamsStatus: """The status id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/update_jira_issue_task_params_task_type.py index 3d7c191b..250de0a1 100644 --- a/rootly_sdk/models/update_jira_issue_task_params_task_type.py +++ b/rootly_sdk/models/update_jira_issue_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateJiraIssueTaskParamsTaskType = Literal["update_jira_issue"] @@ -11,5 +11,5 @@ def check_update_jira_issue_task_params_task_type(value: str | None) -> UpdateJi if value is None: return None if value in UPDATE_JIRA_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateJiraIssueTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_JIRA_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_linear_issue_task_params.py b/rootly_sdk/models/update_linear_issue_task_params.py index 6f7c3236..555aca6c 100644 --- a/rootly_sdk/models/update_linear_issue_task_params.py +++ b/rootly_sdk/models/update_linear_issue_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -25,28 +27,28 @@ class UpdateLinearIssueTaskParams: """ Attributes: issue_id (str): The issue id - 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 + 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 valid JSON """ issue_id: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -54,7 +56,7 @@ def to_dict(self) -> dict[str, Any]: issue_id = self.issue_id - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -62,7 +64,7 @@ def to_dict(self) -> dict[str, Any]: description = self.description - state: None | Unset | dict[str, Any] + state: dict[str, Any] | None | Unset if isinstance(self.state, Unset): state = UNSET elif isinstance(self.state, UpdateLinearIssueTaskParamsStateType0): @@ -70,24 +72,24 @@ def to_dict(self) -> dict[str, Any]: else: state = self.state - project: Unset | dict[str, Any] = UNSET + project: dict[str, Any] | Unset = UNSET if not isinstance(self.project, Unset): project = self.project.to_dict() - labels: Unset | list[dict[str, Any]] = UNSET + labels: list[dict[str, Any]] | Unset = 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: Unset | dict[str, Any] = UNSET + priority: dict[str, Any] | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() assign_user_email = self.assign_user_email - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -132,7 +134,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: Unset | UpdateLinearIssueTaskParamsTaskType + task_type: UpdateLinearIssueTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -142,7 +144,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) - def _parse_state(data: object) -> Union["UpdateLinearIssueTaskParamsStateType0", None, Unset]: + def _parse_state(data: object) -> None | Unset | UpdateLinearIssueTaskParamsStateType0: if data is None: return data if isinstance(data, Unset): @@ -153,28 +155,30 @@ def _parse_state(data: object) -> Union["UpdateLinearIssueTaskParamsStateType0", state_type_0 = UpdateLinearIssueTaskParamsStateType0.from_dict(data) return state_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["UpdateLinearIssueTaskParamsStateType0", None, Unset], data) + return cast(None | Unset | UpdateLinearIssueTaskParamsStateType0, data) state = _parse_state(d.pop("state", UNSET)) _project = d.pop("project", UNSET) - project: Unset | UpdateLinearIssueTaskParamsProject + project: UpdateLinearIssueTaskParamsProject | Unset if isinstance(_project, Unset): project = UNSET else: project = UpdateLinearIssueTaskParamsProject.from_dict(_project) - labels = [] _labels = d.pop("labels", UNSET) - for labels_item_data in _labels or []: - labels_item = UpdateLinearIssueTaskParamsLabelsItem.from_dict(labels_item_data) + 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) - labels.append(labels_item) + labels.append(labels_item) _priority = d.pop("priority", UNSET) - priority: Unset | UpdateLinearIssueTaskParamsPriority + priority: UpdateLinearIssueTaskParamsPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: @@ -182,12 +186,12 @@ def _parse_state(data: object) -> Union["UpdateLinearIssueTaskParamsStateType0", assign_user_email = d.pop("assign_user_email", UNSET) - def _parse_custom_fields_mapping(data: object) -> None | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 244efd9a..79c23c9d 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class UpdateLinearIssueTaskParamsLabelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 4ca581ca..f4b9cfd4 100644 --- a/rootly_sdk/models/update_linear_issue_task_params_priority.py +++ b/rootly_sdk/models/update_linear_issue_task_params_priority.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateLinearIssueTaskParamsPriority: """The priority id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 7bea360a..d10f9177 100644 --- a/rootly_sdk/models/update_linear_issue_task_params_project.py +++ b/rootly_sdk/models/update_linear_issue_task_params_project.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateLinearIssueTaskParamsProject: """The project id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 b18324bb..e5b7c643 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateLinearIssueTaskParamsStateType0: """The state id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/update_linear_issue_task_params_task_type.py index 2718538d..36839963 100644 --- a/rootly_sdk/models/update_linear_issue_task_params_task_type.py +++ b/rootly_sdk/models/update_linear_issue_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateLinearIssueTaskParamsTaskType = Literal["update_linear_issue"] @@ -11,5 +11,5 @@ def check_update_linear_issue_task_params_task_type(value: str | None) -> Update if value is None: return None if value in UPDATE_LINEAR_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateLinearIssueTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_LINEAR_ISSUE_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_live_call_router.py b/rootly_sdk/models/update_live_call_router.py index ab09a49a..da84e742 100644 --- a/rootly_sdk/models/update_live_call_router.py +++ b/rootly_sdk/models/update_live_call_router.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_live_call_router_data import UpdateLiveCallRouterData @@ -18,14 +19,13 @@ class UpdateLiveCallRouter: data (UpdateLiveCallRouterData): """ - data: "UpdateLiveCallRouterData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateLiveCallRouterData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_live_call_router.additional_properties = d return update_live_call_router - - @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_live_call_router_data.py b/rootly_sdk/models/update_live_call_router_data.py index 1fdba004..f316ba45 100644 --- a/rootly_sdk/models/update_live_call_router_data.py +++ b/rootly_sdk/models/update_live_call_router_data.py @@ -1,13 +1,15 @@ +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_live_call_router_data_type import ( UpdateLiveCallRouterDataType, check_update_live_call_router_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_live_call_router_data_attributes import UpdateLiveCallRouterDataAttributes @@ -22,25 +24,31 @@ class UpdateLiveCallRouterData: Attributes: type_ (UpdateLiveCallRouterDataType): attributes (UpdateLiveCallRouterDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateLiveCallRouterDataType - attributes: "UpdateLiveCallRouterDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateLiveCallRouterDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateLiveCallRouterDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_live_call_router_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_live_call_router_data.additional_properties = d return update_live_call_router_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_live_call_router_data_attributes.py b/rootly_sdk/models/update_live_call_router_data_attributes.py index e6799896..eb5a8633 100644 --- a/rootly_sdk/models/update_live_call_router_data_attributes.py +++ b/rootly_sdk/models/update_live_call_router_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -37,69 +39,61 @@ class UpdateLiveCallRouterDataAttributes: """ Attributes: - 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 + 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 live_call_router - 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 + 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 callers to press a key before being connected - calling_tree_prompt (Union[Unset, str]): The audio instructions callers will hear when they call this number, + calling_tree_prompt (str | Unset): The audio instructions callers will hear when they call this number, prompting them to select from available options to route their call - 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]): + 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): """ - 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 + 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 def to_dict(self) -> dict[str, Any]: - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind @@ -107,11 +101,11 @@ def to_dict(self) -> dict[str, Any]: name = self.name - country_code: Unset | str = UNSET + country_code: str | Unset = UNSET if not isinstance(self.country_code, Unset): country_code = self.country_code - phone_type: Unset | str = UNSET + phone_type: str | Unset = UNSET if not isinstance(self.phone_type, Unset): phone_type = self.phone_type @@ -119,13 +113,13 @@ def to_dict(self) -> dict[str, Any]: caller_greeting = self.caller_greeting - unavailable_responder_message: None | Unset | str + unavailable_responder_message: None | str | Unset if isinstance(self.unavailable_responder_message, Unset): unavailable_responder_message = UNSET else: unavailable_responder_message = self.unavailable_responder_message - waiting_music_url: Unset | str = UNSET + waiting_music_url: str | Unset = UNSET if not isinstance(self.waiting_music_url, Unset): waiting_music_url = self.waiting_music_url @@ -141,7 +135,7 @@ def to_dict(self) -> dict[str, Any]: notify_via_push_notification = self.notify_via_push_notification - informational_notification_message: None | Unset | str + informational_notification_message: None | str | Unset if isinstance(self.informational_notification_message, Unset): informational_notification_message = UNSET else: @@ -153,14 +147,14 @@ def to_dict(self) -> dict[str, Any]: calling_tree_prompt = self.calling_tree_prompt - paging_targets: Unset | list[dict[str, Any]] = UNSET + paging_targets: list[dict[str, Any]] | Unset = 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: Unset | dict[str, Any] = UNSET + escalation_policy_trigger_params: dict[str, Any] | Unset = UNSET if not isinstance(self.escalation_policy_trigger_params, Unset): escalation_policy_trigger_params = self.escalation_policy_trigger_params.to_dict() @@ -223,7 +217,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _kind = d.pop("kind", UNSET) - kind: Unset | UpdateLiveCallRouterDataAttributesKind + kind: UpdateLiveCallRouterDataAttributesKind | Unset if isinstance(_kind, Unset): kind = UNSET else: @@ -234,14 +228,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: Unset | UpdateLiveCallRouterDataAttributesCountryCode + country_code: UpdateLiveCallRouterDataAttributesCountryCode | Unset 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: Unset | UpdateLiveCallRouterDataAttributesPhoneType + phone_type: UpdateLiveCallRouterDataAttributesPhoneType | Unset if isinstance(_phone_type, Unset): phone_type = UNSET else: @@ -251,19 +245,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 | Unset | str: + def _parse_unavailable_responder_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: Unset | UpdateLiveCallRouterDataAttributesWaitingMusicUrl + waiting_music_url: UpdateLiveCallRouterDataAttributesWaitingMusicUrl | Unset if isinstance(_waiting_music_url, Unset): waiting_music_url = UNSET else: @@ -281,12 +275,12 @@ def _parse_unavailable_responder_message(data: object) -> None | Unset | str: notify_via_push_notification = d.pop("notify_via_push_notification", UNSET) - def _parse_informational_notification_message(data: object) -> None | Unset | str: + def _parse_informational_notification_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) informational_notification_message = _parse_informational_notification_message( d.pop("informational_notification_message", UNSET) @@ -298,17 +292,19 @@ def _parse_informational_notification_message(data: object) -> None | Unset | st calling_tree_prompt = d.pop("calling_tree_prompt", UNSET) - paging_targets = [] _paging_targets = d.pop("paging_targets", UNSET) - for paging_targets_item_data in _paging_targets or []: - paging_targets_item = UpdateLiveCallRouterDataAttributesPagingTargetsItem.from_dict( - paging_targets_item_data - ) + 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 + ) - 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: Unset | UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams + escalation_policy_trigger_params: UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams | Unset 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_country_code.py b/rootly_sdk/models/update_live_call_router_data_attributes_country_code.py index fc1faf8b..80ffca65 100644 --- a/rootly_sdk/models/update_live_call_router_data_attributes_country_code.py +++ b/rootly_sdk/models/update_live_call_router_data_attributes_country_code.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateLiveCallRouterDataAttributesCountryCode = Literal["AU", "CA", "CH", "DE", "GB", "NL", "NZ", "SE", "US"] @@ -21,7 +21,7 @@ def check_update_live_call_router_data_attributes_country_code( if value is None: return None if value in UPDATE_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_COUNTRY_CODE_VALUES: - return cast(UpdateLiveCallRouterDataAttributesCountryCode, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_COUNTRY_CODE_VALUES!r}" ) 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 95a1f5e9..3bfa787b 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,8 +1,9 @@ +from __future__ import annotations + 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.update_live_call_router_data_attributes_escalation_policy_trigger_params_type import ( UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParamsType, @@ -23,7 +24,6 @@ class UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParams: id: str type_: UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParamsType - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: type_: str = self.type_ field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -53,21 +53,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: type_=type_, ) - update_live_call_router_data_attributes_escalation_policy_trigger_params.additional_properties = d return update_live_call_router_data_attributes_escalation_policy_trigger_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/update_live_call_router_data_attributes_escalation_policy_trigger_params_type.py b/rootly_sdk/models/update_live_call_router_data_attributes_escalation_policy_trigger_params_type.py index e0e1500c..b291525a 100644 --- a/rootly_sdk/models/update_live_call_router_data_attributes_escalation_policy_trigger_params_type.py +++ b/rootly_sdk/models/update_live_call_router_data_attributes_escalation_policy_trigger_params_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParamsType = Literal[ "EscalationPolicy", "Functionality", "Group", "Service" @@ -20,7 +20,7 @@ def check_update_live_call_router_data_attributes_escalation_policy_trigger_para if value is None: return None if value in UPDATE_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_ESCALATION_POLICY_TRIGGER_PARAMS_TYPE_VALUES: - return cast(UpdateLiveCallRouterDataAttributesEscalationPolicyTriggerParamsType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_ESCALATION_POLICY_TRIGGER_PARAMS_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_live_call_router_data_attributes_kind.py b/rootly_sdk/models/update_live_call_router_data_attributes_kind.py index 2a5cf210..d572796e 100644 --- a/rootly_sdk/models/update_live_call_router_data_attributes_kind.py +++ b/rootly_sdk/models/update_live_call_router_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateLiveCallRouterDataAttributesKind = Literal["live", "voicemail"] @@ -14,7 +14,7 @@ def check_update_live_call_router_data_attributes_kind( if value is None: return None if value in UPDATE_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_KIND_VALUES: - return cast(UpdateLiveCallRouterDataAttributesKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_KIND_VALUES!r}" ) 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 d3526da7..f0681a78 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,8 +1,9 @@ +from __future__ import annotations + 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.update_live_call_router_data_attributes_paging_targets_item_type import ( UpdateLiveCallRouterDataAttributesPagingTargetsItemType, @@ -25,7 +26,6 @@ class UpdateLiveCallRouterDataAttributesPagingTargetsItem: id: str type_: UpdateLiveCallRouterDataAttributesPagingTargetsItemType alert_urgency_id: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -35,7 +35,7 @@ def to_dict(self) -> dict[str, Any]: alert_urgency_id = self.alert_urgency_id field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -61,21 +61,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: alert_urgency_id=alert_urgency_id, ) - update_live_call_router_data_attributes_paging_targets_item.additional_properties = d return update_live_call_router_data_attributes_paging_targets_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_live_call_router_data_attributes_paging_targets_item_type.py b/rootly_sdk/models/update_live_call_router_data_attributes_paging_targets_item_type.py index 4ba48f88..4e9b8702 100644 --- a/rootly_sdk/models/update_live_call_router_data_attributes_paging_targets_item_type.py +++ b/rootly_sdk/models/update_live_call_router_data_attributes_paging_targets_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateLiveCallRouterDataAttributesPagingTargetsItemType = Literal[ "escalation_policy", "functionality", "service", "team" @@ -20,7 +20,7 @@ def check_update_live_call_router_data_attributes_paging_targets_item_type( if value is None: return None if value in UPDATE_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_PAGING_TARGETS_ITEM_TYPE_VALUES: - return cast(UpdateLiveCallRouterDataAttributesPagingTargetsItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_PAGING_TARGETS_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_live_call_router_data_attributes_phone_type.py b/rootly_sdk/models/update_live_call_router_data_attributes_phone_type.py index 3c1b5ec2..78ae07ef 100644 --- a/rootly_sdk/models/update_live_call_router_data_attributes_phone_type.py +++ b/rootly_sdk/models/update_live_call_router_data_attributes_phone_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateLiveCallRouterDataAttributesPhoneType = Literal["local", "mobile", "toll_free"] @@ -15,7 +15,7 @@ def check_update_live_call_router_data_attributes_phone_type( if value is None: return None if value in UPDATE_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_PHONE_TYPE_VALUES: - return cast(UpdateLiveCallRouterDataAttributesPhoneType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_PHONE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_live_call_router_data_attributes_waiting_music_url.py b/rootly_sdk/models/update_live_call_router_data_attributes_waiting_music_url.py index 2e57fecb..dbcfa583 100644 --- a/rootly_sdk/models/update_live_call_router_data_attributes_waiting_music_url.py +++ b/rootly_sdk/models/update_live_call_router_data_attributes_waiting_music_url.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateLiveCallRouterDataAttributesWaitingMusicUrl = Literal[ "https://storage.rootly.com/twilio/voicemail/BusyStrings.mp3", @@ -29,7 +29,7 @@ def check_update_live_call_router_data_attributes_waiting_music_url( if value is None: return None if value in UPDATE_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_WAITING_MUSIC_URL_VALUES: - return cast(UpdateLiveCallRouterDataAttributesWaitingMusicUrl, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_LIVE_CALL_ROUTER_DATA_ATTRIBUTES_WAITING_MUSIC_URL_VALUES!r}" ) diff --git a/rootly_sdk/models/update_live_call_router_data_type.py b/rootly_sdk/models/update_live_call_router_data_type.py index 1236e414..2b0bdf78 100644 --- a/rootly_sdk/models/update_live_call_router_data_type.py +++ b/rootly_sdk/models/update_live_call_router_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateLiveCallRouterDataType = Literal["live_call_routers"] @@ -11,5 +11,5 @@ def check_update_live_call_router_data_type(value: str | None) -> UpdateLiveCall if value is None: return None if value in UPDATE_LIVE_CALL_ROUTER_DATA_TYPE_VALUES: - return cast(UpdateLiveCallRouterDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_LIVE_CALL_ROUTER_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_motion_task_task_params.py b/rootly_sdk/models/update_motion_task_task_params.py index 47b708b5..35906759 100644 --- a/rootly_sdk/models/update_motion_task_task_params.py +++ b/rootly_sdk/models/update_motion_task_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,29 +24,29 @@ class UpdateMotionTaskTaskParams: """ Attributes: task_id (str): The task id - 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_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_id: str - 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 + 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 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -52,11 +54,11 @@ def to_dict(self) -> dict[str, Any]: description = self.description - labels: Unset | list[str] = UNSET + labels: list[str] | Unset = UNSET if not isinstance(self.labels, Unset): labels = self.labels - priority: Unset | dict[str, Any] = UNSET + priority: dict[str, Any] | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() @@ -96,7 +98,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: Unset | UpdateMotionTaskTaskParamsTaskType + task_type: UpdateMotionTaskTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -109,7 +111,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: Unset | UpdateMotionTaskTaskParamsPriority + priority: UpdateMotionTaskTaskParamsPriority | Unset 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 54667733..20e79aec 100644 --- a/rootly_sdk/models/update_motion_task_task_params_priority.py +++ b/rootly_sdk/models/update_motion_task_task_params_priority.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateMotionTaskTaskParamsPriority: """The priority id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_motion_task_task_params_task_type.py b/rootly_sdk/models/update_motion_task_task_params_task_type.py index 7806c099..af0e8d10 100644 --- a/rootly_sdk/models/update_motion_task_task_params_task_type.py +++ b/rootly_sdk/models/update_motion_task_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateMotionTaskTaskParamsTaskType = Literal["update_motion_task"] @@ -11,5 +11,5 @@ def check_update_motion_task_task_params_task_type(value: str | None) -> UpdateM if value is None: return None if value in UPDATE_MOTION_TASK_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateMotionTaskTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_MOTION_TASK_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_notion_page_task_params.py b/rootly_sdk/models/update_notion_page_task_params.py index bfc0e927..89bd9a23 100644 --- a/rootly_sdk/models/update_notion_page_task_params.py +++ b/rootly_sdk/models/update_notion_page_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -18,28 +20,28 @@ class UpdateNotionPageTaskParams: """ Attributes: file_id (str): The Notion page ID - 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]): + 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): """ file_id: str - 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 + 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 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -81,7 +83,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: Unset | UpdateNotionPageTaskParamsTaskType + task_type: UpdateNotionPageTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_notion_page_task_params_task_type.py b/rootly_sdk/models/update_notion_page_task_params_task_type.py index 9ad62e71..e632977d 100644 --- a/rootly_sdk/models/update_notion_page_task_params_task_type.py +++ b/rootly_sdk/models/update_notion_page_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateNotionPageTaskParamsTaskType = Literal["update_notion_page"] @@ -11,5 +11,5 @@ def check_update_notion_page_task_params_task_type(value: str | None) -> UpdateN if value is None: return None if value in UPDATE_NOTION_PAGE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateNotionPageTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_NOTION_PAGE_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_on_call_pay_report.py b/rootly_sdk/models/update_on_call_pay_report.py index c1ca2b46..fcc920bf 100644 --- a/rootly_sdk/models/update_on_call_pay_report.py +++ b/rootly_sdk/models/update_on_call_pay_report.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_on_call_pay_report_data import UpdateOnCallPayReportData @@ -18,14 +19,13 @@ class UpdateOnCallPayReport: data (UpdateOnCallPayReportData): """ - data: "UpdateOnCallPayReportData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateOnCallPayReportData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_on_call_pay_report.additional_properties = d return update_on_call_pay_report - - @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_on_call_pay_report_data.py b/rootly_sdk/models/update_on_call_pay_report_data.py index ff717150..c507f8ef 100644 --- a/rootly_sdk/models/update_on_call_pay_report_data.py +++ b/rootly_sdk/models/update_on_call_pay_report_data.py @@ -1,13 +1,15 @@ +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_on_call_pay_report_data_type import ( UpdateOnCallPayReportDataType, check_update_on_call_pay_report_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_on_call_pay_report_data_attributes import UpdateOnCallPayReportDataAttributes @@ -22,25 +24,31 @@ class UpdateOnCallPayReportData: Attributes: type_ (UpdateOnCallPayReportDataType): attributes (UpdateOnCallPayReportDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateOnCallPayReportDataType - attributes: "UpdateOnCallPayReportDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateOnCallPayReportDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateOnCallPayReportDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_on_call_pay_report_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_on_call_pay_report_data.additional_properties = d return update_on_call_pay_report_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_on_call_pay_report_data_attributes.py b/rootly_sdk/models/update_on_call_pay_report_data_attributes.py index 3b473545..6d942dc5 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,9 +1,10 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast from attrs import define as _attrs_define -from dateutil.parser import isoparse from ..types import UNSET, Unset @@ -14,30 +15,30 @@ class UpdateOnCallPayReportDataAttributes: """ Attributes: - 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): 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: 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 + 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 def to_dict(self) -> dict[str, Any]: - start_date: Unset | str = UNSET + start_date: str | Unset = UNSET if not isinstance(self.start_date, Unset): start_date = self.start_date.isoformat() - end_date: Unset | str = UNSET + end_date: str | Unset = UNSET if not isinstance(self.end_date, Unset): end_date = self.end_date.isoformat() - schedule_ids: Unset | list[str] = UNSET + schedule_ids: list[str] | Unset = UNSET if not isinstance(self.schedule_ids, Unset): schedule_ids = self.schedule_ids @@ -65,18 +66,18 @@ 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: Unset | datetime.date + start_date: datetime.date | Unset if isinstance(_start_date, Unset): start_date = UNSET else: - start_date = isoparse(_start_date).date() + start_date = datetime.date.fromisoformat(_start_date) _end_date = d.pop("end_date", UNSET) - end_date: Unset | datetime.date + end_date: datetime.date | Unset if isinstance(_end_date, Unset): end_date = UNSET else: - end_date = isoparse(_end_date).date() + end_date = datetime.date.fromisoformat(_end_date) schedule_ids = cast(list[str], d.pop("schedule_ids", UNSET)) diff --git a/rootly_sdk/models/update_on_call_pay_report_data_type.py b/rootly_sdk/models/update_on_call_pay_report_data_type.py index 369a592f..a18e5aca 100644 --- a/rootly_sdk/models/update_on_call_pay_report_data_type.py +++ b/rootly_sdk/models/update_on_call_pay_report_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallPayReportDataType = Literal["on_call_pay_reports"] @@ -11,5 +11,5 @@ def check_update_on_call_pay_report_data_type(value: str | None) -> UpdateOnCall if value is None: return None if value in UPDATE_ON_CALL_PAY_REPORT_DATA_TYPE_VALUES: - return cast(UpdateOnCallPayReportDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_PAY_REPORT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_on_call_role.py b/rootly_sdk/models/update_on_call_role.py index ff9a0a38..f8951e41 100644 --- a/rootly_sdk/models/update_on_call_role.py +++ b/rootly_sdk/models/update_on_call_role.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_on_call_role_data import UpdateOnCallRoleData @@ -18,14 +19,13 @@ class UpdateOnCallRole: data (UpdateOnCallRoleData): """ - data: "UpdateOnCallRoleData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateOnCallRoleData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_on_call_role.additional_properties = d return update_on_call_role - - @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_on_call_role_data.py b/rootly_sdk/models/update_on_call_role_data.py index 320a3c0d..b1299545 100644 --- a/rootly_sdk/models/update_on_call_role_data.py +++ b/rootly_sdk/models/update_on_call_role_data.py @@ -1,10 +1,12 @@ +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_on_call_role_data_type import UpdateOnCallRoleDataType, check_update_on_call_role_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_on_call_role_data_attributes import UpdateOnCallRoleDataAttributes @@ -19,25 +21,31 @@ class UpdateOnCallRoleData: Attributes: type_ (UpdateOnCallRoleDataType): attributes (UpdateOnCallRoleDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateOnCallRoleDataType - attributes: "UpdateOnCallRoleDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateOnCallRoleDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateOnCallRoleDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_on_call_role_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_on_call_role_data.additional_properties = d return update_on_call_role_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_on_call_role_data_attributes.py b/rootly_sdk/models/update_on_call_role_data_attributes.py index cedd2246..e14e7204 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -71,6 +73,10 @@ UpdateOnCallRoleDataAttributesLiveCallRoutingPermissionsItem, check_update_on_call_role_data_attributes_live_call_routing_permissions_item, ) +from ..models.update_on_call_role_data_attributes_members_permissions_item import ( + UpdateOnCallRoleDataAttributesMembersPermissionsItem, + check_update_on_call_role_data_attributes_members_permissions_item, +) from ..models.update_on_call_role_data_attributes_on_call_readiness_report_permissions_item import ( UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem, check_update_on_call_role_data_attributes_on_call_readiness_report_permissions_item, @@ -108,78 +114,75 @@ class UpdateOnCallRoleDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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): 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): + members_permissions (list[UpdateOnCallRoleDataAttributesMembersPermissionsItem] | 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: 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] = ( + slug: None | str | Unset = UNSET + 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 = ( UNSET ) on_call_readiness_report_permissions: ( - Unset | list[UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] + list[UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem] | Unset ) = 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] = ( + 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 = ( 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 + 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 + members_permissions: list[UpdateOnCallRoleDataAttributesMembersPermissionsItem] | 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 def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -189,168 +192,175 @@ def to_dict(self) -> dict[str, Any]: system_role = self.system_role - alert_sources_permissions: Unset | list[str] = UNSET + alert_sources_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + alert_urgency_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + alert_fields_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + alert_groups_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + alert_routing_rules_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + on_call_readiness_report_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + on_call_roles_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + alerts_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + api_keys_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + audits_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + contacts_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + escalation_policies_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + groups_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + heartbeats_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + integrations_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + invitations_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + live_call_routing_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + members_permissions: list[str] | Unset = UNSET + if not isinstance(self.members_permissions, Unset): + members_permissions = [] + for members_permissions_item_data in self.members_permissions: + members_permissions_item: str = members_permissions_item_data + members_permissions.append(members_permissions_item) + + schedule_override_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + schedules_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + services_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + functionalities_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + webhooks_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + workflows_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + catalogs_permissions: list[str] | Unset = UNSET if not isinstance(self.catalogs_permissions, Unset): catalogs_permissions = [] for catalogs_permissions_item_data in self.catalogs_permissions: @@ -400,6 +410,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["invitations_permissions"] = invitations_permissions if live_call_routing_permissions is not UNSET: field_dict["live_call_routing_permissions"] = live_call_routing_permissions + if members_permissions is not UNSET: + field_dict["members_permissions"] = members_permissions if schedule_override_permissions is not UNSET: field_dict["schedule_override_permissions"] = schedule_override_permissions if schedules_permissions is not UNSET: @@ -421,12 +433,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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) @@ -434,233 +446,308 @@ def _parse_slug(data: object) -> None | Unset | str: system_role = d.pop("system_role", UNSET) - alert_sources_permissions = [] _alert_sources_permissions = d.pop("alert_sources_permissions", UNSET) - 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: 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 + ) + ) - 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) - 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: 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 + ) + ) - 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) - 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: 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 + ) - 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) - 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: 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 + ) - 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) - 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: ( + 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 + ) ) - ) - 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) - 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: ( + 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 + ) ) - ) - 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) - 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: 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 + ) + ) - 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) - 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: 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 + ) - alerts_permissions.append(alerts_permissions_item) + alerts_permissions.append(alerts_permissions_item) - api_keys_permissions = [] _api_keys_permissions = d.pop("api_keys_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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 + ) - audits_permissions.append(audits_permissions_item) + audits_permissions.append(audits_permissions_item) - contacts_permissions = [] _contacts_permissions = d.pop("contacts_permissions", UNSET) - 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: 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 + ) - contacts_permissions.append(contacts_permissions_item) + contacts_permissions.append(contacts_permissions_item) - escalation_policies_permissions = [] _escalation_policies_permissions = d.pop("escalation_policies_permissions", UNSET) - 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: ( + 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 + ) ) - ) - 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) - 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: 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 + ) - groups_permissions.append(groups_permissions_item) + groups_permissions.append(groups_permissions_item) - heartbeats_permissions = [] _heartbeats_permissions = d.pop("heartbeats_permissions", UNSET) - 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: 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 + ) - heartbeats_permissions.append(heartbeats_permissions_item) + heartbeats_permissions.append(heartbeats_permissions_item) - integrations_permissions = [] _integrations_permissions = d.pop("integrations_permissions", UNSET) - 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: 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 + ) - integrations_permissions.append(integrations_permissions_item) + integrations_permissions.append(integrations_permissions_item) - invitations_permissions = [] _invitations_permissions = d.pop("invitations_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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 + ) ) - ) - live_call_routing_permissions.append(live_call_routing_permissions_item) + live_call_routing_permissions.append(live_call_routing_permissions_item) + + _members_permissions = d.pop("members_permissions", UNSET) + members_permissions: list[UpdateOnCallRoleDataAttributesMembersPermissionsItem] | Unset = UNSET + if _members_permissions is not UNSET: + members_permissions = [] + for members_permissions_item_data in _members_permissions: + members_permissions_item = check_update_on_call_role_data_attributes_members_permissions_item( + members_permissions_item_data + ) + + members_permissions.append(members_permissions_item) - schedule_override_permissions = [] _schedule_override_permissions = d.pop("schedule_override_permissions", UNSET) - 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: 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 + ) ) - ) - 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) - 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: 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 + ) - schedules_permissions.append(schedules_permissions_item) + schedules_permissions.append(schedules_permissions_item) - services_permissions = [] _services_permissions = d.pop("services_permissions", UNSET) - 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: 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 + ) - services_permissions.append(services_permissions_item) + services_permissions.append(services_permissions_item) - functionalities_permissions = [] _functionalities_permissions = d.pop("functionalities_permissions", UNSET) - 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: 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 + ) ) - ) - functionalities_permissions.append(functionalities_permissions_item) + functionalities_permissions.append(functionalities_permissions_item) - webhooks_permissions = [] _webhooks_permissions = d.pop("webhooks_permissions", UNSET) - 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: 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 + ) - webhooks_permissions.append(webhooks_permissions_item) + webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions = [] _workflows_permissions = d.pop("workflows_permissions", UNSET) - 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: 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 + ) - workflows_permissions.append(workflows_permissions_item) + workflows_permissions.append(workflows_permissions_item) - catalogs_permissions = [] _catalogs_permissions = d.pop("catalogs_permissions", UNSET) - 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: 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 + ) - catalogs_permissions.append(catalogs_permissions_item) + catalogs_permissions.append(catalogs_permissions_item) update_on_call_role_data_attributes = cls( slug=slug, @@ -683,6 +770,7 @@ def _parse_slug(data: object) -> None | Unset | str: integrations_permissions=integrations_permissions, invitations_permissions=invitations_permissions, live_call_routing_permissions=live_call_routing_permissions, + members_permissions=members_permissions, schedule_override_permissions=schedule_override_permissions, schedules_permissions=schedules_permissions, services_permissions=services_permissions, diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_alert_fields_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_alert_fields_permissions_item.py index 37821860..6bec087f 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_alert_fields_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_alert_fields_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesAlertFieldsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_alert_fields_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_FIELDS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesAlertFieldsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_FIELDS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_alert_groups_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_alert_groups_permissions_item.py index f2357f91..6c6c75e9 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_alert_groups_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_alert_groups_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesAlertGroupsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_alert_groups_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_GROUPS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesAlertGroupsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_GROUPS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_alert_routing_rules_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_alert_routing_rules_permissions_item.py index c193879a..60632752 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_alert_routing_rules_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_alert_routing_rules_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_alert_routing_rules_permissions_it if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_ROUTING_RULES_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesAlertRoutingRulesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_ROUTING_RULES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_alert_sources_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_alert_sources_permissions_item.py index 2406acf0..7f948dff 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_alert_sources_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_alert_sources_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesAlertSourcesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_alert_sources_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_SOURCES_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesAlertSourcesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_SOURCES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_alert_urgency_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_alert_urgency_permissions_item.py index 9b406631..993680ae 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_alert_urgency_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_alert_urgency_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesAlertUrgencyPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_alert_urgency_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_URGENCY_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesAlertUrgencyPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERT_URGENCY_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_alerts_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_alerts_permissions_item.py index 7a65d1e8..b5e2280e 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_alerts_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_alerts_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesAlertsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_alerts_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERTS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesAlertsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_ALERTS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_api_keys_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_api_keys_permissions_item.py index e698017b..f6bd07c4 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_api_keys_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_api_keys_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesApiKeysPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_api_keys_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_API_KEYS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesApiKeysPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_API_KEYS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_audits_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_audits_permissions_item.py index 05e5b30b..3c13974a 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_audits_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_audits_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesAuditsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_audits_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_AUDITS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesAuditsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_AUDITS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_catalogs_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_catalogs_permissions_item.py index f6ee37ee..cb15655e 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_catalogs_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_catalogs_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesCatalogsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_catalogs_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_CATALOGS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesCatalogsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_CATALOGS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_contacts_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_contacts_permissions_item.py index 95bf83a3..3ec4d190 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_contacts_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_contacts_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesContactsPermissionsItem = Literal["read"] @@ -15,7 +15,7 @@ def check_update_on_call_role_data_attributes_contacts_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_CONTACTS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesContactsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_CONTACTS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_escalation_policies_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_escalation_policies_permissions_item.py index a5f55c32..379796a5 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_escalation_policies_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_escalation_policies_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesEscalationPoliciesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_escalation_policies_permissions_it if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_ESCALATION_POLICIES_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesEscalationPoliciesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_ESCALATION_POLICIES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_functionalities_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_functionalities_permissions_item.py index 45ebd261..e319b253 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_functionalities_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_functionalities_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesFunctionalitiesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_functionalities_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_FUNCTIONALITIES_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesFunctionalitiesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_FUNCTIONALITIES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_groups_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_groups_permissions_item.py index 415dad7f..e8f0809d 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_groups_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_groups_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesGroupsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_groups_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_GROUPS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesGroupsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_GROUPS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_heartbeats_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_heartbeats_permissions_item.py index 63af3a56..c4094f4e 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_heartbeats_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_heartbeats_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesHeartbeatsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_heartbeats_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_HEARTBEATS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesHeartbeatsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_HEARTBEATS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_integrations_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_integrations_permissions_item.py index a0bd39ed..50331a59 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_integrations_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_integrations_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesIntegrationsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_integrations_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_INTEGRATIONS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesIntegrationsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_INTEGRATIONS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_invitations_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_invitations_permissions_item.py index ab2d59a9..f88362bd 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_invitations_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_invitations_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesInvitationsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_invitations_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_INVITATIONS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesInvitationsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_INVITATIONS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_live_call_routing_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_live_call_routing_permissions_item.py index 72de6355..96cb0a7d 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_live_call_routing_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_live_call_routing_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesLiveCallRoutingPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_live_call_routing_permissions_item if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_LIVE_CALL_ROUTING_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesLiveCallRoutingPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_LIVE_CALL_ROUTING_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_members_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_members_permissions_item.py new file mode 100644 index 00000000..59de5425 --- /dev/null +++ b/rootly_sdk/models/update_on_call_role_data_attributes_members_permissions_item.py @@ -0,0 +1,23 @@ +from typing import Literal + +UpdateOnCallRoleDataAttributesMembersPermissionsItem = Literal["delete", "read", "update"] + +UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_MEMBERS_PERMISSIONS_ITEM_VALUES: set[ + UpdateOnCallRoleDataAttributesMembersPermissionsItem +] = { + "delete", + "read", + "update", +} + + +def check_update_on_call_role_data_attributes_members_permissions_item( + value: str | None, +) -> UpdateOnCallRoleDataAttributesMembersPermissionsItem | None: + if value is None: + return None + if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_MEMBERS_PERMISSIONS_ITEM_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_MEMBERS_PERMISSIONS_ITEM_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_on_call_readiness_report_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_on_call_readiness_report_permissions_item.py index c2025904..a9b58cb8 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_on_call_readiness_report_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_on_call_readiness_report_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem = Literal["read"] @@ -15,7 +15,7 @@ def check_update_on_call_role_data_attributes_on_call_readiness_report_permissio if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_ON_CALL_READINESS_REPORT_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesOnCallReadinessReportPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_ON_CALL_READINESS_REPORT_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_on_call_roles_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_on_call_roles_permissions_item.py index d1891acc..f64bad01 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_on_call_roles_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_on_call_roles_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesOnCallRolesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_on_call_roles_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_ON_CALL_ROLES_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesOnCallRolesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_ON_CALL_ROLES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_schedule_override_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_schedule_override_permissions_item.py index 50b216ff..34eab7af 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_schedule_override_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_schedule_override_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesScheduleOverridePermissionsItem = Literal["create", "update"] @@ -16,7 +16,7 @@ def check_update_on_call_role_data_attributes_schedule_override_permissions_item if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_SCHEDULE_OVERRIDE_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesScheduleOverridePermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_SCHEDULE_OVERRIDE_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_schedules_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_schedules_permissions_item.py index d9d0129f..399340f0 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_schedules_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_schedules_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesSchedulesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_schedules_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_SCHEDULES_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesSchedulesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_SCHEDULES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_services_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_services_permissions_item.py index 4fb526d5..e0e5ab1e 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_services_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_services_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesServicesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_services_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_SERVICES_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesServicesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_SERVICES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_webhooks_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_webhooks_permissions_item.py index cf9dcf72..b323c774 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_webhooks_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_webhooks_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesWebhooksPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_webhooks_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_WEBHOOKS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesWebhooksPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_WEBHOOKS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_attributes_workflows_permissions_item.py b/rootly_sdk/models/update_on_call_role_data_attributes_workflows_permissions_item.py index a49d2034..a5e0611f 100644 --- a/rootly_sdk/models/update_on_call_role_data_attributes_workflows_permissions_item.py +++ b/rootly_sdk/models/update_on_call_role_data_attributes_workflows_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataAttributesWorkflowsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_on_call_role_data_attributes_workflows_permissions_item( if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_WORKFLOWS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateOnCallRoleDataAttributesWorkflowsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_ATTRIBUTES_WORKFLOWS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_role_data_type.py b/rootly_sdk/models/update_on_call_role_data_type.py index b07c6ebc..c86c35b9 100644 --- a/rootly_sdk/models/update_on_call_role_data_type.py +++ b/rootly_sdk/models/update_on_call_role_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallRoleDataType = Literal["on_call_roles"] @@ -11,5 +11,5 @@ def check_update_on_call_role_data_type(value: str | None) -> UpdateOnCallRoleDa if value is None: return None if value in UPDATE_ON_CALL_ROLE_DATA_TYPE_VALUES: - return cast(UpdateOnCallRoleDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_ROLE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_on_call_shadow.py b/rootly_sdk/models/update_on_call_shadow.py index 08575554..38d2242e 100644 --- a/rootly_sdk/models/update_on_call_shadow.py +++ b/rootly_sdk/models/update_on_call_shadow.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_on_call_shadow_data import UpdateOnCallShadowData @@ -18,14 +19,13 @@ class UpdateOnCallShadow: data (UpdateOnCallShadowData): """ - data: "UpdateOnCallShadowData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateOnCallShadowData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_on_call_shadow.additional_properties = d return update_on_call_shadow - - @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_on_call_shadow_data.py b/rootly_sdk/models/update_on_call_shadow_data.py index a31c2b12..8cee8705 100644 --- a/rootly_sdk/models/update_on_call_shadow_data.py +++ b/rootly_sdk/models/update_on_call_shadow_data.py @@ -1,10 +1,12 @@ +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_on_call_shadow_data_type import UpdateOnCallShadowDataType, check_update_on_call_shadow_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_on_call_shadow_data_attributes import UpdateOnCallShadowDataAttributes @@ -19,25 +21,31 @@ class UpdateOnCallShadowData: Attributes: type_ (UpdateOnCallShadowDataType): attributes (UpdateOnCallShadowDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateOnCallShadowDataType - attributes: "UpdateOnCallShadowDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateOnCallShadowDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateOnCallShadowDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_on_call_shadow_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_on_call_shadow_data.additional_properties = d return update_on_call_shadow_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_on_call_shadow_data_attributes.py b/rootly_sdk/models/update_on_call_shadow_data_attributes.py index 5f937250..2a3ab37e 100644 --- a/rootly_sdk/models/update_on_call_shadow_data_attributes.py +++ b/rootly_sdk/models/update_on_call_shadow_data_attributes.py @@ -1,9 +1,10 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from dateutil.parser import isoparse from ..models.update_on_call_shadow_data_attributes_shadowable_type import ( UpdateOnCallShadowDataAttributesShadowableType, @@ -18,25 +19,25 @@ class UpdateOnCallShadowDataAttributes: """ Attributes: - 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): 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: 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 + 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 def to_dict(self) -> dict[str, Any]: schedule_id = self.schedule_id - shadowable_type: Unset | str = UNSET + shadowable_type: str | Unset = UNSET if not isinstance(self.shadowable_type, Unset): shadowable_type = self.shadowable_type @@ -44,11 +45,11 @@ def to_dict(self) -> dict[str, Any]: shadow_user_id = self.shadow_user_id - starts_at: Unset | str = UNSET + starts_at: str | Unset = UNSET if not isinstance(self.starts_at, Unset): starts_at = self.starts_at.isoformat() - ends_at: Unset | str = UNSET + ends_at: str | Unset = UNSET if not isinstance(self.ends_at, Unset): ends_at = self.ends_at.isoformat() @@ -76,7 +77,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: Unset | UpdateOnCallShadowDataAttributesShadowableType + shadowable_type: UpdateOnCallShadowDataAttributesShadowableType | Unset if isinstance(_shadowable_type, Unset): shadowable_type = UNSET else: @@ -87,18 +88,18 @@ 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: Unset | datetime.datetime + starts_at: datetime.datetime | Unset if isinstance(_starts_at, Unset): starts_at = UNSET else: - starts_at = isoparse(_starts_at) + starts_at = datetime.datetime.fromisoformat(_starts_at) _ends_at = d.pop("ends_at", UNSET) - ends_at: Unset | datetime.datetime + ends_at: datetime.datetime | Unset if isinstance(_ends_at, Unset): ends_at = UNSET else: - ends_at = isoparse(_ends_at) + ends_at = datetime.datetime.fromisoformat(_ends_at) update_on_call_shadow_data_attributes = cls( schedule_id=schedule_id, diff --git a/rootly_sdk/models/update_on_call_shadow_data_attributes_shadowable_type.py b/rootly_sdk/models/update_on_call_shadow_data_attributes_shadowable_type.py index ac64d2fd..e331c955 100644 --- a/rootly_sdk/models/update_on_call_shadow_data_attributes_shadowable_type.py +++ b/rootly_sdk/models/update_on_call_shadow_data_attributes_shadowable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallShadowDataAttributesShadowableType = Literal["Schedule", "User"] @@ -14,7 +14,7 @@ def check_update_on_call_shadow_data_attributes_shadowable_type( if value is None: return None if value in UPDATE_ON_CALL_SHADOW_DATA_ATTRIBUTES_SHADOWABLE_TYPE_VALUES: - return cast(UpdateOnCallShadowDataAttributesShadowableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_SHADOW_DATA_ATTRIBUTES_SHADOWABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_on_call_shadow_data_type.py b/rootly_sdk/models/update_on_call_shadow_data_type.py index 464960bb..7780d0b5 100644 --- a/rootly_sdk/models/update_on_call_shadow_data_type.py +++ b/rootly_sdk/models/update_on_call_shadow_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOnCallShadowDataType = Literal["on_call_shadows"] @@ -11,5 +11,5 @@ def check_update_on_call_shadow_data_type(value: str | None) -> UpdateOnCallShad if value is None: return None if value in UPDATE_ON_CALL_SHADOW_DATA_TYPE_VALUES: - return cast(UpdateOnCallShadowDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ON_CALL_SHADOW_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_opsgenie_alert_task_params.py b/rootly_sdk/models/update_opsgenie_alert_task_params.py index 983c4f88..3c7dd2b8 100644 --- a/rootly_sdk/models/update_opsgenie_alert_task_params.py +++ b/rootly_sdk/models/update_opsgenie_alert_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -28,18 +30,18 @@ class UpdateOpsgenieAlertTaskParams: alert_id (str): Opsgenie Alert ID priority (UpdateOpsgenieAlertTaskParamsPriority): completion (UpdateOpsgenieAlertTaskParamsCompletion): - 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 + 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 information about the alert """ alert_id: str priority: UpdateOpsgenieAlertTaskParamsPriority - completion: "UpdateOpsgenieAlertTaskParamsCompletion" - task_type: Unset | UpdateOpsgenieAlertTaskParamsTaskType = UNSET - message: Unset | str = UNSET - description: Unset | str = UNSET + completion: UpdateOpsgenieAlertTaskParamsCompletion + task_type: UpdateOpsgenieAlertTaskParamsTaskType | Unset = UNSET + message: str | Unset = UNSET + description: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -49,7 +51,7 @@ def to_dict(self) -> dict[str, Any]: completion = self.completion.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -87,7 +89,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: Unset | UpdateOpsgenieAlertTaskParamsTaskType + task_type: UpdateOpsgenieAlertTaskParamsTaskType | Unset 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 74ddc709..f1933281 100644 --- a/rootly_sdk/models/update_opsgenie_alert_task_params_completion.py +++ b/rootly_sdk/models/update_opsgenie_alert_task_params_completion.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class UpdateOpsgenieAlertTaskParamsCompletion: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_alert_task_params_priority.py b/rootly_sdk/models/update_opsgenie_alert_task_params_priority.py index 12a9e540..b1a86244 100644 --- a/rootly_sdk/models/update_opsgenie_alert_task_params_priority.py +++ b/rootly_sdk/models/update_opsgenie_alert_task_params_priority.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOpsgenieAlertTaskParamsPriority = Literal["auto", "P1", "P2", "P3", "P4", "P5"] @@ -16,7 +16,7 @@ def check_update_opsgenie_alert_task_params_priority(value: str | None) -> Updat if value is None: return None if value in UPDATE_OPSGENIE_ALERT_TASK_PARAMS_PRIORITY_VALUES: - return cast(UpdateOpsgenieAlertTaskParamsPriority, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_OPSGENIE_ALERT_TASK_PARAMS_PRIORITY_VALUES!r}" ) diff --git a/rootly_sdk/models/update_opsgenie_alert_task_params_task_type.py b/rootly_sdk/models/update_opsgenie_alert_task_params_task_type.py index a90d8590..766e50ef 100644 --- a/rootly_sdk/models/update_opsgenie_alert_task_params_task_type.py +++ b/rootly_sdk/models/update_opsgenie_alert_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOpsgenieAlertTaskParamsTaskType = Literal["update_opsgenie_alert"] @@ -13,7 +13,7 @@ def check_update_opsgenie_alert_task_params_task_type( if value is None: return None if value in UPDATE_OPSGENIE_ALERT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateOpsgenieAlertTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_OPSGENIE_ALERT_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_opsgenie_incident_task_params.py b/rootly_sdk/models/update_opsgenie_incident_task_params.py index a7d8ec23..46b0c6ef 100644 --- a/rootly_sdk/models/update_opsgenie_incident_task_params.py +++ b/rootly_sdk/models/update_opsgenie_incident_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -27,26 +29,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 (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 + 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 information about the alert - status (Union[Unset, UpdateOpsgenieIncidentTaskParamsStatus]): - priority (Union[Unset, UpdateOpsgenieIncidentTaskParamsPriority]): + status (UpdateOpsgenieIncidentTaskParamsStatus | Unset): + priority (UpdateOpsgenieIncidentTaskParamsPriority | Unset): """ opsgenie_incident_id: str - task_type: Unset | UpdateOpsgenieIncidentTaskParamsTaskType = UNSET - message: Unset | str = UNSET - description: Unset | str = UNSET - status: Unset | UpdateOpsgenieIncidentTaskParamsStatus = UNSET - priority: Unset | UpdateOpsgenieIncidentTaskParamsPriority = UNSET + task_type: UpdateOpsgenieIncidentTaskParamsTaskType | Unset = UNSET + message: str | Unset = UNSET + description: str | Unset = UNSET + status: UpdateOpsgenieIncidentTaskParamsStatus | Unset = UNSET + priority: UpdateOpsgenieIncidentTaskParamsPriority | Unset = 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -54,11 +56,11 @@ def to_dict(self) -> dict[str, Any]: description = self.description - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status - priority: Unset | str = UNSET + priority: str | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority @@ -88,7 +90,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: Unset | UpdateOpsgenieIncidentTaskParamsTaskType + task_type: UpdateOpsgenieIncidentTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -99,14 +101,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _status = d.pop("status", UNSET) - status: Unset | UpdateOpsgenieIncidentTaskParamsStatus + status: UpdateOpsgenieIncidentTaskParamsStatus | Unset if isinstance(_status, Unset): status = UNSET else: status = check_update_opsgenie_incident_task_params_status(_status) _priority = d.pop("priority", UNSET) - priority: Unset | UpdateOpsgenieIncidentTaskParamsPriority + priority: UpdateOpsgenieIncidentTaskParamsPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: diff --git a/rootly_sdk/models/update_opsgenie_incident_task_params_priority.py b/rootly_sdk/models/update_opsgenie_incident_task_params_priority.py index 9650c439..026c636e 100644 --- a/rootly_sdk/models/update_opsgenie_incident_task_params_priority.py +++ b/rootly_sdk/models/update_opsgenie_incident_task_params_priority.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOpsgenieIncidentTaskParamsPriority = Literal["", "auto", "P1", "P2", "P3", "P4", "P5"] @@ -19,7 +19,7 @@ def check_update_opsgenie_incident_task_params_priority( if value is None: return None if value in UPDATE_OPSGENIE_INCIDENT_TASK_PARAMS_PRIORITY_VALUES: - return cast(UpdateOpsgenieIncidentTaskParamsPriority, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_OPSGENIE_INCIDENT_TASK_PARAMS_PRIORITY_VALUES!r}" ) diff --git a/rootly_sdk/models/update_opsgenie_incident_task_params_status.py b/rootly_sdk/models/update_opsgenie_incident_task_params_status.py index 4711dff5..341c1214 100644 --- a/rootly_sdk/models/update_opsgenie_incident_task_params_status.py +++ b/rootly_sdk/models/update_opsgenie_incident_task_params_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOpsgenieIncidentTaskParamsStatus = Literal["auto", "close", "open", "resolve"] @@ -16,7 +16,7 @@ def check_update_opsgenie_incident_task_params_status( if value is None: return None if value in UPDATE_OPSGENIE_INCIDENT_TASK_PARAMS_STATUS_VALUES: - return cast(UpdateOpsgenieIncidentTaskParamsStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_OPSGENIE_INCIDENT_TASK_PARAMS_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/update_opsgenie_incident_task_params_task_type.py b/rootly_sdk/models/update_opsgenie_incident_task_params_task_type.py index 39846970..66a17799 100644 --- a/rootly_sdk/models/update_opsgenie_incident_task_params_task_type.py +++ b/rootly_sdk/models/update_opsgenie_incident_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOpsgenieIncidentTaskParamsTaskType = Literal["update_opsgenie_incident"] @@ -13,7 +13,7 @@ def check_update_opsgenie_incident_task_params_task_type( if value is None: return None if value in UPDATE_OPSGENIE_INCIDENT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateOpsgenieIncidentTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_OPSGENIE_INCIDENT_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_override_shift.py b/rootly_sdk/models/update_override_shift.py index 5ea83e20..e57beab6 100644 --- a/rootly_sdk/models/update_override_shift.py +++ b/rootly_sdk/models/update_override_shift.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_override_shift_data import UpdateOverrideShiftData @@ -18,14 +19,13 @@ class UpdateOverrideShift: data (UpdateOverrideShiftData): """ - data: "UpdateOverrideShiftData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateOverrideShiftData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_override_shift.additional_properties = d return update_override_shift - - @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_override_shift_data.py b/rootly_sdk/models/update_override_shift_data.py index e3af4213..5f43a52c 100644 --- a/rootly_sdk/models/update_override_shift_data.py +++ b/rootly_sdk/models/update_override_shift_data.py @@ -1,10 +1,12 @@ +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_override_shift_data_type import UpdateOverrideShiftDataType, check_update_override_shift_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_override_shift_data_attributes import UpdateOverrideShiftDataAttributes @@ -19,25 +21,31 @@ class UpdateOverrideShiftData: Attributes: type_ (UpdateOverrideShiftDataType): attributes (UpdateOverrideShiftDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateOverrideShiftDataType - attributes: "UpdateOverrideShiftDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateOverrideShiftDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateOverrideShiftDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_override_shift_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_override_shift_data.additional_properties = d return update_override_shift_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_override_shift_data_attributes.py b/rootly_sdk/models/update_override_shift_data_attributes.py index 2e7cc8df..2a34c48e 100644 --- a/rootly_sdk/models/update_override_shift_data_attributes.py +++ b/rootly_sdk/models/update_override_shift_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_override_shift_data_type.py b/rootly_sdk/models/update_override_shift_data_type.py index aab00099..d0d0e975 100644 --- a/rootly_sdk/models/update_override_shift_data_type.py +++ b/rootly_sdk/models/update_override_shift_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateOverrideShiftDataType = Literal["shifts"] @@ -11,5 +11,5 @@ def check_update_override_shift_data_type(value: str | None) -> UpdateOverrideSh if value is None: return None if value in UPDATE_OVERRIDE_SHIFT_DATA_TYPE_VALUES: - return cast(UpdateOverrideShiftDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_OVERRIDE_SHIFT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_pagerduty_incident_task_params.py b/rootly_sdk/models/update_pagerduty_incident_task_params.py index fc8753f0..3020e135 100644 --- a/rootly_sdk/models/update_pagerduty_incident_task_params.py +++ b/rootly_sdk/models/update_pagerduty_incident_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -26,37 +28,37 @@ class UpdatePagerdutyIncidentTaskParams: """ Attributes: pagerduty_incident_id (str): Pagerduty incident id - 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 + 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 severity """ pagerduty_incident_id: str - 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 + 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 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type title = self.title - status: Unset | str = UNSET + status: str | Unset = UNSET if not isinstance(self.status, Unset): status = self.status @@ -64,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: escalation_level = self.escalation_level - urgency: Unset | str = UNSET + urgency: str | Unset = UNSET if not isinstance(self.urgency, Unset): urgency = self.urgency @@ -100,7 +102,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: Unset | UpdatePagerdutyIncidentTaskParamsTaskType + task_type: UpdatePagerdutyIncidentTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -109,7 +111,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: title = d.pop("title", UNSET) _status = d.pop("status", UNSET) - status: Unset | UpdatePagerdutyIncidentTaskParamsStatus + status: UpdatePagerdutyIncidentTaskParamsStatus | Unset if isinstance(_status, Unset): status = UNSET else: @@ -120,7 +122,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: Unset | UpdatePagerdutyIncidentTaskParamsUrgency + urgency: UpdatePagerdutyIncidentTaskParamsUrgency | Unset if isinstance(_urgency, Unset): urgency = UNSET else: diff --git a/rootly_sdk/models/update_pagerduty_incident_task_params_status.py b/rootly_sdk/models/update_pagerduty_incident_task_params_status.py index bed2353e..102f3830 100644 --- a/rootly_sdk/models/update_pagerduty_incident_task_params_status.py +++ b/rootly_sdk/models/update_pagerduty_incident_task_params_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdatePagerdutyIncidentTaskParamsStatus = Literal["acknowledged", "auto", "resolved"] @@ -15,7 +15,7 @@ def check_update_pagerduty_incident_task_params_status( if value is None: return None if value in UPDATE_PAGERDUTY_INCIDENT_TASK_PARAMS_STATUS_VALUES: - return cast(UpdatePagerdutyIncidentTaskParamsStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_PAGERDUTY_INCIDENT_TASK_PARAMS_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/update_pagerduty_incident_task_params_task_type.py b/rootly_sdk/models/update_pagerduty_incident_task_params_task_type.py index 566b3a4d..c0514c79 100644 --- a/rootly_sdk/models/update_pagerduty_incident_task_params_task_type.py +++ b/rootly_sdk/models/update_pagerduty_incident_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdatePagerdutyIncidentTaskParamsTaskType = Literal["update_pagerduty_incident"] @@ -13,7 +13,7 @@ def check_update_pagerduty_incident_task_params_task_type( if value is None: return None if value in UPDATE_PAGERDUTY_INCIDENT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdatePagerdutyIncidentTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_PAGERDUTY_INCIDENT_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_pagerduty_incident_task_params_urgency.py b/rootly_sdk/models/update_pagerduty_incident_task_params_urgency.py index 454dfb53..7373712c 100644 --- a/rootly_sdk/models/update_pagerduty_incident_task_params_urgency.py +++ b/rootly_sdk/models/update_pagerduty_incident_task_params_urgency.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdatePagerdutyIncidentTaskParamsUrgency = Literal["auto", "high", "low"] @@ -15,7 +15,7 @@ def check_update_pagerduty_incident_task_params_urgency( if value is None: return None if value in UPDATE_PAGERDUTY_INCIDENT_TASK_PARAMS_URGENCY_VALUES: - return cast(UpdatePagerdutyIncidentTaskParamsUrgency, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_PAGERDUTY_INCIDENT_TASK_PARAMS_URGENCY_VALUES!r}" ) diff --git a/rootly_sdk/models/update_pagertree_alert_task_params.py b/rootly_sdk/models/update_pagertree_alert_task_params.py index b59eca40..75b8f2ae 100644 --- a/rootly_sdk/models/update_pagertree_alert_task_params.py +++ b/rootly_sdk/models/update_pagertree_alert_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -30,30 +32,30 @@ class UpdatePagertreeAlertTaskParams: """ Attributes: - 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): + 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: 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -63,22 +65,22 @@ def to_dict(self) -> dict[str, Any]: description = self.description - urgency: Unset | str = UNSET + urgency: str | Unset = UNSET if not isinstance(self.urgency, Unset): urgency = self.urgency - severity: Unset | str = UNSET + severity: str | Unset = UNSET if not isinstance(self.severity, Unset): severity = self.severity - teams: Unset | list[dict[str, Any]] = UNSET + teams: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + users: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.users, Unset): users = [] for users_item_data in self.users: @@ -118,7 +120,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: Unset | UpdatePagertreeAlertTaskParamsTaskType + task_type: UpdatePagertreeAlertTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -131,32 +133,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _urgency = d.pop("urgency", UNSET) - urgency: Unset | UpdatePagertreeAlertTaskParamsUrgency + urgency: UpdatePagertreeAlertTaskParamsUrgency | Unset if isinstance(_urgency, Unset): urgency = UNSET else: urgency = check_update_pagertree_alert_task_params_urgency(_urgency) _severity = d.pop("severity", UNSET) - severity: Unset | UpdatePagertreeAlertTaskParamsSeverity + severity: UpdatePagertreeAlertTaskParamsSeverity | Unset if isinstance(_severity, Unset): severity = UNSET else: severity = check_update_pagertree_alert_task_params_severity(_severity) - teams = [] _teams = d.pop("teams", UNSET) - for teams_item_data in _teams or []: - teams_item = UpdatePagertreeAlertTaskParamsTeamsItem.from_dict(teams_item_data) + 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) - teams.append(teams_item) + teams.append(teams_item) - users = [] _users = d.pop("users", UNSET) - for users_item_data in _users or []: - users_item = UpdatePagertreeAlertTaskParamsUsersItem.from_dict(users_item_data) + 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) - users.append(users_item) + users.append(users_item) incident = d.pop("incident", UNSET) diff --git a/rootly_sdk/models/update_pagertree_alert_task_params_severity.py b/rootly_sdk/models/update_pagertree_alert_task_params_severity.py index 7d965b60..d65f862b 100644 --- a/rootly_sdk/models/update_pagertree_alert_task_params_severity.py +++ b/rootly_sdk/models/update_pagertree_alert_task_params_severity.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdatePagertreeAlertTaskParamsSeverity = Literal["auto", "SEV-1", "SEV-2", "SEV-3", "SEV-4"] @@ -17,7 +17,7 @@ def check_update_pagertree_alert_task_params_severity( if value is None: return None if value in UPDATE_PAGERTREE_ALERT_TASK_PARAMS_SEVERITY_VALUES: - return cast(UpdatePagertreeAlertTaskParamsSeverity, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_PAGERTREE_ALERT_TASK_PARAMS_SEVERITY_VALUES!r}" ) diff --git a/rootly_sdk/models/update_pagertree_alert_task_params_task_type.py b/rootly_sdk/models/update_pagertree_alert_task_params_task_type.py index 3130d99b..0cb773eb 100644 --- a/rootly_sdk/models/update_pagertree_alert_task_params_task_type.py +++ b/rootly_sdk/models/update_pagertree_alert_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdatePagertreeAlertTaskParamsTaskType = Literal["update_pagertree_alert"] @@ -13,7 +13,7 @@ def check_update_pagertree_alert_task_params_task_type( if value is None: return None if value in UPDATE_PAGERTREE_ALERT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdatePagertreeAlertTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_PAGERTREE_ALERT_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) 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 1c7a5f64..6bd86d6a 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class UpdatePagertreeAlertTaskParamsTeamsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_urgency.py b/rootly_sdk/models/update_pagertree_alert_task_params_urgency.py index 5bfa3376..a083cd8f 100644 --- a/rootly_sdk/models/update_pagertree_alert_task_params_urgency.py +++ b/rootly_sdk/models/update_pagertree_alert_task_params_urgency.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdatePagertreeAlertTaskParamsUrgency = Literal["auto", "critical", "high", "low", "medium"] @@ -15,7 +15,7 @@ def check_update_pagertree_alert_task_params_urgency(value: str | None) -> Updat if value is None: return None if value in UPDATE_PAGERTREE_ALERT_TASK_PARAMS_URGENCY_VALUES: - return cast(UpdatePagertreeAlertTaskParamsUrgency, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_PAGERTREE_ALERT_TASK_PARAMS_URGENCY_VALUES!r}" ) 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 fbf4cec1..8f9a0105 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class UpdatePagertreeAlertTaskParamsUsersItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 3155be8a..022687c8 100644 --- a/rootly_sdk/models/update_playbook.py +++ b/rootly_sdk/models/update_playbook.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_playbook_data import UpdatePlaybookData @@ -18,14 +19,13 @@ class UpdatePlaybook: data (UpdatePlaybookData): """ - data: "UpdatePlaybookData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdatePlaybookData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_playbook.additional_properties = d return update_playbook - - @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_playbook_data.py b/rootly_sdk/models/update_playbook_data.py index 55556936..1f6af7aa 100644 --- a/rootly_sdk/models/update_playbook_data.py +++ b/rootly_sdk/models/update_playbook_data.py @@ -1,10 +1,12 @@ +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_playbook_data_type import UpdatePlaybookDataType, check_update_playbook_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_playbook_data_attributes import UpdatePlaybookDataAttributes @@ -19,25 +21,31 @@ class UpdatePlaybookData: Attributes: type_ (UpdatePlaybookDataType): attributes (UpdatePlaybookDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdatePlaybookDataType - attributes: "UpdatePlaybookDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdatePlaybookDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdatePlaybookDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_playbook_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_playbook_data.additional_properties = d return update_playbook_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_playbook_data_attributes.py b/rootly_sdk/models/update_playbook_data_attributes.py index 78d0a41a..1644f220 100644 --- a/rootly_sdk/models/update_playbook_data_attributes.py +++ b/rootly_sdk/models/update_playbook_data_attributes.py @@ -1,8 +1,14 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast from attrs import define as _attrs_define +from ..models.update_playbook_data_attributes_kind import ( + UpdatePlaybookDataAttributesKind, + check_update_playbook_data_attributes_kind, +) from ..types import UNSET, Unset T = TypeVar("T", bound="UpdatePlaybookDataAttributes") @@ -12,43 +18,61 @@ class UpdatePlaybookDataAttributes: """ Attributes: - 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): The title of the playbook + summary (None | str | Unset): The summary of the playbook + kind (UpdatePlaybookDataAttributesKind | Unset): Whether the playbook body lives in Rootly (`internal_document`) + or at an external link (`external_url`). + content (None | str | Unset): Sanitized HTML instructions. Still returned when `kind` is `external_url`, where + the body may be stale — branch on `kind`, not on `content` being present. + 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 + cause_ids (list[str] | None | Unset): The Cause IDs to attach to the incident """ - 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 + title: str | Unset = UNSET + summary: None | str | Unset = UNSET + kind: UpdatePlaybookDataAttributesKind | Unset = UNSET + content: 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 + cause_ids: list[str] | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: title = self.title - summary: None | Unset | str + summary: None | str | Unset if isinstance(self.summary, Unset): summary = UNSET else: summary = self.summary - external_url: None | Unset | str + kind: str | Unset = UNSET + if not isinstance(self.kind, Unset): + kind = self.kind + + content: None | str | Unset + if isinstance(self.content, Unset): + content = UNSET + else: + content = self.content + + external_url: None | str | Unset if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - severity_ids: None | Unset | list[str] + severity_ids: list[str] | None | Unset if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -57,7 +81,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - environment_ids: None | Unset | list[str] + environment_ids: list[str] | None | Unset if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -66,7 +90,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -75,7 +99,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - functionality_ids: None | Unset | list[str] + functionality_ids: list[str] | None | Unset if isinstance(self.functionality_ids, Unset): functionality_ids = UNSET elif isinstance(self.functionality_ids, list): @@ -84,7 +108,7 @@ def to_dict(self) -> dict[str, Any]: else: functionality_ids = self.functionality_ids - group_ids: None | Unset | list[str] + group_ids: list[str] | None | Unset if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -93,7 +117,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: None | Unset | list[str] + incident_type_ids: list[str] | None | Unset if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -102,6 +126,15 @@ def to_dict(self) -> dict[str, Any]: else: incident_type_ids = self.incident_type_ids + cause_ids: list[str] | None | Unset + if isinstance(self.cause_ids, Unset): + cause_ids = UNSET + elif isinstance(self.cause_ids, list): + cause_ids = self.cause_ids + + else: + cause_ids = self.cause_ids + field_dict: dict[str, Any] = {} field_dict.update({}) @@ -109,6 +142,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["title"] = title if summary is not UNSET: field_dict["summary"] = summary + if kind is not UNSET: + field_dict["kind"] = kind + if content is not UNSET: + field_dict["content"] = content if external_url is not UNSET: field_dict["external_url"] = external_url if severity_ids is not UNSET: @@ -123,6 +160,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["group_ids"] = group_ids if incident_type_ids is not UNSET: field_dict["incident_type_ids"] = incident_type_ids + if cause_ids is not UNSET: + field_dict["cause_ids"] = cause_ids return field_dict @@ -131,25 +170,41 @@ 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 | Unset | str: + def _parse_summary(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) summary = _parse_summary(d.pop("summary", UNSET)) - def _parse_external_url(data: object) -> None | Unset | str: + _kind = d.pop("kind", UNSET) + kind: UpdatePlaybookDataAttributesKind | Unset + if isinstance(_kind, Unset): + kind = UNSET + else: + kind = check_update_playbook_data_attributes_kind(_kind) + + def _parse_content(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + content = _parse_content(d.pop("content", UNSET)) + + def _parse_external_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - def _parse_severity_ids(data: object) -> None | Unset | list[str]: + def _parse_severity_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -160,13 +215,13 @@ def _parse_severity_ids(data: object) -> None | Unset | list[str]: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_environment_ids(data: object) -> None | Unset | list[str]: + def _parse_environment_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -177,13 +232,13 @@ def _parse_environment_ids(data: object) -> None | Unset | list[str]: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -194,13 +249,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_functionality_ids(data: object) -> None | Unset | list[str]: + def _parse_functionality_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -211,13 +266,13 @@ def _parse_functionality_ids(data: object) -> None | Unset | list[str]: functionality_ids_type_0 = cast(list[str], data) return functionality_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) functionality_ids = _parse_functionality_ids(d.pop("functionality_ids", UNSET)) - def _parse_group_ids(data: object) -> None | Unset | list[str]: + def _parse_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -228,13 +283,13 @@ def _parse_group_ids(data: object) -> None | Unset | list[str]: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: + def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -245,15 +300,34 @@ def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) + def _parse_cause_ids(data: object) -> list[str] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + cause_ids_type_0 = cast(list[str], data) + + return cause_ids_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[str] | None | Unset, data) + + cause_ids = _parse_cause_ids(d.pop("cause_ids", UNSET)) + update_playbook_data_attributes = cls( title=title, summary=summary, + kind=kind, + content=content, external_url=external_url, severity_ids=severity_ids, environment_ids=environment_ids, @@ -261,6 +335,7 @@ def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: functionality_ids=functionality_ids, group_ids=group_ids, incident_type_ids=incident_type_ids, + cause_ids=cause_ids, ) return update_playbook_data_attributes diff --git a/rootly_sdk/models/update_playbook_data_attributes_kind.py b/rootly_sdk/models/update_playbook_data_attributes_kind.py new file mode 100644 index 00000000..2e97ad68 --- /dev/null +++ b/rootly_sdk/models/update_playbook_data_attributes_kind.py @@ -0,0 +1,16 @@ +from typing import Literal + +UpdatePlaybookDataAttributesKind = Literal["external_url", "internal_document"] + +UPDATE_PLAYBOOK_DATA_ATTRIBUTES_KIND_VALUES: set[UpdatePlaybookDataAttributesKind] = { + "external_url", + "internal_document", +} + + +def check_update_playbook_data_attributes_kind(value: str | None) -> UpdatePlaybookDataAttributesKind | None: + if value is None: + return None + if value in UPDATE_PLAYBOOK_DATA_ATTRIBUTES_KIND_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_PLAYBOOK_DATA_ATTRIBUTES_KIND_VALUES!r}") diff --git a/rootly_sdk/models/update_playbook_data_type.py b/rootly_sdk/models/update_playbook_data_type.py index 19bf30ab..cf17d4b1 100644 --- a/rootly_sdk/models/update_playbook_data_type.py +++ b/rootly_sdk/models/update_playbook_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdatePlaybookDataType = Literal["playbooks"] @@ -11,5 +11,5 @@ def check_update_playbook_data_type(value: str | None) -> UpdatePlaybookDataType if value is None: return None if value in UPDATE_PLAYBOOK_DATA_TYPE_VALUES: - return cast(UpdatePlaybookDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_PLAYBOOK_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_playbook_task.py b/rootly_sdk/models/update_playbook_task.py index 56544842..027524db 100644 --- a/rootly_sdk/models/update_playbook_task.py +++ b/rootly_sdk/models/update_playbook_task.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_playbook_task_data import UpdatePlaybookTaskData @@ -18,14 +19,13 @@ class UpdatePlaybookTask: data (UpdatePlaybookTaskData): """ - data: "UpdatePlaybookTaskData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdatePlaybookTaskData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_playbook_task.additional_properties = d return update_playbook_task - - @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_playbook_task_data.py b/rootly_sdk/models/update_playbook_task_data.py index 0eb8ab5f..cba67ede 100644 --- a/rootly_sdk/models/update_playbook_task_data.py +++ b/rootly_sdk/models/update_playbook_task_data.py @@ -1,10 +1,12 @@ +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_playbook_task_data_type import UpdatePlaybookTaskDataType, check_update_playbook_task_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_playbook_task_data_attributes import UpdatePlaybookTaskDataAttributes @@ -19,25 +21,31 @@ class UpdatePlaybookTaskData: Attributes: type_ (UpdatePlaybookTaskDataType): attributes (UpdatePlaybookTaskDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdatePlaybookTaskDataType - attributes: "UpdatePlaybookTaskDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdatePlaybookTaskDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdatePlaybookTaskDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_playbook_task_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_playbook_task_data.additional_properties = d return update_playbook_task_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_playbook_task_data_attributes.py b/rootly_sdk/models/update_playbook_task_data_attributes.py index 858224cb..a8ef0615 100644 --- a/rootly_sdk/models/update_playbook_task_data_attributes.py +++ b/rootly_sdk/models/update_playbook_task_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,25 +14,25 @@ class UpdatePlaybookTaskDataAttributes: """ Attributes: - 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): The task of the task + description (None | str | Unset): The description of the task + position (int | None | Unset): The position of the task """ - task: Unset | str = UNSET - description: None | Unset | str = UNSET - position: None | Unset | int = UNSET + task: str | Unset = UNSET + description: None | str | Unset = UNSET + position: int | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: task = self.task - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -53,21 +55,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_playbook_task_data_type.py b/rootly_sdk/models/update_playbook_task_data_type.py index bc3b4cff..4d94184b 100644 --- a/rootly_sdk/models/update_playbook_task_data_type.py +++ b/rootly_sdk/models/update_playbook_task_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdatePlaybookTaskDataType = Literal["playbook_tasks"] @@ -11,5 +11,5 @@ def check_update_playbook_task_data_type(value: str | None) -> UpdatePlaybookTas if value is None: return None if value in UPDATE_PLAYBOOK_TASK_DATA_TYPE_VALUES: - return cast(UpdatePlaybookTaskDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_PLAYBOOK_TASK_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_post_mortem_template.py b/rootly_sdk/models/update_post_mortem_template.py index 2ef52623..5b617115 100644 --- a/rootly_sdk/models/update_post_mortem_template.py +++ b/rootly_sdk/models/update_post_mortem_template.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_post_mortem_template_data import UpdatePostMortemTemplateData @@ -18,14 +19,13 @@ class UpdatePostMortemTemplate: data (UpdatePostMortemTemplateData): """ - data: "UpdatePostMortemTemplateData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdatePostMortemTemplateData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_post_mortem_template.additional_properties = d return update_post_mortem_template - - @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_post_mortem_template_data.py b/rootly_sdk/models/update_post_mortem_template_data.py index b7139ea7..c1595e4e 100644 --- a/rootly_sdk/models/update_post_mortem_template_data.py +++ b/rootly_sdk/models/update_post_mortem_template_data.py @@ -1,13 +1,15 @@ +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_post_mortem_template_data_type import ( UpdatePostMortemTemplateDataType, check_update_post_mortem_template_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_post_mortem_template_data_attributes import UpdatePostMortemTemplateDataAttributes @@ -22,25 +24,31 @@ class UpdatePostMortemTemplateData: Attributes: type_ (UpdatePostMortemTemplateDataType): attributes (UpdatePostMortemTemplateDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdatePostMortemTemplateDataType - attributes: "UpdatePostMortemTemplateDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdatePostMortemTemplateDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdatePostMortemTemplateDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_post_mortem_template_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_post_mortem_template_data.additional_properties = d return update_post_mortem_template_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_post_mortem_template_data_attributes.py b/rootly_sdk/models/update_post_mortem_template_data_attributes.py index 8ecd5181..c2a067a2 100644 --- a/rootly_sdk/models/update_post_mortem_template_data_attributes.py +++ b/rootly_sdk/models/update_post_mortem_template_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,23 +18,23 @@ class UpdatePostMortemTemplateDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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), + 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), Liquid syntax, and HTML. Will be sanitized and applied to both content and content_html fields. - format_ (Union[Unset, UpdatePostMortemTemplateDataAttributesFormat]): The format of the input Default: 'html'. + format_ (UpdatePostMortemTemplateDataAttributesFormat | Unset): The format of the input Default: 'html'. """ - slug: None | Unset | str = UNSET - name: Unset | str = UNSET - default: None | Unset | bool = UNSET - content: Unset | str = UNSET - format_: Unset | UpdatePostMortemTemplateDataAttributesFormat = "html" + slug: None | str | Unset = UNSET + name: str | Unset = UNSET + default: bool | None | Unset = UNSET + content: str | Unset = UNSET + format_: UpdatePostMortemTemplateDataAttributesFormat | Unset = "html" def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -40,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - default: None | Unset | bool + default: bool | None | Unset if isinstance(self.default, Unset): default = UNSET else: @@ -48,7 +50,7 @@ def to_dict(self) -> dict[str, Any]: content = self.content - format_: Unset | str = UNSET + format_: str | Unset = UNSET if not isinstance(self.format_, Unset): format_ = self.format_ @@ -72,30 +74,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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_default(data: object) -> None | Unset | bool: + def _parse_default(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) default = _parse_default(d.pop("default", UNSET)) content = d.pop("content", UNSET) _format_ = d.pop("format", UNSET) - format_: Unset | UpdatePostMortemTemplateDataAttributesFormat + format_: UpdatePostMortemTemplateDataAttributesFormat | Unset if isinstance(_format_, Unset): format_ = UNSET else: diff --git a/rootly_sdk/models/update_post_mortem_template_data_attributes_format.py b/rootly_sdk/models/update_post_mortem_template_data_attributes_format.py index d5cfa2ab..6f53a8be 100644 --- a/rootly_sdk/models/update_post_mortem_template_data_attributes_format.py +++ b/rootly_sdk/models/update_post_mortem_template_data_attributes_format.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdatePostMortemTemplateDataAttributesFormat = Literal["html", "markdown"] @@ -14,7 +14,7 @@ def check_update_post_mortem_template_data_attributes_format( if value is None: return None if value in UPDATE_POST_MORTEM_TEMPLATE_DATA_ATTRIBUTES_FORMAT_VALUES: - return cast(UpdatePostMortemTemplateDataAttributesFormat, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_POST_MORTEM_TEMPLATE_DATA_ATTRIBUTES_FORMAT_VALUES!r}" ) diff --git a/rootly_sdk/models/update_post_mortem_template_data_type.py b/rootly_sdk/models/update_post_mortem_template_data_type.py index 583e1924..84ecda8f 100644 --- a/rootly_sdk/models/update_post_mortem_template_data_type.py +++ b/rootly_sdk/models/update_post_mortem_template_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdatePostMortemTemplateDataType = Literal["post_mortem_templates"] @@ -11,5 +11,5 @@ def check_update_post_mortem_template_data_type(value: str | None) -> UpdatePost if value is None: return None if value in UPDATE_POST_MORTEM_TEMPLATE_DATA_TYPE_VALUES: - return cast(UpdatePostMortemTemplateDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_POST_MORTEM_TEMPLATE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_problem.py b/rootly_sdk/models/update_problem.py new file mode 100644 index 00000000..8b7edf4c --- /dev/null +++ b/rootly_sdk/models/update_problem.py @@ -0,0 +1,48 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.update_problem_data import UpdateProblemData + + +T = TypeVar("T", bound="UpdateProblem") + + +@_attrs_define +class UpdateProblem: + """ + Attributes: + data (UpdateProblemData): + """ + + data: UpdateProblemData + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_problem_data import UpdateProblemData + + d = dict(src_dict) + data = UpdateProblemData.from_dict(d.pop("data")) + + update_problem = cls( + data=data, + ) + + return update_problem diff --git a/rootly_sdk/models/update_problem_action_item.py b/rootly_sdk/models/update_problem_action_item.py new file mode 100644 index 00000000..9ccb2d54 --- /dev/null +++ b/rootly_sdk/models/update_problem_action_item.py @@ -0,0 +1,48 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.update_problem_action_item_data import UpdateProblemActionItemData + + +T = TypeVar("T", bound="UpdateProblemActionItem") + + +@_attrs_define +class UpdateProblemActionItem: + """ + Attributes: + data (UpdateProblemActionItemData): + """ + + data: UpdateProblemActionItemData + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "data": data, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_problem_action_item_data import UpdateProblemActionItemData + + d = dict(src_dict) + data = UpdateProblemActionItemData.from_dict(d.pop("data")) + + update_problem_action_item = cls( + data=data, + ) + + return update_problem_action_item diff --git a/rootly_sdk/models/update_problem_action_item_data.py b/rootly_sdk/models/update_problem_action_item_data.py new file mode 100644 index 00000000..4e8dcb4b --- /dev/null +++ b/rootly_sdk/models/update_problem_action_item_data.py @@ -0,0 +1,72 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.update_problem_action_item_data_type import ( + UpdateProblemActionItemDataType, + check_update_problem_action_item_data_type, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.update_problem_action_item_data_attributes import UpdateProblemActionItemDataAttributes + + +T = TypeVar("T", bound="UpdateProblemActionItemData") + + +@_attrs_define +class UpdateProblemActionItemData: + """ + Attributes: + type_ (UpdateProblemActionItemDataType): + attributes (UpdateProblemActionItemDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. + """ + + type_: UpdateProblemActionItemDataType + attributes: UpdateProblemActionItemDataAttributes + id: str | Unset = 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( + { + "type": type_, + "attributes": attributes, + } + ) + if id is not UNSET: + field_dict["id"] = id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_problem_action_item_data_attributes import UpdateProblemActionItemDataAttributes + + d = dict(src_dict) + type_ = check_update_problem_action_item_data_type(d.pop("type")) + + attributes = UpdateProblemActionItemDataAttributes.from_dict(d.pop("attributes")) + + id = d.pop("id", UNSET) + + update_problem_action_item_data = cls( + type_=type_, + attributes=attributes, + id=id, + ) + + return update_problem_action_item_data diff --git a/rootly_sdk/models/update_problem_action_item_data_attributes.py b/rootly_sdk/models/update_problem_action_item_data_attributes.py new file mode 100644 index 00000000..9c7b1665 --- /dev/null +++ b/rootly_sdk/models/update_problem_action_item_data_attributes.py @@ -0,0 +1,162 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..models.update_problem_action_item_data_attributes_priority import ( + UpdateProblemActionItemDataAttributesPriority, + check_update_problem_action_item_data_attributes_priority, +) +from ..models.update_problem_action_item_data_attributes_status import ( + UpdateProblemActionItemDataAttributesStatus, + check_update_problem_action_item_data_attributes_status, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateProblemActionItemDataAttributes") + + +@_attrs_define +class UpdateProblemActionItemDataAttributes: + """ + Attributes: + summary (str | Unset): The summary of the action item + description (None | str | Unset): The description of the action item + assigned_to_user_id (int | None | Unset): ID of user you wish to assign this action item + priority (UpdateProblemActionItemDataAttributesPriority | Unset): The priority of the action item + status (UpdateProblemActionItemDataAttributesStatus | Unset): The status of the action item + due_date (None | str | Unset): The due date of the action item + jira_issue_url (None | str | Unset): The Jira issue URL. + """ + + summary: str | Unset = UNSET + description: None | str | Unset = UNSET + assigned_to_user_id: int | None | Unset = UNSET + priority: UpdateProblemActionItemDataAttributesPriority | Unset = UNSET + status: UpdateProblemActionItemDataAttributesStatus | Unset = UNSET + due_date: None | str | Unset = UNSET + jira_issue_url: None | str | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + summary = self.summary + + description: None | str | Unset + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + assigned_to_user_id: int | None | Unset + if isinstance(self.assigned_to_user_id, Unset): + assigned_to_user_id = UNSET + else: + assigned_to_user_id = self.assigned_to_user_id + + priority: str | Unset = UNSET + if not isinstance(self.priority, Unset): + priority = self.priority + + status: str | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status + + due_date: None | str | Unset + if isinstance(self.due_date, Unset): + due_date = UNSET + else: + due_date = self.due_date + + jira_issue_url: None | str | Unset + if isinstance(self.jira_issue_url, Unset): + jira_issue_url = UNSET + else: + jira_issue_url = self.jira_issue_url + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if summary is not UNSET: + field_dict["summary"] = summary + if description is not UNSET: + field_dict["description"] = description + if assigned_to_user_id is not UNSET: + field_dict["assigned_to_user_id"] = assigned_to_user_id + if priority is not UNSET: + field_dict["priority"] = priority + if status is not UNSET: + field_dict["status"] = status + if due_date is not UNSET: + field_dict["due_date"] = due_date + if jira_issue_url is not UNSET: + field_dict["jira_issue_url"] = jira_issue_url + + return field_dict + + @classmethod + 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: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_assigned_to_user_id(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + assigned_to_user_id = _parse_assigned_to_user_id(d.pop("assigned_to_user_id", UNSET)) + + _priority = d.pop("priority", UNSET) + priority: UpdateProblemActionItemDataAttributesPriority | Unset + if isinstance(_priority, Unset): + priority = UNSET + else: + priority = check_update_problem_action_item_data_attributes_priority(_priority) + + _status = d.pop("status", UNSET) + status: UpdateProblemActionItemDataAttributesStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = check_update_problem_action_item_data_attributes_status(_status) + + def _parse_due_date(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + due_date = _parse_due_date(d.pop("due_date", UNSET)) + + def _parse_jira_issue_url(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + jira_issue_url = _parse_jira_issue_url(d.pop("jira_issue_url", UNSET)) + + update_problem_action_item_data_attributes = cls( + summary=summary, + description=description, + assigned_to_user_id=assigned_to_user_id, + priority=priority, + status=status, + due_date=due_date, + jira_issue_url=jira_issue_url, + ) + + return update_problem_action_item_data_attributes diff --git a/rootly_sdk/models/update_problem_action_item_data_attributes_priority.py b/rootly_sdk/models/update_problem_action_item_data_attributes_priority.py new file mode 100644 index 00000000..2f60c1f1 --- /dev/null +++ b/rootly_sdk/models/update_problem_action_item_data_attributes_priority.py @@ -0,0 +1,21 @@ +from typing import Literal + +UpdateProblemActionItemDataAttributesPriority = Literal["high", "low", "medium"] + +UPDATE_PROBLEM_ACTION_ITEM_DATA_ATTRIBUTES_PRIORITY_VALUES: set[UpdateProblemActionItemDataAttributesPriority] = { + "high", + "low", + "medium", +} + + +def check_update_problem_action_item_data_attributes_priority( + value: str | None, +) -> UpdateProblemActionItemDataAttributesPriority | None: + if value is None: + return None + if value in UPDATE_PROBLEM_ACTION_ITEM_DATA_ATTRIBUTES_PRIORITY_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_PROBLEM_ACTION_ITEM_DATA_ATTRIBUTES_PRIORITY_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_problem_action_item_data_attributes_status.py b/rootly_sdk/models/update_problem_action_item_data_attributes_status.py new file mode 100644 index 00000000..ebedbac3 --- /dev/null +++ b/rootly_sdk/models/update_problem_action_item_data_attributes_status.py @@ -0,0 +1,22 @@ +from typing import Literal + +UpdateProblemActionItemDataAttributesStatus = Literal["cancelled", "done", "in_progress", "open"] + +UPDATE_PROBLEM_ACTION_ITEM_DATA_ATTRIBUTES_STATUS_VALUES: set[UpdateProblemActionItemDataAttributesStatus] = { + "cancelled", + "done", + "in_progress", + "open", +} + + +def check_update_problem_action_item_data_attributes_status( + value: str | None, +) -> UpdateProblemActionItemDataAttributesStatus | None: + if value is None: + return None + if value in UPDATE_PROBLEM_ACTION_ITEM_DATA_ATTRIBUTES_STATUS_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_PROBLEM_ACTION_ITEM_DATA_ATTRIBUTES_STATUS_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_problem_action_item_data_type.py b/rootly_sdk/models/update_problem_action_item_data_type.py new file mode 100644 index 00000000..bf208201 --- /dev/null +++ b/rootly_sdk/models/update_problem_action_item_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +UpdateProblemActionItemDataType = Literal["problem_action_items"] + +UPDATE_PROBLEM_ACTION_ITEM_DATA_TYPE_VALUES: set[UpdateProblemActionItemDataType] = { + "problem_action_items", +} + + +def check_update_problem_action_item_data_type(value: str | None) -> UpdateProblemActionItemDataType | None: + if value is None: + return None + if value in UPDATE_PROBLEM_ACTION_ITEM_DATA_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_PROBLEM_ACTION_ITEM_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_problem_data.py b/rootly_sdk/models/update_problem_data.py new file mode 100644 index 00000000..0f765c4a --- /dev/null +++ b/rootly_sdk/models/update_problem_data.py @@ -0,0 +1,69 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.update_problem_data_type import UpdateProblemDataType, check_update_problem_data_type +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.update_problem_data_attributes import UpdateProblemDataAttributes + + +T = TypeVar("T", bound="UpdateProblemData") + + +@_attrs_define +class UpdateProblemData: + """ + Attributes: + type_ (UpdateProblemDataType): + attributes (UpdateProblemDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. + """ + + type_: UpdateProblemDataType + attributes: UpdateProblemDataAttributes + id: str | Unset = 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( + { + "type": type_, + "attributes": attributes, + } + ) + if id is not UNSET: + field_dict["id"] = id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_problem_data_attributes import UpdateProblemDataAttributes + + d = dict(src_dict) + type_ = check_update_problem_data_type(d.pop("type")) + + attributes = UpdateProblemDataAttributes.from_dict(d.pop("attributes")) + + id = d.pop("id", UNSET) + + update_problem_data = cls( + type_=type_, + attributes=attributes, + id=id, + ) + + return update_problem_data diff --git a/rootly_sdk/models/update_problem_data_attributes.py b/rootly_sdk/models/update_problem_data_attributes.py new file mode 100644 index 00000000..45cf6740 --- /dev/null +++ b/rootly_sdk/models/update_problem_data_attributes.py @@ -0,0 +1,410 @@ +from __future__ import annotations + +import datetime +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar, cast + +from attrs import define as _attrs_define + +from ..models.update_problem_data_attributes_expected_status import ( + UpdateProblemDataAttributesExpectedStatus, + check_update_problem_data_attributes_expected_status, +) +from ..models.update_problem_data_attributes_priority import ( + UpdateProblemDataAttributesPriority, + check_update_problem_data_attributes_priority, +) +from ..models.update_problem_data_attributes_status import ( + UpdateProblemDataAttributesStatus, + check_update_problem_data_attributes_status, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.update_problem_data_attributes_form_field_selections_item import ( + UpdateProblemDataAttributesFormFieldSelectionsItem, + ) + + +T = TypeVar("T", bound="UpdateProblemDataAttributes") + + +@_attrs_define +class UpdateProblemDataAttributes: + """ + Attributes: + title (str | Unset): The title of the problem + description (None | str | Unset): The description of the problem + owner_user_id (int | None | Unset): ID of the user who owns the problem + owner_group_id (None | str | Unset): ID of the group (team) that owns the problem + priority (UpdateProblemDataAttributesPriority | Unset): The priority of the problem + due_date (datetime.date | None | Unset): The due date of the problem + scope (None | str | Unset): The scope of the problem + exit_criteria (None | str | Unset): The exit criteria of the problem + impact_so_far (None | str | Unset): The impact observed so far + root_cause (None | str | Unset): The root cause of the problem + resolution (None | str | Unset): The resolution of the problem + deferral_reason (None | str | Unset): The reason and accepted risk for deferring the problem + cancellation_reason (None | str | Unset): The reason for cancelling the problem + next_review_at (None | str | Unset): The next review date for a deferred problem + re_review_cadence (int | None | Unset): Days between reviews for a deferred problem + form_field_selections (list[UpdateProblemDataAttributesFormFieldSelectionsItem] | Unset): Custom (form) field + selections for the problem + status (UpdateProblemDataAttributesStatus | Unset): Target status. Transitions run through the problem status + workflow: gate fields required by the target status must be supplied in the same request. Other updatable + attributes may accompany a status change and are applied atomically with it. + expected_status (UpdateProblemDataAttributesExpectedStatus | Unset): Optional optimistic-concurrency guard: the + transition is rejected unless the problem is currently in this status. + """ + + title: str | Unset = UNSET + description: None | str | Unset = UNSET + owner_user_id: int | None | Unset = UNSET + owner_group_id: None | str | Unset = UNSET + priority: UpdateProblemDataAttributesPriority | Unset = UNSET + due_date: datetime.date | None | Unset = UNSET + scope: None | str | Unset = UNSET + exit_criteria: None | str | Unset = UNSET + impact_so_far: None | str | Unset = UNSET + root_cause: None | str | Unset = UNSET + resolution: None | str | Unset = UNSET + deferral_reason: None | str | Unset = UNSET + cancellation_reason: None | str | Unset = UNSET + next_review_at: None | str | Unset = UNSET + re_review_cadence: int | None | Unset = UNSET + form_field_selections: list[UpdateProblemDataAttributesFormFieldSelectionsItem] | Unset = UNSET + status: UpdateProblemDataAttributesStatus | Unset = UNSET + expected_status: UpdateProblemDataAttributesExpectedStatus | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + title = self.title + + description: None | str | Unset + if isinstance(self.description, Unset): + description = UNSET + else: + description = self.description + + owner_user_id: int | None | Unset + if isinstance(self.owner_user_id, Unset): + owner_user_id = UNSET + else: + owner_user_id = self.owner_user_id + + owner_group_id: None | str | Unset + if isinstance(self.owner_group_id, Unset): + owner_group_id = UNSET + else: + owner_group_id = self.owner_group_id + + priority: str | Unset = UNSET + if not isinstance(self.priority, Unset): + priority = self.priority + + due_date: None | str | Unset + if isinstance(self.due_date, Unset): + due_date = UNSET + elif isinstance(self.due_date, datetime.date): + due_date = self.due_date.isoformat() + else: + due_date = self.due_date + + scope: None | str | Unset + if isinstance(self.scope, Unset): + scope = UNSET + else: + scope = self.scope + + exit_criteria: None | str | Unset + if isinstance(self.exit_criteria, Unset): + exit_criteria = UNSET + else: + exit_criteria = self.exit_criteria + + impact_so_far: None | str | Unset + if isinstance(self.impact_so_far, Unset): + impact_so_far = UNSET + else: + impact_so_far = self.impact_so_far + + root_cause: None | str | Unset + if isinstance(self.root_cause, Unset): + root_cause = UNSET + else: + root_cause = self.root_cause + + resolution: None | str | Unset + if isinstance(self.resolution, Unset): + resolution = UNSET + else: + resolution = self.resolution + + deferral_reason: None | str | Unset + if isinstance(self.deferral_reason, Unset): + deferral_reason = UNSET + else: + deferral_reason = self.deferral_reason + + cancellation_reason: None | str | Unset + if isinstance(self.cancellation_reason, Unset): + cancellation_reason = UNSET + else: + cancellation_reason = self.cancellation_reason + + next_review_at: None | str | Unset + if isinstance(self.next_review_at, Unset): + next_review_at = UNSET + else: + next_review_at = self.next_review_at + + re_review_cadence: int | None | Unset + if isinstance(self.re_review_cadence, Unset): + re_review_cadence = UNSET + else: + re_review_cadence = self.re_review_cadence + + form_field_selections: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.form_field_selections, Unset): + form_field_selections = [] + for form_field_selections_item_data in self.form_field_selections: + form_field_selections_item = form_field_selections_item_data.to_dict() + form_field_selections.append(form_field_selections_item) + + status: str | Unset = UNSET + if not isinstance(self.status, Unset): + status = self.status + + expected_status: str | Unset = UNSET + if not isinstance(self.expected_status, Unset): + expected_status = self.expected_status + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if title is not UNSET: + field_dict["title"] = title + if description is not UNSET: + field_dict["description"] = description + if owner_user_id is not UNSET: + field_dict["owner_user_id"] = owner_user_id + if owner_group_id is not UNSET: + field_dict["owner_group_id"] = owner_group_id + if priority is not UNSET: + field_dict["priority"] = priority + if due_date is not UNSET: + field_dict["due_date"] = due_date + if scope is not UNSET: + field_dict["scope"] = scope + if exit_criteria is not UNSET: + field_dict["exit_criteria"] = exit_criteria + if impact_so_far is not UNSET: + field_dict["impact_so_far"] = impact_so_far + if root_cause is not UNSET: + field_dict["root_cause"] = root_cause + if resolution is not UNSET: + field_dict["resolution"] = resolution + if deferral_reason is not UNSET: + field_dict["deferral_reason"] = deferral_reason + if cancellation_reason is not UNSET: + field_dict["cancellation_reason"] = cancellation_reason + if next_review_at is not UNSET: + field_dict["next_review_at"] = next_review_at + if re_review_cadence is not UNSET: + field_dict["re_review_cadence"] = re_review_cadence + if form_field_selections is not UNSET: + field_dict["form_field_selections"] = form_field_selections + if status is not UNSET: + field_dict["status"] = status + if expected_status is not UNSET: + field_dict["expected_status"] = expected_status + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_problem_data_attributes_form_field_selections_item import ( + UpdateProblemDataAttributesFormFieldSelectionsItem, + ) + + d = dict(src_dict) + title = d.pop("title", UNSET) + + def _parse_description(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + description = _parse_description(d.pop("description", UNSET)) + + def _parse_owner_user_id(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + owner_user_id = _parse_owner_user_id(d.pop("owner_user_id", UNSET)) + + def _parse_owner_group_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + owner_group_id = _parse_owner_group_id(d.pop("owner_group_id", UNSET)) + + _priority = d.pop("priority", UNSET) + priority: UpdateProblemDataAttributesPriority | Unset + if isinstance(_priority, Unset): + priority = UNSET + else: + priority = check_update_problem_data_attributes_priority(_priority) + + def _parse_due_date(data: object) -> datetime.date | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, str): + raise TypeError() + due_date_type_0 = datetime.date.fromisoformat(data) + + return due_date_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(datetime.date | None | Unset, data) + + due_date = _parse_due_date(d.pop("due_date", UNSET)) + + def _parse_scope(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + scope = _parse_scope(d.pop("scope", UNSET)) + + def _parse_exit_criteria(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + exit_criteria = _parse_exit_criteria(d.pop("exit_criteria", UNSET)) + + def _parse_impact_so_far(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + impact_so_far = _parse_impact_so_far(d.pop("impact_so_far", UNSET)) + + def _parse_root_cause(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + root_cause = _parse_root_cause(d.pop("root_cause", UNSET)) + + def _parse_resolution(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + resolution = _parse_resolution(d.pop("resolution", UNSET)) + + def _parse_deferral_reason(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + deferral_reason = _parse_deferral_reason(d.pop("deferral_reason", UNSET)) + + def _parse_cancellation_reason(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + cancellation_reason = _parse_cancellation_reason(d.pop("cancellation_reason", UNSET)) + + def _parse_next_review_at(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + next_review_at = _parse_next_review_at(d.pop("next_review_at", UNSET)) + + def _parse_re_review_cadence(data: object) -> int | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(int | None | Unset, data) + + re_review_cadence = _parse_re_review_cadence(d.pop("re_review_cadence", UNSET)) + + _form_field_selections = d.pop("form_field_selections", UNSET) + form_field_selections: list[UpdateProblemDataAttributesFormFieldSelectionsItem] | Unset = UNSET + if _form_field_selections is not UNSET: + form_field_selections = [] + for form_field_selections_item_data in _form_field_selections: + form_field_selections_item = UpdateProblemDataAttributesFormFieldSelectionsItem.from_dict( + form_field_selections_item_data + ) + + form_field_selections.append(form_field_selections_item) + + _status = d.pop("status", UNSET) + status: UpdateProblemDataAttributesStatus | Unset + if isinstance(_status, Unset): + status = UNSET + else: + status = check_update_problem_data_attributes_status(_status) + + _expected_status = d.pop("expected_status", UNSET) + expected_status: UpdateProblemDataAttributesExpectedStatus | Unset + if isinstance(_expected_status, Unset): + expected_status = UNSET + else: + expected_status = check_update_problem_data_attributes_expected_status(_expected_status) + + update_problem_data_attributes = cls( + title=title, + description=description, + owner_user_id=owner_user_id, + owner_group_id=owner_group_id, + priority=priority, + due_date=due_date, + scope=scope, + exit_criteria=exit_criteria, + impact_so_far=impact_so_far, + root_cause=root_cause, + resolution=resolution, + deferral_reason=deferral_reason, + cancellation_reason=cancellation_reason, + next_review_at=next_review_at, + re_review_cadence=re_review_cadence, + form_field_selections=form_field_selections, + status=status, + expected_status=expected_status, + ) + + return update_problem_data_attributes diff --git a/rootly_sdk/models/update_problem_data_attributes_expected_status.py b/rootly_sdk/models/update_problem_data_attributes_expected_status.py new file mode 100644 index 00000000..89ea7bcb --- /dev/null +++ b/rootly_sdk/models/update_problem_data_attributes_expected_status.py @@ -0,0 +1,23 @@ +from typing import Literal + +UpdateProblemDataAttributesExpectedStatus = Literal["cancelled", "completed", "created", "deferred", "in_progress"] + +UPDATE_PROBLEM_DATA_ATTRIBUTES_EXPECTED_STATUS_VALUES: set[UpdateProblemDataAttributesExpectedStatus] = { + "cancelled", + "completed", + "created", + "deferred", + "in_progress", +} + + +def check_update_problem_data_attributes_expected_status( + value: str | None, +) -> UpdateProblemDataAttributesExpectedStatus | None: + if value is None: + return None + if value in UPDATE_PROBLEM_DATA_ATTRIBUTES_EXPECTED_STATUS_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_PROBLEM_DATA_ATTRIBUTES_EXPECTED_STATUS_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_problem_data_attributes_form_field_selections_item.py b/rootly_sdk/models/update_problem_data_attributes_form_field_selections_item.py new file mode 100644 index 00000000..93042868 --- /dev/null +++ b/rootly_sdk/models/update_problem_data_attributes_form_field_selections_item.py @@ -0,0 +1,47 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="UpdateProblemDataAttributesFormFieldSelectionsItem") + + +@_attrs_define +class UpdateProblemDataAttributesFormFieldSelectionsItem: + """ """ + + 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) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + update_problem_data_attributes_form_field_selections_item = cls() + + update_problem_data_attributes_form_field_selections_item.additional_properties = d + return update_problem_data_attributes_form_field_selections_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_problem_data_attributes_priority.py b/rootly_sdk/models/update_problem_data_attributes_priority.py new file mode 100644 index 00000000..af30d339 --- /dev/null +++ b/rootly_sdk/models/update_problem_data_attributes_priority.py @@ -0,0 +1,18 @@ +from typing import Literal + +UpdateProblemDataAttributesPriority = Literal["P0", "P1", "P2", "P3"] + +UPDATE_PROBLEM_DATA_ATTRIBUTES_PRIORITY_VALUES: set[UpdateProblemDataAttributesPriority] = { + "P0", + "P1", + "P2", + "P3", +} + + +def check_update_problem_data_attributes_priority(value: str | None) -> UpdateProblemDataAttributesPriority | None: + if value is None: + return None + if value in UPDATE_PROBLEM_DATA_ATTRIBUTES_PRIORITY_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_PROBLEM_DATA_ATTRIBUTES_PRIORITY_VALUES!r}") diff --git a/rootly_sdk/models/update_problem_data_attributes_status.py b/rootly_sdk/models/update_problem_data_attributes_status.py new file mode 100644 index 00000000..0437ba14 --- /dev/null +++ b/rootly_sdk/models/update_problem_data_attributes_status.py @@ -0,0 +1,19 @@ +from typing import Literal + +UpdateProblemDataAttributesStatus = Literal["cancelled", "completed", "created", "deferred", "in_progress"] + +UPDATE_PROBLEM_DATA_ATTRIBUTES_STATUS_VALUES: set[UpdateProblemDataAttributesStatus] = { + "cancelled", + "completed", + "created", + "deferred", + "in_progress", +} + + +def check_update_problem_data_attributes_status(value: str | None) -> UpdateProblemDataAttributesStatus | None: + if value is None: + return None + if value in UPDATE_PROBLEM_DATA_ATTRIBUTES_STATUS_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_PROBLEM_DATA_ATTRIBUTES_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/update_problem_data_type.py b/rootly_sdk/models/update_problem_data_type.py new file mode 100644 index 00000000..f19610b6 --- /dev/null +++ b/rootly_sdk/models/update_problem_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +UpdateProblemDataType = Literal["problems"] + +UPDATE_PROBLEM_DATA_TYPE_VALUES: set[UpdateProblemDataType] = { + "problems", +} + + +def check_update_problem_data_type(value: str | None) -> UpdateProblemDataType | None: + if value is None: + return None + if value in UPDATE_PROBLEM_DATA_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_PROBLEM_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_pulse.py b/rootly_sdk/models/update_pulse.py index 8f92ec5b..781f56ba 100644 --- a/rootly_sdk/models/update_pulse.py +++ b/rootly_sdk/models/update_pulse.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_pulse_data import UpdatePulseData @@ -18,14 +19,13 @@ class UpdatePulse: data (UpdatePulseData): """ - data: "UpdatePulseData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdatePulseData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_pulse.additional_properties = d return update_pulse - - @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_pulse_data.py b/rootly_sdk/models/update_pulse_data.py index b79e1f0b..17615d54 100644 --- a/rootly_sdk/models/update_pulse_data.py +++ b/rootly_sdk/models/update_pulse_data.py @@ -1,10 +1,12 @@ +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_pulse_data_type import UpdatePulseDataType, check_update_pulse_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_pulse_data_attributes import UpdatePulseDataAttributes @@ -19,25 +21,31 @@ class UpdatePulseData: Attributes: type_ (UpdatePulseDataType): attributes (UpdatePulseDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdatePulseDataType - attributes: "UpdatePulseDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdatePulseDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdatePulseDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_pulse_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_pulse_data.additional_properties = d return update_pulse_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_pulse_data_attributes.py b/rootly_sdk/models/update_pulse_data_attributes.py index 8451d755..6ad8fb57 100644 --- a/rootly_sdk/models/update_pulse_data_attributes.py +++ b/rootly_sdk/models/update_pulse_data_attributes.py @@ -1,9 +1,10 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define -from dateutil.parser import isoparse from ..types import UNSET, Unset @@ -20,35 +21,35 @@ class UpdatePulseDataAttributes: """ Attributes: - 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): 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: 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 + 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 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 | Unset | str + source: None | str | Unset if isinstance(self.source, Unset): source = UNSET else: @@ -56,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: summary = self.summary - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -65,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - environment_ids: None | Unset | list[str] + environment_ids: list[str] | None | Unset if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -74,7 +75,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET elif isinstance(self.started_at, datetime.datetime): @@ -82,7 +83,7 @@ def to_dict(self) -> dict[str, Any]: else: started_at = self.started_at - ended_at: None | Unset | str + ended_at: None | str | Unset if isinstance(self.ended_at, Unset): ended_at = UNSET elif isinstance(self.ended_at, datetime.datetime): @@ -90,35 +91,35 @@ def to_dict(self) -> dict[str, Any]: else: ended_at = self.ended_at - external_url: None | Unset | str + external_url: None | str | Unset if isinstance(self.external_url, Unset): external_url = UNSET else: external_url = self.external_url - labels: Unset | list[None | dict[str, Any]] = UNSET + labels: list[dict[str, Any] | None] | Unset = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: - labels_item: None | dict[str, Any] + labels_item: dict[str, Any] | None if isinstance(labels_item_data, UpdatePulseDataAttributesLabelsItemType0): labels_item = labels_item_data.to_dict() else: labels_item = labels_item_data labels.append(labels_item) - refs: Unset | list[None | dict[str, Any]] = UNSET + refs: list[dict[str, Any] | None] | Unset = UNSET if not isinstance(self.refs, Unset): refs = [] for refs_item_data in self.refs: - refs_item: None | dict[str, Any] + refs_item: dict[str, Any] | None if isinstance(refs_item_data, UpdatePulseDataAttributesRefsItemType0): refs_item = refs_item_data.to_dict() else: refs_item = refs_item_data refs.append(refs_item) - data: None | Unset | dict[str, Any] + data: dict[str, Any] | None | Unset if isinstance(self.data, Unset): data = UNSET elif isinstance(self.data, UpdatePulseDataAttributesDataType0): @@ -160,18 +161,18 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_source(data: object) -> None | Unset | str: + def _parse_source(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) source = _parse_source(d.pop("source", UNSET)) summary = d.pop("summary", UNSET) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -182,13 +183,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_environment_ids(data: object) -> None | Unset | list[str]: + def _parse_environment_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -199,13 +200,13 @@ def _parse_environment_ids(data: object) -> None | Unset | list[str]: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_started_at(data: object) -> None | Unset | datetime.datetime: + def _parse_started_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -213,16 +214,16 @@ def _parse_started_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - started_at_type_0 = isoparse(data) + started_at_type_0 = datetime.datetime.fromisoformat(data) return started_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: + def _parse_ended_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -230,67 +231,71 @@ def _parse_ended_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - ended_at_type_0 = isoparse(data) + ended_at_type_0 = datetime.datetime.fromisoformat(data) return ended_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) ended_at = _parse_ended_at(d.pop("ended_at", UNSET)) - def _parse_external_url(data: object) -> None | Unset | str: + def _parse_external_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_url = _parse_external_url(d.pop("external_url", UNSET)) - labels = [] _labels = d.pop("labels", UNSET) - for labels_item_data in _labels or []: + labels: list[None | UpdatePulseDataAttributesLabelsItemType0] | Unset = UNSET + if _labels is not UNSET: + labels = [] + for labels_item_data in _labels: - 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) + 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) - return labels_item_type_0 - except: # noqa: E722 - pass - return cast(Union["UpdatePulseDataAttributesLabelsItemType0", None], data) + return labels_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | UpdatePulseDataAttributesLabelsItemType0, 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) - for refs_item_data in _refs or []: + refs: list[None | UpdatePulseDataAttributesRefsItemType0] | Unset = UNSET + if _refs is not UNSET: + refs = [] + for refs_item_data in _refs: - 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) + 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) - return refs_item_type_0 - except: # noqa: E722 - pass - return cast(Union["UpdatePulseDataAttributesRefsItemType0", None], data) + return refs_item_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | UpdatePulseDataAttributesRefsItemType0, 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) -> Union["UpdatePulseDataAttributesDataType0", None, Unset]: + def _parse_data(data: object) -> None | Unset | UpdatePulseDataAttributesDataType0: if data is None: return data if isinstance(data, Unset): @@ -301,9 +306,9 @@ def _parse_data(data: object) -> Union["UpdatePulseDataAttributesDataType0", Non data_type_0 = UpdatePulseDataAttributesDataType0.from_dict(data) return data_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["UpdatePulseDataAttributesDataType0", None, Unset], data) + return cast(None | Unset | UpdatePulseDataAttributesDataType0, 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 06fff96b..30981982 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 9c825e31..82002c46 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="UpdatePulseDataAttributesLabelsItemType0") @@ -17,7 +18,6 @@ class UpdatePulseDataAttributesLabelsItemType0: key: str value: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: key = self.key @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: value = self.value field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "key": key, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: value=value, ) - update_pulse_data_attributes_labels_item_type_0.additional_properties = d return update_pulse_data_attributes_labels_item_type_0 - - @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_pulse_data_attributes_refs_item_type_0.py b/rootly_sdk/models/update_pulse_data_attributes_refs_item_type_0.py index ceff1b7a..9fb0cd20 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="UpdatePulseDataAttributesRefsItemType0") @@ -17,7 +18,6 @@ class UpdatePulseDataAttributesRefsItemType0: key: str value: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: key = self.key @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: value = self.value field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "key": key, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: value=value, ) - update_pulse_data_attributes_refs_item_type_0.additional_properties = d return update_pulse_data_attributes_refs_item_type_0 - - @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_pulse_data_type.py b/rootly_sdk/models/update_pulse_data_type.py index 9b659d51..a2e9e979 100644 --- a/rootly_sdk/models/update_pulse_data_type.py +++ b/rootly_sdk/models/update_pulse_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdatePulseDataType = Literal["pulses"] @@ -11,5 +11,5 @@ def check_update_pulse_data_type(value: str | None) -> UpdatePulseDataType | Non if value is None: return None if value in UPDATE_PULSE_DATA_TYPE_VALUES: - return cast(UpdatePulseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_PULSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_quip_page_task_params.py b/rootly_sdk/models/update_quip_page_task_params.py index de4bf983..3de18173 100644 --- a/rootly_sdk/models/update_quip_page_task_params.py +++ b/rootly_sdk/models/update_quip_page_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -18,25 +20,25 @@ class UpdateQuipPageTaskParams: """ Attributes: file_id (str): The Quip page ID - 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 + 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 """ file_id: str - 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 + 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 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -74,7 +76,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: Unset | UpdateQuipPageTaskParamsTaskType + task_type: UpdateQuipPageTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_quip_page_task_params_task_type.py b/rootly_sdk/models/update_quip_page_task_params_task_type.py index 306ed8bc..8dfdff18 100644 --- a/rootly_sdk/models/update_quip_page_task_params_task_type.py +++ b/rootly_sdk/models/update_quip_page_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateQuipPageTaskParamsTaskType = Literal["update_quip_page"] @@ -11,5 +11,5 @@ def check_update_quip_page_task_params_task_type(value: str | None) -> UpdateQui if value is None: return None if value in UPDATE_QUIP_PAGE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateQuipPageTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_QUIP_PAGE_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_retrospective_configuration.py b/rootly_sdk/models/update_retrospective_configuration.py index b193a418..0af90dc1 100644 --- a/rootly_sdk/models/update_retrospective_configuration.py +++ b/rootly_sdk/models/update_retrospective_configuration.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_retrospective_configuration_data import UpdateRetrospectiveConfigurationData @@ -18,14 +19,13 @@ class UpdateRetrospectiveConfiguration: data (UpdateRetrospectiveConfigurationData): """ - data: "UpdateRetrospectiveConfigurationData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateRetrospectiveConfigurationData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_retrospective_configuration.additional_properties = d return update_retrospective_configuration - - @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_retrospective_configuration_data.py b/rootly_sdk/models/update_retrospective_configuration_data.py index 35842ed6..12e45b55 100644 --- a/rootly_sdk/models/update_retrospective_configuration_data.py +++ b/rootly_sdk/models/update_retrospective_configuration_data.py @@ -1,13 +1,15 @@ +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_retrospective_configuration_data_type import ( UpdateRetrospectiveConfigurationDataType, check_update_retrospective_configuration_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_retrospective_configuration_data_attributes import ( @@ -24,25 +26,31 @@ class UpdateRetrospectiveConfigurationData: Attributes: type_ (UpdateRetrospectiveConfigurationDataType): attributes (UpdateRetrospectiveConfigurationDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateRetrospectiveConfigurationDataType - attributes: "UpdateRetrospectiveConfigurationDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateRetrospectiveConfigurationDataAttributes + id: str | Unset = 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 @@ -57,26 +65,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateRetrospectiveConfigurationDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_retrospective_configuration_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_retrospective_configuration_data.additional_properties = d return update_retrospective_configuration_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_retrospective_configuration_data_attributes.py b/rootly_sdk/models/update_retrospective_configuration_data_attributes.py index 318b73d8..969dbf0b 100644 --- a/rootly_sdk/models/update_retrospective_configuration_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_configuration_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,18 +14,17 @@ class UpdateRetrospectiveConfigurationDataAttributes: """ Attributes: - 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): 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: None | Unset | list[str] = UNSET - group_ids: None | Unset | list[str] = UNSET - incident_type_ids: None | Unset | list[str] = UNSET + severity_ids: list[str] | None | Unset = UNSET + group_ids: list[str] | None | Unset = UNSET + incident_type_ids: list[str] | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: - severity_ids: None | Unset | list[str] + severity_ids: list[str] | None | Unset if isinstance(self.severity_ids, Unset): severity_ids = UNSET elif isinstance(self.severity_ids, list): @@ -32,7 +33,7 @@ def to_dict(self) -> dict[str, Any]: else: severity_ids = self.severity_ids - group_ids: None | Unset | list[str] + group_ids: list[str] | None | Unset if isinstance(self.group_ids, Unset): group_ids = UNSET elif isinstance(self.group_ids, list): @@ -41,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: else: group_ids = self.group_ids - incident_type_ids: None | Unset | list[str] + incident_type_ids: list[str] | None | Unset if isinstance(self.incident_type_ids, Unset): incident_type_ids = UNSET elif isinstance(self.incident_type_ids, list): @@ -66,7 +67,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) -> None | Unset | list[str]: + def _parse_severity_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -77,13 +78,13 @@ def _parse_severity_ids(data: object) -> None | Unset | list[str]: severity_ids_type_0 = cast(list[str], data) return severity_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) severity_ids = _parse_severity_ids(d.pop("severity_ids", UNSET)) - def _parse_group_ids(data: object) -> None | Unset | list[str]: + def _parse_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -94,13 +95,13 @@ def _parse_group_ids(data: object) -> None | Unset | list[str]: group_ids_type_0 = cast(list[str], data) return group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) group_ids = _parse_group_ids(d.pop("group_ids", UNSET)) - def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: + def _parse_incident_type_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -111,9 +112,9 @@ def _parse_incident_type_ids(data: object) -> None | Unset | list[str]: incident_type_ids_type_0 = cast(list[str], data) return incident_type_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) incident_type_ids = _parse_incident_type_ids(d.pop("incident_type_ids", UNSET)) diff --git a/rootly_sdk/models/update_retrospective_configuration_data_type.py b/rootly_sdk/models/update_retrospective_configuration_data_type.py index 2e0b7a9d..a6779f6a 100644 --- a/rootly_sdk/models/update_retrospective_configuration_data_type.py +++ b/rootly_sdk/models/update_retrospective_configuration_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRetrospectiveConfigurationDataType = Literal["retrospective_configurations"] @@ -13,7 +13,7 @@ def check_update_retrospective_configuration_data_type( if value is None: return None if value in UPDATE_RETROSPECTIVE_CONFIGURATION_DATA_TYPE_VALUES: - return cast(UpdateRetrospectiveConfigurationDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_RETROSPECTIVE_CONFIGURATION_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_retrospective_process.py b/rootly_sdk/models/update_retrospective_process.py index b5e48c48..f7fd1c0d 100644 --- a/rootly_sdk/models/update_retrospective_process.py +++ b/rootly_sdk/models/update_retrospective_process.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_retrospective_process_data import UpdateRetrospectiveProcessData @@ -18,14 +19,13 @@ class UpdateRetrospectiveProcess: data (UpdateRetrospectiveProcessData): """ - data: "UpdateRetrospectiveProcessData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateRetrospectiveProcessData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_retrospective_process.additional_properties = d return update_retrospective_process - - @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_retrospective_process_data.py b/rootly_sdk/models/update_retrospective_process_data.py index 592d517b..28250c9e 100644 --- a/rootly_sdk/models/update_retrospective_process_data.py +++ b/rootly_sdk/models/update_retrospective_process_data.py @@ -1,13 +1,15 @@ +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_retrospective_process_data_type import ( UpdateRetrospectiveProcessDataType, check_update_retrospective_process_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_retrospective_process_data_attributes import UpdateRetrospectiveProcessDataAttributes @@ -22,25 +24,31 @@ class UpdateRetrospectiveProcessData: Attributes: type_ (UpdateRetrospectiveProcessDataType): attributes (UpdateRetrospectiveProcessDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateRetrospectiveProcessDataType - attributes: "UpdateRetrospectiveProcessDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateRetrospectiveProcessDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateRetrospectiveProcessDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_retrospective_process_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_retrospective_process_data.additional_properties = d return update_retrospective_process_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_retrospective_process_data_attributes.py b/rootly_sdk/models/update_retrospective_process_data_attributes.py index 36f56c48..2627b37f 100644 --- a/rootly_sdk/models/update_retrospective_process_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_process_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -24,22 +26,22 @@ class UpdateRetrospectiveProcessDataAttributes: """ Attributes: - 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): 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: Unset | str = UNSET - description: None | Unset | str = UNSET - retrospective_process_matching_criteria: Union[ - "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0", - "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1", - "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2", - Unset, - ] = UNSET + name: str | Unset = UNSET + description: None | str | Unset = UNSET + retrospective_process_matching_criteria: ( + Unset + | UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0 + | UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1 + | UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2 + ) = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_retrospective_process_data_attributes_retrospective_process_matching_criteria_type_0 import ( @@ -51,13 +53,13 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - retrospective_process_matching_criteria: Unset | dict[str, Any] + retrospective_process_matching_criteria: dict[str, Any] | Unset if isinstance(self.retrospective_process_matching_criteria, Unset): retrospective_process_matching_criteria = UNSET elif isinstance( @@ -100,23 +102,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) def _parse_retrospective_process_matching_criteria( data: object, - ) -> Union[ - "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0", - "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1", - "UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2", - Unset, - ]: + ) -> ( + Unset + | UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType0 + | UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType1 + | UpdateRetrospectiveProcessDataAttributesRetrospectiveProcessMatchingCriteriaType2 + ): if isinstance(data, Unset): return data try: @@ -127,7 +129,7 @@ def _parse_retrospective_process_matching_criteria( ) return retrospective_process_matching_criteria_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -137,7 +139,7 @@ def _parse_retrospective_process_matching_criteria( ) return retrospective_process_matching_criteria_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): 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 59823a93..5fe8b8ec 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,3 +1,5 @@ +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 0ccf8f66..51a20fd7 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,3 +1,5 @@ +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 4f61a7b2..f8c3eab1 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,3 +1,5 @@ +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_type.py b/rootly_sdk/models/update_retrospective_process_data_type.py index 20451a15..3b52f7b6 100644 --- a/rootly_sdk/models/update_retrospective_process_data_type.py +++ b/rootly_sdk/models/update_retrospective_process_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRetrospectiveProcessDataType = Literal["retrospective_processes"] @@ -11,5 +11,5 @@ def check_update_retrospective_process_data_type(value: str | None) -> UpdateRet if value is None: return None if value in UPDATE_RETROSPECTIVE_PROCESS_DATA_TYPE_VALUES: - return cast(UpdateRetrospectiveProcessDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_RETROSPECTIVE_PROCESS_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_retrospective_process_group.py b/rootly_sdk/models/update_retrospective_process_group.py index 95e59d85..07e72221 100644 --- a/rootly_sdk/models/update_retrospective_process_group.py +++ b/rootly_sdk/models/update_retrospective_process_group.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_retrospective_process_group_data import UpdateRetrospectiveProcessGroupData @@ -18,14 +19,13 @@ class UpdateRetrospectiveProcessGroup: data (UpdateRetrospectiveProcessGroupData): """ - data: "UpdateRetrospectiveProcessGroupData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateRetrospectiveProcessGroupData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_retrospective_process_group.additional_properties = d return update_retrospective_process_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_retrospective_process_group_data.py b/rootly_sdk/models/update_retrospective_process_group_data.py index 8a9b04c0..e29d8095 100644 --- a/rootly_sdk/models/update_retrospective_process_group_data.py +++ b/rootly_sdk/models/update_retrospective_process_group_data.py @@ -1,13 +1,15 @@ +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_retrospective_process_group_data_type import ( UpdateRetrospectiveProcessGroupDataType, check_update_retrospective_process_group_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_retrospective_process_group_data_attributes import ( @@ -24,25 +26,31 @@ class UpdateRetrospectiveProcessGroupData: Attributes: type_ (UpdateRetrospectiveProcessGroupDataType): attributes (UpdateRetrospectiveProcessGroupDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateRetrospectiveProcessGroupDataType - attributes: "UpdateRetrospectiveProcessGroupDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateRetrospectiveProcessGroupDataAttributes + id: str | Unset = 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 @@ -57,26 +65,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateRetrospectiveProcessGroupDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_retrospective_process_group_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_retrospective_process_group_data.additional_properties = d return update_retrospective_process_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_retrospective_process_group_data_attributes.py b/rootly_sdk/models/update_retrospective_process_group_data_attributes.py index 6c573ac5..b34d1eac 100644 --- a/rootly_sdk/models/update_retrospective_process_group_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_process_group_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -12,12 +14,12 @@ class UpdateRetrospectiveProcessGroupDataAttributes: """ Attributes: - sub_status_id (Union[Unset, str]): - position (Union[Unset, int]): + sub_status_id (str | Unset): + position (int | Unset): """ - sub_status_id: Unset | str = UNSET - position: Unset | int = UNSET + sub_status_id: str | Unset = UNSET + position: int | Unset = 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_data_type.py b/rootly_sdk/models/update_retrospective_process_group_data_type.py index 2971fa5d..01fe412b 100644 --- a/rootly_sdk/models/update_retrospective_process_group_data_type.py +++ b/rootly_sdk/models/update_retrospective_process_group_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRetrospectiveProcessGroupDataType = Literal["retrospective_process_groups"] @@ -13,7 +13,7 @@ def check_update_retrospective_process_group_data_type( if value is None: return None if value in UPDATE_RETROSPECTIVE_PROCESS_GROUP_DATA_TYPE_VALUES: - return cast(UpdateRetrospectiveProcessGroupDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_RETROSPECTIVE_PROCESS_GROUP_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_retrospective_process_group_step.py b/rootly_sdk/models/update_retrospective_process_group_step.py index 59c0725f..b5058fda 100644 --- a/rootly_sdk/models/update_retrospective_process_group_step.py +++ b/rootly_sdk/models/update_retrospective_process_group_step.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_retrospective_process_group_step_data import UpdateRetrospectiveProcessGroupStepData @@ -18,14 +19,13 @@ class UpdateRetrospectiveProcessGroupStep: data (UpdateRetrospectiveProcessGroupStepData): """ - data: "UpdateRetrospectiveProcessGroupStepData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateRetrospectiveProcessGroupStepData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_retrospective_process_group_step.additional_properties = d return update_retrospective_process_group_step - - @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_retrospective_process_group_step_data.py b/rootly_sdk/models/update_retrospective_process_group_step_data.py index 72ecd8b3..3552d7df 100644 --- a/rootly_sdk/models/update_retrospective_process_group_step_data.py +++ b/rootly_sdk/models/update_retrospective_process_group_step_data.py @@ -1,13 +1,15 @@ +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_retrospective_process_group_step_data_type import ( UpdateRetrospectiveProcessGroupStepDataType, check_update_retrospective_process_group_step_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_retrospective_process_group_step_data_attributes import ( @@ -24,25 +26,31 @@ class UpdateRetrospectiveProcessGroupStepData: Attributes: type_ (UpdateRetrospectiveProcessGroupStepDataType): attributes (UpdateRetrospectiveProcessGroupStepDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateRetrospectiveProcessGroupStepDataType - attributes: "UpdateRetrospectiveProcessGroupStepDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateRetrospectiveProcessGroupStepDataAttributes + id: str | Unset = 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 @@ -57,26 +65,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateRetrospectiveProcessGroupStepDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_retrospective_process_group_step_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_retrospective_process_group_step_data.additional_properties = d return update_retrospective_process_group_step_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_retrospective_process_group_step_data_attributes.py b/rootly_sdk/models/update_retrospective_process_group_step_data_attributes.py index 2568f90e..76b6e3c0 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -12,10 +14,10 @@ class UpdateRetrospectiveProcessGroupStepDataAttributes: """ Attributes: - position (Union[Unset, int]): + position (int | Unset): """ - position: Unset | int = UNSET + position: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: position = self.position diff --git a/rootly_sdk/models/update_retrospective_process_group_step_data_type.py b/rootly_sdk/models/update_retrospective_process_group_step_data_type.py index 31263e3d..7d303cdb 100644 --- a/rootly_sdk/models/update_retrospective_process_group_step_data_type.py +++ b/rootly_sdk/models/update_retrospective_process_group_step_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRetrospectiveProcessGroupStepDataType = Literal["retrospective_process_group_steps"] @@ -13,7 +13,7 @@ def check_update_retrospective_process_group_step_data_type( if value is None: return None if value in UPDATE_RETROSPECTIVE_PROCESS_GROUP_STEP_DATA_TYPE_VALUES: - return cast(UpdateRetrospectiveProcessGroupStepDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_RETROSPECTIVE_PROCESS_GROUP_STEP_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_retrospective_step.py b/rootly_sdk/models/update_retrospective_step.py index bc6d3b12..2898575a 100644 --- a/rootly_sdk/models/update_retrospective_step.py +++ b/rootly_sdk/models/update_retrospective_step.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_retrospective_step_data import UpdateRetrospectiveStepData @@ -18,14 +19,13 @@ class UpdateRetrospectiveStep: data (UpdateRetrospectiveStepData): """ - data: "UpdateRetrospectiveStepData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateRetrospectiveStepData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_retrospective_step.additional_properties = d return update_retrospective_step - - @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_retrospective_step_data.py b/rootly_sdk/models/update_retrospective_step_data.py index 1034ebad..633870a1 100644 --- a/rootly_sdk/models/update_retrospective_step_data.py +++ b/rootly_sdk/models/update_retrospective_step_data.py @@ -1,13 +1,15 @@ +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_retrospective_step_data_type import ( UpdateRetrospectiveStepDataType, check_update_retrospective_step_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_retrospective_step_data_attributes import UpdateRetrospectiveStepDataAttributes @@ -22,25 +24,31 @@ class UpdateRetrospectiveStepData: Attributes: type_ (UpdateRetrospectiveStepDataType): attributes (UpdateRetrospectiveStepDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateRetrospectiveStepDataType - attributes: "UpdateRetrospectiveStepDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateRetrospectiveStepDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateRetrospectiveStepDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_retrospective_step_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_retrospective_step_data.additional_properties = d return update_retrospective_step_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_retrospective_step_data_attributes.py b/rootly_sdk/models/update_retrospective_step_data_attributes.py index a1e7a4fa..6bfa6251 100644 --- a/rootly_sdk/models/update_retrospective_step_data_attributes.py +++ b/rootly_sdk/models/update_retrospective_step_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,27 +14,27 @@ class UpdateRetrospectiveStepDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `title`; any submitted value is ignored. This + slug (None | str | Unset): 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): 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: 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 + slug: None | str | Unset = UNSET + 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 def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -40,25 +42,25 @@ def to_dict(self) -> dict[str, Any]: title = self.title - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - incident_role_id: None | Unset | str + incident_role_id: None | str | Unset if isinstance(self.incident_role_id, Unset): incident_role_id = UNSET else: incident_role_id = self.incident_role_id - due_after_days: None | Unset | int + due_after_days: int | None | Unset if isinstance(self.due_after_days, Unset): due_after_days = UNSET else: due_after_days = self.due_after_days - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -90,50 +92,50 @@ 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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) title = d.pop("title", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_incident_role_id(data: object) -> None | Unset | str: + def _parse_incident_role_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) incident_role_id = _parse_incident_role_id(d.pop("incident_role_id", UNSET)) - def _parse_due_after_days(data: object) -> None | Unset | int: + def _parse_due_after_days(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) due_after_days = _parse_due_after_days(d.pop("due_after_days", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_retrospective_step_data_type.py b/rootly_sdk/models/update_retrospective_step_data_type.py index 091a89f2..effe3166 100644 --- a/rootly_sdk/models/update_retrospective_step_data_type.py +++ b/rootly_sdk/models/update_retrospective_step_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRetrospectiveStepDataType = Literal["retrospective_steps"] @@ -11,5 +11,5 @@ def check_update_retrospective_step_data_type(value: str | None) -> UpdateRetros if value is None: return None if value in UPDATE_RETROSPECTIVE_STEP_DATA_TYPE_VALUES: - return cast(UpdateRetrospectiveStepDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_RETROSPECTIVE_STEP_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_role.py b/rootly_sdk/models/update_role.py index 0e36ba39..86ba71be 100644 --- a/rootly_sdk/models/update_role.py +++ b/rootly_sdk/models/update_role.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_role_data import UpdateRoleData @@ -18,14 +19,13 @@ class UpdateRole: data (UpdateRoleData): """ - data: "UpdateRoleData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateRoleData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_role.additional_properties = d return update_role - - @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_role_data.py b/rootly_sdk/models/update_role_data.py index c334e4fe..480bf9f0 100644 --- a/rootly_sdk/models/update_role_data.py +++ b/rootly_sdk/models/update_role_data.py @@ -1,10 +1,12 @@ +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_role_data_type import UpdateRoleDataType, check_update_role_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_role_data_attributes import UpdateRoleDataAttributes @@ -19,25 +21,31 @@ class UpdateRoleData: Attributes: type_ (UpdateRoleDataType): attributes (UpdateRoleDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateRoleDataType - attributes: "UpdateRoleDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateRoleDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateRoleDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_role_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_role_data.additional_properties = d return update_role_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_role_data_attributes.py b/rootly_sdk/models/update_role_data_attributes.py index b802aa29..72371077 100644 --- a/rootly_sdk/models/update_role_data_attributes.py +++ b/rootly_sdk/models/update_role_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -83,6 +85,10 @@ UpdateRoleDataAttributesPlaybooksPermissionsItem, check_update_role_data_attributes_playbooks_permissions_item, ) +from ..models.update_role_data_attributes_private_agent_permissions_item import ( + UpdateRoleDataAttributesPrivateAgentPermissionsItem, + check_update_role_data_attributes_private_agent_permissions_item, +) from ..models.update_role_data_attributes_private_incidents_permissions_item import ( UpdateRoleDataAttributesPrivateIncidentsPermissionsItem, check_update_role_data_attributes_private_incidents_permissions_item, @@ -111,6 +117,10 @@ UpdateRoleDataAttributesSlasPermissionsItem, check_update_role_data_attributes_slas_permissions_item, ) +from ..models.update_role_data_attributes_status_page_updates_permissions_type_0_item import ( + UpdateRoleDataAttributesStatusPageUpdatesPermissionsType0Item, + check_update_role_data_attributes_status_page_updates_permissions_type_0_item, +) from ..models.update_role_data_attributes_status_pages_permissions_item import ( UpdateRoleDataAttributesStatusPagesPermissionsItem, check_update_role_data_attributes_status_pages_permissions_item, @@ -136,88 +146,97 @@ class UpdateRoleDataAttributes: """ Attributes: - 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 + slug (None | str | Unset): 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): 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): + status_page_updates_permissions (list[UpdateRoleDataAttributesStatusPageUpdatesPermissionsType0Item] | None | + 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): + private_agent_permissions (list[UpdateRoleDataAttributesPrivateAgentPermissionsItem] | Unset): Private Agent + management permissions: create issues enrollment tokens, read views agent inventory and details, and delete + revokes agent credentials. Create and delete can be used independently through the API; browser inventory + requires read. + slas_permissions (list[UpdateRoleDataAttributesSlasPermissionsItem] | Unset): + paging_permissions (list[UpdateRoleDataAttributesPagingPermissionsItem] | Unset): + incident_communication_permissions (list[UpdateRoleDataAttributesIncidentCommunicationPermissionsItem] | Unset): + communication_permissions (list[UpdateRoleDataAttributesCommunicationPermissionsItem] | 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] = ( + slug: None | str | Unset = UNSET + 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 + status_page_updates_permissions: ( + list[UpdateRoleDataAttributesStatusPageUpdatesPermissionsType0Item] | None | 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 + private_agent_permissions: list[UpdateRoleDataAttributesPrivateAgentPermissionsItem] | Unset = UNSET + slas_permissions: list[UpdateRoleDataAttributesSlasPermissionsItem] | Unset = UNSET + paging_permissions: list[UpdateRoleDataAttributesPagingPermissionsItem] | Unset = UNSET + incident_communication_permissions: list[UpdateRoleDataAttributesIncidentCommunicationPermissionsItem] | Unset = ( UNSET ) - communication_permissions: Unset | list[UpdateRoleDataAttributesCommunicationPermissionsItem] = UNSET + communication_permissions: list[UpdateRoleDataAttributesCommunicationPermissionsItem] | Unset = UNSET def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -225,7 +244,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - incident_permission_set_id: None | Unset | str + incident_permission_set_id: None | str | Unset if isinstance(self.incident_permission_set_id, Unset): incident_permission_set_id = UNSET else: @@ -235,217 +254,236 @@ def to_dict(self) -> dict[str, Any]: is_editable = self.is_editable - api_keys_permissions: Unset | list[str] = UNSET + api_keys_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + audits_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + billing_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + environments_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + form_fields_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + functionalities_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + groups_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + incident_causes_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + incident_feedbacks_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + incident_roles_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + incident_types_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + incidents_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + integrations_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + invitations_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + playbooks_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + private_incidents_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + retrospective_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + roles_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + secrets_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + services_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + severities_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + status_pages_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + status_page_updates_permissions: list[str] | None | Unset + if isinstance(self.status_page_updates_permissions, Unset): + status_page_updates_permissions = UNSET + elif isinstance(self.status_page_updates_permissions, list): + status_page_updates_permissions = [] + for status_page_updates_permissions_type_0_item_data in self.status_page_updates_permissions: + status_page_updates_permissions_type_0_item: str = status_page_updates_permissions_type_0_item_data + status_page_updates_permissions.append(status_page_updates_permissions_type_0_item) + + else: + status_page_updates_permissions = self.status_page_updates_permissions + + webhooks_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + workflows_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + catalogs_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + sub_statuses_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + edge_connector_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + private_agent_permissions: list[str] | Unset = UNSET + if not isinstance(self.private_agent_permissions, Unset): + private_agent_permissions = [] + for private_agent_permissions_item_data in self.private_agent_permissions: + private_agent_permissions_item: str = private_agent_permissions_item_data + private_agent_permissions.append(private_agent_permissions_item) + + slas_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + paging_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + incident_communication_permissions: list[str] | Unset = 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: Unset | list[str] = UNSET + communication_permissions: list[str] | Unset = UNSET if not isinstance(self.communication_permissions, Unset): communication_permissions = [] for communication_permissions_item_data in self.communication_permissions: @@ -509,6 +547,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["severities_permissions"] = severities_permissions if status_pages_permissions is not UNSET: field_dict["status_pages_permissions"] = status_pages_permissions + if status_page_updates_permissions is not UNSET: + field_dict["status_page_updates_permissions"] = status_page_updates_permissions if webhooks_permissions is not UNSET: field_dict["webhooks_permissions"] = webhooks_permissions if workflows_permissions is not UNSET: @@ -519,6 +559,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["sub_statuses_permissions"] = sub_statuses_permissions if edge_connector_permissions is not UNSET: field_dict["edge_connector_permissions"] = edge_connector_permissions + if private_agent_permissions is not UNSET: + field_dict["private_agent_permissions"] = private_agent_permissions if slas_permissions is not UNSET: field_dict["slas_permissions"] = slas_permissions if paging_permissions is not UNSET: @@ -534,23 +576,23 @@ 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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_incident_permission_set_id(data: object) -> None | Unset | str: + def _parse_incident_permission_set_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) incident_permission_set_id = _parse_incident_permission_set_id(d.pop("incident_permission_set_id", UNSET)) @@ -558,284 +600,395 @@ def _parse_incident_permission_set_id(data: object) -> None | Unset | str: is_editable = d.pop("is_editable", UNSET) - api_keys_permissions = [] _api_keys_permissions = d.pop("api_keys_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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 + ) - audits_permissions.append(audits_permissions_item) + audits_permissions.append(audits_permissions_item) - billing_permissions = [] _billing_permissions = d.pop("billing_permissions", UNSET) - 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: 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 + ) - billing_permissions.append(billing_permissions_item) + billing_permissions.append(billing_permissions_item) - environments_permissions = [] _environments_permissions = d.pop("environments_permissions", UNSET) - 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: 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 + ) - environments_permissions.append(environments_permissions_item) + environments_permissions.append(environments_permissions_item) - form_fields_permissions = [] _form_fields_permissions = d.pop("form_fields_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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 + ) - functionalities_permissions.append(functionalities_permissions_item) + functionalities_permissions.append(functionalities_permissions_item) - groups_permissions = [] _groups_permissions = d.pop("groups_permissions", UNSET) - 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: 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 + ) - groups_permissions.append(groups_permissions_item) + groups_permissions.append(groups_permissions_item) - incident_causes_permissions = [] _incident_causes_permissions = d.pop("incident_causes_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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 + ) + ) - 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) - 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: 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 + ) - 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) - 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: 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 + ) - 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) - 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: 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 + ) - incidents_permissions.append(incidents_permissions_item) + incidents_permissions.append(incidents_permissions_item) - integrations_permissions = [] _integrations_permissions = d.pop("integrations_permissions", UNSET) - 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: 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 + ) - integrations_permissions.append(integrations_permissions_item) + integrations_permissions.append(integrations_permissions_item) - invitations_permissions = [] _invitations_permissions = d.pop("invitations_permissions", UNSET) - 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: 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 + ) - invitations_permissions.append(invitations_permissions_item) + invitations_permissions.append(invitations_permissions_item) - playbooks_permissions = [] _playbooks_permissions = d.pop("playbooks_permissions", UNSET) - 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: 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 + ) - playbooks_permissions.append(playbooks_permissions_item) + playbooks_permissions.append(playbooks_permissions_item) - private_incidents_permissions = [] _private_incidents_permissions = d.pop("private_incidents_permissions", UNSET) - 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: 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 + ) + ) - 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) - 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: 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 + ) - retrospective_permissions.append(retrospective_permissions_item) + retrospective_permissions.append(retrospective_permissions_item) - roles_permissions = [] _roles_permissions = d.pop("roles_permissions", UNSET) - 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: 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 + ) - roles_permissions.append(roles_permissions_item) + roles_permissions.append(roles_permissions_item) - secrets_permissions = [] _secrets_permissions = d.pop("secrets_permissions", UNSET) - 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: 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 + ) - secrets_permissions.append(secrets_permissions_item) + secrets_permissions.append(secrets_permissions_item) - services_permissions = [] _services_permissions = d.pop("services_permissions", UNSET) - 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: 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 + ) - services_permissions.append(services_permissions_item) + services_permissions.append(services_permissions_item) - severities_permissions = [] _severities_permissions = d.pop("severities_permissions", UNSET) - 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: 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 + ) - severities_permissions.append(severities_permissions_item) + severities_permissions.append(severities_permissions_item) - status_pages_permissions = [] _status_pages_permissions = d.pop("status_pages_permissions", UNSET) - 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: 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 + ) - status_pages_permissions.append(status_pages_permissions_item) + status_pages_permissions.append(status_pages_permissions_item) + + def _parse_status_page_updates_permissions( + data: object, + ) -> list[UpdateRoleDataAttributesStatusPageUpdatesPermissionsType0Item] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + status_page_updates_permissions_type_0 = [] + _status_page_updates_permissions_type_0 = data + for status_page_updates_permissions_type_0_item_data in _status_page_updates_permissions_type_0: + status_page_updates_permissions_type_0_item = ( + check_update_role_data_attributes_status_page_updates_permissions_type_0_item( + status_page_updates_permissions_type_0_item_data + ) + ) + + status_page_updates_permissions_type_0.append(status_page_updates_permissions_type_0_item) + + return status_page_updates_permissions_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[UpdateRoleDataAttributesStatusPageUpdatesPermissionsType0Item] | None | Unset, data) + + status_page_updates_permissions = _parse_status_page_updates_permissions( + d.pop("status_page_updates_permissions", UNSET) + ) - webhooks_permissions = [] _webhooks_permissions = d.pop("webhooks_permissions", UNSET) - 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: 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 + ) - webhooks_permissions.append(webhooks_permissions_item) + webhooks_permissions.append(webhooks_permissions_item) - workflows_permissions = [] _workflows_permissions = d.pop("workflows_permissions", UNSET) - 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: 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 + ) - workflows_permissions.append(workflows_permissions_item) + workflows_permissions.append(workflows_permissions_item) - catalogs_permissions = [] _catalogs_permissions = d.pop("catalogs_permissions", UNSET) - 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: 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 + ) - catalogs_permissions.append(catalogs_permissions_item) + catalogs_permissions.append(catalogs_permissions_item) - sub_statuses_permissions = [] _sub_statuses_permissions = d.pop("sub_statuses_permissions", UNSET) - 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: 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 + ) - 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) - 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: 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 + ) - edge_connector_permissions.append(edge_connector_permissions_item) + edge_connector_permissions.append(edge_connector_permissions_item) + + _private_agent_permissions = d.pop("private_agent_permissions", UNSET) + private_agent_permissions: list[UpdateRoleDataAttributesPrivateAgentPermissionsItem] | Unset = UNSET + if _private_agent_permissions is not UNSET: + private_agent_permissions = [] + for private_agent_permissions_item_data in _private_agent_permissions: + private_agent_permissions_item = check_update_role_data_attributes_private_agent_permissions_item( + private_agent_permissions_item_data + ) + + private_agent_permissions.append(private_agent_permissions_item) - slas_permissions = [] _slas_permissions = d.pop("slas_permissions", UNSET) - 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: 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 + ) - slas_permissions.append(slas_permissions_item) + slas_permissions.append(slas_permissions_item) - paging_permissions = [] _paging_permissions = d.pop("paging_permissions", UNSET) - 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: 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 + ) - paging_permissions.append(paging_permissions_item) + paging_permissions.append(paging_permissions_item) - incident_communication_permissions = [] _incident_communication_permissions = d.pop("incident_communication_permissions", UNSET) - 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: ( + 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 + ) ) - ) - 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) - 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: 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 + ) - communication_permissions.append(communication_permissions_item) + communication_permissions.append(communication_permissions_item) update_role_data_attributes = cls( slug=slug, @@ -865,11 +1018,13 @@ def _parse_incident_permission_set_id(data: object) -> None | Unset | str: services_permissions=services_permissions, severities_permissions=severities_permissions, status_pages_permissions=status_pages_permissions, + status_page_updates_permissions=status_page_updates_permissions, webhooks_permissions=webhooks_permissions, workflows_permissions=workflows_permissions, catalogs_permissions=catalogs_permissions, sub_statuses_permissions=sub_statuses_permissions, edge_connector_permissions=edge_connector_permissions, + private_agent_permissions=private_agent_permissions, slas_permissions=slas_permissions, paging_permissions=paging_permissions, incident_communication_permissions=incident_communication_permissions, diff --git a/rootly_sdk/models/update_role_data_attributes_api_keys_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_api_keys_permissions_item.py index 1d1fe713..17e4c1e9 100644 --- a/rootly_sdk/models/update_role_data_attributes_api_keys_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_api_keys_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesApiKeysPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_update_role_data_attributes_api_keys_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_API_KEYS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesApiKeysPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_API_KEYS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_audits_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_audits_permissions_item.py index 88c491b4..b3dc6ebf 100644 --- a/rootly_sdk/models/update_role_data_attributes_audits_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_audits_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesAuditsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_update_role_data_attributes_audits_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_AUDITS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesAuditsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_AUDITS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_billing_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_billing_permissions_item.py index f2d2db55..46880bf2 100644 --- a/rootly_sdk/models/update_role_data_attributes_billing_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_billing_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesBillingPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_update_role_data_attributes_billing_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_BILLING_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesBillingPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_BILLING_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_catalogs_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_catalogs_permissions_item.py index b5e0a260..75f2a88e 100644 --- a/rootly_sdk/models/update_role_data_attributes_catalogs_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_catalogs_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesCatalogsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_update_role_data_attributes_catalogs_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_CATALOGS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesCatalogsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_CATALOGS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_communication_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_communication_permissions_item.py index ae3bc0a4..f2c95888 100644 --- a/rootly_sdk/models/update_role_data_attributes_communication_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_communication_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesCommunicationPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_role_data_attributes_communication_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_COMMUNICATION_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesCommunicationPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_COMMUNICATION_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_edge_connector_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_edge_connector_permissions_item.py index 2b251f19..9f45108f 100644 --- a/rootly_sdk/models/update_role_data_attributes_edge_connector_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_edge_connector_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesEdgeConnectorPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_role_data_attributes_edge_connector_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_EDGE_CONNECTOR_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesEdgeConnectorPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_EDGE_CONNECTOR_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_environments_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_environments_permissions_item.py index 6887c31f..ed2110a5 100644 --- a/rootly_sdk/models/update_role_data_attributes_environments_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_environments_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesEnvironmentsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_role_data_attributes_environments_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_ENVIRONMENTS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesEnvironmentsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_ENVIRONMENTS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_form_fields_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_form_fields_permissions_item.py index 0a6d16f2..b28452b4 100644 --- a/rootly_sdk/models/update_role_data_attributes_form_fields_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_form_fields_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesFormFieldsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_role_data_attributes_form_fields_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_FORM_FIELDS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesFormFieldsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_FORM_FIELDS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_functionalities_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_functionalities_permissions_item.py index 461447a2..5c9bb186 100644 --- a/rootly_sdk/models/update_role_data_attributes_functionalities_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_functionalities_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesFunctionalitiesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_role_data_attributes_functionalities_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_FUNCTIONALITIES_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesFunctionalitiesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_FUNCTIONALITIES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_groups_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_groups_permissions_item.py index 2c0c4475..9aae1e25 100644 --- a/rootly_sdk/models/update_role_data_attributes_groups_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_groups_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesGroupsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_update_role_data_attributes_groups_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_GROUPS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesGroupsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_GROUPS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_incident_causes_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_incident_causes_permissions_item.py index 458baaae..418d8fd2 100644 --- a/rootly_sdk/models/update_role_data_attributes_incident_causes_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_incident_causes_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesIncidentCausesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_role_data_attributes_incident_causes_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_INCIDENT_CAUSES_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesIncidentCausesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_INCIDENT_CAUSES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_incident_communication_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_incident_communication_permissions_item.py index 2b853a53..61685161 100644 --- a/rootly_sdk/models/update_role_data_attributes_incident_communication_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_incident_communication_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesIncidentCommunicationPermissionsItem = Literal["create", "delete", "read", "send", "update"] @@ -19,7 +19,7 @@ def check_update_role_data_attributes_incident_communication_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_INCIDENT_COMMUNICATION_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesIncidentCommunicationPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_INCIDENT_COMMUNICATION_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_incident_feedbacks_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_incident_feedbacks_permissions_item.py index 869ac078..221cec3b 100644 --- a/rootly_sdk/models/update_role_data_attributes_incident_feedbacks_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_incident_feedbacks_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesIncidentFeedbacksPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_role_data_attributes_incident_feedbacks_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_INCIDENT_FEEDBACKS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesIncidentFeedbacksPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_INCIDENT_FEEDBACKS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_incident_roles_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_incident_roles_permissions_item.py index af4e94f8..2de0ce8b 100644 --- a/rootly_sdk/models/update_role_data_attributes_incident_roles_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_incident_roles_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesIncidentRolesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_role_data_attributes_incident_roles_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_INCIDENT_ROLES_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesIncidentRolesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_INCIDENT_ROLES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_incident_types_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_incident_types_permissions_item.py index 466d617e..1c845765 100644 --- a/rootly_sdk/models/update_role_data_attributes_incident_types_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_incident_types_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesIncidentTypesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_role_data_attributes_incident_types_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_INCIDENT_TYPES_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesIncidentTypesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_INCIDENT_TYPES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_incidents_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_incidents_permissions_item.py index 6b79060c..7e1cc11e 100644 --- a/rootly_sdk/models/update_role_data_attributes_incidents_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_incidents_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesIncidentsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_update_role_data_attributes_incidents_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_INCIDENTS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesIncidentsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_INCIDENTS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_integrations_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_integrations_permissions_item.py index 01930502..45def6bf 100644 --- a/rootly_sdk/models/update_role_data_attributes_integrations_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_integrations_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesIntegrationsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_role_data_attributes_integrations_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_INTEGRATIONS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesIntegrationsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_INTEGRATIONS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_invitations_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_invitations_permissions_item.py index 31291ad3..c30bfb2d 100644 --- a/rootly_sdk/models/update_role_data_attributes_invitations_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_invitations_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesInvitationsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_role_data_attributes_invitations_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_INVITATIONS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesInvitationsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_INVITATIONS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_paging_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_paging_permissions_item.py index d60e2a5b..adff68c5 100644 --- a/rootly_sdk/models/update_role_data_attributes_paging_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_paging_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesPagingPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_update_role_data_attributes_paging_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_PAGING_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesPagingPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_PAGING_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_playbooks_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_playbooks_permissions_item.py index da0546d1..cd050646 100644 --- a/rootly_sdk/models/update_role_data_attributes_playbooks_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_playbooks_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesPlaybooksPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_update_role_data_attributes_playbooks_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_PLAYBOOKS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesPlaybooksPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_PLAYBOOKS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_private_agent_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_private_agent_permissions_item.py new file mode 100644 index 00000000..d6f082c2 --- /dev/null +++ b/rootly_sdk/models/update_role_data_attributes_private_agent_permissions_item.py @@ -0,0 +1,24 @@ +from typing import Literal + +UpdateRoleDataAttributesPrivateAgentPermissionsItem = Literal["create", "delete", "read", "update"] + +UPDATE_ROLE_DATA_ATTRIBUTES_PRIVATE_AGENT_PERMISSIONS_ITEM_VALUES: set[ + UpdateRoleDataAttributesPrivateAgentPermissionsItem +] = { + "create", + "delete", + "read", + "update", +} + + +def check_update_role_data_attributes_private_agent_permissions_item( + value: str | None, +) -> UpdateRoleDataAttributesPrivateAgentPermissionsItem | None: + if value is None: + return None + if value in UPDATE_ROLE_DATA_ATTRIBUTES_PRIVATE_AGENT_PERMISSIONS_ITEM_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_PRIVATE_AGENT_PERMISSIONS_ITEM_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_role_data_attributes_private_incidents_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_private_incidents_permissions_item.py index ad83f107..11d8fc92 100644 --- a/rootly_sdk/models/update_role_data_attributes_private_incidents_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_private_incidents_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesPrivateIncidentsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_role_data_attributes_private_incidents_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_PRIVATE_INCIDENTS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesPrivateIncidentsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_PRIVATE_INCIDENTS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_retrospective_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_retrospective_permissions_item.py index 8e77ad34..f08b0536 100644 --- a/rootly_sdk/models/update_role_data_attributes_retrospective_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_retrospective_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesRetrospectivePermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_role_data_attributes_retrospective_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_RETROSPECTIVE_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesRetrospectivePermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_RETROSPECTIVE_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_roles_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_roles_permissions_item.py index f3f03bbb..7e7ea5f7 100644 --- a/rootly_sdk/models/update_role_data_attributes_roles_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_roles_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesRolesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_update_role_data_attributes_roles_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_ROLES_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesRolesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_ROLES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_secrets_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_secrets_permissions_item.py index fe5ceb1c..52feba45 100644 --- a/rootly_sdk/models/update_role_data_attributes_secrets_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_secrets_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesSecretsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_update_role_data_attributes_secrets_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_SECRETS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesSecretsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_SECRETS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_services_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_services_permissions_item.py index f9f8625a..3374fce8 100644 --- a/rootly_sdk/models/update_role_data_attributes_services_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_services_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesServicesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_update_role_data_attributes_services_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_SERVICES_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesServicesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_SERVICES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_severities_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_severities_permissions_item.py index 5a103876..16da5606 100644 --- a/rootly_sdk/models/update_role_data_attributes_severities_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_severities_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesSeveritiesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_role_data_attributes_severities_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_SEVERITIES_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesSeveritiesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_SEVERITIES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_slas_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_slas_permissions_item.py index c6505182..2fb93ba8 100644 --- a/rootly_sdk/models/update_role_data_attributes_slas_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_slas_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesSlasPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_update_role_data_attributes_slas_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_SLAS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesSlasPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_SLAS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_status_page_updates_permissions_type_0_item.py b/rootly_sdk/models/update_role_data_attributes_status_page_updates_permissions_type_0_item.py new file mode 100644 index 00000000..b76dad14 --- /dev/null +++ b/rootly_sdk/models/update_role_data_attributes_status_page_updates_permissions_type_0_item.py @@ -0,0 +1,24 @@ +from typing import Literal + +UpdateRoleDataAttributesStatusPageUpdatesPermissionsType0Item = Literal["create", "delete", "read", "update"] + +UPDATE_ROLE_DATA_ATTRIBUTES_STATUS_PAGE_UPDATES_PERMISSIONS_TYPE_0_ITEM_VALUES: set[ + UpdateRoleDataAttributesStatusPageUpdatesPermissionsType0Item +] = { + "create", + "delete", + "read", + "update", +} + + +def check_update_role_data_attributes_status_page_updates_permissions_type_0_item( + value: str | None, +) -> UpdateRoleDataAttributesStatusPageUpdatesPermissionsType0Item | None: + if value is None: + return None + if value in UPDATE_ROLE_DATA_ATTRIBUTES_STATUS_PAGE_UPDATES_PERMISSIONS_TYPE_0_ITEM_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_STATUS_PAGE_UPDATES_PERMISSIONS_TYPE_0_ITEM_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_role_data_attributes_status_pages_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_status_pages_permissions_item.py index 8c43c186..efff50e8 100644 --- a/rootly_sdk/models/update_role_data_attributes_status_pages_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_status_pages_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesStatusPagesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_role_data_attributes_status_pages_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_STATUS_PAGES_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesStatusPagesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_STATUS_PAGES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_sub_statuses_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_sub_statuses_permissions_item.py index f1be3424..d6ab8e4e 100644 --- a/rootly_sdk/models/update_role_data_attributes_sub_statuses_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_sub_statuses_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesSubStatusesPermissionsItem = Literal["create", "delete", "read", "update"] @@ -18,7 +18,7 @@ def check_update_role_data_attributes_sub_statuses_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_SUB_STATUSES_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesSubStatusesPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_SUB_STATUSES_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_webhooks_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_webhooks_permissions_item.py index 6947e58d..6acea871 100644 --- a/rootly_sdk/models/update_role_data_attributes_webhooks_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_webhooks_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesWebhooksPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_update_role_data_attributes_webhooks_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_WEBHOOKS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesWebhooksPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_WEBHOOKS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_attributes_workflows_permissions_item.py b/rootly_sdk/models/update_role_data_attributes_workflows_permissions_item.py index d722a81b..42c3cd48 100644 --- a/rootly_sdk/models/update_role_data_attributes_workflows_permissions_item.py +++ b/rootly_sdk/models/update_role_data_attributes_workflows_permissions_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataAttributesWorkflowsPermissionsItem = Literal["create", "delete", "read", "update"] @@ -16,7 +16,7 @@ def check_update_role_data_attributes_workflows_permissions_item( if value is None: return None if value in UPDATE_ROLE_DATA_ATTRIBUTES_WORKFLOWS_PERMISSIONS_ITEM_VALUES: - return cast(UpdateRoleDataAttributesWorkflowsPermissionsItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_ATTRIBUTES_WORKFLOWS_PERMISSIONS_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_role_data_type.py b/rootly_sdk/models/update_role_data_type.py index c78fa4c3..44715b62 100644 --- a/rootly_sdk/models/update_role_data_type.py +++ b/rootly_sdk/models/update_role_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateRoleDataType = Literal["roles"] @@ -11,5 +11,5 @@ def check_update_role_data_type(value: str | None) -> UpdateRoleDataType | None: if value is None: return None if value in UPDATE_ROLE_DATA_TYPE_VALUES: - return cast(UpdateRoleDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_ROLE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_schedule.py b/rootly_sdk/models/update_schedule.py index 102bd7ae..2d11462b 100644 --- a/rootly_sdk/models/update_schedule.py +++ b/rootly_sdk/models/update_schedule.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_schedule_data import UpdateScheduleData @@ -18,14 +19,13 @@ class UpdateSchedule: data (UpdateScheduleData): """ - data: "UpdateScheduleData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateScheduleData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_schedule.additional_properties = d return update_schedule - - @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_schedule_data.py b/rootly_sdk/models/update_schedule_data.py index 58501025..39ae2286 100644 --- a/rootly_sdk/models/update_schedule_data.py +++ b/rootly_sdk/models/update_schedule_data.py @@ -1,10 +1,12 @@ +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_schedule_data_type import UpdateScheduleDataType, check_update_schedule_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_schedule_data_attributes import UpdateScheduleDataAttributes @@ -19,25 +21,31 @@ class UpdateScheduleData: Attributes: type_ (UpdateScheduleDataType): attributes (UpdateScheduleDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateScheduleDataType - attributes: "UpdateScheduleDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateScheduleDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateScheduleDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_schedule_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_schedule_data.additional_properties = d return update_schedule_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_schedule_data_attributes.py b/rootly_sdk/models/update_schedule_data_attributes.py index 894682df..e4feafe0 100644 --- a/rootly_sdk/models/update_schedule_data_attributes.py +++ b/rootly_sdk/models/update_schedule_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -10,6 +12,9 @@ from ..types import UNSET, Unset if TYPE_CHECKING: + from ..models.update_schedule_data_attributes_business_hours_type_0 import ( + UpdateScheduleDataAttributesBusinessHoursType0, + ) from ..models.update_schedule_data_attributes_slack_channel_type_0 import ( UpdateScheduleDataAttributesSlackChannelType0, ) @@ -23,70 +28,85 @@ class UpdateScheduleDataAttributes: """ Attributes: - 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 + 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 + time_zone (None | str | Unset): IANA time zone the schedule's rotations are rendered in. Only writable for + organizations configured with one timezone per schedule; otherwise it is derived from the rotations. + 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 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[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. + 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. Requires `slack_channel` to be set; otherwise this value is forced to false on save. - shift_report_enabled (Union[None, Unset, bool]): Whether the weekly shift summary report is enabled. Requires + shift_report_enabled (bool | None | Unset): 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 (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 + 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 + business_hours (None | Unset | UpdateScheduleDataAttributesBusinessHoursType0): Controls shadow paging on the + schedule. Null disables shadow paging. start_time and end_time are HH:MM 24-hour format strings. """ - 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 + name: str | Unset = UNSET + description: None | str | Unset = UNSET + all_time_coverage: bool | None | Unset = UNSET + time_zone: None | str | 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 + business_hours: None | Unset | UpdateScheduleDataAttributesBusinessHoursType0 = UNSET def to_dict(self) -> dict[str, Any]: + from ..models.update_schedule_data_attributes_business_hours_type_0 import ( + UpdateScheduleDataAttributesBusinessHoursType0, + ) from ..models.update_schedule_data_attributes_slack_channel_type_0 import ( UpdateScheduleDataAttributesSlackChannelType0, ) name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - all_time_coverage: None | Unset | bool + all_time_coverage: bool | None | Unset if isinstance(self.all_time_coverage, Unset): all_time_coverage = UNSET else: all_time_coverage = self.all_time_coverage - slack_user_group: Unset | dict[str, Any] = UNSET + time_zone: None | str | Unset + if isinstance(self.time_zone, Unset): + time_zone = UNSET + else: + time_zone = self.time_zone + + slack_user_group: dict[str, Any] | Unset = UNSET if not isinstance(self.slack_user_group, Unset): slack_user_group = self.slack_user_group.to_dict() - slack_channel: None | Unset | dict[str, Any] + slack_channel: dict[str, Any] | None | Unset if isinstance(self.slack_channel, Unset): slack_channel = UNSET elif isinstance(self.slack_channel, UpdateScheduleDataAttributesSlackChannelType0): @@ -94,62 +114,70 @@ def to_dict(self) -> dict[str, Any]: else: slack_channel = self.slack_channel - owner_group_ids: Unset | list[str] = UNSET + owner_group_ids: list[str] | Unset = UNSET if not isinstance(self.owner_group_ids, Unset): owner_group_ids = self.owner_group_ids - owner_user_id: None | Unset | int + owner_user_id: int | None | Unset if isinstance(self.owner_user_id, Unset): owner_user_id = UNSET else: owner_user_id = self.owner_user_id - sync_linear_enabled: None | Unset | bool + sync_linear_enabled: bool | None | Unset if isinstance(self.sync_linear_enabled, Unset): sync_linear_enabled = UNSET else: sync_linear_enabled = self.sync_linear_enabled - include_shadows_in_slack_notifications: None | Unset | bool + include_shadows_in_slack_notifications: bool | None | Unset 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: None | Unset | bool + shift_start_notifications_enabled: bool | None | Unset 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: None | Unset | bool + shift_update_notifications_enabled: bool | None | Unset 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: None | Unset | bool + shift_report_enabled: bool | None | Unset if isinstance(self.shift_report_enabled, Unset): shift_report_enabled = UNSET else: shift_report_enabled = self.shift_report_enabled - shift_report_day_of_week: Unset | str = UNSET + shift_report_day_of_week: str | Unset = 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 | Unset | str + shift_report_time_of_day: None | str | Unset 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 | Unset | str + shift_report_time_zone: None | str | Unset if isinstance(self.shift_report_time_zone, Unset): shift_report_time_zone = UNSET else: shift_report_time_zone = self.shift_report_time_zone + business_hours: dict[str, Any] | None | Unset + if isinstance(self.business_hours, Unset): + business_hours = UNSET + elif isinstance(self.business_hours, UpdateScheduleDataAttributesBusinessHoursType0): + business_hours = self.business_hours.to_dict() + else: + business_hours = self.business_hours + field_dict: dict[str, Any] = {} field_dict.update({}) @@ -159,6 +187,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["description"] = description if all_time_coverage is not UNSET: field_dict["all_time_coverage"] = all_time_coverage + if time_zone is not UNSET: + field_dict["time_zone"] = time_zone if slack_user_group is not UNSET: field_dict["slack_user_group"] = slack_user_group if slack_channel is not UNSET: @@ -183,11 +213,16 @@ def to_dict(self) -> dict[str, Any]: field_dict["shift_report_time_of_day"] = shift_report_time_of_day if shift_report_time_zone is not UNSET: field_dict["shift_report_time_zone"] = shift_report_time_zone + if business_hours is not UNSET: + field_dict["business_hours"] = business_hours return field_dict @classmethod def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_schedule_data_attributes_business_hours_type_0 import ( + UpdateScheduleDataAttributesBusinessHoursType0, + ) from ..models.update_schedule_data_attributes_slack_channel_type_0 import ( UpdateScheduleDataAttributesSlackChannelType0, ) @@ -196,32 +231,41 @@ 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: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_all_time_coverage(data: object) -> None | Unset | bool: + def _parse_all_time_coverage(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) all_time_coverage = _parse_all_time_coverage(d.pop("all_time_coverage", UNSET)) + def _parse_time_zone(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) + _slack_user_group = d.pop("slack_user_group", UNSET) - slack_user_group: Unset | UpdateScheduleDataAttributesSlackUserGroup + slack_user_group: UpdateScheduleDataAttributesSlackUserGroup | Unset 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) -> Union["UpdateScheduleDataAttributesSlackChannelType0", None, Unset]: + def _parse_slack_channel(data: object) -> None | Unset | UpdateScheduleDataAttributesSlackChannelType0: if data is None: return data if isinstance(data, Unset): @@ -232,76 +276,76 @@ def _parse_slack_channel(data: object) -> Union["UpdateScheduleDataAttributesSla slack_channel_type_0 = UpdateScheduleDataAttributesSlackChannelType0.from_dict(data) return slack_channel_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["UpdateScheduleDataAttributesSlackChannelType0", None, Unset], data) + return cast(None | Unset | UpdateScheduleDataAttributesSlackChannelType0, 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) -> None | Unset | int: + def _parse_owner_user_id(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) owner_user_id = _parse_owner_user_id(d.pop("owner_user_id", UNSET)) - def _parse_sync_linear_enabled(data: object) -> None | Unset | bool: + def _parse_sync_linear_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) sync_linear_enabled = _parse_sync_linear_enabled(d.pop("sync_linear_enabled", UNSET)) - def _parse_include_shadows_in_slack_notifications(data: object) -> None | Unset | bool: + def _parse_include_shadows_in_slack_notifications(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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) -> None | Unset | bool: + def _parse_shift_start_notifications_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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) -> None | Unset | bool: + def _parse_shift_update_notifications_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) shift_update_notifications_enabled = _parse_shift_update_notifications_enabled( d.pop("shift_update_notifications_enabled", UNSET) ) - def _parse_shift_report_enabled(data: object) -> None | Unset | bool: + def _parse_shift_report_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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: Unset | UpdateScheduleDataAttributesShiftReportDayOfWeek + shift_report_day_of_week: UpdateScheduleDataAttributesShiftReportDayOfWeek | Unset if isinstance(_shift_report_day_of_week, Unset): shift_report_day_of_week = UNSET else: @@ -309,28 +353,46 @@ def _parse_shift_report_enabled(data: object) -> None | Unset | bool: _shift_report_day_of_week ) - def _parse_shift_report_time_of_day(data: object) -> None | Unset | str: + def _parse_shift_report_time_of_day(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_shift_report_time_zone(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) shift_report_time_zone = _parse_shift_report_time_zone(d.pop("shift_report_time_zone", UNSET)) + def _parse_business_hours(data: object) -> None | Unset | UpdateScheduleDataAttributesBusinessHoursType0: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, dict): + raise TypeError() + business_hours_type_0 = UpdateScheduleDataAttributesBusinessHoursType0.from_dict(data) + + return business_hours_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(None | Unset | UpdateScheduleDataAttributesBusinessHoursType0, data) + + business_hours = _parse_business_hours(d.pop("business_hours", UNSET)) + update_schedule_data_attributes = cls( name=name, description=description, all_time_coverage=all_time_coverage, + time_zone=time_zone, slack_user_group=slack_user_group, slack_channel=slack_channel, owner_group_ids=owner_group_ids, @@ -343,6 +405,7 @@ def _parse_shift_report_time_zone(data: object) -> None | Unset | str: shift_report_day_of_week=shift_report_day_of_week, shift_report_time_of_day=shift_report_time_of_day, shift_report_time_zone=shift_report_time_zone, + business_hours=business_hours, ) return update_schedule_data_attributes diff --git a/rootly_sdk/models/update_schedule_data_attributes_business_hours_type_0.py b/rootly_sdk/models/update_schedule_data_attributes_business_hours_type_0.py new file mode 100644 index 00000000..172d9b0f --- /dev/null +++ b/rootly_sdk/models/update_schedule_data_attributes_business_hours_type_0.py @@ -0,0 +1,60 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="UpdateScheduleDataAttributesBusinessHoursType0") + + +@_attrs_define +class UpdateScheduleDataAttributesBusinessHoursType0: + """Controls shadow paging on the schedule. Null disables shadow paging. start_time and end_time are HH:MM 24-hour + format strings. + + Attributes: + start_time (str): + end_time (str): + include_weekends (bool): + """ + + start_time: str + end_time: str + include_weekends: bool + + def to_dict(self) -> dict[str, Any]: + start_time = self.start_time + + end_time = self.end_time + + include_weekends = self.include_weekends + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "start_time": start_time, + "end_time": end_time, + "include_weekends": include_weekends, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + start_time = d.pop("start_time") + + end_time = d.pop("end_time") + + include_weekends = d.pop("include_weekends") + + update_schedule_data_attributes_business_hours_type_0 = cls( + start_time=start_time, + end_time=end_time, + include_weekends=include_weekends, + ) + + return update_schedule_data_attributes_business_hours_type_0 diff --git a/rootly_sdk/models/update_schedule_data_attributes_shift_report_day_of_week.py b/rootly_sdk/models/update_schedule_data_attributes_shift_report_day_of_week.py index 1444d350..14d4f38d 100644 --- a/rootly_sdk/models/update_schedule_data_attributes_shift_report_day_of_week.py +++ b/rootly_sdk/models/update_schedule_data_attributes_shift_report_day_of_week.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateScheduleDataAttributesShiftReportDayOfWeek = Literal[ "friday", "monday", "saturday", "sunday", "thursday", "tuesday", "wednesday" @@ -23,7 +23,7 @@ def check_update_schedule_data_attributes_shift_report_day_of_week( if value is None: return None if value in UPDATE_SCHEDULE_DATA_ATTRIBUTES_SHIFT_REPORT_DAY_OF_WEEK_VALUES: - return cast(UpdateScheduleDataAttributesShiftReportDayOfWeek, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SCHEDULE_DATA_ATTRIBUTES_SHIFT_REPORT_DAY_OF_WEEK_VALUES!r}" ) 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 46ca63e0..0dd53bb7 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,8 +1,9 @@ +from __future__ import annotations + 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 @@ -13,13 +14,12 @@ class UpdateScheduleDataAttributesSlackChannelType0: """ Attributes: - id (Union[Unset, str]): Slack channel ID - name (Union[Unset, str]): Slack channel name + id (str | Unset): Slack channel ID + name (str | Unset): Slack channel name """ - id: Unset | str = UNSET - name: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + id: str | Unset = UNSET + name: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: id = self.id @@ -27,7 +27,7 @@ def to_dict(self) -> dict[str, Any]: 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 @@ -48,21 +48,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - update_schedule_data_attributes_slack_channel_type_0.additional_properties = d return update_schedule_data_attributes_slack_channel_type_0 - - @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_schedule_data_attributes_slack_user_group.py b/rootly_sdk/models/update_schedule_data_attributes_slack_user_group.py index 23c6060f..42deaec9 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,8 +1,9 @@ +from __future__ import annotations + 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 @@ -13,13 +14,12 @@ class UpdateScheduleDataAttributesSlackUserGroup: """ Attributes: - id (Union[Unset, str]): Slack user group ID - name (Union[Unset, str]): Slack user group name + id (str | Unset): Slack user group ID + name (str | Unset): Slack user group name """ - id: Unset | str = UNSET - name: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + id: str | Unset = UNSET + name: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: id = self.id @@ -27,7 +27,7 @@ def to_dict(self) -> dict[str, Any]: 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 @@ -48,21 +48,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - update_schedule_data_attributes_slack_user_group.additional_properties = d return update_schedule_data_attributes_slack_user_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_schedule_data_type.py b/rootly_sdk/models/update_schedule_data_type.py index 7c2d0900..2e8a3a05 100644 --- a/rootly_sdk/models/update_schedule_data_type.py +++ b/rootly_sdk/models/update_schedule_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateScheduleDataType = Literal["schedules"] @@ -11,5 +11,5 @@ def check_update_schedule_data_type(value: str | None) -> UpdateScheduleDataType if value is None: return None if value in UPDATE_SCHEDULE_DATA_TYPE_VALUES: - return cast(UpdateScheduleDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_SCHEDULE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_schedule_rotation.py b/rootly_sdk/models/update_schedule_rotation.py index 921f3797..d7519c24 100644 --- a/rootly_sdk/models/update_schedule_rotation.py +++ b/rootly_sdk/models/update_schedule_rotation.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_schedule_rotation_data import UpdateScheduleRotationData @@ -18,14 +19,13 @@ class UpdateScheduleRotation: data (UpdateScheduleRotationData): """ - data: "UpdateScheduleRotationData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateScheduleRotationData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_schedule_rotation.additional_properties = d return update_schedule_rotation - - @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_schedule_rotation_active_day.py b/rootly_sdk/models/update_schedule_rotation_active_day.py index e76df6e6..131bb9c7 100644 --- a/rootly_sdk/models/update_schedule_rotation_active_day.py +++ b/rootly_sdk/models/update_schedule_rotation_active_day.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_schedule_rotation_active_day_data import UpdateScheduleRotationActiveDayData @@ -18,14 +19,13 @@ class UpdateScheduleRotationActiveDay: data (UpdateScheduleRotationActiveDayData): """ - data: "UpdateScheduleRotationActiveDayData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateScheduleRotationActiveDayData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_schedule_rotation_active_day.additional_properties = d return update_schedule_rotation_active_day - - @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_schedule_rotation_active_day_data.py b/rootly_sdk/models/update_schedule_rotation_active_day_data.py index 515b3780..cc9fa2b9 100644 --- a/rootly_sdk/models/update_schedule_rotation_active_day_data.py +++ b/rootly_sdk/models/update_schedule_rotation_active_day_data.py @@ -1,13 +1,15 @@ +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_schedule_rotation_active_day_data_type import ( UpdateScheduleRotationActiveDayDataType, check_update_schedule_rotation_active_day_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_schedule_rotation_active_day_data_attributes import ( @@ -24,25 +26,31 @@ class UpdateScheduleRotationActiveDayData: Attributes: type_ (UpdateScheduleRotationActiveDayDataType): attributes (UpdateScheduleRotationActiveDayDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateScheduleRotationActiveDayDataType - attributes: "UpdateScheduleRotationActiveDayDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateScheduleRotationActiveDayDataAttributes + id: str | Unset = 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 @@ -57,26 +65,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateScheduleRotationActiveDayDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_schedule_rotation_active_day_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_schedule_rotation_active_day_data.additional_properties = d return update_schedule_rotation_active_day_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_schedule_rotation_active_day_data_attributes.py b/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes.py index 90525656..668118fe 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,24 +24,21 @@ class UpdateScheduleRotationActiveDayDataAttributes: """ Attributes: - 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): 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: Unset | UpdateScheduleRotationActiveDayDataAttributesDayName = UNSET - active_time_attributes: Unset | list["UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem"] = ( - UNSET - ) + day_name: UpdateScheduleRotationActiveDayDataAttributesDayName | Unset = UNSET + active_time_attributes: list[UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem] | Unset = UNSET def to_dict(self) -> dict[str, Any]: - day_name: Unset | str = UNSET + day_name: str | Unset = UNSET if not isinstance(self.day_name, Unset): day_name = self.day_name - active_time_attributes: Unset | list[dict[str, Any]] = UNSET + active_time_attributes: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.active_time_attributes, Unset): active_time_attributes = [] for active_time_attributes_item_data in self.active_time_attributes: @@ -64,22 +63,26 @@ 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: Unset | UpdateScheduleRotationActiveDayDataAttributesDayName + day_name: UpdateScheduleRotationActiveDayDataAttributesDayName | Unset 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) - 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: 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 + ) ) - ) - 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 1c322623..23a3f04c 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,8 +1,9 @@ +from __future__ import annotations + 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 @@ -13,13 +14,12 @@ class UpdateScheduleRotationActiveDayDataAttributesActiveTimeAttributesItem: """ Attributes: - 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): Start time for schedule rotation active time + end_time (str | Unset): End time for schedule rotation active time """ - start_time: Unset | str = UNSET - end_time: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + start_time: str | Unset = UNSET + end_time: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: start_time = self.start_time @@ -27,7 +27,7 @@ def to_dict(self) -> dict[str, Any]: end_time = self.end_time field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if start_time is not UNSET: field_dict["start_time"] = start_time @@ -48,21 +48,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: end_time=end_time, ) - update_schedule_rotation_active_day_data_attributes_active_time_attributes_item.additional_properties = d return update_schedule_rotation_active_day_data_attributes_active_time_attributes_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_schedule_rotation_active_day_data_attributes_day_name.py b/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes_day_name.py index 919a0e28..6e30dcf8 100644 --- a/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes_day_name.py +++ b/rootly_sdk/models/update_schedule_rotation_active_day_data_attributes_day_name.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateScheduleRotationActiveDayDataAttributesDayName = Literal["F", "M", "R", "S", "T", "U", "W"] @@ -21,7 +21,7 @@ def check_update_schedule_rotation_active_day_data_attributes_day_name( if value is None: return None if value in UPDATE_SCHEDULE_ROTATION_ACTIVE_DAY_DATA_ATTRIBUTES_DAY_NAME_VALUES: - return cast(UpdateScheduleRotationActiveDayDataAttributesDayName, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SCHEDULE_ROTATION_ACTIVE_DAY_DATA_ATTRIBUTES_DAY_NAME_VALUES!r}" ) diff --git a/rootly_sdk/models/update_schedule_rotation_active_day_data_type.py b/rootly_sdk/models/update_schedule_rotation_active_day_data_type.py index 933d83e9..be416a77 100644 --- a/rootly_sdk/models/update_schedule_rotation_active_day_data_type.py +++ b/rootly_sdk/models/update_schedule_rotation_active_day_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateScheduleRotationActiveDayDataType = Literal["schedule_rotation_active_days"] @@ -13,7 +13,7 @@ def check_update_schedule_rotation_active_day_data_type( if value is None: return None if value in UPDATE_SCHEDULE_ROTATION_ACTIVE_DAY_DATA_TYPE_VALUES: - return cast(UpdateScheduleRotationActiveDayDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SCHEDULE_ROTATION_ACTIVE_DAY_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_schedule_rotation_data.py b/rootly_sdk/models/update_schedule_rotation_data.py index 4e9691fc..daa2c299 100644 --- a/rootly_sdk/models/update_schedule_rotation_data.py +++ b/rootly_sdk/models/update_schedule_rotation_data.py @@ -1,13 +1,15 @@ +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_schedule_rotation_data_type import ( UpdateScheduleRotationDataType, check_update_schedule_rotation_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_schedule_rotation_data_attributes import UpdateScheduleRotationDataAttributes @@ -22,25 +24,31 @@ class UpdateScheduleRotationData: Attributes: type_ (UpdateScheduleRotationDataType): attributes (UpdateScheduleRotationDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateScheduleRotationDataType - attributes: "UpdateScheduleRotationDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateScheduleRotationDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateScheduleRotationDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_schedule_rotation_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_schedule_rotation_data.additional_properties = d return update_schedule_rotation_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_schedule_rotation_data_attributes.py b/rootly_sdk/models/update_schedule_rotation_data_attributes.py index 33ed6694..55c4e436 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes.py @@ -1,9 +1,10 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define -from dateutil.parser import isoparse from ..models.update_schedule_rotation_data_attributes_active_days_item import ( UpdateScheduleRotationDataAttributesActiveDaysItem, @@ -45,47 +46,47 @@ class UpdateScheduleRotationDataAttributes: Attributes: schedule_rotationable_type (UpdateScheduleRotationDataAttributesScheduleRotationableType): Schedule rotation type - 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 + 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. Organizations with one timezone per schedule manage this + on the schedule; a value differing from the schedule's is rejected. 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 created after this time. - 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 + 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 """ schedule_rotationable_type: UpdateScheduleRotationDataAttributesScheduleRotationableType - 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 + 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 schedule_rotation_members: ( - None | Unset | list["UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item"] + list[UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | Unset ) = UNSET def to_dict(self) -> dict[str, Any]: @@ -107,7 +108,7 @@ def to_dict(self) -> dict[str, Any]: active_all_week = self.active_all_week - active_days: Unset | list[str] = UNSET + active_days: list[str] | Unset = UNSET if not isinstance(self.active_days, Unset): active_days = [] for active_days_item_data in self.active_days: @@ -116,7 +117,7 @@ def to_dict(self) -> dict[str, Any]: active_time_type = self.active_time_type - active_time_attributes: Unset | list[dict[str, Any]] = UNSET + active_time_attributes: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.active_time_attributes, Unset): active_time_attributes = [] for active_time_attributes_item_data in self.active_time_attributes: @@ -125,7 +126,7 @@ def to_dict(self) -> dict[str, Any]: time_zone = self.time_zone - schedule_rotationable_attributes: Unset | dict[str, Any] + schedule_rotationable_attributes: dict[str, Any] | Unset if isinstance(self.schedule_rotationable_attributes, Unset): schedule_rotationable_attributes = UNSET elif isinstance( @@ -146,7 +147,7 @@ def to_dict(self) -> dict[str, Any]: else: schedule_rotationable_attributes = self.schedule_rotationable_attributes.to_dict() - start_time: None | Unset | str + start_time: None | str | Unset if isinstance(self.start_time, Unset): start_time = UNSET elif isinstance(self.start_time, datetime.datetime): @@ -154,7 +155,7 @@ def to_dict(self) -> dict[str, Any]: else: start_time = self.start_time - end_time: None | Unset | str + end_time: None | str | Unset if isinstance(self.end_time, Unset): end_time = UNSET elif isinstance(self.end_time, datetime.datetime): @@ -162,7 +163,7 @@ def to_dict(self) -> dict[str, Any]: else: end_time = self.end_time - schedule_rotation_members: None | Unset | list[dict[str, Any]] + schedule_rotation_members: list[dict[str, Any]] | None | Unset if isinstance(self.schedule_rotation_members, Unset): schedule_rotation_members = UNSET elif isinstance(self.schedule_rotation_members, list): @@ -238,35 +239,41 @@ 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) - 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: 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 + ) - 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) - 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: 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 + ) - 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, - ) -> Union[ - "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType0", - "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType1", - "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType2", - "UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType3", - Unset, - ]: + ) -> ( + Unset + | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType0 + | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType1 + | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType2 + | UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType3 + ): if isinstance(data, Unset): return data try: @@ -277,7 +284,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -287,7 +294,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -297,7 +304,7 @@ def _parse_schedule_rotationable_attributes( ) return schedule_rotationable_attributes_type_2 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -311,7 +318,7 @@ def _parse_schedule_rotationable_attributes( d.pop("schedule_rotationable_attributes", UNSET) ) - def _parse_start_time(data: object) -> None | Unset | datetime.datetime: + def _parse_start_time(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -319,16 +326,16 @@ def _parse_start_time(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - start_time_type_0 = isoparse(data) + start_time_type_0 = datetime.datetime.fromisoformat(data) return start_time_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) start_time = _parse_start_time(d.pop("start_time", UNSET)) - def _parse_end_time(data: object) -> None | Unset | datetime.datetime: + def _parse_end_time(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -336,18 +343,18 @@ def _parse_end_time(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - end_time_type_0 = isoparse(data) + end_time_type_0 = datetime.datetime.fromisoformat(data) return end_time_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, data) end_time = _parse_end_time(d.pop("end_time", UNSET)) def _parse_schedule_rotation_members( data: object, - ) -> None | Unset | list["UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item"]: + ) -> list[UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -367,11 +374,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast( - None | Unset | list["UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item"], data - ) + return cast(list[UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item] | None | Unset, 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_days_item.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_active_days_item.py index 5719eeac..34ce4f5f 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_active_days_item.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_active_days_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateScheduleRotationDataAttributesActiveDaysItem = Literal["F", "M", "R", "S", "T", "U", "W"] @@ -21,7 +21,7 @@ def check_update_schedule_rotation_data_attributes_active_days_item( if value is None: return None if value in UPDATE_SCHEDULE_ROTATION_DATA_ATTRIBUTES_ACTIVE_DAYS_ITEM_VALUES: - return cast(UpdateScheduleRotationDataAttributesActiveDaysItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SCHEDULE_ROTATION_DATA_ATTRIBUTES_ACTIVE_DAYS_ITEM_VALUES!r}" ) 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 d2f97054..7e7026ec 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="UpdateScheduleRotationDataAttributesActiveTimeAttributesItem") @@ -17,7 +18,6 @@ class UpdateScheduleRotationDataAttributesActiveTimeAttributesItem: start_time: str end_time: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: start_time = self.start_time @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: end_time = self.end_time field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "start_time": start_time, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: end_time=end_time, ) - update_schedule_rotation_data_attributes_active_time_attributes_item.additional_properties = d return update_schedule_rotation_data_attributes_active_time_attributes_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_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 26bb8869..d555cdae 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,8 +1,9 @@ +from __future__ import annotations + 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.update_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item_member_type import ( UpdateScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType, @@ -19,13 +20,12 @@ class UpdateScheduleRotationDataAttributesScheduleRotationMembersType0Item: Attributes: member_type (UpdateScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType): Type of member member_id (str): ID of the member - position (Union[Unset, int]): Position of the member in rotation + position (int | Unset): Position of the member in rotation """ member_type: UpdateScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType member_id: str - position: Unset | int = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + position: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: member_type: str = self.member_type @@ -35,7 +35,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "member_type": member_type, @@ -64,21 +64,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position=position, ) - update_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item.additional_properties = d return update_schedule_rotation_data_attributes_schedule_rotation_members_type_0_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_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item_member_type.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item_member_type.py index 983df442..31195203 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item_member_type.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotation_members_type_0_item_member_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType = Literal["Schedule", "User"] @@ -16,7 +16,7 @@ def check_update_schedule_rotation_data_attributes_schedule_rotation_members_typ if value is None: return None if value in UPDATE_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATION_MEMBERS_TYPE_0_ITEM_MEMBER_TYPE_VALUES: - return cast(UpdateScheduleRotationDataAttributesScheduleRotationMembersType0ItemMemberType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATION_MEMBERS_TYPE_0_ITEM_MEMBER_TYPE_VALUES!r}" ) 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 d43b06fc..252cbab7 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,3 +1,5 @@ +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 389f8b8b..dd465bea 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,3 +1,5 @@ +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_handoff_day.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1_handoff_day.py index e1379141..0b54927c 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1_handoff_day.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_1_handoff_day.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType1HandoffDay = Literal[ "F", "M", "R", "S", "T", "U", "W" @@ -23,7 +23,7 @@ def check_update_schedule_rotation_data_attributes_schedule_rotationable_attribu if value is None: return None if value in UPDATE_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATIONABLE_ATTRIBUTES_TYPE_1_HANDOFF_DAY_VALUES: - return cast(UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType1HandoffDay, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATIONABLE_ATTRIBUTES_TYPE_1_HANDOFF_DAY_VALUES!r}" ) 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 451c364f..b9b2c88f 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,3 +1,5 @@ +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_handoff_day.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2_handoff_day.py index 600fe7f8..5c73fe13 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2_handoff_day.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_2_handoff_day.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType2HandoffDay = Literal[ "first_day_of_month", "last_day_of_month" @@ -18,7 +18,7 @@ def check_update_schedule_rotation_data_attributes_schedule_rotationable_attribu if value is None: return None if value in UPDATE_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATIONABLE_ATTRIBUTES_TYPE_2_HANDOFF_DAY_VALUES: - return cast(UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType2HandoffDay, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATIONABLE_ATTRIBUTES_TYPE_2_HANDOFF_DAY_VALUES!r}" ) 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 b36bed23..53f98ff3 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,3 +1,5 @@ +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_shift_length_unit.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3_shift_length_unit.py index 8750a1e6..b76e4f94 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3_shift_length_unit.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_attributes_type_3_shift_length_unit.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType3ShiftLengthUnit = Literal[ "days", "hours", "weeks" @@ -22,7 +22,7 @@ def check_update_schedule_rotation_data_attributes_schedule_rotationable_attribu value in UPDATE_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATIONABLE_ATTRIBUTES_TYPE_3_SHIFT_LENGTH_UNIT_VALUES ): - return cast(UpdateScheduleRotationDataAttributesScheduleRotationableAttributesType3ShiftLengthUnit, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATIONABLE_ATTRIBUTES_TYPE_3_SHIFT_LENGTH_UNIT_VALUES!r}" ) diff --git a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_type.py b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_type.py index 16664a66..5bcb77b7 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_type.py +++ b/rootly_sdk/models/update_schedule_rotation_data_attributes_schedule_rotationable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateScheduleRotationDataAttributesScheduleRotationableType = Literal[ "ScheduleBiweeklyRotation", @@ -25,7 +25,7 @@ def check_update_schedule_rotation_data_attributes_schedule_rotationable_type( if value is None: return None if value in UPDATE_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATIONABLE_TYPE_VALUES: - return cast(UpdateScheduleRotationDataAttributesScheduleRotationableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SCHEDULE_ROTATION_DATA_ATTRIBUTES_SCHEDULE_ROTATIONABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_schedule_rotation_data_type.py b/rootly_sdk/models/update_schedule_rotation_data_type.py index 801dee7e..23d3bac7 100644 --- a/rootly_sdk/models/update_schedule_rotation_data_type.py +++ b/rootly_sdk/models/update_schedule_rotation_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateScheduleRotationDataType = Literal["schedule_rotations"] @@ -11,5 +11,5 @@ def check_update_schedule_rotation_data_type(value: str | None) -> UpdateSchedul if value is None: return None if value in UPDATE_SCHEDULE_ROTATION_DATA_TYPE_VALUES: - return cast(UpdateScheduleRotationDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_SCHEDULE_ROTATION_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_schedule_rotation_user.py b/rootly_sdk/models/update_schedule_rotation_user.py index 2d3d11c9..5abcb4d9 100644 --- a/rootly_sdk/models/update_schedule_rotation_user.py +++ b/rootly_sdk/models/update_schedule_rotation_user.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_schedule_rotation_user_data import UpdateScheduleRotationUserData @@ -18,14 +19,13 @@ class UpdateScheduleRotationUser: data (UpdateScheduleRotationUserData): """ - data: "UpdateScheduleRotationUserData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateScheduleRotationUserData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_schedule_rotation_user.additional_properties = d return update_schedule_rotation_user - - @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_schedule_rotation_user_data.py b/rootly_sdk/models/update_schedule_rotation_user_data.py index 69217cc6..e9729b5e 100644 --- a/rootly_sdk/models/update_schedule_rotation_user_data.py +++ b/rootly_sdk/models/update_schedule_rotation_user_data.py @@ -1,13 +1,15 @@ +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_schedule_rotation_user_data_type import ( UpdateScheduleRotationUserDataType, check_update_schedule_rotation_user_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_schedule_rotation_user_data_attributes import UpdateScheduleRotationUserDataAttributes @@ -22,25 +24,31 @@ class UpdateScheduleRotationUserData: Attributes: type_ (UpdateScheduleRotationUserDataType): attributes (UpdateScheduleRotationUserDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateScheduleRotationUserDataType - attributes: "UpdateScheduleRotationUserDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateScheduleRotationUserDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateScheduleRotationUserDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_schedule_rotation_user_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_schedule_rotation_user_data.additional_properties = d return update_schedule_rotation_user_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_schedule_rotation_user_data_attributes.py b/rootly_sdk/models/update_schedule_rotation_user_data_attributes.py index 7861c6a9..7b8c2006 100644 --- a/rootly_sdk/models/update_schedule_rotation_user_data_attributes.py +++ b/rootly_sdk/models/update_schedule_rotation_user_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -12,12 +14,12 @@ class UpdateScheduleRotationUserDataAttributes: """ Attributes: - user_id (Union[Unset, int]): Schedule rotation user - position (Union[Unset, int]): Position of the user inside rotation + user_id (int | Unset): Schedule rotation user + position (int | Unset): Position of the user inside rotation """ - user_id: Unset | int = UNSET - position: Unset | int = UNSET + user_id: int | Unset = UNSET + position: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: user_id = self.user_id diff --git a/rootly_sdk/models/update_schedule_rotation_user_data_type.py b/rootly_sdk/models/update_schedule_rotation_user_data_type.py index 97ba04a9..865fa4b3 100644 --- a/rootly_sdk/models/update_schedule_rotation_user_data_type.py +++ b/rootly_sdk/models/update_schedule_rotation_user_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateScheduleRotationUserDataType = Literal["schedule_rotation_users"] @@ -11,5 +11,5 @@ def check_update_schedule_rotation_user_data_type(value: str | None) -> UpdateSc if value is None: return None if value in UPDATE_SCHEDULE_ROTATION_USER_DATA_TYPE_VALUES: - return cast(UpdateScheduleRotationUserDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_SCHEDULE_ROTATION_USER_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_secret.py b/rootly_sdk/models/update_secret.py index cb35d785..67aa8714 100644 --- a/rootly_sdk/models/update_secret.py +++ b/rootly_sdk/models/update_secret.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_secret_data import UpdateSecretData @@ -18,14 +19,13 @@ class UpdateSecret: data (UpdateSecretData): """ - data: "UpdateSecretData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateSecretData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_secret.additional_properties = d return update_secret - - @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_secret_data.py b/rootly_sdk/models/update_secret_data.py index cebfeff5..1b9c6a1b 100644 --- a/rootly_sdk/models/update_secret_data.py +++ b/rootly_sdk/models/update_secret_data.py @@ -1,10 +1,12 @@ +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_secret_data_type import UpdateSecretDataType, check_update_secret_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_secret_data_attributes import UpdateSecretDataAttributes @@ -19,25 +21,31 @@ class UpdateSecretData: Attributes: type_ (UpdateSecretDataType): attributes (UpdateSecretDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateSecretDataType - attributes: "UpdateSecretDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateSecretDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateSecretDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_secret_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_secret_data.additional_properties = d return update_secret_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_secret_data_attributes.py b/rootly_sdk/models/update_secret_data_attributes.py index 58b2ee38..02081f02 100644 --- a/rootly_sdk/models/update_secret_data_attributes.py +++ b/rootly_sdk/models/update_secret_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -13,41 +15,54 @@ class UpdateSecretDataAttributes: """ Attributes: name (str): The name of the secret - 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. + 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. + owner_group_ids (list[str] | None | Unset): IDs of the teams whose members can see and pick this secret; their + team admins can manage it. Empty means only users with the org Secrets permission can. Ignored unless team + scoping is enabled for the organization. """ name: str - 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 + 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 + owner_group_ids: list[str] | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name secret = self.secret - hashicorp_vault_mount: None | Unset | str + hashicorp_vault_mount: None | str | Unset if isinstance(self.hashicorp_vault_mount, Unset): hashicorp_vault_mount = UNSET else: hashicorp_vault_mount = self.hashicorp_vault_mount - hashicorp_vault_path: None | Unset | str + hashicorp_vault_path: None | str | Unset if isinstance(self.hashicorp_vault_path, Unset): hashicorp_vault_path = UNSET else: hashicorp_vault_path = self.hashicorp_vault_path - hashicorp_vault_version: None | Unset | int + hashicorp_vault_version: int | None | Unset if isinstance(self.hashicorp_vault_version, Unset): hashicorp_vault_version = UNSET else: hashicorp_vault_version = self.hashicorp_vault_version + owner_group_ids: list[str] | None | Unset + if isinstance(self.owner_group_ids, Unset): + owner_group_ids = UNSET + elif isinstance(self.owner_group_ids, list): + owner_group_ids = self.owner_group_ids + + else: + owner_group_ids = self.owner_group_ids + field_dict: dict[str, Any] = {} field_dict.update( @@ -63,6 +78,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["hashicorp_vault_path"] = hashicorp_vault_path if hashicorp_vault_version is not UNSET: field_dict["hashicorp_vault_version"] = hashicorp_vault_version + if owner_group_ids is not UNSET: + field_dict["owner_group_ids"] = owner_group_ids return field_dict @@ -73,39 +90,57 @@ 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 | Unset | str: + def _parse_hashicorp_vault_mount(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) hashicorp_vault_mount = _parse_hashicorp_vault_mount(d.pop("hashicorp_vault_mount", UNSET)) - def _parse_hashicorp_vault_path(data: object) -> None | Unset | str: + def _parse_hashicorp_vault_path(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) hashicorp_vault_path = _parse_hashicorp_vault_path(d.pop("hashicorp_vault_path", UNSET)) - def _parse_hashicorp_vault_version(data: object) -> None | Unset | int: + def _parse_hashicorp_vault_version(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) hashicorp_vault_version = _parse_hashicorp_vault_version(d.pop("hashicorp_vault_version", UNSET)) + def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + try: + if not isinstance(data, list): + raise TypeError() + owner_group_ids_type_0 = cast(list[str], data) + + return owner_group_ids_type_0 + except (TypeError, ValueError, AttributeError, KeyError): + pass + return cast(list[str] | None | Unset, data) + + owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) + update_secret_data_attributes = cls( name=name, secret=secret, hashicorp_vault_mount=hashicorp_vault_mount, hashicorp_vault_path=hashicorp_vault_path, hashicorp_vault_version=hashicorp_vault_version, + owner_group_ids=owner_group_ids, ) return update_secret_data_attributes diff --git a/rootly_sdk/models/update_secret_data_type.py b/rootly_sdk/models/update_secret_data_type.py index 83034a12..b71c1146 100644 --- a/rootly_sdk/models/update_secret_data_type.py +++ b/rootly_sdk/models/update_secret_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateSecretDataType = Literal["secrets"] @@ -11,5 +11,5 @@ def check_update_secret_data_type(value: str | None) -> UpdateSecretDataType | N if value is None: return None if value in UPDATE_SECRET_DATA_TYPE_VALUES: - return cast(UpdateSecretDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_SECRET_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_service.py b/rootly_sdk/models/update_service.py index e1c9b8af..f5936dcd 100644 --- a/rootly_sdk/models/update_service.py +++ b/rootly_sdk/models/update_service.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_service_data import UpdateServiceData @@ -18,14 +19,13 @@ class UpdateService: data (UpdateServiceData): """ - data: "UpdateServiceData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateServiceData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_service.additional_properties = d return update_service - - @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_service_data.py b/rootly_sdk/models/update_service_data.py index 66ba895b..4e976aae 100644 --- a/rootly_sdk/models/update_service_data.py +++ b/rootly_sdk/models/update_service_data.py @@ -1,10 +1,12 @@ +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_service_data_type import UpdateServiceDataType, check_update_service_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_service_data_attributes import UpdateServiceDataAttributes @@ -19,25 +21,31 @@ class UpdateServiceData: Attributes: type_ (UpdateServiceDataType): attributes (UpdateServiceDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateServiceDataType - attributes: "UpdateServiceDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateServiceDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateServiceDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_service_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_service_data.additional_properties = d return update_service_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_service_data_attributes.py b/rootly_sdk/models/update_service_data_attributes.py index 3782a4e9..1ac7eafd 100644 --- a/rootly_sdk/models/update_service_data_attributes.py +++ b/rootly_sdk/models/update_service_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -28,86 +30,83 @@ class UpdateServiceDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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: + name (str | Unset): The name of the service + description (None | str | Unset): The description of the service + public_description (None | str | Unset): The status page 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: :namespace/:kind/:entity_name - 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: + 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: rootlyhq/my-service - 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: + 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: rootlyhq/my-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. 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 + 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. Empty array removes all; + omitting or null leaves unchanged. + owner_user_ids (list[int] | None | Unset): Owner Users associated with this service. Empty array removes all; + omitting or null leaves unchanged. + 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 associated with 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. + 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. """ - 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 + slug: None | str | Unset = UNSET + 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 def to_dict(self) -> dict[str, Any]: from ..models.update_service_data_attributes_alert_broadcast_channel_type_0 import ( @@ -117,7 +116,7 @@ def to_dict(self) -> dict[str, Any]: UpdateServiceDataAttributesIncidentBroadcastChannelType0, ) - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -125,19 +124,19 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -146,79 +145,79 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | Unset | str + backstage_id: None | str | Unset if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | Unset | str + pagerduty_id: None | str | Unset if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - opsgenie_id: None | Unset | str + opsgenie_id: None | str | Unset if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - cortex_id: None | Unset | str + cortex_id: None | str | Unset if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | Unset | str + service_now_ci_sys_id: None | str | Unset 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 | Unset | str + github_repository_name: None | str | Unset if isinstance(self.github_repository_name, Unset): github_repository_name = UNSET else: github_repository_name = self.github_repository_name - github_repository_branch: None | Unset | str + github_repository_branch: None | str | Unset if isinstance(self.github_repository_branch, Unset): github_repository_branch = UNSET else: github_repository_branch = self.github_repository_branch - gitlab_repository_name: None | Unset | str + gitlab_repository_name: None | str | Unset if isinstance(self.gitlab_repository_name, Unset): gitlab_repository_name = UNSET else: gitlab_repository_name = self.gitlab_repository_name - gitlab_repository_branch: None | Unset | str + gitlab_repository_branch: None | str | Unset if isinstance(self.gitlab_repository_branch, Unset): gitlab_repository_branch = UNSET else: gitlab_repository_branch = self.gitlab_repository_branch - environment_ids: None | Unset | list[str] + environment_ids: list[str] | None | Unset if isinstance(self.environment_ids, Unset): environment_ids = UNSET elif isinstance(self.environment_ids, list): @@ -227,7 +226,7 @@ def to_dict(self) -> dict[str, Any]: else: environment_ids = self.environment_ids - service_ids: None | Unset | list[str] + service_ids: list[str] | None | Unset if isinstance(self.service_ids, Unset): service_ids = UNSET elif isinstance(self.service_ids, list): @@ -236,7 +235,7 @@ def to_dict(self) -> dict[str, Any]: else: service_ids = self.service_ids - owner_group_ids: None | Unset | list[str] + owner_group_ids: list[str] | None | Unset if isinstance(self.owner_group_ids, Unset): owner_group_ids = UNSET elif isinstance(self.owner_group_ids, list): @@ -245,7 +244,7 @@ def to_dict(self) -> dict[str, Any]: else: owner_group_ids = self.owner_group_ids - owner_user_ids: None | Unset | list[int] + owner_user_ids: list[int] | None | Unset if isinstance(self.owner_user_ids, Unset): owner_user_ids = UNSET elif isinstance(self.owner_user_ids, list): @@ -254,31 +253,31 @@ def to_dict(self) -> dict[str, Any]: else: owner_user_ids = self.owner_user_ids - alerts_email_enabled: None | Unset | bool + alerts_email_enabled: bool | None | Unset if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alert_urgency_id: None | Unset | str + alert_urgency_id: None | str | Unset if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - escalation_policy_id: None | Unset | str + escalation_policy_id: None | str | Unset if isinstance(self.escalation_policy_id, Unset): escalation_policy_id = UNSET else: escalation_policy_id = self.escalation_policy_id - kubernetes_deployment_name: None | Unset | str + kubernetes_deployment_name: None | str | Unset if isinstance(self.kubernetes_deployment_name, Unset): kubernetes_deployment_name = UNSET else: kubernetes_deployment_name = self.kubernetes_deployment_name - slack_channels: None | Unset | list[dict[str, Any]] + slack_channels: list[dict[str, Any]] | None | Unset if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -290,7 +289,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: None | Unset | list[dict[str, Any]] + slack_aliases: list[dict[str, Any]] | None | Unset if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -302,13 +301,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: None | Unset | bool + alert_broadcast_enabled: bool | None | Unset if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: None | Unset | dict[str, Any] + alert_broadcast_channel: dict[str, Any] | None | Unset if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, UpdateServiceDataAttributesAlertBroadcastChannelType0): @@ -316,13 +315,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: None | Unset | bool + incident_broadcast_enabled: bool | None | Unset if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: None | Unset | dict[str, Any] + incident_broadcast_channel: dict[str, Any] | None | Unset if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, UpdateServiceDataAttributesIncidentBroadcastChannelType0): @@ -330,7 +329,7 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - properties: Unset | list[dict[str, Any]] = UNSET + properties: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -425,36 +424,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -465,121 +464,121 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | Unset | str: + def _parse_backstage_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | Unset | str: + def _parse_pagerduty_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | Unset | str: + def _parse_opsgenie_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_cortex_id(data: object) -> None | Unset | str: + def _parse_cortex_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: + def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_github_repository_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) github_repository_name = _parse_github_repository_name(d.pop("github_repository_name", UNSET)) - def _parse_github_repository_branch(data: object) -> None | Unset | str: + def _parse_github_repository_branch(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) github_repository_branch = _parse_github_repository_branch(d.pop("github_repository_branch", UNSET)) - def _parse_gitlab_repository_name(data: object) -> None | Unset | str: + def _parse_gitlab_repository_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) gitlab_repository_name = _parse_gitlab_repository_name(d.pop("gitlab_repository_name", UNSET)) - def _parse_gitlab_repository_branch(data: object) -> None | Unset | str: + def _parse_gitlab_repository_branch(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) gitlab_repository_branch = _parse_gitlab_repository_branch(d.pop("gitlab_repository_branch", UNSET)) - def _parse_environment_ids(data: object) -> None | Unset | list[str]: + def _parse_environment_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -590,13 +589,13 @@ def _parse_environment_ids(data: object) -> None | Unset | list[str]: environment_ids_type_0 = cast(list[str], data) return environment_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) environment_ids = _parse_environment_ids(d.pop("environment_ids", UNSET)) - def _parse_service_ids(data: object) -> None | Unset | list[str]: + def _parse_service_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -607,13 +606,13 @@ def _parse_service_ids(data: object) -> None | Unset | list[str]: service_ids_type_0 = cast(list[str], data) return service_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) service_ids = _parse_service_ids(d.pop("service_ids", UNSET)) - def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: + def _parse_owner_group_ids(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -624,13 +623,13 @@ def _parse_owner_group_ids(data: object) -> None | Unset | list[str]: owner_group_ids_type_0 = cast(list[str], data) return owner_group_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) owner_group_ids = _parse_owner_group_ids(d.pop("owner_group_ids", UNSET)) - def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: + def _parse_owner_user_ids(data: object) -> list[int] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -641,51 +640,51 @@ def _parse_owner_user_ids(data: object) -> None | Unset | list[int]: owner_user_ids_type_0 = cast(list[int], data) return owner_user_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[int], data) + return cast(list[int] | None | Unset, data) owner_user_ids = _parse_owner_user_ids(d.pop("owner_user_ids", UNSET)) - def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: + def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | Unset | str: + def _parse_alert_urgency_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_escalation_policy_id(data: object) -> None | Unset | str: + def _parse_escalation_policy_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) escalation_policy_id = _parse_escalation_policy_id(d.pop("escalation_policy_id", UNSET)) - def _parse_kubernetes_deployment_name(data: object) -> None | Unset | str: + def _parse_kubernetes_deployment_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) kubernetes_deployment_name = _parse_kubernetes_deployment_name(d.pop("kubernetes_deployment_name", UNSET)) def _parse_slack_channels( data: object, - ) -> None | Unset | list["UpdateServiceDataAttributesSlackChannelsType0Item"]: + ) -> list[UpdateServiceDataAttributesSlackChannelsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -703,15 +702,13 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["UpdateServiceDataAttributesSlackChannelsType0Item"], data) + return cast(list[UpdateServiceDataAttributesSlackChannelsType0Item] | None | Unset, data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases( - data: object, - ) -> None | Unset | list["UpdateServiceDataAttributesSlackAliasesType0Item"]: + def _parse_slack_aliases(data: object) -> list[UpdateServiceDataAttributesSlackAliasesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -729,24 +726,24 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["UpdateServiceDataAttributesSlackAliasesType0Item"], data) + return cast(list[UpdateServiceDataAttributesSlackAliasesType0Item] | None | Unset, data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> None | Unset | bool: + def _parse_alert_broadcast_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) def _parse_alert_broadcast_channel( data: object, - ) -> Union["UpdateServiceDataAttributesAlertBroadcastChannelType0", None, Unset]: + ) -> None | Unset | UpdateServiceDataAttributesAlertBroadcastChannelType0: if data is None: return data if isinstance(data, Unset): @@ -757,24 +754,24 @@ def _parse_alert_broadcast_channel( alert_broadcast_channel_type_0 = UpdateServiceDataAttributesAlertBroadcastChannelType0.from_dict(data) return alert_broadcast_channel_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["UpdateServiceDataAttributesAlertBroadcastChannelType0", None, Unset], data) + return cast(None | Unset | UpdateServiceDataAttributesAlertBroadcastChannelType0, data) alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> None | Unset | bool: + def _parse_incident_broadcast_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) def _parse_incident_broadcast_channel( data: object, - ) -> Union["UpdateServiceDataAttributesIncidentBroadcastChannelType0", None, Unset]: + ) -> None | Unset | UpdateServiceDataAttributesIncidentBroadcastChannelType0: if data is None: return data if isinstance(data, Unset): @@ -787,18 +784,20 @@ def _parse_incident_broadcast_channel( ) return incident_broadcast_channel_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["UpdateServiceDataAttributesIncidentBroadcastChannelType0", None, Unset], data) + return cast(None | Unset | UpdateServiceDataAttributesIncidentBroadcastChannelType0, data) incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) - properties = [] _properties = d.pop("properties", UNSET) - for properties_item_data in _properties or []: - properties_item = UpdateServiceDataAttributesPropertiesItem.from_dict(properties_item_data) + 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) - properties.append(properties_item) + properties.append(properties_item) update_service_data_attributes = cls( slug=slug, 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 d153a8a6..0c58876f 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,8 +1,9 @@ +from __future__ import annotations + 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 @@ -15,12 +16,11 @@ class UpdateServiceDataAttributesAlertBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (Union[Unset, str]): Slack channel name + name (str | Unset): Slack channel name """ id: str - name: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + name: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: id = self.id @@ -28,7 +28,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -51,21 +51,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - update_service_data_attributes_alert_broadcast_channel_type_0.additional_properties = d return update_service_data_attributes_alert_broadcast_channel_type_0 - - @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_service_data_attributes_incident_broadcast_channel_type_0.py b/rootly_sdk/models/update_service_data_attributes_incident_broadcast_channel_type_0.py index 8de96ac0..8ce4358c 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,8 +1,9 @@ +from __future__ import annotations + 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 @@ -15,12 +16,11 @@ class UpdateServiceDataAttributesIncidentBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (Union[Unset, str]): Slack channel name + name (str | Unset): Slack channel name """ id: str - name: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + name: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: id = self.id @@ -28,7 +28,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -51,21 +51,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - update_service_data_attributes_incident_broadcast_channel_type_0.additional_properties = d return update_service_data_attributes_incident_broadcast_channel_type_0 - - @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_service_data_attributes_properties_item.py b/rootly_sdk/models/update_service_data_attributes_properties_item.py index c548afb0..ed866804 100644 --- a/rootly_sdk/models/update_service_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_service_data_attributes_properties_item.py @@ -1,3 +1,5 @@ +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 fda97fed..54ef16f3 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="UpdateServiceDataAttributesSlackAliasesType0Item") @@ -17,7 +18,6 @@ class UpdateServiceDataAttributesSlackAliasesType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - update_service_data_attributes_slack_aliases_type_0_item.additional_properties = d return update_service_data_attributes_slack_aliases_type_0_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_service_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/update_service_data_attributes_slack_channels_type_0_item.py index fb934d04..7e80d716 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="UpdateServiceDataAttributesSlackChannelsType0Item") @@ -17,7 +18,6 @@ class UpdateServiceDataAttributesSlackChannelsType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - update_service_data_attributes_slack_channels_type_0_item.additional_properties = d return update_service_data_attributes_slack_channels_type_0_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_service_data_type.py b/rootly_sdk/models/update_service_data_type.py index cc7c625a..86a0d101 100644 --- a/rootly_sdk/models/update_service_data_type.py +++ b/rootly_sdk/models/update_service_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateServiceDataType = Literal["services"] @@ -11,5 +11,5 @@ def check_update_service_data_type(value: str | None) -> UpdateServiceDataType | if value is None: return None if value in UPDATE_SERVICE_DATA_TYPE_VALUES: - return cast(UpdateServiceDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_SERVICE_DATA_TYPE_VALUES!r}") 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 2b6e9bdc..dfb6002f 100644 --- a/rootly_sdk/models/update_service_now_incident_task_params.py +++ b/rootly_sdk/models/update_service_now_incident_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,28 +25,28 @@ class UpdateServiceNowIncidentTaskParams: """ Attributes: incident_id (str): The incident id - 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 + 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 valid JSON """ incident_id: str - 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 + 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 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -52,15 +54,15 @@ def to_dict(self) -> dict[str, Any]: description = self.description - priority: Unset | dict[str, Any] = UNSET + priority: dict[str, Any] | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - completion: Unset | dict[str, Any] = UNSET + completion: dict[str, Any] | Unset = UNSET if not isinstance(self.completion, Unset): completion = self.completion.to_dict() - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: @@ -99,7 +101,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: Unset | UpdateServiceNowIncidentTaskParamsTaskType + task_type: UpdateServiceNowIncidentTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -110,25 +112,25 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: description = d.pop("description", UNSET) _priority = d.pop("priority", UNSET) - priority: Unset | UpdateServiceNowIncidentTaskParamsPriority + priority: UpdateServiceNowIncidentTaskParamsPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: priority = UpdateServiceNowIncidentTaskParamsPriority.from_dict(_priority) _completion = d.pop("completion", UNSET) - completion: Unset | UpdateServiceNowIncidentTaskParamsCompletion + completion: UpdateServiceNowIncidentTaskParamsCompletion | Unset if isinstance(_completion, Unset): completion = UNSET else: completion = UpdateServiceNowIncidentTaskParamsCompletion.from_dict(_completion) - def _parse_custom_fields_mapping(data: object) -> None | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 8c295c19..f88a1164 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateServiceNowIncidentTaskParamsCompletion: """The completion id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 f71ab86f..a48fa9a6 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateServiceNowIncidentTaskParamsPriority: """The priority id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/update_service_now_incident_task_params_task_type.py index 75f67351..1a010951 100644 --- a/rootly_sdk/models/update_service_now_incident_task_params_task_type.py +++ b/rootly_sdk/models/update_service_now_incident_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateServiceNowIncidentTaskParamsTaskType = Literal["update_service_now_incident"] @@ -13,7 +13,7 @@ def check_update_service_now_incident_task_params_task_type( if value is None: return None if value in UPDATE_SERVICE_NOW_INCIDENT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateServiceNowIncidentTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SERVICE_NOW_INCIDENT_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_severity.py b/rootly_sdk/models/update_severity.py index eea36150..c689ffea 100644 --- a/rootly_sdk/models/update_severity.py +++ b/rootly_sdk/models/update_severity.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_severity_data import UpdateSeverityData @@ -18,14 +19,13 @@ class UpdateSeverity: data (UpdateSeverityData): """ - data: "UpdateSeverityData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateSeverityData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_severity.additional_properties = d return update_severity - - @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_severity_data.py b/rootly_sdk/models/update_severity_data.py index 3e607d77..35e5f9a1 100644 --- a/rootly_sdk/models/update_severity_data.py +++ b/rootly_sdk/models/update_severity_data.py @@ -1,10 +1,12 @@ +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_severity_data_type import UpdateSeverityDataType, check_update_severity_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_severity_data_attributes import UpdateSeverityDataAttributes @@ -19,25 +21,31 @@ class UpdateSeverityData: Attributes: type_ (UpdateSeverityDataType): attributes (UpdateSeverityDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateSeverityDataType - attributes: "UpdateSeverityDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateSeverityDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateSeverityDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_severity_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_severity_data.additional_properties = d return update_severity_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_severity_data_attributes.py b/rootly_sdk/models/update_severity_data_attributes.py index 4eac8106..41ce317c 100644 --- a/rootly_sdk/models/update_severity_data_attributes.py +++ b/rootly_sdk/models/update_severity_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -25,32 +27,32 @@ class UpdateSeverityDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + 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 associated with this severity + slack_aliases (list[UpdateSeverityDataAttributesSlackAliasesType0Item] | None | Unset): Slack Aliases associated + with this severity """ - 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 + slug: None | str | Unset = UNSET + 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 def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -58,29 +60,29 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - severity: Unset | str = UNSET + severity: str | Unset = UNSET if not isinstance(self.severity, Unset): severity = self.severity - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -89,7 +91,7 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - slack_channels: None | Unset | list[dict[str, Any]] + slack_channels: list[dict[str, Any]] | None | Unset if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -101,7 +103,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: None | Unset | list[dict[str, Any]] + slack_aliases: list[dict[str, Any]] | None | Unset if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -148,52 +150,52 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) _severity = d.pop("severity", UNSET) - severity: Unset | UpdateSeverityDataAttributesSeverity + severity: UpdateSeverityDataAttributesSeverity | Unset if isinstance(_severity, Unset): severity = UNSET else: severity = check_update_severity_data_attributes_severity(_severity) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -204,15 +206,15 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) def _parse_slack_channels( data: object, - ) -> None | Unset | list["UpdateSeverityDataAttributesSlackChannelsType0Item"]: + ) -> list[UpdateSeverityDataAttributesSlackChannelsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -230,15 +232,15 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["UpdateSeverityDataAttributesSlackChannelsType0Item"], data) + return cast(list[UpdateSeverityDataAttributesSlackChannelsType0Item] | None | Unset, data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) def _parse_slack_aliases( data: object, - ) -> None | Unset | list["UpdateSeverityDataAttributesSlackAliasesType0Item"]: + ) -> list[UpdateSeverityDataAttributesSlackAliasesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -256,9 +258,9 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["UpdateSeverityDataAttributesSlackAliasesType0Item"], data) + return cast(list[UpdateSeverityDataAttributesSlackAliasesType0Item] | None | Unset, data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) diff --git a/rootly_sdk/models/update_severity_data_attributes_severity.py b/rootly_sdk/models/update_severity_data_attributes_severity.py index 05da3789..f216c3aa 100644 --- a/rootly_sdk/models/update_severity_data_attributes_severity.py +++ b/rootly_sdk/models/update_severity_data_attributes_severity.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateSeverityDataAttributesSeverity = Literal["critical", "high", "low", "medium"] @@ -14,5 +14,5 @@ def check_update_severity_data_attributes_severity(value: str | None) -> UpdateS if value is None: return None if value in UPDATE_SEVERITY_DATA_ATTRIBUTES_SEVERITY_VALUES: - return cast(UpdateSeverityDataAttributesSeverity, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_SEVERITY_DATA_ATTRIBUTES_SEVERITY_VALUES!r}") 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 bfe51d70..7adb280b 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="UpdateSeverityDataAttributesSlackAliasesType0Item") @@ -17,7 +18,6 @@ class UpdateSeverityDataAttributesSlackAliasesType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - update_severity_data_attributes_slack_aliases_type_0_item.additional_properties = d return update_severity_data_attributes_slack_aliases_type_0_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_severity_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/update_severity_data_attributes_slack_channels_type_0_item.py index f429bb07..bbf66b16 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="UpdateSeverityDataAttributesSlackChannelsType0Item") @@ -17,7 +18,6 @@ class UpdateSeverityDataAttributesSlackChannelsType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - update_severity_data_attributes_slack_channels_type_0_item.additional_properties = d return update_severity_data_attributes_slack_channels_type_0_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_severity_data_type.py b/rootly_sdk/models/update_severity_data_type.py index 00410eac..13e3c18b 100644 --- a/rootly_sdk/models/update_severity_data_type.py +++ b/rootly_sdk/models/update_severity_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateSeverityDataType = Literal["severities"] @@ -11,5 +11,5 @@ def check_update_severity_data_type(value: str | None) -> UpdateSeverityDataType if value is None: return None if value in UPDATE_SEVERITY_DATA_TYPE_VALUES: - return cast(UpdateSeverityDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_SEVERITY_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_sharepoint_page_task_params.py b/rootly_sdk/models/update_sharepoint_page_task_params.py index 280b8bbb..c8af9115 100644 --- a/rootly_sdk/models/update_sharepoint_page_task_params.py +++ b/rootly_sdk/models/update_sharepoint_page_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -18,23 +20,23 @@ class UpdateSharepointPageTaskParams: """ Attributes: file_id (str): The SharePoint file ID - 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 + 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 """ file_id: str - task_type: Unset | UpdateSharepointPageTaskParamsTaskType = UNSET - title: Unset | str = UNSET - content: Unset | str = UNSET - post_mortem_template_id: Unset | str = UNSET + task_type: UpdateSharepointPageTaskParamsTaskType | Unset = UNSET + title: str | Unset = UNSET + content: str | Unset = UNSET + post_mortem_template_id: str | Unset = 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -68,7 +70,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: Unset | UpdateSharepointPageTaskParamsTaskType + task_type: UpdateSharepointPageTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_sharepoint_page_task_params_task_type.py b/rootly_sdk/models/update_sharepoint_page_task_params_task_type.py index e10cdd33..38a12a47 100644 --- a/rootly_sdk/models/update_sharepoint_page_task_params_task_type.py +++ b/rootly_sdk/models/update_sharepoint_page_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateSharepointPageTaskParamsTaskType = Literal["update_sharepoint_page"] @@ -13,7 +13,7 @@ def check_update_sharepoint_page_task_params_task_type( if value is None: return None if value in UPDATE_SHAREPOINT_PAGE_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateSharepointPageTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SHAREPOINT_PAGE_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_shortcut_story_task_params.py b/rootly_sdk/models/update_shortcut_story_task_params.py index 96ad23fa..e313e0ac 100644 --- a/rootly_sdk/models/update_shortcut_story_task_params.py +++ b/rootly_sdk/models/update_shortcut_story_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,20 +25,20 @@ class UpdateShortcutStoryTaskParams: Attributes: story_id (str): The story id archivation (UpdateShortcutStoryTaskParamsArchivation): The archivation id and display name - 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 + 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 """ story_id: str - archivation: "UpdateShortcutStoryTaskParamsArchivation" - task_type: Unset | UpdateShortcutStoryTaskParamsTaskType = UNSET - title: Unset | str = UNSET - description: Unset | str = UNSET - labels: Unset | str = UNSET - due_date: Unset | str = UNSET + archivation: UpdateShortcutStoryTaskParamsArchivation + task_type: UpdateShortcutStoryTaskParamsTaskType | Unset = UNSET + title: str | Unset = UNSET + description: str | Unset = UNSET + labels: str | Unset = UNSET + due_date: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: archivation = self.archivation.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -87,7 +89,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: Unset | UpdateShortcutStoryTaskParamsTaskType + task_type: UpdateShortcutStoryTaskParamsTaskType | Unset 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 95ac2aae..faabfdc3 100644 --- a/rootly_sdk/models/update_shortcut_story_task_params_archivation.py +++ b/rootly_sdk/models/update_shortcut_story_task_params_archivation.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateShortcutStoryTaskParamsArchivation: """The archivation id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_story_task_params_task_type.py b/rootly_sdk/models/update_shortcut_story_task_params_task_type.py index 7b88b275..97d96eaf 100644 --- a/rootly_sdk/models/update_shortcut_story_task_params_task_type.py +++ b/rootly_sdk/models/update_shortcut_story_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateShortcutStoryTaskParamsTaskType = Literal["update_shortcut_story"] @@ -13,7 +13,7 @@ def check_update_shortcut_story_task_params_task_type( if value is None: return None if value in UPDATE_SHORTCUT_STORY_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateShortcutStoryTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SHORTCUT_STORY_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_shortcut_task_task_params.py b/rootly_sdk/models/update_shortcut_task_task_params.py index e1168caf..d0085575 100644 --- a/rootly_sdk/models/update_shortcut_task_task_params.py +++ b/rootly_sdk/models/update_shortcut_task_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,15 +26,15 @@ 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 (Union[Unset, UpdateShortcutTaskTaskParamsTaskType]): - description (Union[Unset, str]): The task description + task_type (UpdateShortcutTaskTaskParamsTaskType | Unset): + description (str | Unset): The task description """ task_id: str parent_story_id: str - completion: "UpdateShortcutTaskTaskParamsCompletion" - task_type: Unset | UpdateShortcutTaskTaskParamsTaskType = UNSET - description: Unset | str = UNSET + completion: UpdateShortcutTaskTaskParamsCompletion + task_type: UpdateShortcutTaskTaskParamsTaskType | Unset = UNSET + description: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: completion = self.completion.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -76,7 +78,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: Unset | UpdateShortcutTaskTaskParamsTaskType + task_type: UpdateShortcutTaskTaskParamsTaskType | Unset 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 fed6aadd..1d7d80bf 100644 --- a/rootly_sdk/models/update_shortcut_task_task_params_completion.py +++ b/rootly_sdk/models/update_shortcut_task_task_params_completion.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateShortcutTaskTaskParamsCompletion: """The completion id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/update_shortcut_task_task_params_task_type.py index 3c437be2..9f318ee9 100644 --- a/rootly_sdk/models/update_shortcut_task_task_params_task_type.py +++ b/rootly_sdk/models/update_shortcut_task_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateShortcutTaskTaskParamsTaskType = Literal["update_shortcut_task"] @@ -11,7 +11,7 @@ def check_update_shortcut_task_task_params_task_type(value: str | None) -> Updat if value is None: return None if value in UPDATE_SHORTCUT_TASK_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateShortcutTaskTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SHORTCUT_TASK_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_sla.py b/rootly_sdk/models/update_sla.py index 06214811..d08a458c 100644 --- a/rootly_sdk/models/update_sla.py +++ b/rootly_sdk/models/update_sla.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_sla_data import UpdateSlaData @@ -18,14 +19,13 @@ class UpdateSla: data (UpdateSlaData): """ - data: "UpdateSlaData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateSlaData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_sla.additional_properties = d return update_sla - - @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_sla_data.py b/rootly_sdk/models/update_sla_data.py index 8676003f..1a99b59a 100644 --- a/rootly_sdk/models/update_sla_data.py +++ b/rootly_sdk/models/update_sla_data.py @@ -1,10 +1,12 @@ +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_sla_data_type import UpdateSlaDataType, check_update_sla_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_sla_data_attributes import UpdateSlaDataAttributes @@ -19,25 +21,31 @@ class UpdateSlaData: Attributes: type_ (UpdateSlaDataType): attributes (UpdateSlaDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateSlaDataType - attributes: "UpdateSlaDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateSlaDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateSlaDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_sla_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_sla_data.additional_properties = d return update_sla_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_sla_data_attributes.py b/rootly_sdk/models/update_sla_data_attributes.py index e16d8136..174e0e2a 100644 --- a/rootly_sdk/models/update_sla_data_attributes.py +++ b/rootly_sdk/models/update_sla_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast from uuid import UUID @@ -40,57 +42,57 @@ class UpdateSlaDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + 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 `manager_role_id` or `manager_user_id` must be provided. - manager_user_id (Union[None, Unset, int]): The ID of the user responsible for this SLA. Exactly one of + manager_user_id (int | None | Unset): 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 (Union[Unset, UpdateSlaDataAttributesAssignmentDeadlineDays]): Number of days for the + assignment_deadline_days (UpdateSlaDataAttributesAssignmentDeadlineDays | Unset): Number of days for the assignment deadline - 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 + 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 completion deadline - 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. + 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. """ - 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 + slug: None | str | Unset = UNSET + 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 def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -98,23 +100,23 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - condition_match_type: Unset | str = UNSET + condition_match_type: str | Unset = UNSET if not isinstance(self.condition_match_type, Unset): condition_match_type = self.condition_match_type - manager_role_id: None | Unset | str + manager_role_id: None | str | Unset if isinstance(self.manager_role_id, Unset): manager_role_id = UNSET elif isinstance(self.manager_role_id, UUID): @@ -122,21 +124,21 @@ def to_dict(self) -> dict[str, Any]: else: manager_role_id = self.manager_role_id - manager_user_id: None | Unset | int + manager_user_id: int | None | Unset if isinstance(self.manager_user_id, Unset): manager_user_id = UNSET else: manager_user_id = self.manager_user_id - assignment_deadline_days: Unset | int = UNSET + assignment_deadline_days: int | Unset = UNSET if not isinstance(self.assignment_deadline_days, Unset): assignment_deadline_days = self.assignment_deadline_days - assignment_deadline_parent_status: Unset | str = UNSET + assignment_deadline_parent_status: str | Unset = 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 | Unset | str + assignment_deadline_sub_status_id: None | str | Unset if isinstance(self.assignment_deadline_sub_status_id, Unset): assignment_deadline_sub_status_id = UNSET elif isinstance(self.assignment_deadline_sub_status_id, UUID): @@ -146,15 +148,15 @@ def to_dict(self) -> dict[str, Any]: assignment_skip_weekends = self.assignment_skip_weekends - completion_deadline_days: Unset | int = UNSET + completion_deadline_days: int | Unset = UNSET if not isinstance(self.completion_deadline_days, Unset): completion_deadline_days = self.completion_deadline_days - completion_deadline_parent_status: Unset | str = UNSET + completion_deadline_parent_status: str | Unset = 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 | Unset | str + completion_deadline_sub_status_id: None | str | Unset if isinstance(self.completion_deadline_sub_status_id, Unset): completion_deadline_sub_status_id = UNSET elif isinstance(self.completion_deadline_sub_status_id, UUID): @@ -164,14 +166,14 @@ def to_dict(self) -> dict[str, Any]: completion_skip_weekends = self.completion_skip_weekends - conditions: Unset | list[dict[str, Any]] = UNSET + conditions: list[dict[str, Any]] | Unset = 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: Unset | list[dict[str, Any]] = UNSET + notification_configurations: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.notification_configurations, Unset): notification_configurations = [] for notification_configurations_item_data in self.notification_configurations: @@ -227,43 +229,43 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) _condition_match_type = d.pop("condition_match_type", UNSET) - condition_match_type: Unset | UpdateSlaDataAttributesConditionMatchType + condition_match_type: UpdateSlaDataAttributesConditionMatchType | Unset 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 | UUID | Unset: + def _parse_manager_role_id(data: object) -> None | Unset | UUID: if data is None: return data if isinstance(data, Unset): @@ -274,23 +276,23 @@ def _parse_manager_role_id(data: object) -> None | UUID | Unset: manager_role_id_type_0 = UUID(data) return manager_role_id_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | UUID | Unset, data) + return cast(None | Unset | UUID, data) manager_role_id = _parse_manager_role_id(d.pop("manager_role_id", UNSET)) - def _parse_manager_user_id(data: object) -> None | Unset | int: + def _parse_manager_user_id(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, 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: Unset | UpdateSlaDataAttributesAssignmentDeadlineDays + assignment_deadline_days: UpdateSlaDataAttributesAssignmentDeadlineDays | Unset if isinstance(_assignment_deadline_days, Unset): assignment_deadline_days = UNSET else: @@ -299,7 +301,7 @@ def _parse_manager_user_id(data: object) -> None | Unset | int: ) _assignment_deadline_parent_status = d.pop("assignment_deadline_parent_status", UNSET) - assignment_deadline_parent_status: Unset | UpdateSlaDataAttributesAssignmentDeadlineParentStatus + assignment_deadline_parent_status: UpdateSlaDataAttributesAssignmentDeadlineParentStatus | Unset if isinstance(_assignment_deadline_parent_status, Unset): assignment_deadline_parent_status = UNSET else: @@ -307,7 +309,7 @@ def _parse_manager_user_id(data: object) -> None | Unset | int: _assignment_deadline_parent_status ) - def _parse_assignment_deadline_sub_status_id(data: object) -> None | UUID | Unset: + def _parse_assignment_deadline_sub_status_id(data: object) -> None | Unset | UUID: if data is None: return data if isinstance(data, Unset): @@ -318,9 +320,9 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | UUID | Unse assignment_deadline_sub_status_id_type_0 = UUID(data) return assignment_deadline_sub_status_id_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | UUID | Unset, data) + return cast(None | Unset | UUID, data) assignment_deadline_sub_status_id = _parse_assignment_deadline_sub_status_id( d.pop("assignment_deadline_sub_status_id", UNSET) @@ -329,7 +331,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | UUID | Unse assignment_skip_weekends = d.pop("assignment_skip_weekends", UNSET) _completion_deadline_days = d.pop("completion_deadline_days", UNSET) - completion_deadline_days: Unset | UpdateSlaDataAttributesCompletionDeadlineDays + completion_deadline_days: UpdateSlaDataAttributesCompletionDeadlineDays | Unset if isinstance(_completion_deadline_days, Unset): completion_deadline_days = UNSET else: @@ -338,7 +340,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | UUID | Unse ) _completion_deadline_parent_status = d.pop("completion_deadline_parent_status", UNSET) - completion_deadline_parent_status: Unset | UpdateSlaDataAttributesCompletionDeadlineParentStatus + completion_deadline_parent_status: UpdateSlaDataAttributesCompletionDeadlineParentStatus | Unset if isinstance(_completion_deadline_parent_status, Unset): completion_deadline_parent_status = UNSET else: @@ -346,7 +348,7 @@ def _parse_assignment_deadline_sub_status_id(data: object) -> None | UUID | Unse _completion_deadline_parent_status ) - def _parse_completion_deadline_sub_status_id(data: object) -> None | UUID | Unset: + def _parse_completion_deadline_sub_status_id(data: object) -> None | Unset | UUID: if data is None: return data if isinstance(data, Unset): @@ -357,9 +359,9 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | UUID | Unse completion_deadline_sub_status_id_type_0 = UUID(data) return completion_deadline_sub_status_id_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | UUID | Unset, data) + return cast(None | Unset | UUID, data) completion_deadline_sub_status_id = _parse_completion_deadline_sub_status_id( d.pop("completion_deadline_sub_status_id", UNSET) @@ -367,21 +369,25 @@ def _parse_completion_deadline_sub_status_id(data: object) -> None | UUID | Unse completion_skip_weekends = d.pop("completion_skip_weekends", UNSET) - conditions = [] _conditions = d.pop("conditions", UNSET) - for conditions_item_data in _conditions or []: - conditions_item = UpdateSlaDataAttributesConditionsItem.from_dict(conditions_item_data) + 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) - conditions.append(conditions_item) + conditions.append(conditions_item) - notification_configurations = [] _notification_configurations = d.pop("notification_configurations", UNSET) - for notification_configurations_item_data in _notification_configurations or []: - notification_configurations_item = UpdateSlaDataAttributesNotificationConfigurationsItem.from_dict( - notification_configurations_item_data - ) + 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 + ) - notification_configurations.append(notification_configurations_item) + notification_configurations.append(notification_configurations_item) update_sla_data_attributes = cls( slug=slug, diff --git a/rootly_sdk/models/update_sla_data_attributes_assignment_deadline_days.py b/rootly_sdk/models/update_sla_data_attributes_assignment_deadline_days.py index b8860340..fe10ea00 100644 --- a/rootly_sdk/models/update_sla_data_attributes_assignment_deadline_days.py +++ b/rootly_sdk/models/update_sla_data_attributes_assignment_deadline_days.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateSlaDataAttributesAssignmentDeadlineDays = Literal[1, 2, 3, 4, 5, 6, 7, 14, 21, 30] @@ -20,7 +20,7 @@ def check_update_sla_data_attributes_assignment_deadline_days( value: int, ) -> UpdateSlaDataAttributesAssignmentDeadlineDays: if value in UPDATE_SLA_DATA_ATTRIBUTES_ASSIGNMENT_DEADLINE_DAYS_VALUES: - return cast(UpdateSlaDataAttributesAssignmentDeadlineDays, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SLA_DATA_ATTRIBUTES_ASSIGNMENT_DEADLINE_DAYS_VALUES!r}" ) diff --git a/rootly_sdk/models/update_sla_data_attributes_assignment_deadline_parent_status.py b/rootly_sdk/models/update_sla_data_attributes_assignment_deadline_parent_status.py index 3ef51437..d3f93de1 100644 --- a/rootly_sdk/models/update_sla_data_attributes_assignment_deadline_parent_status.py +++ b/rootly_sdk/models/update_sla_data_attributes_assignment_deadline_parent_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateSlaDataAttributesAssignmentDeadlineParentStatus = Literal[ "cancelled", "closed", "in_triage", "mitigated", "resolved", "started" @@ -22,7 +22,7 @@ def check_update_sla_data_attributes_assignment_deadline_parent_status( if value is None: return None if value in UPDATE_SLA_DATA_ATTRIBUTES_ASSIGNMENT_DEADLINE_PARENT_STATUS_VALUES: - return cast(UpdateSlaDataAttributesAssignmentDeadlineParentStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SLA_DATA_ATTRIBUTES_ASSIGNMENT_DEADLINE_PARENT_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/update_sla_data_attributes_completion_deadline_days.py b/rootly_sdk/models/update_sla_data_attributes_completion_deadline_days.py index 53f9f041..fa22617f 100644 --- a/rootly_sdk/models/update_sla_data_attributes_completion_deadline_days.py +++ b/rootly_sdk/models/update_sla_data_attributes_completion_deadline_days.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateSlaDataAttributesCompletionDeadlineDays = Literal[1, 2, 3, 4, 5, 6, 7, 14, 21, 30] @@ -20,7 +20,7 @@ def check_update_sla_data_attributes_completion_deadline_days( value: int, ) -> UpdateSlaDataAttributesCompletionDeadlineDays: if value in UPDATE_SLA_DATA_ATTRIBUTES_COMPLETION_DEADLINE_DAYS_VALUES: - return cast(UpdateSlaDataAttributesCompletionDeadlineDays, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SLA_DATA_ATTRIBUTES_COMPLETION_DEADLINE_DAYS_VALUES!r}" ) diff --git a/rootly_sdk/models/update_sla_data_attributes_completion_deadline_parent_status.py b/rootly_sdk/models/update_sla_data_attributes_completion_deadline_parent_status.py index 02fe0c7c..abf475dd 100644 --- a/rootly_sdk/models/update_sla_data_attributes_completion_deadline_parent_status.py +++ b/rootly_sdk/models/update_sla_data_attributes_completion_deadline_parent_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateSlaDataAttributesCompletionDeadlineParentStatus = Literal[ "cancelled", "closed", "in_triage", "mitigated", "resolved", "started" @@ -22,7 +22,7 @@ def check_update_sla_data_attributes_completion_deadline_parent_status( if value is None: return None if value in UPDATE_SLA_DATA_ATTRIBUTES_COMPLETION_DEADLINE_PARENT_STATUS_VALUES: - return cast(UpdateSlaDataAttributesCompletionDeadlineParentStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SLA_DATA_ATTRIBUTES_COMPLETION_DEADLINE_PARENT_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/update_sla_data_attributes_condition_match_type.py b/rootly_sdk/models/update_sla_data_attributes_condition_match_type.py index 38d85ad7..5affe48a 100644 --- a/rootly_sdk/models/update_sla_data_attributes_condition_match_type.py +++ b/rootly_sdk/models/update_sla_data_attributes_condition_match_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateSlaDataAttributesConditionMatchType = Literal["ALL", "ANY"] @@ -14,7 +14,7 @@ def check_update_sla_data_attributes_condition_match_type( if value is None: return None if value in UPDATE_SLA_DATA_ATTRIBUTES_CONDITION_MATCH_TYPE_VALUES: - return cast(UpdateSlaDataAttributesConditionMatchType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SLA_DATA_ATTRIBUTES_CONDITION_MATCH_TYPE_VALUES!r}" ) 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 82f24748..365fdd73 100644 --- a/rootly_sdk/models/update_sla_data_attributes_conditions_item.py +++ b/rootly_sdk/models/update_sla_data_attributes_conditions_item.py @@ -1,9 +1,10 @@ +from __future__ import annotations + 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_sla_data_attributes_conditions_item_conditionable_type import ( UpdateSlaDataAttributesConditionsItemConditionableType, @@ -24,33 +25,32 @@ class UpdateSlaDataAttributesConditionsItem: Attributes: conditionable_type (UpdateSlaDataAttributesConditionsItemConditionableType): The type of condition operator (str): The comparison operator - 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 + 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 values); otherwise use 'status' (with parent status names). Sending the wrong one will return a validation error. - 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 + 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 """ conditionable_type: UpdateSlaDataAttributesConditionsItemConditionableType operator: str - 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) + property_: UpdateSlaDataAttributesConditionsItemProperty | Unset = UNSET + values: list[str] | None | Unset = UNSET + form_field_id: None | Unset | UUID = UNSET + position: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: conditionable_type: str = self.conditionable_type operator = self.operator - property_: Unset | str = UNSET + property_: str | Unset = UNSET if not isinstance(self.property_, Unset): property_ = self.property_ - values: None | Unset | list[str] + values: list[str] | None | Unset if isinstance(self.values, Unset): values = UNSET elif isinstance(self.values, list): @@ -59,7 +59,7 @@ def to_dict(self) -> dict[str, Any]: else: values = self.values - form_field_id: None | Unset | str + form_field_id: None | str | Unset if isinstance(self.form_field_id, Unset): form_field_id = UNSET elif isinstance(self.form_field_id, UUID): @@ -70,7 +70,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "conditionable_type": conditionable_type, @@ -98,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_: Unset | UpdateSlaDataAttributesConditionsItemProperty + property_: UpdateSlaDataAttributesConditionsItemProperty | Unset if isinstance(_property_, Unset): property_ = UNSET else: property_ = check_update_sla_data_attributes_conditions_item_property(_property_) - def _parse_values(data: object) -> None | Unset | list[str]: + def _parse_values(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -115,13 +115,13 @@ def _parse_values(data: object) -> None | Unset | list[str]: values_type_0 = cast(list[str], data) return values_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) values = _parse_values(d.pop("values", UNSET)) - def _parse_form_field_id(data: object) -> None | UUID | Unset: + def _parse_form_field_id(data: object) -> None | Unset | UUID: if data is None: return data if isinstance(data, Unset): @@ -132,9 +132,9 @@ def _parse_form_field_id(data: object) -> None | UUID | Unset: form_field_id_type_0 = UUID(data) return form_field_id_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | UUID | Unset, data) + return cast(None | Unset | UUID, data) form_field_id = _parse_form_field_id(d.pop("form_field_id", UNSET)) @@ -149,21 +149,4 @@ def _parse_form_field_id(data: object) -> None | UUID | Unset: position=position, ) - update_sla_data_attributes_conditions_item.additional_properties = d return update_sla_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_sla_data_attributes_conditions_item_conditionable_type.py b/rootly_sdk/models/update_sla_data_attributes_conditions_item_conditionable_type.py index e3652003..15b10661 100644 --- a/rootly_sdk/models/update_sla_data_attributes_conditions_item_conditionable_type.py +++ b/rootly_sdk/models/update_sla_data_attributes_conditions_item_conditionable_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateSlaDataAttributesConditionsItemConditionableType = Literal[ "SLAs::BuiltInFieldCondition", "SLAs::CustomFieldCondition" @@ -18,7 +18,7 @@ def check_update_sla_data_attributes_conditions_item_conditionable_type( if value is None: return None if value in UPDATE_SLA_DATA_ATTRIBUTES_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES: - return cast(UpdateSlaDataAttributesConditionsItemConditionableType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SLA_DATA_ATTRIBUTES_CONDITIONS_ITEM_CONDITIONABLE_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_sla_data_attributes_conditions_item_property.py b/rootly_sdk/models/update_sla_data_attributes_conditions_item_property.py index 6cbbbbbb..8fe1fdb2 100644 --- a/rootly_sdk/models/update_sla_data_attributes_conditions_item_property.py +++ b/rootly_sdk/models/update_sla_data_attributes_conditions_item_property.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateSlaDataAttributesConditionsItemProperty = Literal[ "acknowledged_at", @@ -49,7 +49,7 @@ def check_update_sla_data_attributes_conditions_item_property( if value is None: return None if value in UPDATE_SLA_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_VALUES: - return cast(UpdateSlaDataAttributesConditionsItemProperty, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SLA_DATA_ATTRIBUTES_CONDITIONS_ITEM_PROPERTY_VALUES!r}" ) 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 9e6b7a2c..fa24d413 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,8 +1,9 @@ +from __future__ import annotations + 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.update_sla_data_attributes_notification_configurations_item_offset_type import ( UpdateSlaDataAttributesNotificationConfigurationsItemOffsetType, @@ -23,7 +24,6 @@ class UpdateSlaDataAttributesNotificationConfigurationsItem: offset_type: UpdateSlaDataAttributesNotificationConfigurationsItemOffsetType offset_days: int - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: offset_type: str = self.offset_type @@ -31,7 +31,7 @@ def to_dict(self) -> dict[str, Any]: offset_days = self.offset_days field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "offset_type": offset_type, @@ -55,21 +55,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: offset_days=offset_days, ) - update_sla_data_attributes_notification_configurations_item.additional_properties = d return update_sla_data_attributes_notification_configurations_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_sla_data_attributes_notification_configurations_item_offset_type.py b/rootly_sdk/models/update_sla_data_attributes_notification_configurations_item_offset_type.py index df9e54b1..af326b11 100644 --- a/rootly_sdk/models/update_sla_data_attributes_notification_configurations_item_offset_type.py +++ b/rootly_sdk/models/update_sla_data_attributes_notification_configurations_item_offset_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateSlaDataAttributesNotificationConfigurationsItemOffsetType = Literal["after_due", "before_due", "when_due"] @@ -17,7 +17,7 @@ def check_update_sla_data_attributes_notification_configurations_item_offset_typ if value is None: return None if value in UPDATE_SLA_DATA_ATTRIBUTES_NOTIFICATION_CONFIGURATIONS_ITEM_OFFSET_TYPE_VALUES: - return cast(UpdateSlaDataAttributesNotificationConfigurationsItemOffsetType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SLA_DATA_ATTRIBUTES_NOTIFICATION_CONFIGURATIONS_ITEM_OFFSET_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_sla_data_type.py b/rootly_sdk/models/update_sla_data_type.py index 31432935..3428c151 100644 --- a/rootly_sdk/models/update_sla_data_type.py +++ b/rootly_sdk/models/update_sla_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateSlaDataType = Literal["slas"] @@ -11,5 +11,5 @@ def check_update_sla_data_type(value: str | None) -> UpdateSlaDataType | None: if value is None: return None if value in UPDATE_SLA_DATA_TYPE_VALUES: - return cast(UpdateSlaDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_SLA_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_slack_canvas_task_params.py b/rootly_sdk/models/update_slack_canvas_task_params.py new file mode 100644 index 00000000..f9224b4a --- /dev/null +++ b/rootly_sdk/models/update_slack_canvas_task_params.py @@ -0,0 +1,161 @@ +from __future__ import annotations + +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 ..models.update_slack_canvas_task_params_operation import ( + UpdateSlackCanvasTaskParamsOperation, + check_update_slack_canvas_task_params_operation, +) +from ..models.update_slack_canvas_task_params_task_type import ( + UpdateSlackCanvasTaskParamsTaskType, + check_update_slack_canvas_task_params_task_type, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.update_slack_canvas_task_params_channel import UpdateSlackCanvasTaskParamsChannel + + +T = TypeVar("T", bound="UpdateSlackCanvasTaskParams") + + +@_attrs_define +class UpdateSlackCanvasTaskParams: + """Update the selected channel canvas using Markdown. The connected Slack app must have Canvas permissions. + + Attributes: + channel (UpdateSlackCanvasTaskParamsChannel): Slack channel containing the canvas. Channel IDs support Liquid + variables. + content (str): The canvas content in Markdown. Supports Liquid variables. + task_type (UpdateSlackCanvasTaskParamsTaskType | Unset): + operation (UpdateSlackCanvasTaskParamsOperation | Unset): Append content or replace the selected table or entire + canvas. Default: 'insert_at_end'. + section_name (None | str | Unset): With replace, target the single table containing this label. Include the + label in the replacement table. Blank replaces the entire canvas. Supports Liquid. + retry_count (int | Unset): Number of times to retry on rate-limit (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. + """ + + channel: UpdateSlackCanvasTaskParamsChannel + content: str + task_type: UpdateSlackCanvasTaskParamsTaskType | Unset = UNSET + operation: UpdateSlackCanvasTaskParamsOperation | Unset = "insert_at_end" + section_name: None | str | Unset = UNSET + retry_count: int | Unset = 0 + retry_wait_time: int | Unset = 1 + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + channel = self.channel.to_dict() + + content = self.content + + task_type: str | Unset = UNSET + if not isinstance(self.task_type, Unset): + task_type = self.task_type + + operation: str | Unset = UNSET + if not isinstance(self.operation, Unset): + operation = self.operation + + section_name: None | str | Unset + if isinstance(self.section_name, Unset): + section_name = UNSET + else: + section_name = self.section_name + + 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( + { + "channel": channel, + "content": content, + } + ) + if task_type is not UNSET: + field_dict["task_type"] = task_type + if operation is not UNSET: + field_dict["operation"] = operation + if section_name is not UNSET: + field_dict["section_name"] = section_name + 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 + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_slack_canvas_task_params_channel import UpdateSlackCanvasTaskParamsChannel + + d = dict(src_dict) + channel = UpdateSlackCanvasTaskParamsChannel.from_dict(d.pop("channel")) + + content = d.pop("content") + + _task_type = d.pop("task_type", UNSET) + task_type: UpdateSlackCanvasTaskParamsTaskType | Unset + if isinstance(_task_type, Unset): + task_type = UNSET + else: + task_type = check_update_slack_canvas_task_params_task_type(_task_type) + + _operation = d.pop("operation", UNSET) + operation: UpdateSlackCanvasTaskParamsOperation | Unset + if isinstance(_operation, Unset): + operation = UNSET + else: + operation = check_update_slack_canvas_task_params_operation(_operation) + + def _parse_section_name(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + section_name = _parse_section_name(d.pop("section_name", UNSET)) + + retry_count = d.pop("retry_count", UNSET) + + retry_wait_time = d.pop("retry_wait_time", UNSET) + + update_slack_canvas_task_params = cls( + channel=channel, + content=content, + task_type=task_type, + operation=operation, + section_name=section_name, + retry_count=retry_count, + retry_wait_time=retry_wait_time, + ) + + update_slack_canvas_task_params.additional_properties = d + return update_slack_canvas_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/update_slack_canvas_task_params_channel.py b/rootly_sdk/models/update_slack_canvas_task_params_channel.py new file mode 100644 index 00000000..0516923d --- /dev/null +++ b/rootly_sdk/models/update_slack_canvas_task_params_channel.py @@ -0,0 +1,51 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="UpdateSlackCanvasTaskParamsChannel") + + +@_attrs_define +class UpdateSlackCanvasTaskParamsChannel: + """Slack channel containing the canvas. Channel IDs support Liquid variables. + + Attributes: + id (str): Slack channel ID. Example: {{ incident.slack_channel_id }}. + name (str): Channel display name. Example: incident-channel. + """ + + id: str + name: str + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "id": id, + "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") + + name = d.pop("name") + + update_slack_canvas_task_params_channel = cls( + id=id, + name=name, + ) + + return update_slack_canvas_task_params_channel diff --git a/rootly_sdk/models/update_slack_canvas_task_params_operation.py b/rootly_sdk/models/update_slack_canvas_task_params_operation.py new file mode 100644 index 00000000..1f951bee --- /dev/null +++ b/rootly_sdk/models/update_slack_canvas_task_params_operation.py @@ -0,0 +1,16 @@ +from typing import Literal + +UpdateSlackCanvasTaskParamsOperation = Literal["insert_at_end", "replace"] + +UPDATE_SLACK_CANVAS_TASK_PARAMS_OPERATION_VALUES: set[UpdateSlackCanvasTaskParamsOperation] = { + "insert_at_end", + "replace", +} + + +def check_update_slack_canvas_task_params_operation(value: str | None) -> UpdateSlackCanvasTaskParamsOperation | None: + if value is None: + return None + if value in UPDATE_SLACK_CANVAS_TASK_PARAMS_OPERATION_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_SLACK_CANVAS_TASK_PARAMS_OPERATION_VALUES!r}") diff --git a/rootly_sdk/models/update_slack_canvas_task_params_task_type.py b/rootly_sdk/models/update_slack_canvas_task_params_task_type.py new file mode 100644 index 00000000..ca4d3a30 --- /dev/null +++ b/rootly_sdk/models/update_slack_canvas_task_params_task_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +UpdateSlackCanvasTaskParamsTaskType = Literal["update_slack_canvas"] + +UPDATE_SLACK_CANVAS_TASK_PARAMS_TASK_TYPE_VALUES: set[UpdateSlackCanvasTaskParamsTaskType] = { + "update_slack_canvas", +} + + +def check_update_slack_canvas_task_params_task_type(value: str | None) -> UpdateSlackCanvasTaskParamsTaskType | None: + if value is None: + return None + if value in UPDATE_SLACK_CANVAS_TASK_PARAMS_TASK_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_SLACK_CANVAS_TASK_PARAMS_TASK_TYPE_VALUES!r}") 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 50023adc..c63222ab 100644 --- a/rootly_sdk/models/update_slack_channel_topic_task_params.py +++ b/rootly_sdk/models/update_slack_channel_topic_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -23,12 +25,18 @@ class UpdateSlackChannelTopicTaskParams: Attributes: channel (UpdateSlackChannelTopicTaskParamsChannel): topic (str): - task_type (Union[Unset, UpdateSlackChannelTopicTaskParamsTaskType]): + task_type (UpdateSlackChannelTopicTaskParamsTaskType | Unset): + retry_count (int | Unset): Number of times to retry on rate-limit (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. """ - channel: "UpdateSlackChannelTopicTaskParamsChannel" + channel: UpdateSlackChannelTopicTaskParamsChannel topic: str - task_type: Unset | UpdateSlackChannelTopicTaskParamsTaskType = UNSET + task_type: UpdateSlackChannelTopicTaskParamsTaskType | Unset = UNSET + retry_count: int | Unset = 0 + retry_wait_time: int | Unset = 1 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -36,10 +44,14 @@ def to_dict(self) -> dict[str, Any]: topic = self.topic - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type + 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( @@ -50,6 +62,10 @@ def to_dict(self) -> dict[str, Any]: ) if task_type is not UNSET: field_dict["task_type"] = task_type + 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 @@ -63,16 +79,22 @@ 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: Unset | UpdateSlackChannelTopicTaskParamsTaskType + task_type: UpdateSlackChannelTopicTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: task_type = check_update_slack_channel_topic_task_params_task_type(_task_type) + retry_count = d.pop("retry_count", UNSET) + + retry_wait_time = d.pop("retry_wait_time", UNSET) + update_slack_channel_topic_task_params = cls( channel=channel, topic=topic, task_type=task_type, + retry_count=retry_count, + retry_wait_time=retry_wait_time, ) update_slack_channel_topic_task_params.additional_properties = d 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 fc44769d..134f02c9 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class UpdateSlackChannelTopicTaskParamsChannel: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_slack_channel_topic_task_params_task_type.py b/rootly_sdk/models/update_slack_channel_topic_task_params_task_type.py index c50cca68..21af55f7 100644 --- a/rootly_sdk/models/update_slack_channel_topic_task_params_task_type.py +++ b/rootly_sdk/models/update_slack_channel_topic_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateSlackChannelTopicTaskParamsTaskType = Literal["update_slack_channel_topic"] @@ -13,7 +13,7 @@ def check_update_slack_channel_topic_task_params_task_type( if value is None: return None if value in UPDATE_SLACK_CHANNEL_TOPIC_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateSlackChannelTopicTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_SLACK_CHANNEL_TOPIC_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_status_page.py b/rootly_sdk/models/update_status_page.py index 3cbbccdd..e68774db 100644 --- a/rootly_sdk/models/update_status_page.py +++ b/rootly_sdk/models/update_status_page.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_status_page_data import UpdateStatusPageData @@ -18,14 +19,13 @@ class UpdateStatusPage: data (UpdateStatusPageData): """ - data: "UpdateStatusPageData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateStatusPageData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_status_page.additional_properties = d return update_status_page - - @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.py b/rootly_sdk/models/update_status_page_announcement.py index 4fa689e1..7c661023 100644 --- a/rootly_sdk/models/update_status_page_announcement.py +++ b/rootly_sdk/models/update_status_page_announcement.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_status_page_announcement_data import UpdateStatusPageAnnouncementData @@ -18,14 +19,13 @@ class UpdateStatusPageAnnouncement: data (UpdateStatusPageAnnouncementData): """ - data: "UpdateStatusPageAnnouncementData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateStatusPageAnnouncementData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 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 index d3144c10..e2d3b98e 100644 --- a/rootly_sdk/models/update_status_page_announcement_data.py +++ b/rootly_sdk/models/update_status_page_announcement_data.py @@ -1,13 +1,15 @@ +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_status_page_announcement_data_type import ( UpdateStatusPageAnnouncementDataType, check_update_status_page_announcement_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_status_page_announcement_data_attributes import UpdateStatusPageAnnouncementDataAttributes @@ -22,25 +24,31 @@ class UpdateStatusPageAnnouncementData: Attributes: type_ (UpdateStatusPageAnnouncementDataType): attributes (UpdateStatusPageAnnouncementDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateStatusPageAnnouncementDataType - attributes: "UpdateStatusPageAnnouncementDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateStatusPageAnnouncementDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateStatusPageAnnouncementDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_status_page_announcement_data = cls( type_=type_, attributes=attributes, + id=id, ) - 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 index 3e6c7fbe..d27f7d11 100644 --- a/rootly_sdk/models/update_status_page_announcement_data_attributes.py +++ b/rootly_sdk/models/update_status_page_announcement_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -12,12 +14,12 @@ class UpdateStatusPageAnnouncementDataAttributes: """ Attributes: - title (Union[Unset, str]): Title of the announcement - body (Union[Unset, str]): Body of the announcement + title (str | Unset): Title of the announcement + body (str | Unset): Body of the announcement """ - title: Unset | str = UNSET - body: Unset | str = UNSET + title: str | Unset = UNSET + body: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: title = self.title diff --git a/rootly_sdk/models/update_status_page_announcement_data_type.py b/rootly_sdk/models/update_status_page_announcement_data_type.py index 503f646e..c6822d92 100644 --- a/rootly_sdk/models/update_status_page_announcement_data_type.py +++ b/rootly_sdk/models/update_status_page_announcement_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateStatusPageAnnouncementDataType = Literal["status_page_announcements"] @@ -11,5 +11,5 @@ def check_update_status_page_announcement_data_type(value: str | None) -> Update if value is None: return None if value in UPDATE_STATUS_PAGE_ANNOUNCEMENT_DATA_TYPE_VALUES: - return cast(UpdateStatusPageAnnouncementDataType, value) + return 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 index a2aeabac..8822c6b6 100644 --- a/rootly_sdk/models/update_status_page_component.py +++ b/rootly_sdk/models/update_status_page_component.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_status_page_component_data import UpdateStatusPageComponentData @@ -18,14 +19,13 @@ class UpdateStatusPageComponent: data (UpdateStatusPageComponentData): """ - data: "UpdateStatusPageComponentData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateStatusPageComponentData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 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 index f41707fe..6dfc1da0 100644 --- a/rootly_sdk/models/update_status_page_component_data.py +++ b/rootly_sdk/models/update_status_page_component_data.py @@ -1,13 +1,15 @@ +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_status_page_component_data_type import ( UpdateStatusPageComponentDataType, check_update_status_page_component_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_status_page_component_data_attributes import UpdateStatusPageComponentDataAttributes @@ -22,25 +24,31 @@ class UpdateStatusPageComponentData: Attributes: type_ (UpdateStatusPageComponentDataType): attributes (UpdateStatusPageComponentDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateStatusPageComponentDataType - attributes: "UpdateStatusPageComponentDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateStatusPageComponentDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateStatusPageComponentDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_status_page_component_data = cls( type_=type_, attributes=attributes, + id=id, ) - 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 index ede7577d..44ec3c7e 100644 --- a/rootly_sdk/models/update_status_page_component_data_attributes.py +++ b/rootly_sdk/models/update_status_page_component_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,33 +14,33 @@ 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 + name (None | str | Unset): Name of the component (ad-hoc components only) + description (None | str | Unset): Description of the component (ad-hoc components only) + status_page_component_group_id (None | str | Unset): ID of the component group on the same status page (null + moves the component to the top level) + position (int | Unset): 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 + name: None | str | Unset = UNSET + description: None | str | Unset = UNSET + status_page_component_group_id: None | str | Unset = UNSET + position: int | Unset = UNSET def to_dict(self) -> dict[str, Any]: - name: None | Unset | str + name: None | str | Unset if isinstance(self.name, Unset): name = UNSET else: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - status_page_component_group_id: None | Unset | str + status_page_component_group_id: None | str | Unset if isinstance(self.status_page_component_group_id, Unset): status_page_component_group_id = UNSET else: @@ -64,30 +66,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_name(data: object) -> None | Unset | str: + def _parse_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) name = _parse_name(d.pop("name", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_status_page_component_group_id(data: object) -> None | Unset | str: + def _parse_status_page_component_group_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) status_page_component_group_id = _parse_status_page_component_group_id( d.pop("status_page_component_group_id", UNSET) diff --git a/rootly_sdk/models/update_status_page_component_data_type.py b/rootly_sdk/models/update_status_page_component_data_type.py index 297ae8c3..b0d1e6d9 100644 --- a/rootly_sdk/models/update_status_page_component_data_type.py +++ b/rootly_sdk/models/update_status_page_component_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateStatusPageComponentDataType = Literal["status_page_components"] @@ -11,5 +11,5 @@ def check_update_status_page_component_data_type(value: str | None) -> UpdateSta if value is None: return None if value in UPDATE_STATUS_PAGE_COMPONENT_DATA_TYPE_VALUES: - return cast(UpdateStatusPageComponentDataType, value) + return 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 index 1832b9ce..8cee2050 100644 --- a/rootly_sdk/models/update_status_page_component_group.py +++ b/rootly_sdk/models/update_status_page_component_group.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_status_page_component_group_data import UpdateStatusPageComponentGroupData @@ -18,14 +19,13 @@ class UpdateStatusPageComponentGroup: data (UpdateStatusPageComponentGroupData): """ - data: "UpdateStatusPageComponentGroupData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateStatusPageComponentGroupData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 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 index 3ff92539..ff80350b 100644 --- a/rootly_sdk/models/update_status_page_component_group_data.py +++ b/rootly_sdk/models/update_status_page_component_group_data.py @@ -1,13 +1,15 @@ +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_status_page_component_group_data_type import ( UpdateStatusPageComponentGroupDataType, check_update_status_page_component_group_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_status_page_component_group_data_attributes import UpdateStatusPageComponentGroupDataAttributes @@ -22,25 +24,31 @@ class UpdateStatusPageComponentGroupData: Attributes: type_ (UpdateStatusPageComponentGroupDataType): attributes (UpdateStatusPageComponentGroupDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateStatusPageComponentGroupDataType - attributes: "UpdateStatusPageComponentGroupDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateStatusPageComponentGroupDataAttributes + id: str | Unset = 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 @@ -55,26 +63,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateStatusPageComponentGroupDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_status_page_component_group_data = cls( type_=type_, attributes=attributes, + id=id, ) - 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 index addfcaed..fb5996dd 100644 --- a/rootly_sdk/models/update_status_page_component_group_data_attributes.py +++ b/rootly_sdk/models/update_status_page_component_group_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,22 +14,22 @@ 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 + name (str | Unset): Name of the component group + description (None | str | Unset): Description of the component group + position (int | Unset): 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 + collapsed_by_default (bool | None | Unset): 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 + name: str | Unset = UNSET + description: None | str | Unset = UNSET + position: int | Unset = UNSET + collapsed_by_default: bool | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -35,7 +37,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position - collapsed_by_default: None | Unset | bool + collapsed_by_default: bool | None | Unset if isinstance(self.collapsed_by_default, Unset): collapsed_by_default = UNSET else: @@ -60,23 +62,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 | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) position = d.pop("position", UNSET) - def _parse_collapsed_by_default(data: object) -> None | Unset | bool: + def _parse_collapsed_by_default(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) collapsed_by_default = _parse_collapsed_by_default(d.pop("collapsed_by_default", UNSET)) 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 index 6ae36636..12241005 100644 --- a/rootly_sdk/models/update_status_page_component_group_data_type.py +++ b/rootly_sdk/models/update_status_page_component_group_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateStatusPageComponentGroupDataType = Literal["status_page_component_groups"] @@ -13,7 +13,7 @@ def check_update_status_page_component_group_data_type( if value is None: return None if value in UPDATE_STATUS_PAGE_COMPONENT_GROUP_DATA_TYPE_VALUES: - return cast(UpdateStatusPageComponentGroupDataType, value) + return 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 a0601657..d3ceaa38 100644 --- a/rootly_sdk/models/update_status_page_data.py +++ b/rootly_sdk/models/update_status_page_data.py @@ -1,10 +1,12 @@ +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_status_page_data_type import UpdateStatusPageDataType, check_update_status_page_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_status_page_data_attributes import UpdateStatusPageDataAttributes @@ -19,25 +21,31 @@ class UpdateStatusPageData: Attributes: type_ (UpdateStatusPageDataType): attributes (UpdateStatusPageDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateStatusPageDataType - attributes: "UpdateStatusPageDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateStatusPageDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateStatusPageDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_status_page_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_status_page_data.additional_properties = d return update_status_page_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_data_attributes.py b/rootly_sdk/models/update_status_page_data_attributes.py index 49be7823..ef1e195e 100644 --- a/rootly_sdk/models/update_status_page_data_attributes.py +++ b/rootly_sdk/models/update_status_page_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -28,77 +30,77 @@ class UpdateStatusPageDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `title`; any submitted value is ignored. This + slug (None | str | Unset): 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 + 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 search results - 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 + 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 Default: 'none'. - authentication_enabled (Union[None, Unset, bool]): Enable authentication (deprecated - use authentication_method + authentication_enabled (bool | None | Unset): Enable authentication (deprecated - use authentication_method instead) Default: False. - 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 + 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 identifier format - 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 + 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 """ - 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 + slug: None | str | Unset = UNSET + 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 def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -106,103 +108,103 @@ def to_dict(self) -> dict[str, Any]: title = self.title - public_title: None | Unset | str + public_title: None | str | Unset if isinstance(self.public_title, Unset): public_title = UNSET else: public_title = self.public_title - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - header_color: None | Unset | str + header_color: None | str | Unset if isinstance(self.header_color, Unset): header_color = UNSET else: header_color = self.header_color - footer_color: None | Unset | str + footer_color: None | str | Unset if isinstance(self.footer_color, Unset): footer_color = UNSET else: footer_color = self.footer_color - allow_search_engine_index: None | Unset | bool + allow_search_engine_index: bool | None | Unset 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: None | Unset | bool + show_uptime: bool | None | Unset if isinstance(self.show_uptime, Unset): show_uptime = UNSET else: show_uptime = self.show_uptime - show_uptime_last_days: Unset | int = UNSET + show_uptime_last_days: int | Unset = UNSET if not isinstance(self.show_uptime_last_days, Unset): show_uptime_last_days = self.show_uptime_last_days - success_message: None | Unset | str + success_message: None | str | Unset if isinstance(self.success_message, Unset): success_message = UNSET else: success_message = self.success_message - failure_message: None | Unset | str + failure_message: None | str | Unset if isinstance(self.failure_message, Unset): failure_message = UNSET else: failure_message = self.failure_message - authentication_method: Unset | str = UNSET + authentication_method: str | Unset = UNSET if not isinstance(self.authentication_method, Unset): authentication_method = self.authentication_method - authentication_enabled: None | Unset | bool + authentication_enabled: bool | None | Unset if isinstance(self.authentication_enabled, Unset): authentication_enabled = UNSET else: authentication_enabled = self.authentication_enabled - authentication_password: None | Unset | str + authentication_password: None | str | Unset if isinstance(self.authentication_password, Unset): authentication_password = UNSET else: authentication_password = self.authentication_password - saml_idp_sso_service_url: None | Unset | str + saml_idp_sso_service_url: None | str | Unset 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 | Unset | str + saml_idp_slo_service_url: None | str | Unset 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 | Unset | str + saml_idp_cert: None | str | Unset if isinstance(self.saml_idp_cert, Unset): saml_idp_cert = UNSET else: saml_idp_cert = self.saml_idp_cert - saml_name_identifier_format: Unset | str = UNSET + saml_name_identifier_format: str | Unset = UNSET if not isinstance(self.saml_name_identifier_format, Unset): saml_name_identifier_format = self.saml_name_identifier_format - section_order: None | Unset | list[str] + section_order: list[str] | None | Unset if isinstance(self.section_order, Unset): section_order = UNSET elif isinstance(self.section_order, list): @@ -214,7 +216,7 @@ def to_dict(self) -> dict[str, Any]: else: section_order = self.section_order - external_domain_names: None | Unset | list[str] + external_domain_names: list[str] | None | Unset if isinstance(self.external_domain_names, Unset): external_domain_names = UNSET elif isinstance(self.external_domain_names, list): @@ -223,51 +225,51 @@ def to_dict(self) -> dict[str, Any]: else: external_domain_names = self.external_domain_names - website_url: None | Unset | str + website_url: None | str | Unset if isinstance(self.website_url, Unset): website_url = UNSET else: website_url = self.website_url - website_privacy_url: None | Unset | str + website_privacy_url: None | str | Unset if isinstance(self.website_privacy_url, Unset): website_privacy_url = UNSET else: website_privacy_url = self.website_privacy_url - website_support_url: None | Unset | str + website_support_url: None | str | Unset if isinstance(self.website_support_url, Unset): website_support_url = UNSET else: website_support_url = self.website_support_url - ga_tracking_id: None | Unset | str + ga_tracking_id: None | str | Unset if isinstance(self.ga_tracking_id, Unset): ga_tracking_id = UNSET else: ga_tracking_id = self.ga_tracking_id - time_zone: None | Unset | str + time_zone: None | str | Unset if isinstance(self.time_zone, Unset): time_zone = UNSET else: time_zone = self.time_zone - public: None | Unset | bool + public: bool | None | Unset if isinstance(self.public, Unset): public = UNSET else: public = self.public - service_ids: Unset | list[str] = UNSET + service_ids: list[str] | Unset = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: Unset | list[str] = UNSET + functionality_ids: list[str] | Unset = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - enabled: None | Unset | bool + enabled: bool | None | Unset if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -343,82 +345,82 @@ 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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) title = d.pop("title", UNSET) - def _parse_public_title(data: object) -> None | Unset | str: + def _parse_public_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_title = _parse_public_title(d.pop("public_title", UNSET)) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_header_color(data: object) -> None | Unset | str: + def _parse_header_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) header_color = _parse_header_color(d.pop("header_color", UNSET)) - def _parse_footer_color(data: object) -> None | Unset | str: + def _parse_footer_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) footer_color = _parse_footer_color(d.pop("footer_color", UNSET)) - def _parse_allow_search_engine_index(data: object) -> None | Unset | bool: + def _parse_allow_search_engine_index(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) allow_search_engine_index = _parse_allow_search_engine_index(d.pop("allow_search_engine_index", UNSET)) - def _parse_show_uptime(data: object) -> None | Unset | bool: + def _parse_show_uptime(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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: Unset | UpdateStatusPageDataAttributesShowUptimeLastDays + show_uptime_last_days: UpdateStatusPageDataAttributesShowUptimeLastDays | Unset if isinstance(_show_uptime_last_days, Unset): show_uptime_last_days = UNSET else: @@ -426,26 +428,26 @@ def _parse_show_uptime(data: object) -> None | Unset | bool: _show_uptime_last_days ) - def _parse_success_message(data: object) -> None | Unset | str: + def _parse_success_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) success_message = _parse_success_message(d.pop("success_message", UNSET)) - def _parse_failure_message(data: object) -> None | Unset | str: + def _parse_failure_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) failure_message = _parse_failure_message(d.pop("failure_message", UNSET)) _authentication_method = d.pop("authentication_method", UNSET) - authentication_method: Unset | UpdateStatusPageDataAttributesAuthenticationMethod + authentication_method: UpdateStatusPageDataAttributesAuthenticationMethod | Unset if isinstance(_authentication_method, Unset): authentication_method = UNSET else: @@ -453,53 +455,53 @@ def _parse_failure_message(data: object) -> None | Unset | str: _authentication_method ) - def _parse_authentication_enabled(data: object) -> None | Unset | bool: + def _parse_authentication_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) authentication_enabled = _parse_authentication_enabled(d.pop("authentication_enabled", UNSET)) - def _parse_authentication_password(data: object) -> None | Unset | str: + def _parse_authentication_password(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) authentication_password = _parse_authentication_password(d.pop("authentication_password", UNSET)) - def _parse_saml_idp_sso_service_url(data: object) -> None | Unset | str: + def _parse_saml_idp_sso_service_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_saml_idp_slo_service_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_saml_idp_cert(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: Unset | UpdateStatusPageDataAttributesSamlNameIdentifierFormat + saml_name_identifier_format: UpdateStatusPageDataAttributesSamlNameIdentifierFormat | Unset if isinstance(_saml_name_identifier_format, Unset): saml_name_identifier_format = UNSET else: @@ -509,7 +511,7 @@ def _parse_saml_idp_cert(data: object) -> None | Unset | str: def _parse_section_order( data: object, - ) -> None | Unset | list[UpdateStatusPageDataAttributesSectionOrderType0Item]: + ) -> list[UpdateStatusPageDataAttributesSectionOrderType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -527,13 +529,13 @@ def _parse_section_order( section_order_type_0.append(section_order_type_0_item) return section_order_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[UpdateStatusPageDataAttributesSectionOrderType0Item], data) + return cast(list[UpdateStatusPageDataAttributesSectionOrderType0Item] | None | Unset, data) section_order = _parse_section_order(d.pop("section_order", UNSET)) - def _parse_external_domain_names(data: object) -> None | Unset | list[str]: + def _parse_external_domain_names(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -544,63 +546,63 @@ def _parse_external_domain_names(data: object) -> None | Unset | list[str]: external_domain_names_type_0 = cast(list[str], data) return external_domain_names_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) external_domain_names = _parse_external_domain_names(d.pop("external_domain_names", UNSET)) - def _parse_website_url(data: object) -> None | Unset | str: + def _parse_website_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) website_url = _parse_website_url(d.pop("website_url", UNSET)) - def _parse_website_privacy_url(data: object) -> None | Unset | str: + def _parse_website_privacy_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) website_privacy_url = _parse_website_privacy_url(d.pop("website_privacy_url", UNSET)) - def _parse_website_support_url(data: object) -> None | Unset | str: + def _parse_website_support_url(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) website_support_url = _parse_website_support_url(d.pop("website_support_url", UNSET)) - def _parse_ga_tracking_id(data: object) -> None | Unset | str: + def _parse_ga_tracking_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) ga_tracking_id = _parse_ga_tracking_id(d.pop("ga_tracking_id", UNSET)) - def _parse_time_zone(data: object) -> None | Unset | str: + def _parse_time_zone(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) time_zone = _parse_time_zone(d.pop("time_zone", UNSET)) - def _parse_public(data: object) -> None | Unset | bool: + def _parse_public(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) public = _parse_public(d.pop("public", UNSET)) @@ -608,12 +610,12 @@ def _parse_public(data: object) -> None | Unset | bool: functionality_ids = cast(list[str], d.pop("functionality_ids", UNSET)) - def _parse_enabled(data: object) -> None | Unset | bool: + def _parse_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/update_status_page_data_attributes_authentication_method.py b/rootly_sdk/models/update_status_page_data_attributes_authentication_method.py index 279887a9..fbbf4fcf 100644 --- a/rootly_sdk/models/update_status_page_data_attributes_authentication_method.py +++ b/rootly_sdk/models/update_status_page_data_attributes_authentication_method.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateStatusPageDataAttributesAuthenticationMethod = Literal["none", "password", "saml"] @@ -17,7 +17,7 @@ def check_update_status_page_data_attributes_authentication_method( if value is None: return None if value in UPDATE_STATUS_PAGE_DATA_ATTRIBUTES_AUTHENTICATION_METHOD_VALUES: - return cast(UpdateStatusPageDataAttributesAuthenticationMethod, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_STATUS_PAGE_DATA_ATTRIBUTES_AUTHENTICATION_METHOD_VALUES!r}" ) diff --git a/rootly_sdk/models/update_status_page_data_attributes_saml_name_identifier_format.py b/rootly_sdk/models/update_status_page_data_attributes_saml_name_identifier_format.py index ac2f1a65..68a1ef75 100644 --- a/rootly_sdk/models/update_status_page_data_attributes_saml_name_identifier_format.py +++ b/rootly_sdk/models/update_status_page_data_attributes_saml_name_identifier_format.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateStatusPageDataAttributesSamlNameIdentifierFormat = Literal[ "urn:oasis:names:tc:SAML:1.1:nameid-format:emailAddress", @@ -23,7 +23,7 @@ def check_update_status_page_data_attributes_saml_name_identifier_format( if value is None: return None if value in UPDATE_STATUS_PAGE_DATA_ATTRIBUTES_SAML_NAME_IDENTIFIER_FORMAT_VALUES: - return cast(UpdateStatusPageDataAttributesSamlNameIdentifierFormat, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_STATUS_PAGE_DATA_ATTRIBUTES_SAML_NAME_IDENTIFIER_FORMAT_VALUES!r}" ) diff --git a/rootly_sdk/models/update_status_page_data_attributes_section_order_type_0_item.py b/rootly_sdk/models/update_status_page_data_attributes_section_order_type_0_item.py index 7fe9b768..863b9259 100644 --- a/rootly_sdk/models/update_status_page_data_attributes_section_order_type_0_item.py +++ b/rootly_sdk/models/update_status_page_data_attributes_section_order_type_0_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateStatusPageDataAttributesSectionOrderType0Item = Literal["incidents", "maintenance", "system_status"] @@ -17,7 +17,7 @@ def check_update_status_page_data_attributes_section_order_type_0_item( if value is None: return None if value in UPDATE_STATUS_PAGE_DATA_ATTRIBUTES_SECTION_ORDER_TYPE_0_ITEM_VALUES: - return cast(UpdateStatusPageDataAttributesSectionOrderType0Item, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_STATUS_PAGE_DATA_ATTRIBUTES_SECTION_ORDER_TYPE_0_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_status_page_data_attributes_show_uptime_last_days.py b/rootly_sdk/models/update_status_page_data_attributes_show_uptime_last_days.py index 6e3ef549..ca4821cc 100644 --- a/rootly_sdk/models/update_status_page_data_attributes_show_uptime_last_days.py +++ b/rootly_sdk/models/update_status_page_data_attributes_show_uptime_last_days.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateStatusPageDataAttributesShowUptimeLastDays = Literal[30, 60, 90] @@ -15,7 +15,7 @@ def check_update_status_page_data_attributes_show_uptime_last_days( value: int, ) -> UpdateStatusPageDataAttributesShowUptimeLastDays: if value in UPDATE_STATUS_PAGE_DATA_ATTRIBUTES_SHOW_UPTIME_LAST_DAYS_VALUES: - return cast(UpdateStatusPageDataAttributesShowUptimeLastDays, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_STATUS_PAGE_DATA_ATTRIBUTES_SHOW_UPTIME_LAST_DAYS_VALUES!r}" ) diff --git a/rootly_sdk/models/update_status_page_data_type.py b/rootly_sdk/models/update_status_page_data_type.py index 71242a9d..96db699a 100644 --- a/rootly_sdk/models/update_status_page_data_type.py +++ b/rootly_sdk/models/update_status_page_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateStatusPageDataType = Literal["status_pages"] @@ -11,5 +11,5 @@ def check_update_status_page_data_type(value: str | None) -> UpdateStatusPageDat if value is None: return None if value in UPDATE_STATUS_PAGE_DATA_TYPE_VALUES: - return cast(UpdateStatusPageDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_STATUS_PAGE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_status_page_team.py b/rootly_sdk/models/update_status_page_team.py new file mode 100644 index 00000000..1e2d20de --- /dev/null +++ b/rootly_sdk/models/update_status_page_team.py @@ -0,0 +1,48 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +if TYPE_CHECKING: + from ..models.update_status_page_team_data import UpdateStatusPageTeamData + + +T = TypeVar("T", bound="UpdateStatusPageTeam") + + +@_attrs_define +class UpdateStatusPageTeam: + """ + Attributes: + data (UpdateStatusPageTeamData): + """ + + data: UpdateStatusPageTeamData + + def to_dict(self) -> dict[str, Any]: + data = self.data.to_dict() + + field_dict: dict[str, Any] = {} + + 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_team_data import UpdateStatusPageTeamData + + d = dict(src_dict) + data = UpdateStatusPageTeamData.from_dict(d.pop("data")) + + update_status_page_team = cls( + data=data, + ) + + return update_status_page_team diff --git a/rootly_sdk/models/update_status_page_team_data.py b/rootly_sdk/models/update_status_page_team_data.py new file mode 100644 index 00000000..d65869f8 --- /dev/null +++ b/rootly_sdk/models/update_status_page_team_data.py @@ -0,0 +1,72 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import TYPE_CHECKING, Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.update_status_page_team_data_type import ( + UpdateStatusPageTeamDataType, + check_update_status_page_team_data_type, +) +from ..types import UNSET, Unset + +if TYPE_CHECKING: + from ..models.update_status_page_team_data_attributes import UpdateStatusPageTeamDataAttributes + + +T = TypeVar("T", bound="UpdateStatusPageTeamData") + + +@_attrs_define +class UpdateStatusPageTeamData: + """ + Attributes: + type_ (UpdateStatusPageTeamDataType): + attributes (UpdateStatusPageTeamDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. + """ + + type_: UpdateStatusPageTeamDataType + attributes: UpdateStatusPageTeamDataAttributes + id: str | Unset = 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( + { + "type": type_, + "attributes": attributes, + } + ) + if id is not UNSET: + field_dict["id"] = id + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + from ..models.update_status_page_team_data_attributes import UpdateStatusPageTeamDataAttributes + + d = dict(src_dict) + type_ = check_update_status_page_team_data_type(d.pop("type")) + + attributes = UpdateStatusPageTeamDataAttributes.from_dict(d.pop("attributes")) + + id = d.pop("id", UNSET) + + update_status_page_team_data = cls( + type_=type_, + attributes=attributes, + id=id, + ) + + return update_status_page_team_data diff --git a/rootly_sdk/models/update_status_page_team_data_attributes.py b/rootly_sdk/models/update_status_page_team_data_attributes.py new file mode 100644 index 00000000..b26c8354 --- /dev/null +++ b/rootly_sdk/models/update_status_page_team_data_attributes.py @@ -0,0 +1,55 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +from ..models.update_status_page_team_data_attributes_permission_level import ( + UpdateStatusPageTeamDataAttributesPermissionLevel, + check_update_status_page_team_data_attributes_permission_level, +) +from ..types import UNSET, Unset + +T = TypeVar("T", bound="UpdateStatusPageTeamDataAttributes") + + +@_attrs_define +class UpdateStatusPageTeamDataAttributes: + """ + Attributes: + permission_level (UpdateStatusPageTeamDataAttributesPermissionLevel | Unset): publish_only lets team members + post status page updates and announcements. edit_and_publish also lets them edit the page, its components, + templates, and subscribers + """ + + permission_level: UpdateStatusPageTeamDataAttributesPermissionLevel | Unset = UNSET + + def to_dict(self) -> dict[str, Any]: + permission_level: str | Unset = UNSET + if not isinstance(self.permission_level, Unset): + permission_level = self.permission_level + + field_dict: dict[str, Any] = {} + + field_dict.update({}) + if permission_level is not UNSET: + field_dict["permission_level"] = permission_level + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + _permission_level = d.pop("permission_level", UNSET) + permission_level: UpdateStatusPageTeamDataAttributesPermissionLevel | Unset + if isinstance(_permission_level, Unset): + permission_level = UNSET + else: + permission_level = check_update_status_page_team_data_attributes_permission_level(_permission_level) + + update_status_page_team_data_attributes = cls( + permission_level=permission_level, + ) + + return update_status_page_team_data_attributes diff --git a/rootly_sdk/models/update_status_page_team_data_attributes_permission_level.py b/rootly_sdk/models/update_status_page_team_data_attributes_permission_level.py new file mode 100644 index 00000000..26c7379f --- /dev/null +++ b/rootly_sdk/models/update_status_page_team_data_attributes_permission_level.py @@ -0,0 +1,22 @@ +from typing import Literal + +UpdateStatusPageTeamDataAttributesPermissionLevel = Literal["edit_and_publish", "publish_only"] + +UPDATE_STATUS_PAGE_TEAM_DATA_ATTRIBUTES_PERMISSION_LEVEL_VALUES: set[ + UpdateStatusPageTeamDataAttributesPermissionLevel +] = { + "edit_and_publish", + "publish_only", +} + + +def check_update_status_page_team_data_attributes_permission_level( + value: str | None, +) -> UpdateStatusPageTeamDataAttributesPermissionLevel | None: + if value is None: + return None + if value in UPDATE_STATUS_PAGE_TEAM_DATA_ATTRIBUTES_PERMISSION_LEVEL_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_STATUS_PAGE_TEAM_DATA_ATTRIBUTES_PERMISSION_LEVEL_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_status_page_team_data_type.py b/rootly_sdk/models/update_status_page_team_data_type.py new file mode 100644 index 00000000..869f2501 --- /dev/null +++ b/rootly_sdk/models/update_status_page_team_data_type.py @@ -0,0 +1,15 @@ +from typing import Literal + +UpdateStatusPageTeamDataType = Literal["status_page_groups"] + +UPDATE_STATUS_PAGE_TEAM_DATA_TYPE_VALUES: set[UpdateStatusPageTeamDataType] = { + "status_page_groups", +} + + +def check_update_status_page_team_data_type(value: str | None) -> UpdateStatusPageTeamDataType | None: + if value is None: + return None + if value in UPDATE_STATUS_PAGE_TEAM_DATA_TYPE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_STATUS_PAGE_TEAM_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_status_page_template.py b/rootly_sdk/models/update_status_page_template.py index 2d1d2500..72a59a0c 100644 --- a/rootly_sdk/models/update_status_page_template.py +++ b/rootly_sdk/models/update_status_page_template.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_status_page_template_data import UpdateStatusPageTemplateData @@ -18,14 +19,13 @@ class UpdateStatusPageTemplate: data (UpdateStatusPageTemplateData): """ - data: "UpdateStatusPageTemplateData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateStatusPageTemplateData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_status_page_template.additional_properties = d return update_status_page_template - - @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_template_data.py b/rootly_sdk/models/update_status_page_template_data.py index 008f3102..8e5f4110 100644 --- a/rootly_sdk/models/update_status_page_template_data.py +++ b/rootly_sdk/models/update_status_page_template_data.py @@ -1,13 +1,15 @@ +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_status_page_template_data_type import ( UpdateStatusPageTemplateDataType, check_update_status_page_template_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_status_page_template_data_attributes import UpdateStatusPageTemplateDataAttributes @@ -22,25 +24,31 @@ class UpdateStatusPageTemplateData: Attributes: type_ (UpdateStatusPageTemplateDataType): attributes (UpdateStatusPageTemplateDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateStatusPageTemplateDataType - attributes: "UpdateStatusPageTemplateDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateStatusPageTemplateDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateStatusPageTemplateDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_status_page_template_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_status_page_template_data.additional_properties = d return update_status_page_template_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_template_data_attributes.py b/rootly_sdk/models/update_status_page_template_data_attributes.py index a05b3365..9efc9b6b 100644 --- a/rootly_sdk/models/update_status_page_template_data_attributes.py +++ b/rootly_sdk/models/update_status_page_template_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -22,44 +24,44 @@ class UpdateStatusPageTemplateDataAttributes: Attributes: title (str): Title of the template body (str): Description of the event the template will populate - 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 + 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 """ title: str body: str - 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 + 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 def to_dict(self) -> dict[str, Any]: title = self.title body = self.body - update_title: None | Unset | str + update_title: None | str | Unset if isinstance(self.update_title, Unset): update_title = UNSET else: update_title = self.update_title - update_status: Unset | str = UNSET + update_status: str | Unset = UNSET if not isinstance(self.update_status, Unset): update_status = self.update_status - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind - should_notify_subscribers: None | Unset | bool + should_notify_subscribers: bool | None | Unset if isinstance(self.should_notify_subscribers, Unset): should_notify_subscribers = UNSET else: @@ -67,7 +69,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position - enabled: None | Unset | bool + enabled: bool | None | Unset if isinstance(self.enabled, Unset): enabled = UNSET else: @@ -103,46 +105,46 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: body = d.pop("body") - def _parse_update_title(data: object) -> None | Unset | str: + def _parse_update_title(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) update_title = _parse_update_title(d.pop("update_title", UNSET)) _update_status = d.pop("update_status", UNSET) - update_status: Unset | UpdateStatusPageTemplateDataAttributesUpdateStatus + update_status: UpdateStatusPageTemplateDataAttributesUpdateStatus | Unset 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: Unset | UpdateStatusPageTemplateDataAttributesKind + kind: UpdateStatusPageTemplateDataAttributesKind | Unset if isinstance(_kind, Unset): kind = UNSET else: kind = check_update_status_page_template_data_attributes_kind(_kind) - def _parse_should_notify_subscribers(data: object) -> None | Unset | bool: + def _parse_should_notify_subscribers(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) should_notify_subscribers = _parse_should_notify_subscribers(d.pop("should_notify_subscribers", UNSET)) position = d.pop("position", UNSET) - def _parse_enabled(data: object) -> None | Unset | bool: + def _parse_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) enabled = _parse_enabled(d.pop("enabled", UNSET)) diff --git a/rootly_sdk/models/update_status_page_template_data_attributes_kind.py b/rootly_sdk/models/update_status_page_template_data_attributes_kind.py index d74c0795..6a198fe5 100644 --- a/rootly_sdk/models/update_status_page_template_data_attributes_kind.py +++ b/rootly_sdk/models/update_status_page_template_data_attributes_kind.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateStatusPageTemplateDataAttributesKind = Literal["normal", "scheduled"] @@ -14,7 +14,7 @@ def check_update_status_page_template_data_attributes_kind( if value is None: return None if value in UPDATE_STATUS_PAGE_TEMPLATE_DATA_ATTRIBUTES_KIND_VALUES: - return cast(UpdateStatusPageTemplateDataAttributesKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_STATUS_PAGE_TEMPLATE_DATA_ATTRIBUTES_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/update_status_page_template_data_attributes_update_status.py b/rootly_sdk/models/update_status_page_template_data_attributes_update_status.py index 80f4884a..49916dca 100644 --- a/rootly_sdk/models/update_status_page_template_data_attributes_update_status.py +++ b/rootly_sdk/models/update_status_page_template_data_attributes_update_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateStatusPageTemplateDataAttributesUpdateStatus = Literal[ "completed", "identified", "in_progress", "investigating", "monitoring", "resolved", "scheduled" @@ -23,7 +23,7 @@ def check_update_status_page_template_data_attributes_update_status( if value is None: return None if value in UPDATE_STATUS_PAGE_TEMPLATE_DATA_ATTRIBUTES_UPDATE_STATUS_VALUES: - return cast(UpdateStatusPageTemplateDataAttributesUpdateStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_STATUS_PAGE_TEMPLATE_DATA_ATTRIBUTES_UPDATE_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/update_status_page_template_data_type.py b/rootly_sdk/models/update_status_page_template_data_type.py index 92c08637..09490702 100644 --- a/rootly_sdk/models/update_status_page_template_data_type.py +++ b/rootly_sdk/models/update_status_page_template_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateStatusPageTemplateDataType = Literal["status_page_templates"] @@ -11,5 +11,5 @@ def check_update_status_page_template_data_type(value: str | None) -> UpdateStat if value is None: return None if value in UPDATE_STATUS_PAGE_TEMPLATE_DATA_TYPE_VALUES: - return cast(UpdateStatusPageTemplateDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_STATUS_PAGE_TEMPLATE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_status_task_params.py b/rootly_sdk/models/update_status_task_params.py index 24deaf51..d623cf43 100644 --- a/rootly_sdk/models/update_status_task_params.py +++ b/rootly_sdk/models/update_status_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -22,19 +24,19 @@ class UpdateStatusTaskParams: """ Attributes: status (UpdateStatusTaskParamsStatus): - task_type (Union[Unset, UpdateStatusTaskParamsTaskType]): - inactivity_timeout (Union[Unset, str]): In format '1 hour', '1 day', etc Example: 1 hour. + task_type (UpdateStatusTaskParamsTaskType | Unset): + inactivity_timeout (str | Unset): In format '1 hour', '1 day', etc Example: 1 hour. """ status: UpdateStatusTaskParamsStatus - task_type: Unset | UpdateStatusTaskParamsTaskType = UNSET - inactivity_timeout: Unset | str = UNSET + task_type: UpdateStatusTaskParamsTaskType | Unset = UNSET + inactivity_timeout: str | Unset = 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: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -60,7 +62,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: Unset | UpdateStatusTaskParamsTaskType + task_type: UpdateStatusTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_status_task_params_status.py b/rootly_sdk/models/update_status_task_params_status.py index a6407eed..476e0282 100644 --- a/rootly_sdk/models/update_status_task_params_status.py +++ b/rootly_sdk/models/update_status_task_params_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateStatusTaskParamsStatus = Literal["cancelled", "closed", "in_triage", "mitigated", "resolved", "started"] @@ -16,5 +16,5 @@ def check_update_status_task_params_status(value: str | None) -> UpdateStatusTas if value is None: return None if value in UPDATE_STATUS_TASK_PARAMS_STATUS_VALUES: - return cast(UpdateStatusTaskParamsStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_STATUS_TASK_PARAMS_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/update_status_task_params_task_type.py b/rootly_sdk/models/update_status_task_params_task_type.py index cfe10bda..29102ff7 100644 --- a/rootly_sdk/models/update_status_task_params_task_type.py +++ b/rootly_sdk/models/update_status_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateStatusTaskParamsTaskType = Literal["update_status"] @@ -11,5 +11,5 @@ def check_update_status_task_params_task_type(value: str | None) -> UpdateStatus if value is None: return None if value in UPDATE_STATUS_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateStatusTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_STATUS_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_sub_status.py b/rootly_sdk/models/update_sub_status.py index 6fda819a..b327669d 100644 --- a/rootly_sdk/models/update_sub_status.py +++ b/rootly_sdk/models/update_sub_status.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_sub_status_data import UpdateSubStatusData @@ -18,14 +19,13 @@ class UpdateSubStatus: data (UpdateSubStatusData): """ - data: "UpdateSubStatusData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateSubStatusData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_sub_status.additional_properties = d return update_sub_status - - @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_sub_status_data.py b/rootly_sdk/models/update_sub_status_data.py index 9ff74dae..824b947d 100644 --- a/rootly_sdk/models/update_sub_status_data.py +++ b/rootly_sdk/models/update_sub_status_data.py @@ -1,10 +1,12 @@ +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_sub_status_data_type import UpdateSubStatusDataType, check_update_sub_status_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_sub_status_data_attributes import UpdateSubStatusDataAttributes @@ -19,25 +21,31 @@ class UpdateSubStatusData: Attributes: type_ (UpdateSubStatusDataType): attributes (UpdateSubStatusDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateSubStatusDataType - attributes: "UpdateSubStatusDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateSubStatusDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateSubStatusDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_sub_status_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_sub_status_data.additional_properties = d return update_sub_status_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_sub_status_data_attributes.py b/rootly_sdk/models/update_sub_status_data_attributes.py index ff3812d8..48ace220 100644 --- a/rootly_sdk/models/update_sub_status_data_attributes.py +++ b/rootly_sdk/models/update_sub_status_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,20 +14,20 @@ class UpdateSubStatusDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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): + description (None | str | Unset): + position (int | None | Unset): """ - slug: None | Unset | str = UNSET - name: Unset | str = UNSET - description: None | Unset | str = UNSET - position: None | Unset | int = UNSET + slug: None | str | Unset = UNSET + name: str | Unset = UNSET + description: None | str | Unset = UNSET + position: int | None | Unset = UNSET def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -33,13 +35,13 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: @@ -63,32 +65,32 @@ 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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) diff --git a/rootly_sdk/models/update_sub_status_data_type.py b/rootly_sdk/models/update_sub_status_data_type.py index 56f80811..e006712f 100644 --- a/rootly_sdk/models/update_sub_status_data_type.py +++ b/rootly_sdk/models/update_sub_status_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateSubStatusDataType = Literal["sub_statuses"] @@ -11,5 +11,5 @@ def check_update_sub_status_data_type(value: str | None) -> UpdateSubStatusDataT if value is None: return None if value in UPDATE_SUB_STATUS_DATA_TYPE_VALUES: - return cast(UpdateSubStatusDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_SUB_STATUS_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_team.py b/rootly_sdk/models/update_team.py index 54e99506..0fc6769c 100644 --- a/rootly_sdk/models/update_team.py +++ b/rootly_sdk/models/update_team.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_team_data import UpdateTeamData @@ -18,14 +19,13 @@ class UpdateTeam: data (UpdateTeamData): """ - data: "UpdateTeamData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateTeamData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_team.additional_properties = d return update_team - - @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_team_data.py b/rootly_sdk/models/update_team_data.py index faa345fa..bfd6d918 100644 --- a/rootly_sdk/models/update_team_data.py +++ b/rootly_sdk/models/update_team_data.py @@ -1,10 +1,12 @@ +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_team_data_type import UpdateTeamDataType, check_update_team_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_team_data_attributes import UpdateTeamDataAttributes @@ -19,25 +21,31 @@ class UpdateTeamData: Attributes: type_ (UpdateTeamDataType): attributes (UpdateTeamDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateTeamDataType - attributes: "UpdateTeamDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateTeamDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateTeamDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_team_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_team_data.additional_properties = d return update_team_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_team_data_attributes.py b/rootly_sdk/models/update_team_data_attributes.py index b3563194..09ca8ddf 100644 --- a/rootly_sdk/models/update_team_data_attributes.py +++ b/rootly_sdk/models/update_team_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define @@ -7,6 +9,10 @@ UpdateTeamDataAttributesAutoAddMembersScope, check_update_team_data_attributes_auto_add_members_scope, ) +from ..models.update_team_data_attributes_schedule_override_policy import ( + UpdateTeamDataAttributesScheduleOverridePolicy, + check_update_team_data_attributes_schedule_override_policy, +) from ..types import UNSET, Unset if TYPE_CHECKING: @@ -32,77 +38,88 @@ class UpdateTeamDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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: + name (str | Unset): The name of the team + description (None | str | Unset): The description of the team + public_description (None | str | Unset): The status page 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: :namespace/:kind/:entity_name - 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 + 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 + scim_group_id (None | str | Unset): The SCIM group id linked to this team. Membership syncs from the SCIM group + while the team keeps its own name. Set to null to unlink. Sending the current id is a no-op; to pin a name- + linked group, unlink then link. + scim_group_external_id (None | str | Unset): Link by the SCIM group's externalId from your identity provider + instead of scim_group_id. Write-only. Rejected when it names a different SCIM group than scim_group_id. + 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 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['UpdateTeamDataAttributesPropertiesItem']]): Array of property values for this - team. + schedule_override_policy (UpdateTeamDataAttributesScheduleOverridePolicy | Unset): Who can create and update + overrides for schedules owned by this team: `everyone` in the organization, only team `members`, or only team + `admins`. Users still need override permission from their on-call role. Only available when the team-level + schedule override policy feature is enabled for the organization. Requests that set it while that feature is + disabled are rejected. + properties (list[UpdateTeamDataAttributesPropertiesItem] | Unset): Array of property values for this team. """ - 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 + slug: None | str | Unset = UNSET + 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 + 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 + scim_group_id: None | str | Unset = UNSET + scim_group_external_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 + schedule_override_policy: UpdateTeamDataAttributesScheduleOverridePolicy | Unset = UNSET + properties: list[UpdateTeamDataAttributesPropertiesItem] | Unset = UNSET def to_dict(self) -> dict[str, Any]: from ..models.update_team_data_attributes_alert_broadcast_channel_type_0 import ( @@ -112,7 +129,7 @@ def to_dict(self) -> dict[str, Any]: UpdateTeamDataAttributesIncidentBroadcastChannelType0, ) - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -120,19 +137,19 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - public_description: None | Unset | str + public_description: None | str | Unset if isinstance(self.public_description, Unset): public_description = UNSET else: public_description = self.public_description - notify_emails: None | Unset | list[str] + notify_emails: list[str] | None | Unset if isinstance(self.notify_emails, Unset): notify_emails = UNSET elif isinstance(self.notify_emails, list): @@ -141,73 +158,85 @@ def to_dict(self) -> dict[str, Any]: else: notify_emails = self.notify_emails - color: None | Unset | str + color: None | str | Unset if isinstance(self.color, Unset): color = UNSET else: color = self.color - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - backstage_id: None | Unset | str + backstage_id: None | str | Unset if isinstance(self.backstage_id, Unset): backstage_id = UNSET else: backstage_id = self.backstage_id - external_id: None | Unset | str + external_id: None | str | Unset if isinstance(self.external_id, Unset): external_id = UNSET else: external_id = self.external_id - pagerduty_id: None | Unset | str + pagerduty_id: None | str | Unset if isinstance(self.pagerduty_id, Unset): pagerduty_id = UNSET else: pagerduty_id = self.pagerduty_id - pagerduty_service_id: None | Unset | str + pagerduty_service_id: None | str | Unset if isinstance(self.pagerduty_service_id, Unset): pagerduty_service_id = UNSET else: pagerduty_service_id = self.pagerduty_service_id - opsgenie_id: None | Unset | str + opsgenie_id: None | str | Unset if isinstance(self.opsgenie_id, Unset): opsgenie_id = UNSET else: opsgenie_id = self.opsgenie_id - victor_ops_id: None | Unset | str + victor_ops_id: None | str | Unset if isinstance(self.victor_ops_id, Unset): victor_ops_id = UNSET else: victor_ops_id = self.victor_ops_id - pagertree_id: None | Unset | str + pagertree_id: None | str | Unset if isinstance(self.pagertree_id, Unset): pagertree_id = UNSET else: pagertree_id = self.pagertree_id - cortex_id: None | Unset | str + cortex_id: None | str | Unset if isinstance(self.cortex_id, Unset): cortex_id = UNSET else: cortex_id = self.cortex_id - service_now_ci_sys_id: None | Unset | str + service_now_ci_sys_id: None | str | Unset 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: None | Unset | list[int] + scim_group_id: None | str | Unset + if isinstance(self.scim_group_id, Unset): + scim_group_id = UNSET + else: + scim_group_id = self.scim_group_id + + scim_group_external_id: None | str | Unset + if isinstance(self.scim_group_external_id, Unset): + scim_group_external_id = UNSET + else: + scim_group_external_id = self.scim_group_external_id + + user_ids: list[int] | None | Unset if isinstance(self.user_ids, Unset): user_ids = UNSET elif isinstance(self.user_ids, list): @@ -216,7 +245,7 @@ def to_dict(self) -> dict[str, Any]: else: user_ids = self.user_ids - admin_ids: None | Unset | list[int] + admin_ids: list[int] | None | Unset if isinstance(self.admin_ids, Unset): admin_ids = UNSET elif isinstance(self.admin_ids, list): @@ -225,19 +254,19 @@ def to_dict(self) -> dict[str, Any]: else: admin_ids = self.admin_ids - alerts_email_enabled: None | Unset | bool + alerts_email_enabled: bool | None | Unset if isinstance(self.alerts_email_enabled, Unset): alerts_email_enabled = UNSET else: alerts_email_enabled = self.alerts_email_enabled - alert_urgency_id: None | Unset | str + alert_urgency_id: None | str | Unset if isinstance(self.alert_urgency_id, Unset): alert_urgency_id = UNSET else: alert_urgency_id = self.alert_urgency_id - slack_channels: None | Unset | list[dict[str, Any]] + slack_channels: list[dict[str, Any]] | None | Unset if isinstance(self.slack_channels, Unset): slack_channels = UNSET elif isinstance(self.slack_channels, list): @@ -249,7 +278,7 @@ def to_dict(self) -> dict[str, Any]: else: slack_channels = self.slack_channels - slack_aliases: None | Unset | list[dict[str, Any]] + slack_aliases: list[dict[str, Any]] | None | Unset if isinstance(self.slack_aliases, Unset): slack_aliases = UNSET elif isinstance(self.slack_aliases, list): @@ -261,13 +290,13 @@ def to_dict(self) -> dict[str, Any]: else: slack_aliases = self.slack_aliases - alert_broadcast_enabled: None | Unset | bool + alert_broadcast_enabled: bool | None | Unset if isinstance(self.alert_broadcast_enabled, Unset): alert_broadcast_enabled = UNSET else: alert_broadcast_enabled = self.alert_broadcast_enabled - alert_broadcast_channel: None | Unset | dict[str, Any] + alert_broadcast_channel: dict[str, Any] | None | Unset if isinstance(self.alert_broadcast_channel, Unset): alert_broadcast_channel = UNSET elif isinstance(self.alert_broadcast_channel, UpdateTeamDataAttributesAlertBroadcastChannelType0): @@ -275,13 +304,13 @@ def to_dict(self) -> dict[str, Any]: else: alert_broadcast_channel = self.alert_broadcast_channel - incident_broadcast_enabled: None | Unset | bool + incident_broadcast_enabled: bool | None | Unset if isinstance(self.incident_broadcast_enabled, Unset): incident_broadcast_enabled = UNSET else: incident_broadcast_enabled = self.incident_broadcast_enabled - incident_broadcast_channel: None | Unset | dict[str, Any] + incident_broadcast_channel: dict[str, Any] | None | Unset if isinstance(self.incident_broadcast_channel, Unset): incident_broadcast_channel = UNSET elif isinstance(self.incident_broadcast_channel, UpdateTeamDataAttributesIncidentBroadcastChannelType0): @@ -289,17 +318,21 @@ def to_dict(self) -> dict[str, Any]: else: incident_broadcast_channel = self.incident_broadcast_channel - auto_add_members_when_attached: None | Unset | bool + auto_add_members_when_attached: bool | None | Unset 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: Unset | str = UNSET + auto_add_members_scope: str | Unset = UNSET if not isinstance(self.auto_add_members_scope, Unset): auto_add_members_scope = self.auto_add_members_scope - properties: Unset | list[dict[str, Any]] = UNSET + schedule_override_policy: str | Unset = UNSET + if not isinstance(self.schedule_override_policy, Unset): + schedule_override_policy = self.schedule_override_policy + + properties: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.properties, Unset): properties = [] for properties_item_data in self.properties: @@ -341,6 +374,10 @@ def to_dict(self) -> dict[str, Any]: field_dict["cortex_id"] = cortex_id if service_now_ci_sys_id is not UNSET: field_dict["service_now_ci_sys_id"] = service_now_ci_sys_id + if scim_group_id is not UNSET: + field_dict["scim_group_id"] = scim_group_id + if scim_group_external_id is not UNSET: + field_dict["scim_group_external_id"] = scim_group_external_id if user_ids is not UNSET: field_dict["user_ids"] = user_ids if admin_ids is not UNSET: @@ -365,6 +402,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["auto_add_members_when_attached"] = auto_add_members_when_attached if auto_add_members_scope is not UNSET: field_dict["auto_add_members_scope"] = auto_add_members_scope + if schedule_override_policy is not UNSET: + field_dict["schedule_override_policy"] = schedule_override_policy if properties is not UNSET: field_dict["properties"] = properties @@ -388,36 +427,36 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_public_description(data: object) -> None | Unset | str: + def _parse_public_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) public_description = _parse_public_description(d.pop("public_description", UNSET)) - def _parse_notify_emails(data: object) -> None | Unset | list[str]: + def _parse_notify_emails(data: object) -> list[str] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -428,112 +467,130 @@ def _parse_notify_emails(data: object) -> None | Unset | list[str]: notify_emails_type_0 = cast(list[str], data) return notify_emails_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[str], data) + return cast(list[str] | None | Unset, data) notify_emails = _parse_notify_emails(d.pop("notify_emails", UNSET)) - def _parse_color(data: object) -> None | Unset | str: + def _parse_color(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) color = _parse_color(d.pop("color", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_backstage_id(data: object) -> None | Unset | str: + def _parse_backstage_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) backstage_id = _parse_backstage_id(d.pop("backstage_id", UNSET)) - def _parse_external_id(data: object) -> None | Unset | str: + def _parse_external_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) external_id = _parse_external_id(d.pop("external_id", UNSET)) - def _parse_pagerduty_id(data: object) -> None | Unset | str: + def _parse_pagerduty_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_id = _parse_pagerduty_id(d.pop("pagerduty_id", UNSET)) - def _parse_pagerduty_service_id(data: object) -> None | Unset | str: + def _parse_pagerduty_service_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagerduty_service_id = _parse_pagerduty_service_id(d.pop("pagerduty_service_id", UNSET)) - def _parse_opsgenie_id(data: object) -> None | Unset | str: + def _parse_opsgenie_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) opsgenie_id = _parse_opsgenie_id(d.pop("opsgenie_id", UNSET)) - def _parse_victor_ops_id(data: object) -> None | Unset | str: + def _parse_victor_ops_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) victor_ops_id = _parse_victor_ops_id(d.pop("victor_ops_id", UNSET)) - def _parse_pagertree_id(data: object) -> None | Unset | str: + def _parse_pagertree_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pagertree_id = _parse_pagertree_id(d.pop("pagertree_id", UNSET)) - def _parse_cortex_id(data: object) -> None | Unset | str: + def _parse_cortex_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) cortex_id = _parse_cortex_id(d.pop("cortex_id", UNSET)) - def _parse_service_now_ci_sys_id(data: object) -> None | Unset | str: + def _parse_service_now_ci_sys_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) -> None | Unset | list[int]: + def _parse_scim_group_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + scim_group_id = _parse_scim_group_id(d.pop("scim_group_id", UNSET)) + + def _parse_scim_group_external_id(data: object) -> None | str | Unset: + if data is None: + return data + if isinstance(data, Unset): + return data + return cast(None | str | Unset, data) + + scim_group_external_id = _parse_scim_group_external_id(d.pop("scim_group_external_id", UNSET)) + + def _parse_user_ids(data: object) -> list[int] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -544,13 +601,13 @@ def _parse_user_ids(data: object) -> None | Unset | list[int]: user_ids_type_0 = cast(list[int], data) return user_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[int], data) + return cast(list[int] | None | Unset, data) user_ids = _parse_user_ids(d.pop("user_ids", UNSET)) - def _parse_admin_ids(data: object) -> None | Unset | list[int]: + def _parse_admin_ids(data: object) -> list[int] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -561,33 +618,31 @@ def _parse_admin_ids(data: object) -> None | Unset | list[int]: admin_ids_type_0 = cast(list[int], data) return admin_ids_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[int], data) + return cast(list[int] | None | Unset, data) admin_ids = _parse_admin_ids(d.pop("admin_ids", UNSET)) - def _parse_alerts_email_enabled(data: object) -> None | Unset | bool: + def _parse_alerts_email_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) alerts_email_enabled = _parse_alerts_email_enabled(d.pop("alerts_email_enabled", UNSET)) - def _parse_alert_urgency_id(data: object) -> None | Unset | str: + def _parse_alert_urgency_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) alert_urgency_id = _parse_alert_urgency_id(d.pop("alert_urgency_id", UNSET)) - def _parse_slack_channels( - data: object, - ) -> None | Unset | list["UpdateTeamDataAttributesSlackChannelsType0Item"]: + def _parse_slack_channels(data: object) -> list[UpdateTeamDataAttributesSlackChannelsType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -605,15 +660,13 @@ def _parse_slack_channels( slack_channels_type_0.append(slack_channels_type_0_item) return slack_channels_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["UpdateTeamDataAttributesSlackChannelsType0Item"], data) + return cast(list[UpdateTeamDataAttributesSlackChannelsType0Item] | None | Unset, data) slack_channels = _parse_slack_channels(d.pop("slack_channels", UNSET)) - def _parse_slack_aliases( - data: object, - ) -> None | Unset | list["UpdateTeamDataAttributesSlackAliasesType0Item"]: + def _parse_slack_aliases(data: object) -> list[UpdateTeamDataAttributesSlackAliasesType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -631,24 +684,24 @@ def _parse_slack_aliases( slack_aliases_type_0.append(slack_aliases_type_0_item) return slack_aliases_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list["UpdateTeamDataAttributesSlackAliasesType0Item"], data) + return cast(list[UpdateTeamDataAttributesSlackAliasesType0Item] | None | Unset, data) slack_aliases = _parse_slack_aliases(d.pop("slack_aliases", UNSET)) - def _parse_alert_broadcast_enabled(data: object) -> None | Unset | bool: + def _parse_alert_broadcast_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) alert_broadcast_enabled = _parse_alert_broadcast_enabled(d.pop("alert_broadcast_enabled", UNSET)) def _parse_alert_broadcast_channel( data: object, - ) -> Union["UpdateTeamDataAttributesAlertBroadcastChannelType0", None, Unset]: + ) -> None | Unset | UpdateTeamDataAttributesAlertBroadcastChannelType0: if data is None: return data if isinstance(data, Unset): @@ -659,24 +712,24 @@ def _parse_alert_broadcast_channel( alert_broadcast_channel_type_0 = UpdateTeamDataAttributesAlertBroadcastChannelType0.from_dict(data) return alert_broadcast_channel_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["UpdateTeamDataAttributesAlertBroadcastChannelType0", None, Unset], data) + return cast(None | Unset | UpdateTeamDataAttributesAlertBroadcastChannelType0, data) alert_broadcast_channel = _parse_alert_broadcast_channel(d.pop("alert_broadcast_channel", UNSET)) - def _parse_incident_broadcast_enabled(data: object) -> None | Unset | bool: + def _parse_incident_broadcast_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) incident_broadcast_enabled = _parse_incident_broadcast_enabled(d.pop("incident_broadcast_enabled", UNSET)) def _parse_incident_broadcast_channel( data: object, - ) -> Union["UpdateTeamDataAttributesIncidentBroadcastChannelType0", None, Unset]: + ) -> None | Unset | UpdateTeamDataAttributesIncidentBroadcastChannelType0: if data is None: return data if isinstance(data, Unset): @@ -689,36 +742,47 @@ def _parse_incident_broadcast_channel( ) return incident_broadcast_channel_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(Union["UpdateTeamDataAttributesIncidentBroadcastChannelType0", None, Unset], data) + return cast(None | Unset | UpdateTeamDataAttributesIncidentBroadcastChannelType0, data) incident_broadcast_channel = _parse_incident_broadcast_channel(d.pop("incident_broadcast_channel", UNSET)) - def _parse_auto_add_members_when_attached(data: object) -> None | Unset | bool: + def _parse_auto_add_members_when_attached(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, 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: Unset | UpdateTeamDataAttributesAutoAddMembersScope + auto_add_members_scope: UpdateTeamDataAttributesAutoAddMembersScope | Unset 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 = [] + _schedule_override_policy = d.pop("schedule_override_policy", UNSET) + schedule_override_policy: UpdateTeamDataAttributesScheduleOverridePolicy | Unset + if isinstance(_schedule_override_policy, Unset): + schedule_override_policy = UNSET + else: + schedule_override_policy = check_update_team_data_attributes_schedule_override_policy( + _schedule_override_policy + ) + _properties = d.pop("properties", UNSET) - for properties_item_data in _properties or []: - properties_item = UpdateTeamDataAttributesPropertiesItem.from_dict(properties_item_data) + 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) - properties.append(properties_item) + properties.append(properties_item) update_team_data_attributes = cls( slug=slug, @@ -737,6 +801,8 @@ def _parse_auto_add_members_when_attached(data: object) -> None | Unset | bool: pagertree_id=pagertree_id, cortex_id=cortex_id, service_now_ci_sys_id=service_now_ci_sys_id, + scim_group_id=scim_group_id, + scim_group_external_id=scim_group_external_id, user_ids=user_ids, admin_ids=admin_ids, alerts_email_enabled=alerts_email_enabled, @@ -749,6 +815,7 @@ def _parse_auto_add_members_when_attached(data: object) -> None | Unset | bool: incident_broadcast_channel=incident_broadcast_channel, auto_add_members_when_attached=auto_add_members_when_attached, auto_add_members_scope=auto_add_members_scope, + schedule_override_policy=schedule_override_policy, properties=properties, ) 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 bb588d8e..19439131 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,8 +1,9 @@ +from __future__ import annotations + 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 @@ -15,12 +16,11 @@ class UpdateTeamDataAttributesAlertBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (Union[Unset, str]): Slack channel name + name (str | Unset): Slack channel name """ id: str - name: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + name: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: id = self.id @@ -28,7 +28,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -51,21 +51,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - update_team_data_attributes_alert_broadcast_channel_type_0.additional_properties = d return update_team_data_attributes_alert_broadcast_channel_type_0 - - @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_team_data_attributes_auto_add_members_scope.py b/rootly_sdk/models/update_team_data_attributes_auto_add_members_scope.py index 3e0a926f..61dee33e 100644 --- a/rootly_sdk/models/update_team_data_attributes_auto_add_members_scope.py +++ b/rootly_sdk/models/update_team_data_attributes_auto_add_members_scope.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateTeamDataAttributesAutoAddMembersScope = Literal["all", "off", "public_and_test", "public_only"] @@ -16,7 +16,7 @@ def check_update_team_data_attributes_auto_add_members_scope( if value is None: return None if value in UPDATE_TEAM_DATA_ATTRIBUTES_AUTO_ADD_MEMBERS_SCOPE_VALUES: - return cast(UpdateTeamDataAttributesAutoAddMembersScope, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_TEAM_DATA_ATTRIBUTES_AUTO_ADD_MEMBERS_SCOPE_VALUES!r}" ) 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 88354504..79ccf928 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,8 +1,9 @@ +from __future__ import annotations + 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 @@ -15,12 +16,11 @@ class UpdateTeamDataAttributesIncidentBroadcastChannelType0: Attributes: id (str): Slack channel ID - name (Union[Unset, str]): Slack channel name + name (str | Unset): Slack channel name """ id: str - name: Unset | str = UNSET - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + name: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: id = self.id @@ -28,7 +28,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -51,21 +51,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - update_team_data_attributes_incident_broadcast_channel_type_0.additional_properties = d return update_team_data_attributes_incident_broadcast_channel_type_0 - - @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_team_data_attributes_properties_item.py b/rootly_sdk/models/update_team_data_attributes_properties_item.py index d5ce8d26..4a14f3eb 100644 --- a/rootly_sdk/models/update_team_data_attributes_properties_item.py +++ b/rootly_sdk/models/update_team_data_attributes_properties_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/update_team_data_attributes_schedule_override_policy.py b/rootly_sdk/models/update_team_data_attributes_schedule_override_policy.py new file mode 100644 index 00000000..6b583be3 --- /dev/null +++ b/rootly_sdk/models/update_team_data_attributes_schedule_override_policy.py @@ -0,0 +1,21 @@ +from typing import Literal + +UpdateTeamDataAttributesScheduleOverridePolicy = Literal["admins", "everyone", "members"] + +UPDATE_TEAM_DATA_ATTRIBUTES_SCHEDULE_OVERRIDE_POLICY_VALUES: set[UpdateTeamDataAttributesScheduleOverridePolicy] = { + "admins", + "everyone", + "members", +} + + +def check_update_team_data_attributes_schedule_override_policy( + value: str | None, +) -> UpdateTeamDataAttributesScheduleOverridePolicy | None: + if value is None: + return None + if value in UPDATE_TEAM_DATA_ATTRIBUTES_SCHEDULE_OVERRIDE_POLICY_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_TEAM_DATA_ATTRIBUTES_SCHEDULE_OVERRIDE_POLICY_VALUES!r}" + ) 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 ed8d4c01..637e866c 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="UpdateTeamDataAttributesSlackAliasesType0Item") @@ -17,7 +18,6 @@ class UpdateTeamDataAttributesSlackAliasesType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - update_team_data_attributes_slack_aliases_type_0_item.additional_properties = d return update_team_data_attributes_slack_aliases_type_0_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_team_data_attributes_slack_channels_type_0_item.py b/rootly_sdk/models/update_team_data_attributes_slack_channels_type_0_item.py index 3c22919f..9e5d859d 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,8 +1,9 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar from attrs import define as _attrs_define -from attrs import field as _attrs_field T = TypeVar("T", bound="UpdateTeamDataAttributesSlackChannelsType0Item") @@ -17,7 +18,6 @@ class UpdateTeamDataAttributesSlackChannelsType0Item: id: str name: str - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: id = self.id @@ -25,7 +25,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update( { "id": id, @@ -47,21 +47,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name=name, ) - update_team_data_attributes_slack_channels_type_0_item.additional_properties = d return update_team_data_attributes_slack_channels_type_0_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_team_data_type.py b/rootly_sdk/models/update_team_data_type.py index cee09f31..d61ae1a2 100644 --- a/rootly_sdk/models/update_team_data_type.py +++ b/rootly_sdk/models/update_team_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateTeamDataType = Literal["groups"] @@ -11,5 +11,5 @@ def check_update_team_data_type(value: str | None) -> UpdateTeamDataType | None: if value is None: return None if value in UPDATE_TEAM_DATA_TYPE_VALUES: - return cast(UpdateTeamDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_TEAM_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_trello_card_task_params.py b/rootly_sdk/models/update_trello_card_task_params.py index 36e4ee8b..b71d98a0 100644 --- a/rootly_sdk/models/update_trello_card_task_params.py +++ b/rootly_sdk/models/update_trello_card_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -26,24 +28,24 @@ class UpdateTrelloCardTaskParams: Attributes: card_id (str): The card id archivation (UpdateTrelloCardTaskParamsArchivation): The archivation id and display name - 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']]): + 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): """ card_id: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -51,7 +53,7 @@ def to_dict(self) -> dict[str, Any]: archivation = self.archivation.to_dict() - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -61,15 +63,15 @@ def to_dict(self) -> dict[str, Any]: due_date = self.due_date - board: Unset | dict[str, Any] = UNSET + board: dict[str, Any] | Unset = UNSET if not isinstance(self.board, Unset): board = self.board.to_dict() - list_: Unset | dict[str, Any] = UNSET + list_: dict[str, Any] | Unset = UNSET if not isinstance(self.list_, Unset): list_ = self.list_.to_dict() - labels: Unset | list[dict[str, Any]] = UNSET + labels: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.labels, Unset): labels = [] for labels_item_data in self.labels: @@ -114,7 +116,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: Unset | UpdateTrelloCardTaskParamsTaskType + task_type: UpdateTrelloCardTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -127,25 +129,27 @@ 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: Unset | UpdateTrelloCardTaskParamsBoard + board: UpdateTrelloCardTaskParamsBoard | Unset if isinstance(_board, Unset): board = UNSET else: board = UpdateTrelloCardTaskParamsBoard.from_dict(_board) _list_ = d.pop("list", UNSET) - list_: Unset | UpdateTrelloCardTaskParamsList + list_: UpdateTrelloCardTaskParamsList | Unset if isinstance(_list_, Unset): list_ = UNSET else: list_ = UpdateTrelloCardTaskParamsList.from_dict(_list_) - labels = [] _labels = d.pop("labels", UNSET) - for labels_item_data in _labels or []: - labels_item = UpdateTrelloCardTaskParamsLabelsItem.from_dict(labels_item_data) + 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) - 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 6196d586..14b2a7be 100644 --- a/rootly_sdk/models/update_trello_card_task_params_archivation.py +++ b/rootly_sdk/models/update_trello_card_task_params_archivation.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateTrelloCardTaskParamsArchivation: """The archivation id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 71073b9f..586b06c8 100644 --- a/rootly_sdk/models/update_trello_card_task_params_board.py +++ b/rootly_sdk/models/update_trello_card_task_params_board.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateTrelloCardTaskParamsBoard: """The board id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 ab0604a8..061422b6 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,12 +15,12 @@ class UpdateTrelloCardTaskParamsLabelsItem: """ Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 1fd02aee..bd084e60 100644 --- a/rootly_sdk/models/update_trello_card_task_params_list.py +++ b/rootly_sdk/models/update_trello_card_task_params_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateTrelloCardTaskParamsList: """The list id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/update_trello_card_task_params_task_type.py index 0d5cc193..0a9793b1 100644 --- a/rootly_sdk/models/update_trello_card_task_params_task_type.py +++ b/rootly_sdk/models/update_trello_card_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateTrelloCardTaskParamsTaskType = Literal["update_trello_card"] @@ -11,5 +11,5 @@ def check_update_trello_card_task_params_task_type(value: str | None) -> UpdateT if value is None: return None if value in UPDATE_TRELLO_CARD_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateTrelloCardTaskParamsTaskType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_TRELLO_CARD_TASK_PARAMS_TASK_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_user.py b/rootly_sdk/models/update_user.py index afb8ad14..05e363bb 100644 --- a/rootly_sdk/models/update_user.py +++ b/rootly_sdk/models/update_user.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_user_data import UpdateUserData @@ -18,14 +19,13 @@ class UpdateUser: data (UpdateUserData): """ - data: "UpdateUserData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateUserData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_user.additional_properties = d return update_user - - @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_user_data.py b/rootly_sdk/models/update_user_data.py index 019d9d74..5110c094 100644 --- a/rootly_sdk/models/update_user_data.py +++ b/rootly_sdk/models/update_user_data.py @@ -1,10 +1,12 @@ +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_user_data_type import UpdateUserDataType, check_update_user_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_user_data_attributes import UpdateUserDataAttributes @@ -19,25 +21,31 @@ class UpdateUserData: Attributes: type_ (UpdateUserDataType): attributes (UpdateUserDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateUserDataType - attributes: "UpdateUserDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateUserDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateUserDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_user_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_user_data.additional_properties = d return update_user_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_user_data_attributes.py b/rootly_sdk/models/update_user_data_attributes.py index acf3a634..1ef584d0 100644 --- a/rootly_sdk/models/update_user_data_attributes.py +++ b/rootly_sdk/models/update_user_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -12,37 +14,37 @@ class UpdateUserDataAttributes: """ Attributes: - 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): 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: None | Unset | str = UNSET - last_name: None | Unset | str = UNSET - role_id: None | Unset | str = UNSET - on_call_role_id: None | Unset | str = UNSET + 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 def to_dict(self) -> dict[str, Any]: - first_name: None | Unset | str + first_name: None | str | Unset if isinstance(self.first_name, Unset): first_name = UNSET else: first_name = self.first_name - last_name: None | Unset | str + last_name: None | str | Unset if isinstance(self.last_name, Unset): last_name = UNSET else: last_name = self.last_name - role_id: None | Unset | str + role_id: None | str | Unset if isinstance(self.role_id, Unset): role_id = UNSET else: role_id = self.role_id - on_call_role_id: None | Unset | str + on_call_role_id: None | str | Unset if isinstance(self.on_call_role_id, Unset): on_call_role_id = UNSET else: @@ -66,39 +68,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 | Unset | str: + def _parse_first_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) first_name = _parse_first_name(d.pop("first_name", UNSET)) - def _parse_last_name(data: object) -> None | Unset | str: + def _parse_last_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) last_name = _parse_last_name(d.pop("last_name", UNSET)) - def _parse_role_id(data: object) -> None | Unset | str: + def _parse_role_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) role_id = _parse_role_id(d.pop("role_id", UNSET)) - def _parse_on_call_role_id(data: object) -> None | Unset | str: + def _parse_on_call_role_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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_data_type.py b/rootly_sdk/models/update_user_data_type.py index 49135214..3d2402f0 100644 --- a/rootly_sdk/models/update_user_data_type.py +++ b/rootly_sdk/models/update_user_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateUserDataType = Literal["users"] @@ -11,5 +11,5 @@ def check_update_user_data_type(value: str | None) -> UpdateUserDataType | None: if value is None: return None if value in UPDATE_USER_DATA_TYPE_VALUES: - return cast(UpdateUserDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_USER_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_user_email_address.py b/rootly_sdk/models/update_user_email_address.py index 31757578..51c44a11 100644 --- a/rootly_sdk/models/update_user_email_address.py +++ b/rootly_sdk/models/update_user_email_address.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_user_email_address_data import UpdateUserEmailAddressData @@ -18,14 +19,13 @@ class UpdateUserEmailAddress: data (UpdateUserEmailAddressData): """ - data: "UpdateUserEmailAddressData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateUserEmailAddressData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_user_email_address.additional_properties = d return update_user_email_address - - @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_user_email_address_data.py b/rootly_sdk/models/update_user_email_address_data.py index 2b87d935..d39b0920 100644 --- a/rootly_sdk/models/update_user_email_address_data.py +++ b/rootly_sdk/models/update_user_email_address_data.py @@ -1,13 +1,15 @@ +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_user_email_address_data_type import ( UpdateUserEmailAddressDataType, check_update_user_email_address_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_user_email_address_data_attributes import UpdateUserEmailAddressDataAttributes @@ -22,25 +24,31 @@ class UpdateUserEmailAddressData: Attributes: type_ (UpdateUserEmailAddressDataType): attributes (UpdateUserEmailAddressDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateUserEmailAddressDataType - attributes: "UpdateUserEmailAddressDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateUserEmailAddressDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateUserEmailAddressDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_user_email_address_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_user_email_address_data.additional_properties = d return update_user_email_address_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_user_email_address_data_attributes.py b/rootly_sdk/models/update_user_email_address_data_attributes.py index 021d4325..977a87b2 100644 --- a/rootly_sdk/models/update_user_email_address_data_attributes.py +++ b/rootly_sdk/models/update_user_email_address_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -12,10 +14,10 @@ class UpdateUserEmailAddressDataAttributes: """ Attributes: - email (Union[Unset, str]): Email address + email (str | Unset): Email address """ - email: Unset | str = UNSET + email: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: email = self.email diff --git a/rootly_sdk/models/update_user_email_address_data_type.py b/rootly_sdk/models/update_user_email_address_data_type.py index 15131d00..fd63c56a 100644 --- a/rootly_sdk/models/update_user_email_address_data_type.py +++ b/rootly_sdk/models/update_user_email_address_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateUserEmailAddressDataType = Literal["user_email_addresses"] @@ -11,5 +11,5 @@ def check_update_user_email_address_data_type(value: str | None) -> UpdateUserEm if value is None: return None if value in UPDATE_USER_EMAIL_ADDRESS_DATA_TYPE_VALUES: - return cast(UpdateUserEmailAddressDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_USER_EMAIL_ADDRESS_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_user_notification_rule.py b/rootly_sdk/models/update_user_notification_rule.py index 5e02a9df..4f42a63f 100644 --- a/rootly_sdk/models/update_user_notification_rule.py +++ b/rootly_sdk/models/update_user_notification_rule.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_user_notification_rule_data import UpdateUserNotificationRuleData @@ -18,14 +19,13 @@ class UpdateUserNotificationRule: data (UpdateUserNotificationRuleData): """ - data: "UpdateUserNotificationRuleData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateUserNotificationRuleData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_user_notification_rule.additional_properties = d return update_user_notification_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_user_notification_rule_data.py b/rootly_sdk/models/update_user_notification_rule_data.py index dd48e99d..e6134018 100644 --- a/rootly_sdk/models/update_user_notification_rule_data.py +++ b/rootly_sdk/models/update_user_notification_rule_data.py @@ -1,13 +1,15 @@ +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_user_notification_rule_data_type import ( UpdateUserNotificationRuleDataType, check_update_user_notification_rule_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_user_notification_rule_data_attributes import UpdateUserNotificationRuleDataAttributes @@ -22,25 +24,31 @@ class UpdateUserNotificationRuleData: Attributes: type_ (UpdateUserNotificationRuleDataType): attributes (UpdateUserNotificationRuleDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateUserNotificationRuleDataType - attributes: "UpdateUserNotificationRuleDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateUserNotificationRuleDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateUserNotificationRuleDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_user_notification_rule_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_user_notification_rule_data.additional_properties = d return update_user_notification_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_user_notification_rule_data_attributes.py b/rootly_sdk/models/update_user_notification_rule_data_attributes.py index 145fe36f..8c2a5196 100644 --- a/rootly_sdk/models/update_user_notification_rule_data_attributes.py +++ b/rootly_sdk/models/update_user_notification_rule_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,62 +18,62 @@ class UpdateUserNotificationRuleDataAttributes: """ Attributes: - 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): 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: 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 + 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 def to_dict(self) -> dict[str, Any]: - delay: None | Unset | int + delay: int | None | Unset if isinstance(self.delay, Unset): delay = UNSET else: delay = self.delay - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - user_email_address_id: None | Unset | str + user_email_address_id: None | str | Unset 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 | Unset | str + user_call_number_id: None | str | Unset 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 | Unset | str + user_sms_number_id: None | str | Unset 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 | Unset | str + user_device_id: None | str | Unset if isinstance(self.user_device_id, Unset): user_device_id = UNSET else: user_device_id = self.user_device_id - enabled_contact_types: Unset | list[str] = UNSET + enabled_contact_types: list[str] | Unset = UNSET if not isinstance(self.enabled_contact_types, Unset): enabled_contact_types = [] for enabled_contact_types_item_data in self.enabled_contact_types: @@ -102,68 +104,72 @@ 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) -> None | Unset | int: + def _parse_delay(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) delay = _parse_delay(d.pop("delay", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_user_email_address_id(data: object) -> None | Unset | str: + def _parse_user_email_address_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_user_call_number_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_user_sms_number_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_user_device_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) - 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: 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 + ) + ) - 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 149df040..dc408276 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,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateUserNotificationRuleDataAttributesEnabledContactTypesItem = Literal[ "call", "device", "email", "google_chat", "microsoft_teams", "non_critical_device", "slack", "sms" @@ -24,7 +24,7 @@ def check_update_user_notification_rule_data_attributes_enabled_contact_types_it if value is None: return None if value in UPDATE_USER_NOTIFICATION_RULE_DATA_ATTRIBUTES_ENABLED_CONTACT_TYPES_ITEM_VALUES: - return cast(UpdateUserNotificationRuleDataAttributesEnabledContactTypesItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_USER_NOTIFICATION_RULE_DATA_ATTRIBUTES_ENABLED_CONTACT_TYPES_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_user_notification_rule_data_type.py b/rootly_sdk/models/update_user_notification_rule_data_type.py index c79d5a1d..6eecf3b5 100644 --- a/rootly_sdk/models/update_user_notification_rule_data_type.py +++ b/rootly_sdk/models/update_user_notification_rule_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateUserNotificationRuleDataType = Literal["user_notification_rules"] @@ -11,5 +11,5 @@ def check_update_user_notification_rule_data_type(value: str | None) -> UpdateUs if value is None: return None if value in UPDATE_USER_NOTIFICATION_RULE_DATA_TYPE_VALUES: - return cast(UpdateUserNotificationRuleDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_USER_NOTIFICATION_RULE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_user_phone_number.py b/rootly_sdk/models/update_user_phone_number.py index 14c053e0..97c1b3b8 100644 --- a/rootly_sdk/models/update_user_phone_number.py +++ b/rootly_sdk/models/update_user_phone_number.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_user_phone_number_data import UpdateUserPhoneNumberData @@ -18,14 +19,13 @@ class UpdateUserPhoneNumber: data (UpdateUserPhoneNumberData): """ - data: "UpdateUserPhoneNumberData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateUserPhoneNumberData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_user_phone_number.additional_properties = d return update_user_phone_number - - @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_user_phone_number_data.py b/rootly_sdk/models/update_user_phone_number_data.py index 196d946f..565fb253 100644 --- a/rootly_sdk/models/update_user_phone_number_data.py +++ b/rootly_sdk/models/update_user_phone_number_data.py @@ -1,13 +1,15 @@ +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_user_phone_number_data_type import ( UpdateUserPhoneNumberDataType, check_update_user_phone_number_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_user_phone_number_data_attributes import UpdateUserPhoneNumberDataAttributes @@ -22,25 +24,31 @@ class UpdateUserPhoneNumberData: Attributes: type_ (UpdateUserPhoneNumberDataType): attributes (UpdateUserPhoneNumberDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateUserPhoneNumberDataType - attributes: "UpdateUserPhoneNumberDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateUserPhoneNumberDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateUserPhoneNumberDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_user_phone_number_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_user_phone_number_data.additional_properties = d return update_user_phone_number_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_user_phone_number_data_attributes.py b/rootly_sdk/models/update_user_phone_number_data_attributes.py index bb449a53..28772c0b 100644 --- a/rootly_sdk/models/update_user_phone_number_data_attributes.py +++ b/rootly_sdk/models/update_user_phone_number_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -12,10 +14,10 @@ class UpdateUserPhoneNumberDataAttributes: """ Attributes: - phone (Union[Unset, str]): Phone number in international format + phone (str | Unset): Phone number in international format """ - phone: Unset | str = UNSET + phone: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: phone = self.phone diff --git a/rootly_sdk/models/update_user_phone_number_data_type.py b/rootly_sdk/models/update_user_phone_number_data_type.py index 53c63194..147a3268 100644 --- a/rootly_sdk/models/update_user_phone_number_data_type.py +++ b/rootly_sdk/models/update_user_phone_number_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateUserPhoneNumberDataType = Literal["user_phone_numbers"] @@ -11,5 +11,5 @@ def check_update_user_phone_number_data_type(value: str | None) -> UpdateUserPho if value is None: return None if value in UPDATE_USER_PHONE_NUMBER_DATA_TYPE_VALUES: - return cast(UpdateUserPhoneNumberDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_USER_PHONE_NUMBER_DATA_TYPE_VALUES!r}") 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 990a3a5b..861fb6d5 100644 --- a/rootly_sdk/models/update_victor_ops_incident_task_params.py +++ b/rootly_sdk/models/update_victor_ops_incident_task_params.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -24,14 +26,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 (Union[Unset, UpdateVictorOpsIncidentTaskParamsTaskType]): - resolution_message (Union[Unset, str]): Resolution message + task_type (UpdateVictorOpsIncidentTaskParamsTaskType | Unset): + resolution_message (str | Unset): Resolution message """ victor_ops_incident_id: str status: UpdateVictorOpsIncidentTaskParamsStatus - task_type: Unset | UpdateVictorOpsIncidentTaskParamsTaskType = UNSET - resolution_message: Unset | str = UNSET + task_type: UpdateVictorOpsIncidentTaskParamsTaskType | Unset = UNSET + resolution_message: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -39,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: status: str = self.status - task_type: Unset | str = UNSET + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -68,7 +70,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: Unset | UpdateVictorOpsIncidentTaskParamsTaskType + task_type: UpdateVictorOpsIncidentTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: diff --git a/rootly_sdk/models/update_victor_ops_incident_task_params_status.py b/rootly_sdk/models/update_victor_ops_incident_task_params_status.py index cd2af9b1..fb9c0cbc 100644 --- a/rootly_sdk/models/update_victor_ops_incident_task_params_status.py +++ b/rootly_sdk/models/update_victor_ops_incident_task_params_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateVictorOpsIncidentTaskParamsStatus = Literal["ack", "auto", "resolve"] @@ -15,7 +15,7 @@ def check_update_victor_ops_incident_task_params_status( if value is None: return None if value in UPDATE_VICTOR_OPS_INCIDENT_TASK_PARAMS_STATUS_VALUES: - return cast(UpdateVictorOpsIncidentTaskParamsStatus, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_VICTOR_OPS_INCIDENT_TASK_PARAMS_STATUS_VALUES!r}" ) diff --git a/rootly_sdk/models/update_victor_ops_incident_task_params_task_type.py b/rootly_sdk/models/update_victor_ops_incident_task_params_task_type.py index 197b6474..5956311b 100644 --- a/rootly_sdk/models/update_victor_ops_incident_task_params_task_type.py +++ b/rootly_sdk/models/update_victor_ops_incident_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateVictorOpsIncidentTaskParamsTaskType = Literal["update_victor_ops_incident"] @@ -13,7 +13,7 @@ def check_update_victor_ops_incident_task_params_task_type( if value is None: return None if value in UPDATE_VICTOR_OPS_INCIDENT_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateVictorOpsIncidentTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_VICTOR_OPS_INCIDENT_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_webhooks_endpoint.py b/rootly_sdk/models/update_webhooks_endpoint.py index 8825d130..5998cbf4 100644 --- a/rootly_sdk/models/update_webhooks_endpoint.py +++ b/rootly_sdk/models/update_webhooks_endpoint.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_webhooks_endpoint_data import UpdateWebhooksEndpointData @@ -18,14 +19,13 @@ class UpdateWebhooksEndpoint: data (UpdateWebhooksEndpointData): """ - data: "UpdateWebhooksEndpointData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateWebhooksEndpointData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_webhooks_endpoint.additional_properties = d return update_webhooks_endpoint - - @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_webhooks_endpoint_data.py b/rootly_sdk/models/update_webhooks_endpoint_data.py index 3d7f75a2..e3ed9a35 100644 --- a/rootly_sdk/models/update_webhooks_endpoint_data.py +++ b/rootly_sdk/models/update_webhooks_endpoint_data.py @@ -1,13 +1,15 @@ +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_webhooks_endpoint_data_type import ( UpdateWebhooksEndpointDataType, check_update_webhooks_endpoint_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_webhooks_endpoint_data_attributes import UpdateWebhooksEndpointDataAttributes @@ -22,25 +24,31 @@ class UpdateWebhooksEndpointData: Attributes: type_ (UpdateWebhooksEndpointDataType): attributes (UpdateWebhooksEndpointDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateWebhooksEndpointDataType - attributes: "UpdateWebhooksEndpointDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateWebhooksEndpointDataAttributes + id: str | Unset = 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 +61,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateWebhooksEndpointDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_webhooks_endpoint_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_webhooks_endpoint_data.additional_properties = d return update_webhooks_endpoint_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_webhooks_endpoint_data_attributes.py b/rootly_sdk/models/update_webhooks_endpoint_data_attributes.py index 99f06e24..e02e7166 100644 --- a/rootly_sdk/models/update_webhooks_endpoint_data_attributes.py +++ b/rootly_sdk/models/update_webhooks_endpoint_data_attributes.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar, cast @@ -22,24 +24,23 @@ class UpdateWebhooksEndpointDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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): 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: None | Unset | str = UNSET - name: Unset | str = UNSET - event_types: Unset | list[UpdateWebhooksEndpointDataAttributesEventTypesItem] = UNSET - enabled: Unset | bool = UNSET - custom_headers: Unset | list["UpdateWebhooksEndpointDataAttributesCustomHeadersItem"] = UNSET + slug: None | str | Unset = UNSET + name: str | Unset = UNSET + event_types: list[UpdateWebhooksEndpointDataAttributesEventTypesItem] | Unset = UNSET + enabled: bool | Unset = UNSET + custom_headers: list[UpdateWebhooksEndpointDataAttributesCustomHeadersItem] | Unset = UNSET def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -47,7 +48,7 @@ def to_dict(self) -> dict[str, Any]: name = self.name - event_types: Unset | list[str] = UNSET + event_types: list[str] | Unset = UNSET if not isinstance(self.event_types, Unset): event_types = [] for event_types_item_data in self.event_types: @@ -56,7 +57,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - custom_headers: Unset | list[dict[str, Any]] = UNSET + custom_headers: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.custom_headers, Unset): custom_headers = [] for custom_headers_item_data in self.custom_headers: @@ -87,34 +88,40 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - event_types = [] _event_types = d.pop("event_types", UNSET) - 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: 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 + ) - 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) - for custom_headers_item_data in _custom_headers or []: - custom_headers_item = UpdateWebhooksEndpointDataAttributesCustomHeadersItem.from_dict( - custom_headers_item_data - ) + 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 + ) - custom_headers.append(custom_headers_item) + custom_headers.append(custom_headers_item) update_webhooks_endpoint_data_attributes = cls( slug=slug, 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 5927d14e..e08d3e1f 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,3 +1,5 @@ +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 67f69ba4..83b3e6b5 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 @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateWebhooksEndpointDataAttributesEventTypesItem = Literal[ "alert.created", @@ -32,6 +32,7 @@ "incident_status_page_event.deleted", "incident_status_page_event.updated", "pulse.created", + "shift.ended", "shift.started", ] @@ -69,6 +70,7 @@ "incident_status_page_event.deleted", "incident_status_page_event.updated", "pulse.created", + "shift.ended", "shift.started", } @@ -79,7 +81,7 @@ def check_update_webhooks_endpoint_data_attributes_event_types_item( if value is None: return None if value in UPDATE_WEBHOOKS_ENDPOINT_DATA_ATTRIBUTES_EVENT_TYPES_ITEM_VALUES: - return cast(UpdateWebhooksEndpointDataAttributesEventTypesItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_WEBHOOKS_ENDPOINT_DATA_ATTRIBUTES_EVENT_TYPES_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/update_webhooks_endpoint_data_type.py b/rootly_sdk/models/update_webhooks_endpoint_data_type.py index aa19772c..5105c972 100644 --- a/rootly_sdk/models/update_webhooks_endpoint_data_type.py +++ b/rootly_sdk/models/update_webhooks_endpoint_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateWebhooksEndpointDataType = Literal["webhooks_endpoints"] @@ -11,5 +11,5 @@ def check_update_webhooks_endpoint_data_type(value: str | None) -> UpdateWebhook if value is None: return None if value in UPDATE_WEBHOOKS_ENDPOINT_DATA_TYPE_VALUES: - return cast(UpdateWebhooksEndpointDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_WEBHOOKS_ENDPOINT_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_workflow.py b/rootly_sdk/models/update_workflow.py index 66d9c7cd..6bf475ac 100644 --- a/rootly_sdk/models/update_workflow.py +++ b/rootly_sdk/models/update_workflow.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_workflow_data import UpdateWorkflowData @@ -18,14 +19,13 @@ class UpdateWorkflow: data (UpdateWorkflowData): """ - data: "UpdateWorkflowData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateWorkflowData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_workflow.additional_properties = d return update_workflow - - @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_action_item_form_field_condition.py b/rootly_sdk/models/update_workflow_action_item_form_field_condition.py index cdfdb15b..b3893818 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,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_workflow_action_item_form_field_condition_data import ( @@ -20,14 +21,13 @@ class UpdateWorkflowActionItemFormFieldCondition: data (UpdateWorkflowActionItemFormFieldConditionData): """ - data: "UpdateWorkflowActionItemFormFieldConditionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateWorkflowActionItemFormFieldConditionData 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, @@ -49,21 +49,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_workflow_action_item_form_field_condition.additional_properties = d return update_workflow_action_item_form_field_condition - - @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_action_item_form_field_condition_data.py b/rootly_sdk/models/update_workflow_action_item_form_field_condition_data.py index f6692ebc..2087bac7 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,13 +1,15 @@ +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_action_item_form_field_condition_data_type import ( UpdateWorkflowActionItemFormFieldConditionDataType, check_update_workflow_action_item_form_field_condition_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_workflow_action_item_form_field_condition_data_attributes import ( @@ -24,25 +26,31 @@ class UpdateWorkflowActionItemFormFieldConditionData: Attributes: type_ (UpdateWorkflowActionItemFormFieldConditionDataType): attributes (UpdateWorkflowActionItemFormFieldConditionDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateWorkflowActionItemFormFieldConditionDataType - attributes: "UpdateWorkflowActionItemFormFieldConditionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateWorkflowActionItemFormFieldConditionDataAttributes + id: str | Unset = 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 @@ -57,26 +65,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateWorkflowActionItemFormFieldConditionDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_workflow_action_item_form_field_condition_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_workflow_action_item_form_field_condition_data.additional_properties = d return update_workflow_action_item_form_field_condition_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_action_item_form_field_condition_data_attributes.py b/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_attributes.py index a13ba23d..c44ebd68 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,75 +18,74 @@ class UpdateWorkflowActionItemFormFieldConditionDataAttributes: """ Attributes: - 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): 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: 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 + 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 def to_dict(self) -> dict[str, Any]: - action_item_condition: Unset | str = UNSET + action_item_condition: str | Unset = UNSET if not isinstance(self.action_item_condition, Unset): action_item_condition = self.action_item_condition - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values - selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_catalog_entity_ids: list[str] | Unset = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_functionality_ids: Unset | list[str] = UNSET + selected_functionality_ids: list[str] | Unset = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: Unset | list[str] = UNSET + selected_group_ids: list[str] | Unset = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: Unset | list[str] = UNSET + selected_option_ids: list[str] | Unset = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: Unset | list[str] = UNSET + selected_service_ids: list[str] | Unset = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_user_ids: Unset | list[int] = UNSET + selected_user_ids: list[int] | Unset = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_cause_ids: Unset | list[str] = UNSET + selected_cause_ids: list[str] | Unset = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: Unset | list[str] = UNSET + selected_environment_ids: list[str] | Unset = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: Unset | list[str] = UNSET + selected_incident_type_ids: list[str] | Unset = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -120,7 +121,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: Unset | UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition + action_item_condition: UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition | Unset if isinstance(_action_item_condition, Unset): action_item_condition = UNSET else: diff --git a/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_attributes_action_item_condition.py b/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_attributes_action_item_condition.py index 3066c1d2..f3a438e3 100644 --- a/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_attributes_action_item_condition.py +++ b/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_attributes_action_item_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_update_workflow_action_item_form_field_condition_data_attributes_actio if value is None: return None if value in UPDATE_WORKFLOW_ACTION_ITEM_FORM_FIELD_CONDITION_DATA_ATTRIBUTES_ACTION_ITEM_CONDITION_VALUES: - return cast(UpdateWorkflowActionItemFormFieldConditionDataAttributesActionItemCondition, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_WORKFLOW_ACTION_ITEM_FORM_FIELD_CONDITION_DATA_ATTRIBUTES_ACTION_ITEM_CONDITION_VALUES!r}" ) diff --git a/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_type.py b/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_type.py index 9583ae17..57491431 100644 --- a/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_type.py +++ b/rootly_sdk/models/update_workflow_action_item_form_field_condition_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateWorkflowActionItemFormFieldConditionDataType = Literal["workflow_action_item_form_field_conditions"] @@ -15,7 +15,7 @@ def check_update_workflow_action_item_form_field_condition_data_type( if value is None: return None if value in UPDATE_WORKFLOW_ACTION_ITEM_FORM_FIELD_CONDITION_DATA_TYPE_VALUES: - return cast(UpdateWorkflowActionItemFormFieldConditionDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_WORKFLOW_ACTION_ITEM_FORM_FIELD_CONDITION_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_workflow_custom_field_selection.py b/rootly_sdk/models/update_workflow_custom_field_selection.py index 931ab1c2..a2904373 100644 --- a/rootly_sdk/models/update_workflow_custom_field_selection.py +++ b/rootly_sdk/models/update_workflow_custom_field_selection.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_workflow_custom_field_selection_data import UpdateWorkflowCustomFieldSelectionData @@ -18,14 +19,13 @@ class UpdateWorkflowCustomFieldSelection: data (UpdateWorkflowCustomFieldSelectionData): """ - data: "UpdateWorkflowCustomFieldSelectionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateWorkflowCustomFieldSelectionData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_workflow_custom_field_selection.additional_properties = d return update_workflow_custom_field_selection - - @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_custom_field_selection_data.py b/rootly_sdk/models/update_workflow_custom_field_selection_data.py index dc4ebd9c..5fca685e 100644 --- a/rootly_sdk/models/update_workflow_custom_field_selection_data.py +++ b/rootly_sdk/models/update_workflow_custom_field_selection_data.py @@ -1,13 +1,15 @@ +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_custom_field_selection_data_type import ( UpdateWorkflowCustomFieldSelectionDataType, check_update_workflow_custom_field_selection_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_workflow_custom_field_selection_data_attributes import ( @@ -24,25 +26,31 @@ class UpdateWorkflowCustomFieldSelectionData: Attributes: type_ (UpdateWorkflowCustomFieldSelectionDataType): attributes (UpdateWorkflowCustomFieldSelectionDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateWorkflowCustomFieldSelectionDataType - attributes: "UpdateWorkflowCustomFieldSelectionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateWorkflowCustomFieldSelectionDataAttributes + id: str | Unset = 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 @@ -57,26 +65,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateWorkflowCustomFieldSelectionDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_workflow_custom_field_selection_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_workflow_custom_field_selection_data.additional_properties = d return update_workflow_custom_field_selection_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_custom_field_selection_data_attributes.py b/rootly_sdk/models/update_workflow_custom_field_selection_data_attributes.py index f895b861..6aa9476a 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,26 +18,26 @@ class UpdateWorkflowCustomFieldSelectionDataAttributes: """ Attributes: - 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): The trigger + condition Default: 'ANY'. + values (list[str] | Unset): + selected_option_ids (list[int] | Unset): """ - incident_condition: Unset | UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition = "ANY" - values: Unset | list[str] = UNSET - selected_option_ids: Unset | list[int] = UNSET + incident_condition: UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition | Unset = "ANY" + values: list[str] | Unset = UNSET + selected_option_ids: list[int] | Unset = UNSET def to_dict(self) -> dict[str, Any]: - incident_condition: Unset | str = UNSET + incident_condition: str | Unset = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values - selected_option_ids: Unset | list[int] = UNSET + selected_option_ids: list[int] | Unset = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids @@ -55,7 +57,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: Unset | UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition + incident_condition: UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition | Unset if isinstance(_incident_condition, Unset): incident_condition = UNSET else: diff --git a/rootly_sdk/models/update_workflow_custom_field_selection_data_attributes_incident_condition.py b/rootly_sdk/models/update_workflow_custom_field_selection_data_attributes_incident_condition.py index d84d4d0b..ea61bb90 100644 --- a/rootly_sdk/models/update_workflow_custom_field_selection_data_attributes_incident_condition.py +++ b/rootly_sdk/models/update_workflow_custom_field_selection_data_attributes_incident_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_update_workflow_custom_field_selection_data_attributes_incident_condit if value is None: return None if value in UPDATE_WORKFLOW_CUSTOM_FIELD_SELECTION_DATA_ATTRIBUTES_INCIDENT_CONDITION_VALUES: - return cast(UpdateWorkflowCustomFieldSelectionDataAttributesIncidentCondition, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_WORKFLOW_CUSTOM_FIELD_SELECTION_DATA_ATTRIBUTES_INCIDENT_CONDITION_VALUES!r}" ) diff --git a/rootly_sdk/models/update_workflow_custom_field_selection_data_type.py b/rootly_sdk/models/update_workflow_custom_field_selection_data_type.py index ad6dc6b7..fa87e44b 100644 --- a/rootly_sdk/models/update_workflow_custom_field_selection_data_type.py +++ b/rootly_sdk/models/update_workflow_custom_field_selection_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateWorkflowCustomFieldSelectionDataType = Literal["workflow_custom_field_selections"] @@ -13,7 +13,7 @@ def check_update_workflow_custom_field_selection_data_type( if value is None: return None if value in UPDATE_WORKFLOW_CUSTOM_FIELD_SELECTION_DATA_TYPE_VALUES: - return cast(UpdateWorkflowCustomFieldSelectionDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_WORKFLOW_CUSTOM_FIELD_SELECTION_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_workflow_data.py b/rootly_sdk/models/update_workflow_data.py index 0e2ef268..7856b7cb 100644 --- a/rootly_sdk/models/update_workflow_data.py +++ b/rootly_sdk/models/update_workflow_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,13 +21,13 @@ 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. + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The workflow to update is identified + by the id in the path. """ type_: UpdateWorkflowDataType - attributes: "UpdateWorkflowDataAttributes" - id: Unset | str = UNSET + attributes: UpdateWorkflowDataAttributes + id: str | Unset = UNSET def to_dict(self) -> dict[str, Any]: type_: str = self.type_ diff --git a/rootly_sdk/models/update_workflow_data_attributes.py b/rootly_sdk/models/update_workflow_data_attributes.py index 0a0ddd2f..3cabee30 100644 --- a/rootly_sdk/models/update_workflow_data_attributes.py +++ b/rootly_sdk/models/update_workflow_data_attributes.py @@ -1,8 +1,14 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define +from ..models.update_workflow_data_attributes_failure_notification_mode import ( + UpdateWorkflowDataAttributesFailureNotificationMode, + check_update_workflow_data_attributes_failure_notification_mode, +) from ..types import UNSET, Unset if TYPE_CHECKING: @@ -11,6 +17,9 @@ from ..models.incident_trigger_params import IncidentTriggerParams from ..models.pulse_trigger_params import PulseTriggerParams from ..models.simple_trigger_params import SimpleTriggerParams + from ..models.update_workflow_data_attributes_failure_notification_channels_item import ( + UpdateWorkflowDataAttributesFailureNotificationChannelsItem, + ) T = TypeVar("T", bound="UpdateWorkflowDataAttributes") @@ -20,69 +29,82 @@ class UpdateWorkflowDataAttributes: """ Attributes: - slug (Union[None, Unset, str]): Deprecated. `slug` is derived from `name`; any submitted value is ignored. This + slug (None | str | Unset): 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 + 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 repeat_condition_duration_since_first_run and repeat_condition_number_of_repeats parameters. - 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]]): + run_once_per_resource (bool | Unset): When true, the workflow runs at most once per incident. Later triggers on + the same incident create a canceled run instead. Manual runs and repeats are not affected. Only applies to + incident workflows. + 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): + group_assignment_ids (list[str] | Unset): Owning team IDs. Requires team-scoped workflows. + cause_ids (list[str] | Unset): + sub_status_ids (list[str] | Unset): + failure_notification_mode (UpdateWorkflowDataAttributesFailureNotificationMode | Unset): Where failure + notifications for this workflow are sent. `inherit` uses the account default channel, `custom` uses + `failure_notification_channels`, `off` suppresses them. + failure_notification_channels (list[UpdateWorkflowDataAttributesFailureNotificationChannelsItem] | Unset): Slack + channels notified when a run of this workflow fails. Used when `failure_notification_mode` is `custom`. """ - 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 + slug: None | str | Unset = UNSET + 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 + run_once_per_resource: 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 + group_assignment_ids: list[str] | Unset = UNSET + cause_ids: list[str] | Unset = UNSET + sub_status_ids: list[str] | Unset = UNSET + failure_notification_mode: UpdateWorkflowDataAttributesFailureNotificationMode | Unset = UNSET + failure_notification_channels: list[UpdateWorkflowDataAttributesFailureNotificationChannelsItem] | Unset = UNSET def to_dict(self) -> dict[str, Any]: from ..models.action_item_trigger_params import ActionItemTriggerParams @@ -90,7 +112,7 @@ 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 + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: @@ -98,37 +120,37 @@ def to_dict(self) -> dict[str, Any]: name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - command: None | Unset | str + command: None | str | Unset if isinstance(self.command, Unset): command = UNSET else: command = self.command - command_feedback_enabled: None | Unset | bool + command_feedback_enabled: bool | None | Unset if isinstance(self.command_feedback_enabled, Unset): command_feedback_enabled = UNSET else: command_feedback_enabled = self.command_feedback_enabled - wait: None | Unset | str + wait: None | str | Unset if isinstance(self.wait, Unset): wait = UNSET else: wait = self.wait - repeat_every_duration: None | Unset | str + repeat_every_duration: None | str | Unset 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 | Unset | str + repeat_condition_duration_since_first_run: None | str | Unset if isinstance(self.repeat_condition_duration_since_first_run, Unset): repeat_condition_duration_since_first_run = UNSET else: @@ -138,19 +160,21 @@ def to_dict(self) -> dict[str, Any]: continuously_repeat = self.continuously_repeat + run_once_per_resource = self.run_once_per_resource + enabled = self.enabled locked = self.locked position = self.position - workflow_group_id: None | Unset | str + workflow_group_id: None | str | Unset if isinstance(self.workflow_group_id, Unset): workflow_group_id = UNSET else: workflow_group_id = self.workflow_group_id - trigger_params: Unset | dict[str, Any] + trigger_params: dict[str, Any] | Unset if isinstance(self.trigger_params, Unset): trigger_params = UNSET elif isinstance(self.trigger_params, IncidentTriggerParams): @@ -164,42 +188,57 @@ def to_dict(self) -> dict[str, Any]: else: trigger_params = self.trigger_params.to_dict() - environment_ids: Unset | list[str] = UNSET + environment_ids: list[str] | Unset = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - severity_ids: Unset | list[str] = UNSET + severity_ids: list[str] | Unset = UNSET if not isinstance(self.severity_ids, Unset): severity_ids = self.severity_ids - incident_type_ids: Unset | list[str] = UNSET + incident_type_ids: list[str] | Unset = UNSET if not isinstance(self.incident_type_ids, Unset): incident_type_ids = self.incident_type_ids - incident_role_ids: Unset | list[str] = UNSET + incident_role_ids: list[str] | Unset = UNSET if not isinstance(self.incident_role_ids, Unset): incident_role_ids = self.incident_role_ids - service_ids: Unset | list[str] = UNSET + service_ids: list[str] | Unset = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: Unset | list[str] = UNSET + functionality_ids: list[str] | Unset = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - group_ids: Unset | list[str] = UNSET + group_ids: list[str] | Unset = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - cause_ids: Unset | list[str] = UNSET + group_assignment_ids: list[str] | Unset = UNSET + if not isinstance(self.group_assignment_ids, Unset): + group_assignment_ids = self.group_assignment_ids + + cause_ids: list[str] | Unset = UNSET if not isinstance(self.cause_ids, Unset): cause_ids = self.cause_ids - sub_status_ids: Unset | list[str] = UNSET + sub_status_ids: list[str] | Unset = UNSET if not isinstance(self.sub_status_ids, Unset): sub_status_ids = self.sub_status_ids + failure_notification_mode: str | Unset = UNSET + if not isinstance(self.failure_notification_mode, Unset): + failure_notification_mode = self.failure_notification_mode + + failure_notification_channels: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.failure_notification_channels, Unset): + failure_notification_channels = [] + for failure_notification_channels_item_data in self.failure_notification_channels: + failure_notification_channels_item = failure_notification_channels_item_data.to_dict() + failure_notification_channels.append(failure_notification_channels_item) + field_dict: dict[str, Any] = {} field_dict.update({}) @@ -223,6 +262,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["repeat_condition_number_of_repeats"] = repeat_condition_number_of_repeats if continuously_repeat is not UNSET: field_dict["continuously_repeat"] = continuously_repeat + if run_once_per_resource is not UNSET: + field_dict["run_once_per_resource"] = run_once_per_resource if enabled is not UNSET: field_dict["enabled"] = enabled if locked is not UNSET: @@ -247,10 +288,16 @@ def to_dict(self) -> dict[str, Any]: field_dict["functionality_ids"] = functionality_ids if group_ids is not UNSET: field_dict["group_ids"] = group_ids + if group_assignment_ids is not UNSET: + field_dict["group_assignment_ids"] = group_assignment_ids if cause_ids is not UNSET: field_dict["cause_ids"] = cause_ids if sub_status_ids is not UNSET: field_dict["sub_status_ids"] = sub_status_ids + if failure_notification_mode is not UNSET: + field_dict["failure_notification_mode"] = failure_notification_mode + if failure_notification_channels is not UNSET: + field_dict["failure_notification_channels"] = failure_notification_channels return field_dict @@ -261,71 +308,74 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.incident_trigger_params import IncidentTriggerParams from ..models.pulse_trigger_params import PulseTriggerParams from ..models.simple_trigger_params import SimpleTriggerParams + from ..models.update_workflow_data_attributes_failure_notification_channels_item import ( + UpdateWorkflowDataAttributesFailureNotificationChannelsItem, + ) d = dict(src_dict) - def _parse_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_command(data: object) -> None | Unset | str: + def _parse_command(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) command = _parse_command(d.pop("command", UNSET)) - def _parse_command_feedback_enabled(data: object) -> None | Unset | bool: + def _parse_command_feedback_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) command_feedback_enabled = _parse_command_feedback_enabled(d.pop("command_feedback_enabled", UNSET)) - def _parse_wait(data: object) -> None | Unset | str: + def _parse_wait(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) wait = _parse_wait(d.pop("wait", UNSET)) - def _parse_repeat_every_duration(data: object) -> None | Unset | str: + def _parse_repeat_every_duration(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_repeat_condition_duration_since_first_run(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) repeat_condition_duration_since_first_run = _parse_repeat_condition_duration_since_first_run( d.pop("repeat_condition_duration_since_first_run", UNSET) @@ -335,31 +385,33 @@ def _parse_repeat_condition_duration_since_first_run(data: object) -> None | Uns continuously_repeat = d.pop("continuously_repeat", UNSET) + run_once_per_resource = d.pop("run_once_per_resource", UNSET) + enabled = d.pop("enabled", UNSET) locked = d.pop("locked", UNSET) position = d.pop("position", UNSET) - def _parse_workflow_group_id(data: object) -> None | Unset | str: + def _parse_workflow_group_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) workflow_group_id = _parse_workflow_group_id(d.pop("workflow_group_id", UNSET)) def _parse_trigger_params( data: object, - ) -> Union[ - "ActionItemTriggerParams", - "AlertTriggerParams", - "IncidentTriggerParams", - "PulseTriggerParams", - "SimpleTriggerParams", - Unset, - ]: + ) -> ( + ActionItemTriggerParams + | AlertTriggerParams + | IncidentTriggerParams + | PulseTriggerParams + | SimpleTriggerParams + | Unset + ): if isinstance(data, Unset): return data try: @@ -368,7 +420,7 @@ def _parse_trigger_params( trigger_params_type_0 = IncidentTriggerParams.from_dict(data) return trigger_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -376,7 +428,7 @@ def _parse_trigger_params( trigger_params_type_1 = ActionItemTriggerParams.from_dict(data) return trigger_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -384,7 +436,7 @@ def _parse_trigger_params( trigger_params_type_2 = AlertTriggerParams.from_dict(data) return trigger_params_type_2 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -392,7 +444,7 @@ def _parse_trigger_params( trigger_params_type_3 = PulseTriggerParams.from_dict(data) return trigger_params_type_3 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -416,10 +468,34 @@ def _parse_trigger_params( group_ids = cast(list[str], d.pop("group_ids", UNSET)) + group_assignment_ids = cast(list[str], d.pop("group_assignment_ids", UNSET)) + cause_ids = cast(list[str], d.pop("cause_ids", UNSET)) sub_status_ids = cast(list[str], d.pop("sub_status_ids", UNSET)) + _failure_notification_mode = d.pop("failure_notification_mode", UNSET) + failure_notification_mode: UpdateWorkflowDataAttributesFailureNotificationMode | Unset + if isinstance(_failure_notification_mode, Unset): + failure_notification_mode = UNSET + else: + failure_notification_mode = check_update_workflow_data_attributes_failure_notification_mode( + _failure_notification_mode + ) + + _failure_notification_channels = d.pop("failure_notification_channels", UNSET) + failure_notification_channels: list[UpdateWorkflowDataAttributesFailureNotificationChannelsItem] | Unset = UNSET + if _failure_notification_channels is not UNSET: + failure_notification_channels = [] + for failure_notification_channels_item_data in _failure_notification_channels: + failure_notification_channels_item = ( + UpdateWorkflowDataAttributesFailureNotificationChannelsItem.from_dict( + failure_notification_channels_item_data + ) + ) + + failure_notification_channels.append(failure_notification_channels_item) + update_workflow_data_attributes = cls( slug=slug, name=name, @@ -431,6 +507,7 @@ def _parse_trigger_params( repeat_condition_duration_since_first_run=repeat_condition_duration_since_first_run, repeat_condition_number_of_repeats=repeat_condition_number_of_repeats, continuously_repeat=continuously_repeat, + run_once_per_resource=run_once_per_resource, enabled=enabled, locked=locked, position=position, @@ -443,8 +520,11 @@ def _parse_trigger_params( service_ids=service_ids, functionality_ids=functionality_ids, group_ids=group_ids, + group_assignment_ids=group_assignment_ids, cause_ids=cause_ids, sub_status_ids=sub_status_ids, + failure_notification_mode=failure_notification_mode, + failure_notification_channels=failure_notification_channels, ) return update_workflow_data_attributes diff --git a/rootly_sdk/models/update_workflow_data_attributes_failure_notification_channels_item.py b/rootly_sdk/models/update_workflow_data_attributes_failure_notification_channels_item.py new file mode 100644 index 00000000..07736427 --- /dev/null +++ b/rootly_sdk/models/update_workflow_data_attributes_failure_notification_channels_item.py @@ -0,0 +1,51 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="UpdateWorkflowDataAttributesFailureNotificationChannelsItem") + + +@_attrs_define +class UpdateWorkflowDataAttributesFailureNotificationChannelsItem: + """ + Attributes: + id (str): Slack channel ID. Liquid is allowed, for example `{{ incident.slack_channel_id }}` for the incident + channel. + name (str): Slack channel name + """ + + id: str + name: str + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "id": id, + "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") + + name = d.pop("name") + + update_workflow_data_attributes_failure_notification_channels_item = cls( + id=id, + name=name, + ) + + return update_workflow_data_attributes_failure_notification_channels_item diff --git a/rootly_sdk/models/update_workflow_data_attributes_failure_notification_mode.py b/rootly_sdk/models/update_workflow_data_attributes_failure_notification_mode.py new file mode 100644 index 00000000..1b127615 --- /dev/null +++ b/rootly_sdk/models/update_workflow_data_attributes_failure_notification_mode.py @@ -0,0 +1,23 @@ +from typing import Literal + +UpdateWorkflowDataAttributesFailureNotificationMode = Literal["custom", "inherit", "off"] + +UPDATE_WORKFLOW_DATA_ATTRIBUTES_FAILURE_NOTIFICATION_MODE_VALUES: set[ + UpdateWorkflowDataAttributesFailureNotificationMode +] = { + "custom", + "inherit", + "off", +} + + +def check_update_workflow_data_attributes_failure_notification_mode( + value: str | None, +) -> UpdateWorkflowDataAttributesFailureNotificationMode | None: + if value is None: + return None + if value in UPDATE_WORKFLOW_DATA_ATTRIBUTES_FAILURE_NOTIFICATION_MODE_VALUES: + return value + raise TypeError( + f"Unexpected value {value!r}. Expected one of {UPDATE_WORKFLOW_DATA_ATTRIBUTES_FAILURE_NOTIFICATION_MODE_VALUES!r}" + ) diff --git a/rootly_sdk/models/update_workflow_data_type.py b/rootly_sdk/models/update_workflow_data_type.py index da3668a9..a6e8ec99 100644 --- a/rootly_sdk/models/update_workflow_data_type.py +++ b/rootly_sdk/models/update_workflow_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateWorkflowDataType = Literal["workflows"] @@ -11,5 +11,5 @@ def check_update_workflow_data_type(value: str | None) -> UpdateWorkflowDataType if value is None: return None if value in UPDATE_WORKFLOW_DATA_TYPE_VALUES: - return cast(UpdateWorkflowDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_WORKFLOW_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_workflow_form_field_condition.py b/rootly_sdk/models/update_workflow_form_field_condition.py index 5dcc8f4a..742ad4ad 100644 --- a/rootly_sdk/models/update_workflow_form_field_condition.py +++ b/rootly_sdk/models/update_workflow_form_field_condition.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_workflow_form_field_condition_data import UpdateWorkflowFormFieldConditionData @@ -18,14 +19,13 @@ class UpdateWorkflowFormFieldCondition: data (UpdateWorkflowFormFieldConditionData): """ - data: "UpdateWorkflowFormFieldConditionData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateWorkflowFormFieldConditionData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_workflow_form_field_condition.additional_properties = d return update_workflow_form_field_condition - - @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_form_field_condition_data.py b/rootly_sdk/models/update_workflow_form_field_condition_data.py index de2ac575..ad35791c 100644 --- a/rootly_sdk/models/update_workflow_form_field_condition_data.py +++ b/rootly_sdk/models/update_workflow_form_field_condition_data.py @@ -1,13 +1,15 @@ +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_form_field_condition_data_type import ( UpdateWorkflowFormFieldConditionDataType, check_update_workflow_form_field_condition_data_type, ) +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_workflow_form_field_condition_data_attributes import ( @@ -24,25 +26,31 @@ class UpdateWorkflowFormFieldConditionData: Attributes: type_ (UpdateWorkflowFormFieldConditionDataType): attributes (UpdateWorkflowFormFieldConditionDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateWorkflowFormFieldConditionDataType - attributes: "UpdateWorkflowFormFieldConditionDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateWorkflowFormFieldConditionDataAttributes + id: str | Unset = 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 @@ -57,26 +65,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateWorkflowFormFieldConditionDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_workflow_form_field_condition_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_workflow_form_field_condition_data.additional_properties = d return update_workflow_form_field_condition_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_form_field_condition_data_attributes.py b/rootly_sdk/models/update_workflow_form_field_condition_data_attributes.py index 01865d0b..212d2286 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,74 +18,74 @@ class UpdateWorkflowFormFieldConditionDataAttributes: """ Attributes: - incident_condition (Union[Unset, UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition]): The trigger + incident_condition (UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition | Unset): 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]]): + 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): """ - 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 + 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 def to_dict(self) -> dict[str, Any]: - incident_condition: Unset | str = UNSET + incident_condition: str | Unset = UNSET if not isinstance(self.incident_condition, Unset): incident_condition = self.incident_condition - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values - selected_catalog_entity_ids: Unset | list[str] = UNSET + selected_catalog_entity_ids: list[str] | Unset = UNSET if not isinstance(self.selected_catalog_entity_ids, Unset): selected_catalog_entity_ids = self.selected_catalog_entity_ids - selected_functionality_ids: Unset | list[str] = UNSET + selected_functionality_ids: list[str] | Unset = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: Unset | list[str] = UNSET + selected_group_ids: list[str] | Unset = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_option_ids: Unset | list[str] = UNSET + selected_option_ids: list[str] | Unset = UNSET if not isinstance(self.selected_option_ids, Unset): selected_option_ids = self.selected_option_ids - selected_service_ids: Unset | list[str] = UNSET + selected_service_ids: list[str] | Unset = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_user_ids: Unset | list[int] = UNSET + selected_user_ids: list[int] | Unset = UNSET if not isinstance(self.selected_user_ids, Unset): selected_user_ids = self.selected_user_ids - selected_cause_ids: Unset | list[str] = UNSET + selected_cause_ids: list[str] | Unset = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: Unset | list[str] = UNSET + selected_environment_ids: list[str] | Unset = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: Unset | list[str] = UNSET + selected_incident_type_ids: list[str] | Unset = UNSET if not isinstance(self.selected_incident_type_ids, Unset): selected_incident_type_ids = self.selected_incident_type_ids @@ -119,7 +121,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: Unset | UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition + incident_condition: UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition | Unset if isinstance(_incident_condition, Unset): incident_condition = UNSET else: diff --git a/rootly_sdk/models/update_workflow_form_field_condition_data_attributes_incident_condition.py b/rootly_sdk/models/update_workflow_form_field_condition_data_attributes_incident_condition.py index 7e92dc11..22c53644 100644 --- a/rootly_sdk/models/update_workflow_form_field_condition_data_attributes_incident_condition.py +++ b/rootly_sdk/models/update_workflow_form_field_condition_data_attributes_incident_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_update_workflow_form_field_condition_data_attributes_incident_conditio if value is None: return None if value in UPDATE_WORKFLOW_FORM_FIELD_CONDITION_DATA_ATTRIBUTES_INCIDENT_CONDITION_VALUES: - return cast(UpdateWorkflowFormFieldConditionDataAttributesIncidentCondition, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_WORKFLOW_FORM_FIELD_CONDITION_DATA_ATTRIBUTES_INCIDENT_CONDITION_VALUES!r}" ) diff --git a/rootly_sdk/models/update_workflow_form_field_condition_data_type.py b/rootly_sdk/models/update_workflow_form_field_condition_data_type.py index 62cc027d..0b9f8afc 100644 --- a/rootly_sdk/models/update_workflow_form_field_condition_data_type.py +++ b/rootly_sdk/models/update_workflow_form_field_condition_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateWorkflowFormFieldConditionDataType = Literal["workflow_form_field_conditions"] @@ -13,7 +13,7 @@ def check_update_workflow_form_field_condition_data_type( if value is None: return None if value in UPDATE_WORKFLOW_FORM_FIELD_CONDITION_DATA_TYPE_VALUES: - return cast(UpdateWorkflowFormFieldConditionDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_WORKFLOW_FORM_FIELD_CONDITION_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/update_workflow_group.py b/rootly_sdk/models/update_workflow_group.py index 14a490be..da6fb58d 100644 --- a/rootly_sdk/models/update_workflow_group.py +++ b/rootly_sdk/models/update_workflow_group.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_workflow_group_data import UpdateWorkflowGroupData @@ -18,14 +19,13 @@ class UpdateWorkflowGroup: data (UpdateWorkflowGroupData): """ - data: "UpdateWorkflowGroupData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateWorkflowGroupData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_workflow_group.additional_properties = d return update_workflow_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_workflow_group_data.py b/rootly_sdk/models/update_workflow_group_data.py index dca07ffb..17c495b4 100644 --- a/rootly_sdk/models/update_workflow_group_data.py +++ b/rootly_sdk/models/update_workflow_group_data.py @@ -1,10 +1,12 @@ +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_group_data_type import UpdateWorkflowGroupDataType, check_update_workflow_group_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_workflow_group_data_attributes import UpdateWorkflowGroupDataAttributes @@ -19,25 +21,31 @@ class UpdateWorkflowGroupData: Attributes: type_ (UpdateWorkflowGroupDataType): attributes (UpdateWorkflowGroupDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateWorkflowGroupDataType - attributes: "UpdateWorkflowGroupDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateWorkflowGroupDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateWorkflowGroupDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_workflow_group_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_workflow_group_data.additional_properties = d return update_workflow_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_workflow_group_data_attributes.py b/rootly_sdk/models/update_workflow_group_data_attributes.py index 4050895d..f96b26c4 100644 --- a/rootly_sdk/models/update_workflow_group_data_attributes.py +++ b/rootly_sdk/models/update_workflow_group_data_attributes.py @@ -1,8 +1,9 @@ +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.update_workflow_group_data_attributes_kind import ( UpdateWorkflowGroupDataAttributesKind, @@ -17,39 +18,38 @@ class UpdateWorkflowGroupDataAttributes: """ Attributes: - 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 + slug (None | str | Unset): 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 (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: 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) + slug: None | str | Unset = UNSET + 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 def to_dict(self) -> dict[str, Any]: - slug: None | Unset | str + slug: None | str | Unset if isinstance(self.slug, Unset): slug = UNSET else: slug = self.slug - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind name = self.name - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -62,7 +62,7 @@ def to_dict(self) -> dict[str, Any]: position = self.position field_dict: dict[str, Any] = {} - field_dict.update(self.additional_properties) + field_dict.update({}) if slug is not UNSET: field_dict["slug"] = slug @@ -85,17 +85,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_slug(data: object) -> None | Unset | str: + def _parse_slug(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slug = _parse_slug(d.pop("slug", UNSET)) _kind = d.pop("kind", UNSET) - kind: Unset | UpdateWorkflowGroupDataAttributesKind + kind: UpdateWorkflowGroupDataAttributesKind | Unset if isinstance(_kind, Unset): kind = UNSET else: @@ -103,12 +103,12 @@ def _parse_slug(data: object) -> None | Unset | str: name = d.pop("name", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) @@ -128,21 +128,4 @@ def _parse_description(data: object) -> None | Unset | str: position=position, ) - update_workflow_group_data_attributes.additional_properties = d return update_workflow_group_data_attributes - - @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_group_data_attributes_kind.py b/rootly_sdk/models/update_workflow_group_data_attributes_kind.py index 246ab189..08d66e3d 100644 --- a/rootly_sdk/models/update_workflow_group_data_attributes_kind.py +++ b/rootly_sdk/models/update_workflow_group_data_attributes_kind.py @@ -1,12 +1,15 @@ -from typing import Literal, cast +from typing import Literal -UpdateWorkflowGroupDataAttributesKind = Literal["action_item", "alert", "incident", "post_mortem", "pulse", "simple"] +UpdateWorkflowGroupDataAttributesKind = Literal[ + "action_item", "alert", "incident", "post_mortem", "problem", "pulse", "simple" +] UPDATE_WORKFLOW_GROUP_DATA_ATTRIBUTES_KIND_VALUES: set[UpdateWorkflowGroupDataAttributesKind] = { "action_item", "alert", "incident", "post_mortem", + "problem", "pulse", "simple", } @@ -16,7 +19,7 @@ def check_update_workflow_group_data_attributes_kind(value: str | None) -> Updat if value is None: return None if value in UPDATE_WORKFLOW_GROUP_DATA_ATTRIBUTES_KIND_VALUES: - return cast(UpdateWorkflowGroupDataAttributesKind, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_WORKFLOW_GROUP_DATA_ATTRIBUTES_KIND_VALUES!r}" ) diff --git a/rootly_sdk/models/update_workflow_group_data_type.py b/rootly_sdk/models/update_workflow_group_data_type.py index 9be84e4d..a155ebc6 100644 --- a/rootly_sdk/models/update_workflow_group_data_type.py +++ b/rootly_sdk/models/update_workflow_group_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateWorkflowGroupDataType = Literal["workflow_groups"] @@ -11,5 +11,5 @@ def check_update_workflow_group_data_type(value: str | None) -> UpdateWorkflowGr if value is None: return None if value in UPDATE_WORKFLOW_GROUP_DATA_TYPE_VALUES: - return cast(UpdateWorkflowGroupDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_WORKFLOW_GROUP_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_workflow_task.py b/rootly_sdk/models/update_workflow_task.py index e1af76eb..674f4481 100644 --- a/rootly_sdk/models/update_workflow_task.py +++ b/rootly_sdk/models/update_workflow_task.py @@ -1,8 +1,9 @@ +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 if TYPE_CHECKING: from ..models.update_workflow_task_data import UpdateWorkflowTaskData @@ -18,14 +19,13 @@ class UpdateWorkflowTask: data (UpdateWorkflowTaskData): """ - data: "UpdateWorkflowTaskData" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + data: UpdateWorkflowTaskData 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, @@ -45,21 +45,4 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data=data, ) - update_workflow_task.additional_properties = d return update_workflow_task - - @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_task_data.py b/rootly_sdk/models/update_workflow_task_data.py index e84af22e..e3bdcd32 100644 --- a/rootly_sdk/models/update_workflow_task_data.py +++ b/rootly_sdk/models/update_workflow_task_data.py @@ -1,10 +1,12 @@ +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_task_data_type import UpdateWorkflowTaskDataType, check_update_workflow_task_data_type +from ..types import UNSET, Unset if TYPE_CHECKING: from ..models.update_workflow_task_data_attributes import UpdateWorkflowTaskDataAttributes @@ -19,25 +21,31 @@ class UpdateWorkflowTaskData: Attributes: type_ (UpdateWorkflowTaskDataType): attributes (UpdateWorkflowTaskDataAttributes): + id (str | Unset): Accepted for JSON:API client compatibility, but ignored. The resource to update is identified + by the id in the path. """ type_: UpdateWorkflowTaskDataType - attributes: "UpdateWorkflowTaskDataAttributes" - additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + attributes: UpdateWorkflowTaskDataAttributes + id: str | Unset = 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 @@ -50,26 +58,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: attributes = UpdateWorkflowTaskDataAttributes.from_dict(d.pop("attributes")) + id = d.pop("id", UNSET) + update_workflow_task_data = cls( type_=type_, attributes=attributes, + id=id, ) - update_workflow_task_data.additional_properties = d return update_workflow_task_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_task_data_attributes.py b/rootly_sdk/models/update_workflow_task_data_attributes.py index 0dc74eb8..8e20b1ac 100644 --- a/rootly_sdk/models/update_workflow_task_data_attributes.py +++ b/rootly_sdk/models/update_workflow_task_data_attributes.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define @@ -78,6 +80,7 @@ from ..models.create_shortcut_story_task_params_type_0 import CreateShortcutStoryTaskParamsType0 from ..models.create_shortcut_story_task_params_type_1 import CreateShortcutStoryTaskParamsType1 from ..models.create_shortcut_task_task_params import CreateShortcutTaskTaskParams + from ..models.create_slack_canvas_task_params import CreateSlackCanvasTaskParams from ..models.create_slack_channel_task_params import CreateSlackChannelTaskParams from ..models.create_sub_incident_task_params import CreateSubIncidentTaskParams from ..models.create_trello_card_task_params import CreateTrelloCardTaskParams @@ -123,6 +126,7 @@ from ..models.print_task_params import PrintTaskParams from ..models.publish_incident_task_params import PublishIncidentTaskParams from ..models.redis_client_task_params import RedisClientTaskParams + from ..models.remove_from_slack_channel_task_params import RemoveFromSlackChannelTaskParams from ..models.remove_google_docs_permissions_task_params import RemoveGoogleDocsPermissionsTaskParams from ..models.rename_google_chat_space_task_params import RenameGoogleChatSpaceTaskParams from ..models.rename_microsoft_teams_channel_task_params import RenameMicrosoftTeamsChannelTaskParams @@ -179,6 +183,7 @@ from ..models.update_sharepoint_page_task_params import UpdateSharepointPageTaskParams from ..models.update_shortcut_story_task_params import UpdateShortcutStoryTaskParams from ..models.update_shortcut_task_task_params import UpdateShortcutTaskTaskParams + from ..models.update_slack_canvas_task_params import UpdateSlackCanvasTaskParams from ..models.update_slack_channel_topic_task_params import UpdateSlackChannelTopicTaskParams from ..models.update_status_task_params import UpdateStatusTaskParams from ..models.update_trello_card_task_params import UpdateTrelloCardTaskParams @@ -193,248 +198,248 @@ class UpdateWorkflowTaskDataAttributes: """ Attributes: - 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): 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 | 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 | 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 | CreateSlackCanvasTaskParams | + 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 | RemoveFromSlackChannelTaskParams | 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 | UpdateSlackCanvasTaskParams | UpdateSlackChannelTopicTaskParams | + UpdateStatusTaskParams | UpdateTrelloCardTaskParams | UpdateVictorOpsIncidentTaskParams | + UpdateZendeskTicketTaskParams): """ - 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 + 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 + | 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 + | 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 + | CreateSlackCanvasTaskParams + | 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 + | RemoveFromSlackChannelTaskParams + | 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 + | UpdateSlackCanvasTaskParams + | UpdateSlackChannelTopicTaskParams + | UpdateStatusTaskParams + | UpdateTrelloCardTaskParams + | UpdateVictorOpsIncidentTaskParams + | UpdateZendeskTicketTaskParams + ) = UNSET def to_dict(self) -> dict[str, Any]: from ..models.add_action_item_task_params import AddActionItemTaskParams @@ -510,6 +515,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.create_shortcut_story_task_params_type_0 import CreateShortcutStoryTaskParamsType0 from ..models.create_shortcut_story_task_params_type_1 import CreateShortcutStoryTaskParamsType1 from ..models.create_shortcut_task_task_params import CreateShortcutTaskTaskParams + from ..models.create_slack_canvas_task_params import CreateSlackCanvasTaskParams from ..models.create_slack_channel_task_params import CreateSlackChannelTaskParams from ..models.create_sub_incident_task_params import CreateSubIncidentTaskParams from ..models.create_trello_card_task_params import CreateTrelloCardTaskParams @@ -555,6 +561,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.print_task_params import PrintTaskParams from ..models.publish_incident_task_params import PublishIncidentTaskParams from ..models.redis_client_task_params import RedisClientTaskParams + from ..models.remove_from_slack_channel_task_params import RemoveFromSlackChannelTaskParams from ..models.remove_google_docs_permissions_task_params import RemoveGoogleDocsPermissionsTaskParams from ..models.rename_google_chat_space_task_params import RenameGoogleChatSpaceTaskParams from ..models.rename_microsoft_teams_channel_task_params import RenameMicrosoftTeamsChannelTaskParams @@ -611,6 +618,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.update_sharepoint_page_task_params import UpdateSharepointPageTaskParams from ..models.update_shortcut_story_task_params import UpdateShortcutStoryTaskParams from ..models.update_shortcut_task_task_params import UpdateShortcutTaskTaskParams + from ..models.update_slack_canvas_task_params import UpdateSlackCanvasTaskParams from ..models.update_slack_channel_topic_task_params import UpdateSlackChannelTopicTaskParams from ..models.update_status_task_params import UpdateStatusTaskParams from ..models.update_trello_card_task_params import UpdateTrelloCardTaskParams @@ -625,7 +633,7 @@ def to_dict(self) -> dict[str, Any]: enabled = self.enabled - task_params: Unset | dict[str, Any] + task_params: dict[str, Any] | Unset if isinstance(self.task_params, Unset): task_params = UNSET elif isinstance(self.task_params, AddActionItemTaskParams): @@ -874,6 +882,8 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, RenameSlackChannelTaskParams): task_params = self.task_params.to_dict() + elif isinstance(self.task_params, RemoveFromSlackChannelTaskParams): + task_params = self.task_params.to_dict() elif isinstance(self.task_params, ChangeSlackChannelPrivacyTaskParams): task_params = self.task_params.to_dict() elif isinstance(self.task_params, RunCommandHerokuTaskParams): @@ -884,6 +894,8 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, CreateSlackChannelTaskParams): task_params = self.task_params.to_dict() + elif isinstance(self.task_params, CreateSlackCanvasTaskParams): + task_params = self.task_params.to_dict() elif isinstance(self.task_params, SendSlackMessageTaskParamsType0): task_params = self.task_params.to_dict() elif isinstance(self.task_params, SendSlackMessageTaskParamsType1): @@ -928,6 +940,8 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, UpdateSlackChannelTopicTaskParams): task_params = self.task_params.to_dict() + elif isinstance(self.task_params, UpdateSlackCanvasTaskParams): + task_params = self.task_params.to_dict() elif isinstance(self.task_params, UpdateStatusTaskParams): task_params = self.task_params.to_dict() elif isinstance(self.task_params, UpdateIncidentStatusTimestampTaskParams): @@ -1053,6 +1067,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.create_shortcut_story_task_params_type_0 import CreateShortcutStoryTaskParamsType0 from ..models.create_shortcut_story_task_params_type_1 import CreateShortcutStoryTaskParamsType1 from ..models.create_shortcut_task_task_params import CreateShortcutTaskTaskParams + from ..models.create_slack_canvas_task_params import CreateSlackCanvasTaskParams from ..models.create_slack_channel_task_params import CreateSlackChannelTaskParams from ..models.create_sub_incident_task_params import CreateSubIncidentTaskParams from ..models.create_trello_card_task_params import CreateTrelloCardTaskParams @@ -1098,6 +1113,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.print_task_params import PrintTaskParams from ..models.publish_incident_task_params import PublishIncidentTaskParams from ..models.redis_client_task_params import RedisClientTaskParams + from ..models.remove_from_slack_channel_task_params import RemoveFromSlackChannelTaskParams from ..models.remove_google_docs_permissions_task_params import RemoveGoogleDocsPermissionsTaskParams from ..models.rename_google_chat_space_task_params import RenameGoogleChatSpaceTaskParams from ..models.rename_microsoft_teams_channel_task_params import RenameMicrosoftTeamsChannelTaskParams @@ -1154,6 +1170,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.update_sharepoint_page_task_params import UpdateSharepointPageTaskParams from ..models.update_shortcut_story_task_params import UpdateShortcutStoryTaskParams from ..models.update_shortcut_task_task_params import UpdateShortcutTaskTaskParams + from ..models.update_slack_canvas_task_params import UpdateSlackCanvasTaskParams from ..models.update_slack_channel_topic_task_params import UpdateSlackChannelTopicTaskParams from ..models.update_status_task_params import UpdateStatusTaskParams from ..models.update_trello_card_task_params import UpdateTrelloCardTaskParams @@ -1171,175 +1188,178 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_task_params( data: object, - ) -> 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, - ]: + ) -> ( + 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 + | 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 + | CreateSlackCanvasTaskParams + | 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 + | RemoveFromSlackChannelTaskParams + | 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 + | UpdateSlackCanvasTaskParams + | UpdateSlackChannelTopicTaskParams + | UpdateStatusTaskParams + | UpdateTrelloCardTaskParams + | UpdateVictorOpsIncidentTaskParams + | UpdateZendeskTicketTaskParams + ): if isinstance(data, Unset): return data try: @@ -1348,7 +1368,7 @@ def _parse_task_params( task_params_type_0 = AddActionItemTaskParams.from_dict(data) return task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1356,7 +1376,7 @@ def _parse_task_params( task_params_type_1 = UpdateActionItemTaskParams.from_dict(data) return task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1364,7 +1384,7 @@ def _parse_task_params( task_params_type_2 = AddRoleTaskParams.from_dict(data) return task_params_type_2 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1372,7 +1392,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1380,7 +1400,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1388,7 +1408,7 @@ def _parse_task_params( task_params_type_4 = AddTeamTaskParams.from_dict(data) return task_params_type_4 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1396,7 +1416,7 @@ def _parse_task_params( task_params_type_5 = AddToTimelineTaskParams.from_dict(data) return task_params_type_5 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1404,7 +1424,7 @@ def _parse_task_params( task_params_type_6 = ArchiveSlackChannelsTaskParams.from_dict(data) return task_params_type_6 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1412,7 +1432,7 @@ def _parse_task_params( task_params_type_7 = AttachDatadogDashboardsTaskParams.from_dict(data) return task_params_type_7 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1420,7 +1440,7 @@ def _parse_task_params( task_params_type_8 = AutoAssignRoleOpsgenieTaskParams.from_dict(data) return task_params_type_8 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1430,7 +1450,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_rootly_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1440,7 +1460,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_rootly_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1450,7 +1470,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_rootly_task_params_type_2 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1460,7 +1480,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_rootly_task_params_type_3 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1470,7 +1490,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_rootly_task_params_type_4 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1480,7 +1500,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_pagerduty_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1490,7 +1510,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_pagerduty_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1498,7 +1518,7 @@ def _parse_task_params( task_params_type_11 = UpdatePagerdutyIncidentTaskParams.from_dict(data) return task_params_type_11 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1506,7 +1526,7 @@ def _parse_task_params( task_params_type_12 = CreatePagerdutyStatusUpdateTaskParams.from_dict(data) return task_params_type_12 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1514,7 +1534,7 @@ def _parse_task_params( task_params_type_13 = CreatePagertreeAlertTaskParams.from_dict(data) return task_params_type_13 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1522,7 +1542,7 @@ def _parse_task_params( task_params_type_14 = UpdatePagertreeAlertTaskParams.from_dict(data) return task_params_type_14 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1530,7 +1550,7 @@ def _parse_task_params( task_params_type_15 = AutoAssignRoleVictorOpsTaskParams.from_dict(data) return task_params_type_15 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1538,7 +1558,7 @@ def _parse_task_params( task_params_type_16 = CallPeopleTaskParams.from_dict(data) return task_params_type_16 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1546,7 +1566,7 @@ def _parse_task_params( task_params_type_17 = CreateAirtableTableRecordTaskParams.from_dict(data) return task_params_type_17 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1554,7 +1574,7 @@ def _parse_task_params( task_params_type_18 = CreateAsanaSubtaskTaskParams.from_dict(data) return task_params_type_18 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1562,7 +1582,7 @@ def _parse_task_params( task_params_type_19 = CreateAsanaTaskTaskParams.from_dict(data) return task_params_type_19 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1570,7 +1590,7 @@ def _parse_task_params( task_params_type_20 = CreateConfluencePageTaskParams.from_dict(data) return task_params_type_20 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1578,7 +1598,7 @@ def _parse_task_params( task_params_type_21 = CreateDatadogNotebookTaskParams.from_dict(data) return task_params_type_21 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1586,7 +1606,7 @@ def _parse_task_params( task_params_type_22 = CreateCodaPageTaskParams.from_dict(data) return task_params_type_22 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1594,7 +1614,7 @@ def _parse_task_params( task_params_type_23 = CreateDropboxPaperPageTaskParams.from_dict(data) return task_params_type_23 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1602,7 +1622,7 @@ def _parse_task_params( task_params_type_24 = CreateGithubIssueTaskParams.from_dict(data) return task_params_type_24 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1610,7 +1630,7 @@ def _parse_task_params( task_params_type_25 = CreateGitlabIssueTaskParams.from_dict(data) return task_params_type_25 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1618,7 +1638,7 @@ def _parse_task_params( task_params_type_26 = CreateOutlookEventTaskParams.from_dict(data) return task_params_type_26 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1626,7 +1646,7 @@ def _parse_task_params( task_params_type_27 = CreateGoogleCalendarEventTaskParams.from_dict(data) return task_params_type_27 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1634,7 +1654,7 @@ def _parse_task_params( task_params_type_28 = UpdateGoogleDocsPageTaskParams.from_dict(data) return task_params_type_28 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1642,7 +1662,7 @@ def _parse_task_params( task_params_type_29 = UpdateCodaPageTaskParams.from_dict(data) return task_params_type_29 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1650,7 +1670,7 @@ def _parse_task_params( task_params_type_30 = UpdateGoogleCalendarEventTaskParams.from_dict(data) return task_params_type_30 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1658,7 +1678,7 @@ def _parse_task_params( task_params_type_31 = CreateSharepointPageTaskParams.from_dict(data) return task_params_type_31 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1666,7 +1686,7 @@ def _parse_task_params( task_params_type_32 = CreateGoogleDocsPageTaskParams.from_dict(data) return task_params_type_32 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1674,7 +1694,7 @@ def _parse_task_params( task_params_type_33 = CreateGoogleDocsPermissionsTaskParams.from_dict(data) return task_params_type_33 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1682,7 +1702,7 @@ def _parse_task_params( task_params_type_34 = RemoveGoogleDocsPermissionsTaskParams.from_dict(data) return task_params_type_34 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1690,7 +1710,7 @@ def _parse_task_params( task_params_type_35 = CreateQuipPageTaskParams.from_dict(data) return task_params_type_35 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1698,7 +1718,7 @@ def _parse_task_params( task_params_type_36 = CreateGoogleMeetingTaskParams.from_dict(data) return task_params_type_36 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1706,7 +1726,7 @@ def _parse_task_params( task_params_type_37 = CreateGoToMeetingTaskParams.from_dict(data) return task_params_type_37 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1714,7 +1734,7 @@ def _parse_task_params( task_params_type_38 = CreateIncidentTaskParams.from_dict(data) return task_params_type_38 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1722,7 +1742,7 @@ def _parse_task_params( task_params_type_39 = CreateSubIncidentTaskParams.from_dict(data) return task_params_type_39 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1730,7 +1750,7 @@ def _parse_task_params( task_params_type_40 = CreateIncidentPostmortemTaskParams.from_dict(data) return task_params_type_40 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1738,7 +1758,7 @@ def _parse_task_params( task_params_type_41 = CreateJiraIssueTaskParams.from_dict(data) return task_params_type_41 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1746,7 +1766,7 @@ def _parse_task_params( task_params_type_42 = CreateJiraSubtaskTaskParams.from_dict(data) return task_params_type_42 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1754,7 +1774,7 @@ def _parse_task_params( task_params_type_43 = AttachRetrospectivePdfToJiraIssueTaskParams.from_dict(data) return task_params_type_43 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1762,7 +1782,7 @@ def _parse_task_params( task_params_type_44 = AttachRetrospectivePdfToFreshserviceTicketTaskParams.from_dict(data) return task_params_type_44 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1770,7 +1790,7 @@ def _parse_task_params( task_params_type_45 = CreateLinearIssueTaskParams.from_dict(data) return task_params_type_45 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1778,7 +1798,7 @@ def _parse_task_params( task_params_type_46 = CreateLinearSubtaskIssueTaskParams.from_dict(data) return task_params_type_46 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1786,7 +1806,7 @@ def _parse_task_params( task_params_type_47 = CreateLinearIssueCommentTaskParams.from_dict(data) return task_params_type_47 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1794,7 +1814,7 @@ def _parse_task_params( task_params_type_48 = CreateMicrosoftTeamsMeetingTaskParams.from_dict(data) return task_params_type_48 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1802,7 +1822,7 @@ def _parse_task_params( task_params_type_49 = CreateMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_49 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1810,7 +1830,7 @@ def _parse_task_params( task_params_type_50 = CreateMicrosoftTeamsChatTaskParams.from_dict(data) return task_params_type_50 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1820,7 +1840,7 @@ def _parse_task_params( ) return componentsschemasadd_microsoft_teams_tab_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1830,7 +1850,7 @@ def _parse_task_params( ) return componentsschemasadd_microsoft_teams_tab_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1838,7 +1858,7 @@ def _parse_task_params( task_params_type_52 = AddMicrosoftTeamsChatTabTaskParams.from_dict(data) return task_params_type_52 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1846,7 +1866,7 @@ def _parse_task_params( task_params_type_53 = CreateGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_53 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1854,7 +1874,7 @@ def _parse_task_params( task_params_type_54 = SendGoogleChatMessageTaskParams.from_dict(data) return task_params_type_54 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1862,7 +1882,7 @@ def _parse_task_params( task_params_type_55 = SendGoogleChatAttachmentsTaskParams.from_dict(data) return task_params_type_55 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1870,7 +1890,7 @@ def _parse_task_params( task_params_type_56 = InviteToGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_56 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1878,7 +1898,7 @@ def _parse_task_params( task_params_type_57 = ArchiveGoogleChatSpacesTaskParams.from_dict(data) return task_params_type_57 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1886,7 +1906,7 @@ def _parse_task_params( task_params_type_58 = RenameGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_58 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1894,7 +1914,7 @@ def _parse_task_params( task_params_type_59 = UpdateGoogleChatSpaceDescriptionTaskParams.from_dict(data) return task_params_type_59 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1902,7 +1922,7 @@ def _parse_task_params( task_params_type_60 = ChangeGoogleChatSpacePrivacyTaskParams.from_dict(data) return task_params_type_60 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1910,7 +1930,7 @@ def _parse_task_params( task_params_type_61 = ArchiveMicrosoftTeamsChannelsTaskParams.from_dict(data) return task_params_type_61 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1918,7 +1938,7 @@ def _parse_task_params( task_params_type_62 = RenameMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_62 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1926,7 +1946,7 @@ def _parse_task_params( task_params_type_63 = InviteToMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_63 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1934,7 +1954,7 @@ def _parse_task_params( task_params_type_64 = CreateNotionPageTaskParams.from_dict(data) return task_params_type_64 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1944,7 +1964,7 @@ def _parse_task_params( ) return componentsschemassend_microsoft_teams_message_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1952,7 +1972,7 @@ def _parse_task_params( task_params_type_66 = SendMicrosoftTeamsChatMessageTaskParams.from_dict(data) return task_params_type_66 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1962,7 +1982,7 @@ def _parse_task_params( ) return componentsschemassend_microsoft_teams_blocks_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1970,7 +1990,7 @@ def _parse_task_params( task_params_type_68 = UpdateNotionPageTaskParams.from_dict(data) return task_params_type_68 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1978,7 +1998,7 @@ def _parse_task_params( task_params_type_69 = UpdateQuipPageTaskParams.from_dict(data) return task_params_type_69 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1986,7 +2006,7 @@ def _parse_task_params( task_params_type_70 = UpdateConfluencePageTaskParams.from_dict(data) return task_params_type_70 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1994,7 +2014,7 @@ def _parse_task_params( task_params_type_71 = UpdateSharepointPageTaskParams.from_dict(data) return task_params_type_71 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2002,7 +2022,7 @@ def _parse_task_params( task_params_type_72 = UpdateDropboxPaperPageTaskParams.from_dict(data) return task_params_type_72 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2010,7 +2030,7 @@ def _parse_task_params( task_params_type_73 = UpdateDatadogNotebookTaskParams.from_dict(data) return task_params_type_73 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2018,7 +2038,7 @@ def _parse_task_params( task_params_type_74 = CreateServiceNowIncidentTaskParams.from_dict(data) return task_params_type_74 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2028,7 +2048,7 @@ def _parse_task_params( ) return componentsschemascreate_shortcut_story_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2038,7 +2058,7 @@ def _parse_task_params( ) return componentsschemascreate_shortcut_story_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2046,7 +2066,7 @@ def _parse_task_params( task_params_type_76 = CreateShortcutTaskTaskParams.from_dict(data) return task_params_type_76 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2054,7 +2074,7 @@ def _parse_task_params( task_params_type_77 = CreateTrelloCardTaskParams.from_dict(data) return task_params_type_77 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2062,7 +2082,7 @@ def _parse_task_params( task_params_type_78 = CreateWebexMeetingTaskParams.from_dict(data) return task_params_type_78 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2070,7 +2090,7 @@ def _parse_task_params( task_params_type_79 = CreateZendeskTicketTaskParams.from_dict(data) return task_params_type_79 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2078,7 +2098,7 @@ def _parse_task_params( task_params_type_80 = CreateZendeskJiraLinkTaskParams.from_dict(data) return task_params_type_80 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2086,7 +2106,7 @@ def _parse_task_params( task_params_type_81 = CreateClickupTaskTaskParams.from_dict(data) return task_params_type_81 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2094,7 +2114,7 @@ def _parse_task_params( task_params_type_82 = CreateMotionTaskTaskParams.from_dict(data) return task_params_type_82 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2102,7 +2122,7 @@ def _parse_task_params( task_params_type_83 = CreateZoomMeetingTaskParams.from_dict(data) return task_params_type_83 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2110,7 +2130,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2118,7 +2138,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2126,7 +2146,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2134,7 +2154,7 @@ def _parse_task_params( componentsschemasget_gitlab_commits_task_params_type_1 = GetGitlabCommitsTaskParamsType1.from_dict(data) return componentsschemasget_gitlab_commits_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2142,7 +2162,7 @@ def _parse_task_params( task_params_type_86 = GetPulsesTaskParams.from_dict(data) return task_params_type_86 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2150,7 +2170,7 @@ def _parse_task_params( task_params_type_87 = GetAlertsTaskParams.from_dict(data) return task_params_type_87 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2158,7 +2178,7 @@ def _parse_task_params( task_params_type_88 = HttpClientTaskParams.from_dict(data) return task_params_type_88 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2166,7 +2186,7 @@ def _parse_task_params( task_params_type_89 = InviteToSlackChannelOpsgenieTaskParams.from_dict(data) return task_params_type_89 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2174,7 +2194,7 @@ def _parse_task_params( task_params_type_90 = InviteToSlackChannelRootlyTaskParams.from_dict(data) return task_params_type_90 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2182,7 +2202,7 @@ def _parse_task_params( task_params_type_91 = InviteToMicrosoftTeamsChannelRootlyTaskParams.from_dict(data) return task_params_type_91 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2192,7 +2212,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_pagerduty_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2202,7 +2222,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_pagerduty_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2212,7 +2232,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2222,7 +2242,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2232,7 +2252,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_2 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2240,7 +2260,7 @@ def _parse_task_params( task_params_type_94 = InviteToSlackChannelVictorOpsTaskParams.from_dict(data) return task_params_type_94 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2248,7 +2268,7 @@ def _parse_task_params( task_params_type_95 = PageOpsgenieOnCallRespondersTaskParams.from_dict(data) return task_params_type_95 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2256,7 +2276,7 @@ def _parse_task_params( task_params_type_96 = CreateOpsgenieAlertTaskParams.from_dict(data) return task_params_type_96 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2264,7 +2284,7 @@ def _parse_task_params( task_params_type_97 = CreateJsmopsAlertTaskParams.from_dict(data) return task_params_type_97 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2272,7 +2292,7 @@ def _parse_task_params( task_params_type_98 = PageJsmopsOnCallRespondersTaskParams.from_dict(data) return task_params_type_98 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2280,7 +2300,7 @@ def _parse_task_params( task_params_type_99 = UpdateOpsgenieAlertTaskParams.from_dict(data) return task_params_type_99 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2288,7 +2308,7 @@ def _parse_task_params( task_params_type_100 = UpdateOpsgenieIncidentTaskParams.from_dict(data) return task_params_type_100 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2296,7 +2316,7 @@ def _parse_task_params( task_params_type_101 = PageRootlyOnCallRespondersTaskParams.from_dict(data) return task_params_type_101 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2304,7 +2324,7 @@ def _parse_task_params( task_params_type_102 = PagePagerdutyOnCallRespondersTaskParams.from_dict(data) return task_params_type_102 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2314,7 +2334,7 @@ def _parse_task_params( ) return componentsschemaspage_victor_ops_on_call_responders_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2324,7 +2344,7 @@ def _parse_task_params( ) return componentsschemaspage_victor_ops_on_call_responders_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2332,7 +2352,7 @@ def _parse_task_params( task_params_type_104 = UpdateVictorOpsIncidentTaskParams.from_dict(data) return task_params_type_104 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2340,7 +2360,7 @@ def _parse_task_params( task_params_type_105 = PrintTaskParams.from_dict(data) return task_params_type_105 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2348,7 +2368,7 @@ def _parse_task_params( task_params_type_106 = PublishIncidentTaskParams.from_dict(data) return task_params_type_106 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2356,7 +2376,7 @@ def _parse_task_params( task_params_type_107 = RedisClientTaskParams.from_dict(data) return task_params_type_107 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2364,287 +2384,311 @@ def _parse_task_params( task_params_type_108 = RenameSlackChannelTaskParams.from_dict(data) return task_params_type_108 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_109 = ChangeSlackChannelPrivacyTaskParams.from_dict(data) + task_params_type_109 = RemoveFromSlackChannelTaskParams.from_dict(data) return task_params_type_109 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_110 = RunCommandHerokuTaskParams.from_dict(data) + task_params_type_110 = ChangeSlackChannelPrivacyTaskParams.from_dict(data) return task_params_type_110 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_111 = SendEmailTaskParams.from_dict(data) + task_params_type_111 = RunCommandHerokuTaskParams.from_dict(data) return task_params_type_111 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_112 = SendDashboardReportTaskParams.from_dict(data) + task_params_type_112 = SendEmailTaskParams.from_dict(data) return task_params_type_112 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_113 = CreateSlackChannelTaskParams.from_dict(data) + task_params_type_113 = SendDashboardReportTaskParams.from_dict(data) return task_params_type_113 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - componentsschemassend_slack_message_task_params_type_0 = SendSlackMessageTaskParamsType0.from_dict(data) + task_params_type_114 = CreateSlackChannelTaskParams.from_dict(data) - return componentsschemassend_slack_message_task_params_type_0 - except: # noqa: E722 + return task_params_type_114 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - componentsschemassend_slack_message_task_params_type_1 = SendSlackMessageTaskParamsType1.from_dict(data) + task_params_type_115 = CreateSlackCanvasTaskParams.from_dict(data) - return componentsschemassend_slack_message_task_params_type_1 - except: # noqa: E722 + return task_params_type_115 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - componentsschemassend_slack_message_task_params_type_2 = SendSlackMessageTaskParamsType2.from_dict(data) + componentsschemassend_slack_message_task_params_type_0 = SendSlackMessageTaskParamsType0.from_dict(data) - return componentsschemassend_slack_message_task_params_type_2 - except: # noqa: E722 + return componentsschemassend_slack_message_task_params_type_0 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_115 = SendSmsTaskParams.from_dict(data) + componentsschemassend_slack_message_task_params_type_1 = SendSlackMessageTaskParamsType1.from_dict(data) - return task_params_type_115 - except: # noqa: E722 + return componentsschemassend_slack_message_task_params_type_1 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_116 = SendWhatsappMessageTaskParams.from_dict(data) + componentsschemassend_slack_message_task_params_type_2 = SendSlackMessageTaskParamsType2.from_dict(data) - return task_params_type_116 - except: # noqa: E722 + 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_117 = SnapshotDatadogGraphTaskParams.from_dict(data) + task_params_type_117 = SendSmsTaskParams.from_dict(data) return task_params_type_117 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_118 = SnapshotGrafanaDashboardTaskParams.from_dict(data) + task_params_type_118 = SendWhatsappMessageTaskParams.from_dict(data) return task_params_type_118 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_119 = SnapshotLookerLookTaskParams.from_dict(data) + task_params_type_119 = SnapshotDatadogGraphTaskParams.from_dict(data) return task_params_type_119 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_120 = SnapshotNewRelicGraphTaskParams.from_dict(data) + task_params_type_120 = SnapshotGrafanaDashboardTaskParams.from_dict(data) return task_params_type_120 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_121 = TweetTwitterMessageTaskParams.from_dict(data) + task_params_type_121 = SnapshotLookerLookTaskParams.from_dict(data) return task_params_type_121 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_122 = UpdateAirtableTableRecordTaskParams.from_dict(data) + task_params_type_122 = SnapshotNewRelicGraphTaskParams.from_dict(data) return task_params_type_122 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_123 = UpdateAsanaTaskTaskParams.from_dict(data) + task_params_type_123 = TweetTwitterMessageTaskParams.from_dict(data) return task_params_type_123 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_124 = UpdateGithubIssueTaskParams.from_dict(data) + task_params_type_124 = UpdateAirtableTableRecordTaskParams.from_dict(data) return task_params_type_124 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_125 = UpdateGitlabIssueTaskParams.from_dict(data) + task_params_type_125 = UpdateAsanaTaskTaskParams.from_dict(data) return task_params_type_125 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_126 = UpdateIncidentTaskParams.from_dict(data) + task_params_type_126 = UpdateGithubIssueTaskParams.from_dict(data) return task_params_type_126 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_127 = UpdateIncidentPostmortemTaskParams.from_dict(data) + task_params_type_127 = UpdateGitlabIssueTaskParams.from_dict(data) return task_params_type_127 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_128 = UpdateJiraIssueTaskParams.from_dict(data) + task_params_type_128 = UpdateIncidentTaskParams.from_dict(data) return task_params_type_128 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_129 = UpdateLinearIssueTaskParams.from_dict(data) + task_params_type_129 = UpdateIncidentPostmortemTaskParams.from_dict(data) return task_params_type_129 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_130 = UpdateServiceNowIncidentTaskParams.from_dict(data) + task_params_type_130 = UpdateJiraIssueTaskParams.from_dict(data) return task_params_type_130 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_131 = UpdateShortcutStoryTaskParams.from_dict(data) + task_params_type_131 = UpdateLinearIssueTaskParams.from_dict(data) return task_params_type_131 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_132 = UpdateShortcutTaskTaskParams.from_dict(data) + task_params_type_132 = UpdateServiceNowIncidentTaskParams.from_dict(data) return task_params_type_132 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_133 = UpdateSlackChannelTopicTaskParams.from_dict(data) + task_params_type_133 = UpdateShortcutStoryTaskParams.from_dict(data) return task_params_type_133 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_134 = UpdateStatusTaskParams.from_dict(data) + task_params_type_134 = UpdateShortcutTaskTaskParams.from_dict(data) return task_params_type_134 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_135 = UpdateIncidentStatusTimestampTaskParams.from_dict(data) + task_params_type_135 = UpdateSlackChannelTopicTaskParams.from_dict(data) return task_params_type_135 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_136 = UpdateTrelloCardTaskParams.from_dict(data) + task_params_type_136 = UpdateSlackCanvasTaskParams.from_dict(data) return task_params_type_136 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_137 = UpdateClickupTaskTaskParams.from_dict(data) + task_params_type_137 = UpdateStatusTaskParams.from_dict(data) return task_params_type_137 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_138 = UpdateMotionTaskTaskParams.from_dict(data) + task_params_type_138 = UpdateIncidentStatusTimestampTaskParams.from_dict(data) return task_params_type_138 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_139 = UpdateZendeskTicketTaskParams.from_dict(data) + task_params_type_139 = UpdateTrelloCardTaskParams.from_dict(data) return task_params_type_139 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_140 = UpdateAttachedAlertsTaskParams.from_dict(data) + task_params_type_140 = UpdateClickupTaskTaskParams.from_dict(data) return task_params_type_140 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_141 = TriggerWorkflowTaskParams.from_dict(data) + task_params_type_141 = UpdateMotionTaskTaskParams.from_dict(data) return task_params_type_141 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_142 = UpdateZendeskTicketTaskParams.from_dict(data) + + return task_params_type_142 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_143 = UpdateAttachedAlertsTaskParams.from_dict(data) + + return task_params_type_143 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_144 = TriggerWorkflowTaskParams.from_dict(data) + + return task_params_type_144 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2652,7 +2696,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2660,7 +2704,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2668,45 +2712,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_143 = CreateOpenaiChatCompletionTaskParams.from_dict(data) + task_params_type_146 = CreateOpenaiChatCompletionTaskParams.from_dict(data) - return task_params_type_143 - except: # noqa: E722 + return task_params_type_146 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_144 = CreateWatsonxChatCompletionTaskParams.from_dict(data) + task_params_type_147 = CreateWatsonxChatCompletionTaskParams.from_dict(data) - return task_params_type_144 - except: # noqa: E722 + return task_params_type_147 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_145 = CreateGoogleGeminiChatCompletionTaskParams.from_dict(data) + task_params_type_148 = CreateGoogleGeminiChatCompletionTaskParams.from_dict(data) - return task_params_type_145 - except: # noqa: E722 + return task_params_type_148 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_146 = CreateMistralChatCompletionTaskParams.from_dict(data) + task_params_type_149 = CreateMistralChatCompletionTaskParams.from_dict(data) - return task_params_type_146 - except: # noqa: E722 + return task_params_type_149 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() - task_params_type_147 = CreateAnthropicChatCompletionTaskParams.from_dict(data) + task_params_type_150 = CreateAnthropicChatCompletionTaskParams.from_dict(data) - return task_params_type_147 + return task_params_type_150 task_params = _parse_task_params(d.pop("task_params", UNSET)) diff --git a/rootly_sdk/models/update_workflow_task_data_type.py b/rootly_sdk/models/update_workflow_task_data_type.py index 2d8571a1..8df74414 100644 --- a/rootly_sdk/models/update_workflow_task_data_type.py +++ b/rootly_sdk/models/update_workflow_task_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateWorkflowTaskDataType = Literal["workflow_tasks"] @@ -11,5 +11,5 @@ def check_update_workflow_task_data_type(value: str | None) -> UpdateWorkflowTas if value is None: return None if value in UPDATE_WORKFLOW_TASK_DATA_TYPE_VALUES: - return cast(UpdateWorkflowTaskDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {UPDATE_WORKFLOW_TASK_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/update_zendesk_ticket_task_params.py b/rootly_sdk/models/update_zendesk_ticket_task_params.py index 17aeb783..fbc11737 100644 --- a/rootly_sdk/models/update_zendesk_ticket_task_params.py +++ b/rootly_sdk/models/update_zendesk_ticket_task_params.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -23,31 +25,31 @@ class UpdateZendeskTicketTaskParams: """ Attributes: ticket_id (str): The ticket id - 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 + 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 valid JSON - ticket_payload (Union[None, Unset, str]): Additional Zendesk ticket attributes. Will be merged into whatever was + ticket_payload (None | str | Unset): 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: 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 + 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 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 + task_type: str | Unset = UNSET if not isinstance(self.task_type, Unset): task_type = self.task_type @@ -55,21 +57,21 @@ def to_dict(self) -> dict[str, Any]: tags = self.tags - priority: Unset | dict[str, Any] = UNSET + priority: dict[str, Any] | Unset = UNSET if not isinstance(self.priority, Unset): priority = self.priority.to_dict() - completion: Unset | dict[str, Any] = UNSET + completion: dict[str, Any] | Unset = UNSET if not isinstance(self.completion, Unset): completion = self.completion.to_dict() - custom_fields_mapping: None | Unset | str + custom_fields_mapping: None | str | Unset if isinstance(self.custom_fields_mapping, Unset): custom_fields_mapping = UNSET else: custom_fields_mapping = self.custom_fields_mapping - ticket_payload: None | Unset | str + ticket_payload: None | str | Unset if isinstance(self.ticket_payload, Unset): ticket_payload = UNSET else: @@ -108,7 +110,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: Unset | UpdateZendeskTicketTaskParamsTaskType + task_type: UpdateZendeskTicketTaskParamsTaskType | Unset if isinstance(_task_type, Unset): task_type = UNSET else: @@ -119,34 +121,34 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: tags = d.pop("tags", UNSET) _priority = d.pop("priority", UNSET) - priority: Unset | UpdateZendeskTicketTaskParamsPriority + priority: UpdateZendeskTicketTaskParamsPriority | Unset if isinstance(_priority, Unset): priority = UNSET else: priority = UpdateZendeskTicketTaskParamsPriority.from_dict(_priority) _completion = d.pop("completion", UNSET) - completion: Unset | UpdateZendeskTicketTaskParamsCompletion + completion: UpdateZendeskTicketTaskParamsCompletion | Unset if isinstance(_completion, Unset): completion = UNSET else: completion = UpdateZendeskTicketTaskParamsCompletion.from_dict(_completion) - def _parse_custom_fields_mapping(data: object) -> None | Unset | str: + def _parse_custom_fields_mapping(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) custom_fields_mapping = _parse_custom_fields_mapping(d.pop("custom_fields_mapping", UNSET)) - def _parse_ticket_payload(data: object) -> None | Unset | str: + def _parse_ticket_payload(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 728efbab..5e531f48 100644 --- a/rootly_sdk/models/update_zendesk_ticket_task_params_completion.py +++ b/rootly_sdk/models/update_zendesk_ticket_task_params_completion.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateZendeskTicketTaskParamsCompletion: """The completion id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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 1545b485..e87ec4f3 100644 --- a/rootly_sdk/models/update_zendesk_ticket_task_params_priority.py +++ b/rootly_sdk/models/update_zendesk_ticket_task_params_priority.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,12 +16,12 @@ class UpdateZendeskTicketTaskParamsPriority: """The priority id and display name Attributes: - id (Union[Unset, str]): - name (Union[Unset, str]): + id (str | Unset): + name (str | Unset): """ - id: Unset | str = UNSET - name: Unset | str = UNSET + id: str | Unset = UNSET + name: str | Unset = UNSET 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_task_type.py b/rootly_sdk/models/update_zendesk_ticket_task_params_task_type.py index 343157c5..4b8f9111 100644 --- a/rootly_sdk/models/update_zendesk_ticket_task_params_task_type.py +++ b/rootly_sdk/models/update_zendesk_ticket_task_params_task_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UpdateZendeskTicketTaskParamsTaskType = Literal["update_zendesk_ticket"] @@ -13,7 +13,7 @@ def check_update_zendesk_ticket_task_params_task_type( if value is None: return None if value in UPDATE_ZENDESK_TICKET_TASK_PARAMS_TASK_TYPE_VALUES: - return cast(UpdateZendeskTicketTaskParamsTaskType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {UPDATE_ZENDESK_TICKET_TASK_PARAMS_TASK_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/uptime_chart_response.py b/rootly_sdk/models/uptime_chart_response.py index 314e0a8b..05e81b57 100644 --- a/rootly_sdk/models/uptime_chart_response.py +++ b/rootly_sdk/models/uptime_chart_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -18,7 +20,7 @@ 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]: diff --git a/rootly_sdk/models/uptime_chart_response_data.py b/rootly_sdk/models/uptime_chart_response_data.py index 489012f1..72ef2ae1 100644 --- a/rootly_sdk/models/uptime_chart_response_data.py +++ b/rootly_sdk/models/uptime_chart_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 0d31891e..3604e323 100644 --- a/rootly_sdk/models/user.py +++ b/rootly_sdk/models/user.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,21 +18,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 (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 + 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 """ email: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,31 +42,31 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - first_name: None | Unset | str + first_name: None | str | Unset if isinstance(self.first_name, Unset): first_name = UNSET else: first_name = self.first_name - last_name: None | Unset | str + last_name: None | str | Unset if isinstance(self.last_name, Unset): last_name = UNSET else: last_name = self.last_name - full_name: None | Unset | str + full_name: None | str | Unset if isinstance(self.full_name, Unset): full_name = UNSET else: full_name = self.full_name - full_name_with_team: None | Unset | str + full_name_with_team: None | str | Unset 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 | Unset | str + time_zone: None | str | Unset if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -101,48 +103,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 | Unset | str: + def _parse_first_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) first_name = _parse_first_name(d.pop("first_name", UNSET)) - def _parse_last_name(data: object) -> None | Unset | str: + def _parse_last_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) last_name = _parse_last_name(d.pop("last_name", UNSET)) - def _parse_full_name(data: object) -> None | Unset | str: + def _parse_full_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) full_name = _parse_full_name(d.pop("full_name", UNSET)) - def _parse_full_name_with_team(data: object) -> None | Unset | str: + def _parse_full_name_with_team(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) full_name_with_team = _parse_full_name_with_team(d.pop("full_name_with_team", UNSET)) - def _parse_time_zone(data: object) -> None | Unset | str: + def _parse_time_zone(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 ada7931e..2f901d3e 100644 --- a/rootly_sdk/models/user_email_address.py +++ b/rootly_sdk/models/user_email_address.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -13,18 +15,18 @@ class UserEmailAddress: """ Attributes: - 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): + 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: Unset | int = UNSET - email: Unset | str = UNSET - primary: Unset | bool = UNSET - created_at: Unset | str = UNSET - updated_at: Unset | str = UNSET + user_id: int | Unset = UNSET + email: str | Unset = UNSET + primary: bool | Unset = UNSET + created_at: str | Unset = UNSET + updated_at: str | Unset = UNSET 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 c79daafa..88ef720b 100644 --- a/rootly_sdk/models/user_email_address_list.py +++ b/rootly_sdk/models/user_email_address_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class UserEmailAddressList: """ Attributes: - data (list['UserEmailAddressListDataItem']): + data (list[UserEmailAddressListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["UserEmailAddressListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[UserEmailAddressListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 86906a72..b5979d41 100644 --- a/rootly_sdk/models/user_email_address_list_data_item.py +++ b/rootly_sdk/models/user_email_address_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/user_email_address_list_data_item_type.py b/rootly_sdk/models/user_email_address_list_data_item_type.py index ca99738a..e55fbb21 100644 --- a/rootly_sdk/models/user_email_address_list_data_item_type.py +++ b/rootly_sdk/models/user_email_address_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UserEmailAddressListDataItemType = Literal["user_email_addresses"] @@ -11,5 +11,5 @@ def check_user_email_address_list_data_item_type(value: str | None) -> UserEmail if value is None: return None if value in USER_EMAIL_ADDRESS_LIST_DATA_ITEM_TYPE_VALUES: - return cast(UserEmailAddressListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {USER_EMAIL_ADDRESS_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/user_email_address_response.py b/rootly_sdk/models/user_email_address_response.py index a85c64e3..8c33c48b 100644 --- a/rootly_sdk/models/user_email_address_response.py +++ b/rootly_sdk/models/user_email_address_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class UserEmailAddressResponse: """ Attributes: data (UserEmailAddressResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "UserEmailAddressResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: UserEmailAddressResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 05b0715b..e6e23d8c 100644 --- a/rootly_sdk/models/user_email_address_response_data.py +++ b/rootly_sdk/models/user_email_address_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/user_email_address_response_data_type.py b/rootly_sdk/models/user_email_address_response_data_type.py index 3d7ec57c..11f05fbf 100644 --- a/rootly_sdk/models/user_email_address_response_data_type.py +++ b/rootly_sdk/models/user_email_address_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UserEmailAddressResponseDataType = Literal["user_email_addresses"] @@ -11,5 +11,5 @@ def check_user_email_address_response_data_type(value: str | None) -> UserEmailA if value is None: return None if value in USER_EMAIL_ADDRESS_RESPONSE_DATA_TYPE_VALUES: - return cast(UserEmailAddressResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {USER_EMAIL_ADDRESS_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/user_flat_response.py b/rootly_sdk/models/user_flat_response.py index dced1e40..ed5c61d3 100644 --- a/rootly_sdk/models/user_flat_response.py +++ b/rootly_sdk/models/user_flat_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -18,32 +20,32 @@ class UserFlatResponse: email (str): Email address created_at (str): Date of creation updated_at (str): Date of last update - 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 + 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 """ id: int email: str created_at: str updated_at: str - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -57,55 +59,55 @@ def to_dict(self) -> dict[str, Any]: name = self.name - phone: None | Unset | str + phone: None | str | Unset if isinstance(self.phone, Unset): phone = UNSET else: phone = self.phone - phone_2: None | Unset | str + phone_2: None | str | Unset if isinstance(self.phone_2, Unset): phone_2 = UNSET else: phone_2 = self.phone_2 - first_name: None | Unset | str + first_name: None | str | Unset if isinstance(self.first_name, Unset): first_name = UNSET else: first_name = self.first_name - last_name: None | Unset | str + last_name: None | str | Unset if isinstance(self.last_name, Unset): last_name = UNSET else: last_name = self.last_name - preferred_name: None | Unset | str + preferred_name: None | str | Unset if isinstance(self.preferred_name, Unset): preferred_name = UNSET else: preferred_name = self.preferred_name - full_name: None | Unset | str + full_name: None | str | Unset if isinstance(self.full_name, Unset): full_name = UNSET else: full_name = self.full_name - full_name_with_team: None | Unset | str + full_name_with_team: None | str | Unset 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 | Unset | str + slack_id: None | str | Unset if isinstance(self.slack_id, Unset): slack_id = UNSET else: slack_id = self.slack_id - time_zone: None | Unset | str + time_zone: None | str | Unset if isinstance(self.time_zone, Unset): time_zone = UNSET else: @@ -157,84 +159,84 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: name = d.pop("name", UNSET) - def _parse_phone(data: object) -> None | Unset | str: + def _parse_phone(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) phone = _parse_phone(d.pop("phone", UNSET)) - def _parse_phone_2(data: object) -> None | Unset | str: + def _parse_phone_2(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) phone_2 = _parse_phone_2(d.pop("phone_2", UNSET)) - def _parse_first_name(data: object) -> None | Unset | str: + def _parse_first_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) first_name = _parse_first_name(d.pop("first_name", UNSET)) - def _parse_last_name(data: object) -> None | Unset | str: + def _parse_last_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) last_name = _parse_last_name(d.pop("last_name", UNSET)) - def _parse_preferred_name(data: object) -> None | Unset | str: + def _parse_preferred_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) preferred_name = _parse_preferred_name(d.pop("preferred_name", UNSET)) - def _parse_full_name(data: object) -> None | Unset | str: + def _parse_full_name(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) full_name = _parse_full_name(d.pop("full_name", UNSET)) - def _parse_full_name_with_team(data: object) -> None | Unset | str: + def _parse_full_name_with_team(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) full_name_with_team = _parse_full_name_with_team(d.pop("full_name_with_team", UNSET)) - def _parse_slack_id(data: object) -> None | Unset | str: + def _parse_slack_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) slack_id = _parse_slack_id(d.pop("slack_id", UNSET)) - def _parse_time_zone(data: object) -> None | Unset | str: + def _parse_time_zone(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 237ac482..54d44705 100644 --- a/rootly_sdk/models/user_list.py +++ b/rootly_sdk/models/user_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class UserList: """ Attributes: - data (list['UserListDataItem']): + data (list[UserListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["UserListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[UserListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 4abc12ea..c9692dbd 100644 --- a/rootly_sdk/models/user_list_data_item.py +++ b/rootly_sdk/models/user_list_data_item.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,13 +24,13 @@ class UserListDataItem: id (str): Unique ID of the user type_ (UserListDataItemType): attributes (User): - relationships (Union[Unset, UserRelationships]): + relationships (UserRelationships | Unset): """ id: str type_: UserListDataItemType - attributes: "User" - relationships: Union[Unset, "UserRelationships"] = UNSET + attributes: User + relationships: UserRelationships | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() - relationships: Unset | dict[str, Any] = UNSET + relationships: dict[str, Any] | Unset = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -69,7 +71,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: Unset | UserRelationships + relationships: UserRelationships | Unset if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/user_list_data_item_type.py b/rootly_sdk/models/user_list_data_item_type.py index e12c3351..f616385a 100644 --- a/rootly_sdk/models/user_list_data_item_type.py +++ b/rootly_sdk/models/user_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UserListDataItemType = Literal["users"] @@ -11,5 +11,5 @@ def check_user_list_data_item_type(value: str | None) -> UserListDataItemType | if value is None: return None if value in USER_LIST_DATA_ITEM_TYPE_VALUES: - return cast(UserListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {USER_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/user_notification_rule.py b/rootly_sdk/models/user_notification_rule.py index d271fc44..a1ece08a 100644 --- a/rootly_sdk/models/user_notification_rule.py +++ b/rootly_sdk/models/user_notification_rule.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -21,81 +23,81 @@ class UserNotificationRule: """ Attributes: - 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 + 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 notification needs to be enabled - 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 + 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 """ - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: user_id = self.user_id - delay: None | Unset | int + delay: int | None | Unset if isinstance(self.delay, Unset): delay = UNSET else: delay = self.delay - position: None | Unset | int + position: int | None | Unset if isinstance(self.position, Unset): position = UNSET else: position = self.position - user_email_address_id: None | Unset | str + user_email_address_id: None | str | Unset 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 | Unset | str + user_call_number_id: None | str | Unset 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 | Unset | str + user_sms_number_id: None | str | Unset 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 | Unset | str + user_device_id: None | str | Unset if isinstance(self.user_device_id, Unset): user_device_id = UNSET else: user_device_id = self.user_device_id - enabled_contact_types: Unset | list[str] = UNSET + enabled_contact_types: list[str] | Unset = 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: Unset | str = UNSET + notification_type: str | Unset = UNSET if not isinstance(self.notification_type, Unset): notification_type = self.notification_type @@ -136,71 +138,73 @@ 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) -> None | Unset | int: + def _parse_delay(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) delay = _parse_delay(d.pop("delay", UNSET)) - def _parse_position(data: object) -> None | Unset | int: + def _parse_position(data: object) -> int | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | int, data) + return cast(int | None | Unset, data) position = _parse_position(d.pop("position", UNSET)) - def _parse_user_email_address_id(data: object) -> None | Unset | str: + def _parse_user_email_address_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_user_call_number_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_user_sms_number_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_user_device_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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) - 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: 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 + ) - 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: Unset | UserNotificationRuleNotificationType + notification_type: UserNotificationRuleNotificationType | Unset 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 0b4a4f5a..336d715e 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,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UserNotificationRuleEnabledContactTypesItem = Literal[ "call", "device", "email", "google_chat", "microsoft_teams", "non_critical_device", "slack", "sms" @@ -22,7 +22,7 @@ def check_user_notification_rule_enabled_contact_types_item( if value is None: return None if value in USER_NOTIFICATION_RULE_ENABLED_CONTACT_TYPES_ITEM_VALUES: - return cast(UserNotificationRuleEnabledContactTypesItem, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {USER_NOTIFICATION_RULE_ENABLED_CONTACT_TYPES_ITEM_VALUES!r}" ) diff --git a/rootly_sdk/models/user_notification_rule_list.py b/rootly_sdk/models/user_notification_rule_list.py index eed922a2..16ce4a2c 100644 --- a/rootly_sdk/models/user_notification_rule_list.py +++ b/rootly_sdk/models/user_notification_rule_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class UserNotificationRuleList: """ Attributes: - data (list['UserNotificationRuleListDataItem']): + data (list[UserNotificationRuleListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["UserNotificationRuleListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[UserNotificationRuleListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 cf65d0b1..52215b0c 100644 --- a/rootly_sdk/models/user_notification_rule_list_data_item.py +++ b/rootly_sdk/models/user_notification_rule_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/user_notification_rule_list_data_item_type.py b/rootly_sdk/models/user_notification_rule_list_data_item_type.py index 5e143f06..7af659d3 100644 --- a/rootly_sdk/models/user_notification_rule_list_data_item_type.py +++ b/rootly_sdk/models/user_notification_rule_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UserNotificationRuleListDataItemType = Literal["user_notification_rules"] @@ -11,7 +11,7 @@ def check_user_notification_rule_list_data_item_type(value: str | None) -> UserN if value is None: return None if value in USER_NOTIFICATION_RULE_LIST_DATA_ITEM_TYPE_VALUES: - return cast(UserNotificationRuleListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {USER_NOTIFICATION_RULE_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/user_notification_rule_notification_type.py b/rootly_sdk/models/user_notification_rule_notification_type.py index 405720ef..7b52b0b3 100644 --- a/rootly_sdk/models/user_notification_rule_notification_type.py +++ b/rootly_sdk/models/user_notification_rule_notification_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UserNotificationRuleNotificationType = Literal["audible", "quiet"] @@ -12,5 +12,5 @@ def check_user_notification_rule_notification_type(value: str | None) -> UserNot if value is None: return None if value in USER_NOTIFICATION_RULE_NOTIFICATION_TYPE_VALUES: - return cast(UserNotificationRuleNotificationType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {USER_NOTIFICATION_RULE_NOTIFICATION_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/user_notification_rule_response.py b/rootly_sdk/models/user_notification_rule_response.py index e3b158dd..c1673a79 100644 --- a/rootly_sdk/models/user_notification_rule_response.py +++ b/rootly_sdk/models/user_notification_rule_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class UserNotificationRuleResponse: """ Attributes: data (UserNotificationRuleResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "UserNotificationRuleResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: UserNotificationRuleResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 962221fd..ed717983 100644 --- a/rootly_sdk/models/user_notification_rule_response_data.py +++ b/rootly_sdk/models/user_notification_rule_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/user_notification_rule_response_data_type.py b/rootly_sdk/models/user_notification_rule_response_data_type.py index 336f0823..0d677a9c 100644 --- a/rootly_sdk/models/user_notification_rule_response_data_type.py +++ b/rootly_sdk/models/user_notification_rule_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UserNotificationRuleResponseDataType = Literal["user_notification_rules"] @@ -11,5 +11,5 @@ def check_user_notification_rule_response_data_type(value: str | None) -> UserNo if value is None: return None if value in USER_NOTIFICATION_RULE_RESPONSE_DATA_TYPE_VALUES: - return cast(UserNotificationRuleResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {USER_NOTIFICATION_RULE_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/user_phone_number.py b/rootly_sdk/models/user_phone_number.py index a458ba06..86276579 100644 --- a/rootly_sdk/models/user_phone_number.py +++ b/rootly_sdk/models/user_phone_number.py @@ -1,10 +1,11 @@ +from __future__ import annotations + import datetime from collections.abc import Mapping from typing import Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field -from dateutil.parser import isoparse from ..types import UNSET, Unset @@ -15,22 +16,22 @@ class UserPhoneNumber: """ Attributes: - 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): + 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: 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,7 +41,7 @@ def to_dict(self) -> dict[str, Any]: primary = self.primary - verified_at: None | Unset | str + verified_at: None | str | Unset if isinstance(self.verified_at, Unset): verified_at = UNSET elif isinstance(self.verified_at, datetime.datetime): @@ -83,7 +84,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: primary = d.pop("primary", UNSET) - def _parse_verified_at(data: object) -> None | Unset | datetime.datetime: + def _parse_verified_at(data: object) -> datetime.datetime | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -91,12 +92,12 @@ def _parse_verified_at(data: object) -> None | Unset | datetime.datetime: try: if not isinstance(data, str): raise TypeError() - verified_at_type_0 = isoparse(data) + verified_at_type_0 = datetime.datetime.fromisoformat(data) return verified_at_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | datetime.datetime, data) + return cast(datetime.datetime | None | Unset, 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 e4eb2ca2..77e98299 100644 --- a/rootly_sdk/models/user_phone_number_list.py +++ b/rootly_sdk/models/user_phone_number_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class UserPhoneNumberList: """ Attributes: - data (list['UserPhoneNumberListDataItem']): + data (list[UserPhoneNumberListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["UserPhoneNumberListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[UserPhoneNumberListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 d8e9ce4c..afe5c8cb 100644 --- a/rootly_sdk/models/user_phone_number_list_data_item.py +++ b/rootly_sdk/models/user_phone_number_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/user_phone_number_list_data_item_type.py b/rootly_sdk/models/user_phone_number_list_data_item_type.py index 321289c9..dba97c90 100644 --- a/rootly_sdk/models/user_phone_number_list_data_item_type.py +++ b/rootly_sdk/models/user_phone_number_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UserPhoneNumberListDataItemType = Literal["user_phone_numbers"] @@ -11,5 +11,5 @@ def check_user_phone_number_list_data_item_type(value: str | None) -> UserPhoneN if value is None: return None if value in USER_PHONE_NUMBER_LIST_DATA_ITEM_TYPE_VALUES: - return cast(UserPhoneNumberListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {USER_PHONE_NUMBER_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/user_phone_number_response.py b/rootly_sdk/models/user_phone_number_response.py index 763bfc8b..ea256e59 100644 --- a/rootly_sdk/models/user_phone_number_response.py +++ b/rootly_sdk/models/user_phone_number_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class UserPhoneNumberResponse: """ Attributes: data (UserPhoneNumberResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "UserPhoneNumberResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: UserPhoneNumberResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 4fcbf23a..faa7c9ef 100644 --- a/rootly_sdk/models/user_phone_number_response_data.py +++ b/rootly_sdk/models/user_phone_number_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/user_phone_number_response_data_type.py b/rootly_sdk/models/user_phone_number_response_data_type.py index c939a6e2..4633131b 100644 --- a/rootly_sdk/models/user_phone_number_response_data_type.py +++ b/rootly_sdk/models/user_phone_number_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UserPhoneNumberResponseDataType = Literal["user_phone_numbers"] @@ -11,5 +11,5 @@ def check_user_phone_number_response_data_type(value: str | None) -> UserPhoneNu if value is None: return None if value in USER_PHONE_NUMBER_RESPONSE_DATA_TYPE_VALUES: - return cast(UserPhoneNumberResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {USER_PHONE_NUMBER_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/user_relationships.py b/rootly_sdk/models/user_relationships.py index 01891445..ccf31d0d 100644 --- a/rootly_sdk/models/user_relationships.py +++ b/rootly_sdk/models/user_relationships.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -18,20 +20,20 @@ class UserRelationships: """ Attributes: - role (Union[Unset, RoleRelationship]): - on_call_role (Union[Unset, OnCallRoleRelationship]): + role (RoleRelationship | Unset): + on_call_role (OnCallRoleRelationship | Unset): """ - role: Union[Unset, "RoleRelationship"] = UNSET - on_call_role: Union[Unset, "OnCallRoleRelationship"] = UNSET + role: RoleRelationship | Unset = UNSET + on_call_role: OnCallRoleRelationship | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: - role: Unset | dict[str, Any] = UNSET + role: dict[str, Any] | Unset = UNSET if not isinstance(self.role, Unset): role = self.role.to_dict() - on_call_role: Unset | dict[str, Any] = UNSET + on_call_role: dict[str, Any] | Unset = UNSET if not isinstance(self.on_call_role, Unset): on_call_role = self.on_call_role.to_dict() @@ -52,14 +54,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: d = dict(src_dict) _role = d.pop("role", UNSET) - role: Unset | RoleRelationship + role: RoleRelationship | Unset if isinstance(_role, Unset): role = UNSET else: role = RoleRelationship.from_dict(_role) _on_call_role = d.pop("on_call_role", UNSET) - on_call_role: Unset | OnCallRoleRelationship + on_call_role: OnCallRoleRelationship | Unset 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 34ff082f..1b834829 100644 --- a/rootly_sdk/models/user_response.py +++ b/rootly_sdk/models/user_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class UserResponse: """ Attributes: data (UserResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "UserResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: UserResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 48e292f5..adf3b1f1 100644 --- a/rootly_sdk/models/user_response_data.py +++ b/rootly_sdk/models/user_response_data.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,13 +24,13 @@ class UserResponseData: id (str): Unique ID of the user type_ (UserResponseDataType): attributes (User): - relationships (Union[Unset, UserRelationships]): + relationships (UserRelationships | Unset): """ id: str type_: UserResponseDataType - attributes: "User" - relationships: Union[Unset, "UserRelationships"] = UNSET + attributes: User + relationships: UserRelationships | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,7 +40,7 @@ def to_dict(self) -> dict[str, Any]: attributes = self.attributes.to_dict() - relationships: Unset | dict[str, Any] = UNSET + relationships: dict[str, Any] | Unset = UNSET if not isinstance(self.relationships, Unset): relationships = self.relationships.to_dict() @@ -69,7 +71,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: Unset | UserRelationships + relationships: UserRelationships | Unset if isinstance(_relationships, Unset): relationships = UNSET else: diff --git a/rootly_sdk/models/user_response_data_type.py b/rootly_sdk/models/user_response_data_type.py index 8e03a330..e689706c 100644 --- a/rootly_sdk/models/user_response_data_type.py +++ b/rootly_sdk/models/user_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal UserResponseDataType = Literal["users"] @@ -11,5 +11,5 @@ def check_user_response_data_type(value: str | None) -> UserResponseDataType | N if value is None: return None if value in USER_RESPONSE_DATA_TYPE_VALUES: - return cast(UserResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {USER_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/verified_domain.py b/rootly_sdk/models/verified_domain.py index 6fc9bf7f..d31d393d 100644 --- a/rootly_sdk/models/verified_domain.py +++ b/rootly_sdk/models/verified_domain.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -25,11 +27,11 @@ class VerifiedDomain: 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 + verified_at (None | str | Unset): When the domain was first verified + last_checked_at (None | str | Unset): When the domain was last checked + last_check_passed_at (None | str | Unset): When the TXT record was last found + check_failures_count (int | Unset): Number of consecutive check failures + source (VerifiedDomainSource | Unset): How the domain was added """ domain: str @@ -39,11 +41,11 @@ class VerifiedDomain: 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 + verified_at: None | str | Unset = UNSET + last_checked_at: None | str | Unset = UNSET + last_check_passed_at: None | str | Unset = UNSET + check_failures_count: int | Unset = UNSET + source: VerifiedDomainSource | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -61,19 +63,19 @@ def to_dict(self) -> dict[str, Any]: updated_at = self.updated_at - verified_at: None | Unset | str + verified_at: None | str | Unset if isinstance(self.verified_at, Unset): verified_at = UNSET else: verified_at = self.verified_at - last_checked_at: None | Unset | str + last_checked_at: None | str | Unset 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 + last_check_passed_at: None | str | Unset if isinstance(self.last_check_passed_at, Unset): last_check_passed_at = UNSET else: @@ -81,7 +83,7 @@ def to_dict(self) -> dict[str, Any]: check_failures_count = self.check_failures_count - source: Unset | str = UNSET + source: str | Unset = UNSET if not isinstance(self.source, Unset): source = self.source @@ -128,37 +130,37 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: updated_at = d.pop("updated_at") - def _parse_verified_at(data: object) -> None | Unset | str: + def _parse_verified_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) verified_at = _parse_verified_at(d.pop("verified_at", UNSET)) - def _parse_last_checked_at(data: object) -> None | Unset | str: + def _parse_last_checked_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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: + def _parse_last_check_passed_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 + source: VerifiedDomainSource | Unset if isinstance(_source, Unset): source = UNSET else: diff --git a/rootly_sdk/models/verified_domain_list.py b/rootly_sdk/models/verified_domain_list.py index 1b552bab..19419f29 100644 --- a/rootly_sdk/models/verified_domain_list.py +++ b/rootly_sdk/models/verified_domain_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class VerifiedDomainList: """ Attributes: - data (list['VerifiedDomainListDataItem']): + data (list[VerifiedDomainListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["VerifiedDomainListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[VerifiedDomainListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - included.append(included_item) + included.append(included_item) verified_domain_list = cls( data=data, diff --git a/rootly_sdk/models/verified_domain_list_data_item.py b/rootly_sdk/models/verified_domain_list_data_item.py index 49509fa3..858c46ab 100644 --- a/rootly_sdk/models/verified_domain_list_data_item.py +++ b/rootly_sdk/models/verified_domain_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ class VerifiedDomainListDataItem: id: str type_: VerifiedDomainListDataItemType - attributes: "VerifiedDomain" + attributes: VerifiedDomain additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/verified_domain_list_data_item_type.py b/rootly_sdk/models/verified_domain_list_data_item_type.py index b2f2b033..57952d84 100644 --- a/rootly_sdk/models/verified_domain_list_data_item_type.py +++ b/rootly_sdk/models/verified_domain_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal VerifiedDomainListDataItemType = Literal["verified_domains"] @@ -11,5 +11,5 @@ def check_verified_domain_list_data_item_type(value: str | None) -> VerifiedDoma if value is None: return None if value in VERIFIED_DOMAIN_LIST_DATA_ITEM_TYPE_VALUES: - return cast(VerifiedDomainListDataItemType, value) + return 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 index 8ab2b86b..2d716c9d 100644 --- a/rootly_sdk/models/verified_domain_response.py +++ b/rootly_sdk/models/verified_domain_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class VerifiedDomainResponse: """ Attributes: data (VerifiedDomainResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "VerifiedDomainResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: VerifiedDomainResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: 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: list[JsonapiIncludedResource] | Unset = UNSET + if _included is not UNSET: + included = [] + for included_item_data in _included: + included_item = JsonapiIncludedResource.from_dict(included_item_data) - included.append(included_item) + included.append(included_item) verified_domain_response = cls( data=data, diff --git a/rootly_sdk/models/verified_domain_response_data.py b/rootly_sdk/models/verified_domain_response_data.py index b5d30fa3..b250f1a6 100644 --- a/rootly_sdk/models/verified_domain_response_data.py +++ b/rootly_sdk/models/verified_domain_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ class VerifiedDomainResponseData: id: str type_: VerifiedDomainResponseDataType - attributes: "VerifiedDomain" + attributes: VerifiedDomain additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: diff --git a/rootly_sdk/models/verified_domain_response_data_type.py b/rootly_sdk/models/verified_domain_response_data_type.py index a7b6e33d..89ec61ea 100644 --- a/rootly_sdk/models/verified_domain_response_data_type.py +++ b/rootly_sdk/models/verified_domain_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal VerifiedDomainResponseDataType = Literal["verified_domains"] @@ -11,5 +11,5 @@ def check_verified_domain_response_data_type(value: str | None) -> VerifiedDomai if value is None: return None if value in VERIFIED_DOMAIN_RESPONSE_DATA_TYPE_VALUES: - return cast(VerifiedDomainResponseDataType, value) + return 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 index 6f4b9879..e0d3f7ee 100644 --- a/rootly_sdk/models/verified_domain_source.py +++ b/rootly_sdk/models/verified_domain_source.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal VerifiedDomainSource = Literal["manual", "migration", "oauth_auto"] @@ -13,5 +13,5 @@ def check_verified_domain_source(value: str | None) -> VerifiedDomainSource | No if value is None: return None if value in VERIFIED_DOMAIN_SOURCE_VALUES: - return cast(VerifiedDomainSource, value) + return 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 index ea62937b..420bb366 100644 --- a/rootly_sdk/models/verified_domain_verification_status.py +++ b/rootly_sdk/models/verified_domain_verification_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal VerifiedDomainVerificationStatus = Literal["expired", "failing", "pending", "verified"] @@ -14,5 +14,5 @@ def check_verified_domain_verification_status(value: str | None) -> VerifiedDoma if value is None: return None if value in VERIFIED_DOMAIN_VERIFICATION_STATUS_VALUES: - return cast(VerifiedDomainVerificationStatus, value) + return 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 af4fd0ef..0a2aa912 100644 --- a/rootly_sdk/models/verify_phone_number_request.py +++ b/rootly_sdk/models/verify_phone_number_request.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar diff --git a/rootly_sdk/models/verify_user_phone_number_response_200.py b/rootly_sdk/models/verify_user_phone_number_response_200.py new file mode 100644 index 00000000..b48091d6 --- /dev/null +++ b/rootly_sdk/models/verify_user_phone_number_response_200.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="VerifyUserPhoneNumberResponse200") + + +@_attrs_define +class VerifyUserPhoneNumberResponse200: + """ + Attributes: + message (str): + """ + + message: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + message = self.message + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "message": message, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + message = d.pop("message") + + verify_user_phone_number_response_200 = cls( + message=message, + ) + + verify_user_phone_number_response_200.additional_properties = d + return verify_user_phone_number_response_200 + + @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/verify_user_phone_number_response_429.py b/rootly_sdk/models/verify_user_phone_number_response_429.py new file mode 100644 index 00000000..96de6cc4 --- /dev/null +++ b/rootly_sdk/models/verify_user_phone_number_response_429.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="VerifyUserPhoneNumberResponse429") + + +@_attrs_define +class VerifyUserPhoneNumberResponse429: + """ + Attributes: + error (str): + """ + + error: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + error = self.error + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "error": error, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + error = d.pop("error") + + verify_user_phone_number_response_429 = cls( + error=error, + ) + + verify_user_phone_number_response_429.additional_properties = d + return verify_user_phone_number_response_429 + + @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/verify_user_phone_number_response_503.py b/rootly_sdk/models/verify_user_phone_number_response_503.py new file mode 100644 index 00000000..547b6172 --- /dev/null +++ b/rootly_sdk/models/verify_user_phone_number_response_503.py @@ -0,0 +1,61 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define +from attrs import field as _attrs_field + +T = TypeVar("T", bound="VerifyUserPhoneNumberResponse503") + + +@_attrs_define +class VerifyUserPhoneNumberResponse503: + """ + Attributes: + error (str): + """ + + error: str + additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) + + def to_dict(self) -> dict[str, Any]: + error = self.error + + field_dict: dict[str, Any] = {} + field_dict.update(self.additional_properties) + field_dict.update( + { + "error": error, + } + ) + + return field_dict + + @classmethod + def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: + d = dict(src_dict) + error = d.pop("error") + + verify_user_phone_number_response_503 = cls( + error=error, + ) + + verify_user_phone_number_response_503.additional_properties = d + return verify_user_phone_number_response_503 + + @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/webhooks_delivery.py b/rootly_sdk/models/webhooks_delivery.py index 9afad961..6474e1d1 100644 --- a/rootly_sdk/models/webhooks_delivery.py +++ b/rootly_sdk/models/webhooks_delivery.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,10 +18,10 @@ class WebhooksDelivery: endpoint_id (str): payload (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 + response_status (int | None): 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]): + delivered_at (None | str): created_at (str): Date of creation updated_at (str): Date of last update """ @@ -27,7 +29,7 @@ class WebhooksDelivery: endpoint_id: str payload: str status: WebhooksDeliveryStatus - response_status: None | int + response_status: int | None delivered_at: None | str created_at: str updated_at: str @@ -40,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: status: str = self.status - response_status: None | int + response_status: int | None response_status = self.response_status delivered_at: None | str @@ -75,10 +77,10 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: status = check_webhooks_delivery_status(d.pop("status")) - def _parse_response_status(data: object) -> None | int: + def _parse_response_status(data: object) -> int | None: if data is None: return data - return cast(None | int, data) + return cast(int | None, data) response_status = _parse_response_status(d.pop("response_status")) diff --git a/rootly_sdk/models/webhooks_delivery_list.py b/rootly_sdk/models/webhooks_delivery_list.py index a03f917e..70fdfb75 100644 --- a/rootly_sdk/models/webhooks_delivery_list.py +++ b/rootly_sdk/models/webhooks_delivery_list.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,16 +22,16 @@ class WebhooksDeliveryList: """ Attributes: - data (list['WebhooksDeliveryListDataItem']): - links (Union[Unset, Links]): - meta (Union[Unset, Meta]): - included (Union[Unset, list['JsonapiIncludedResource']]): + data (list[WebhooksDeliveryListDataItem]): + links (Links | Unset): + meta (Meta | Unset): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["WebhooksDeliveryListDataItem"] - links: Union[Unset, "Links"] = UNSET - meta: Union[Unset, "Meta"] = UNSET - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[WebhooksDeliveryListDataItem] + links: Links | Unset = UNSET + meta: Meta | Unset = UNSET + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,15 +40,15 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Unset | dict[str, Any] = UNSET + links: dict[str, Any] | Unset = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Unset | dict[str, Any] = UNSET + meta: dict[str, Any] | Unset = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,25 +87,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Unset | Links + links: Links | Unset if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Unset | Meta + meta: Meta | Unset if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) - included = [] _included = d.pop("included", UNSET) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 28e9bcf7..5fa5e915 100644 --- a/rootly_sdk/models/webhooks_delivery_list_data_item.py +++ b/rootly_sdk/models/webhooks_delivery_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/webhooks_delivery_list_data_item_type.py b/rootly_sdk/models/webhooks_delivery_list_data_item_type.py index eae3419a..6ed50294 100644 --- a/rootly_sdk/models/webhooks_delivery_list_data_item_type.py +++ b/rootly_sdk/models/webhooks_delivery_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WebhooksDeliveryListDataItemType = Literal["webhooks_deliveries"] @@ -11,5 +11,5 @@ def check_webhooks_delivery_list_data_item_type(value: str | None) -> WebhooksDe if value is None: return None if value in WEBHOOKS_DELIVERY_LIST_DATA_ITEM_TYPE_VALUES: - return cast(WebhooksDeliveryListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {WEBHOOKS_DELIVERY_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/webhooks_delivery_response.py b/rootly_sdk/models/webhooks_delivery_response.py index d75b8899..e691f084 100644 --- a/rootly_sdk/models/webhooks_delivery_response.py +++ b/rootly_sdk/models/webhooks_delivery_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class WebhooksDeliveryResponse: """ Attributes: data (WebhooksDeliveryResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "WebhooksDeliveryResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: WebhooksDeliveryResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 e08e14af..034eb5c6 100644 --- a/rootly_sdk/models/webhooks_delivery_response_data.py +++ b/rootly_sdk/models/webhooks_delivery_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/webhooks_delivery_response_data_type.py b/rootly_sdk/models/webhooks_delivery_response_data_type.py index e33ec70e..9dee0590 100644 --- a/rootly_sdk/models/webhooks_delivery_response_data_type.py +++ b/rootly_sdk/models/webhooks_delivery_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WebhooksDeliveryResponseDataType = Literal["webhooks_deliveries"] @@ -11,5 +11,5 @@ def check_webhooks_delivery_response_data_type(value: str | None) -> WebhooksDel if value is None: return None if value in WEBHOOKS_DELIVERY_RESPONSE_DATA_TYPE_VALUES: - return cast(WebhooksDeliveryResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {WEBHOOKS_DELIVERY_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/webhooks_delivery_status.py b/rootly_sdk/models/webhooks_delivery_status.py index 577e3d3a..9bc61b13 100644 --- a/rootly_sdk/models/webhooks_delivery_status.py +++ b/rootly_sdk/models/webhooks_delivery_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WebhooksDeliveryStatus = Literal["failed", "pending", "success"] @@ -13,5 +13,5 @@ def check_webhooks_delivery_status(value: str | None) -> WebhooksDeliveryStatus if value is None: return None if value in WEBHOOKS_DELIVERY_STATUS_VALUES: - return cast(WebhooksDeliveryStatus, value) + return 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 2cd304b4..07b56996 100644 --- a/rootly_sdk/models/webhooks_endpoint.py +++ b/rootly_sdk/models/webhooks_endpoint.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -28,9 +30,9 @@ class WebhooksEndpoint: enabled (bool): created_at (str): Date of creation updated_at (str): Date of last update - 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. + 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. """ name: str @@ -40,8 +42,8 @@ class WebhooksEndpoint: enabled: bool created_at: str updated_at: str - slug: Unset | str = UNSET - custom_headers: Unset | list["WebhooksEndpointCustomHeadersItem"] = UNSET + slug: str | Unset = UNSET + custom_headers: list[WebhooksEndpointCustomHeadersItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -64,7 +66,7 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - custom_headers: Unset | list[dict[str, Any]] = UNSET + custom_headers: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.custom_headers, Unset): custom_headers = [] for custom_headers_item_data in self.custom_headers: @@ -117,12 +119,14 @@ 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) - for custom_headers_item_data in _custom_headers or []: - custom_headers_item = WebhooksEndpointCustomHeadersItem.from_dict(custom_headers_item_data) + 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) - 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 40958b3c..4dc7a532 100644 --- a/rootly_sdk/models/webhooks_endpoint_custom_headers_item.py +++ b/rootly_sdk/models/webhooks_endpoint_custom_headers_item.py @@ -1,3 +1,5 @@ +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 f4256cf0..e44caafb 100644 --- a/rootly_sdk/models/webhooks_endpoint_event_types_item.py +++ b/rootly_sdk/models/webhooks_endpoint_event_types_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WebhooksEndpointEventTypesItem = Literal[ "alert.created", @@ -32,6 +32,7 @@ "incident_status_page_event.deleted", "incident_status_page_event.updated", "pulse.created", + "shift.ended", "shift.started", ] @@ -67,6 +68,7 @@ "incident_status_page_event.deleted", "incident_status_page_event.updated", "pulse.created", + "shift.ended", "shift.started", } @@ -75,5 +77,5 @@ def check_webhooks_endpoint_event_types_item(value: str | None) -> WebhooksEndpo if value is None: return None if value in WEBHOOKS_ENDPOINT_EVENT_TYPES_ITEM_VALUES: - return cast(WebhooksEndpointEventTypesItem, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {WEBHOOKS_ENDPOINT_EVENT_TYPES_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/webhooks_endpoint_list.py b/rootly_sdk/models/webhooks_endpoint_list.py index a4fd1daf..21d0e5a9 100644 --- a/rootly_sdk/models/webhooks_endpoint_list.py +++ b/rootly_sdk/models/webhooks_endpoint_list.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -20,16 +22,16 @@ class WebhooksEndpointList: """ Attributes: - data (list['WebhooksEndpointListDataItem']): - links (Union[Unset, Links]): - meta (Union[Unset, Meta]): - included (Union[Unset, list['JsonapiIncludedResource']]): + data (list[WebhooksEndpointListDataItem]): + links (Links | Unset): + meta (Meta | Unset): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["WebhooksEndpointListDataItem"] - links: Union[Unset, "Links"] = UNSET - meta: Union[Unset, "Meta"] = UNSET - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[WebhooksEndpointListDataItem] + links: Links | Unset = UNSET + meta: Meta | Unset = UNSET + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -38,15 +40,15 @@ def to_dict(self) -> dict[str, Any]: data_item = data_item_data.to_dict() data.append(data_item) - links: Unset | dict[str, Any] = UNSET + links: dict[str, Any] | Unset = UNSET if not isinstance(self.links, Unset): links = self.links.to_dict() - meta: Unset | dict[str, Any] = UNSET + meta: dict[str, Any] | Unset = UNSET if not isinstance(self.meta, Unset): meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -85,25 +87,27 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: data.append(data_item) _links = d.pop("links", UNSET) - links: Unset | Links + links: Links | Unset if isinstance(_links, Unset): links = UNSET else: links = Links.from_dict(_links) _meta = d.pop("meta", UNSET) - meta: Unset | Meta + meta: Meta | Unset if isinstance(_meta, Unset): meta = UNSET else: meta = Meta.from_dict(_meta) - included = [] _included = d.pop("included", UNSET) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 cc5bce1c..a19f4014 100644 --- a/rootly_sdk/models/webhooks_endpoint_list_data_item.py +++ b/rootly_sdk/models/webhooks_endpoint_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/webhooks_endpoint_list_data_item_type.py b/rootly_sdk/models/webhooks_endpoint_list_data_item_type.py index 23748367..2609b17b 100644 --- a/rootly_sdk/models/webhooks_endpoint_list_data_item_type.py +++ b/rootly_sdk/models/webhooks_endpoint_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WebhooksEndpointListDataItemType = Literal["webhooks_endpoints"] @@ -11,5 +11,5 @@ def check_webhooks_endpoint_list_data_item_type(value: str | None) -> WebhooksEn if value is None: return None if value in WEBHOOKS_ENDPOINT_LIST_DATA_ITEM_TYPE_VALUES: - return cast(WebhooksEndpointListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {WEBHOOKS_ENDPOINT_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/webhooks_endpoint_response.py b/rootly_sdk/models/webhooks_endpoint_response.py index be935fca..962ce545 100644 --- a/rootly_sdk/models/webhooks_endpoint_response.py +++ b/rootly_sdk/models/webhooks_endpoint_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class WebhooksEndpointResponse: """ Attributes: data (WebhooksEndpointResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "WebhooksEndpointResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: WebhooksEndpointResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 d86d8e51..b4a2d8ed 100644 --- a/rootly_sdk/models/webhooks_endpoint_response_data.py +++ b/rootly_sdk/models/webhooks_endpoint_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/webhooks_endpoint_response_data_type.py b/rootly_sdk/models/webhooks_endpoint_response_data_type.py index 7b572470..7543f271 100644 --- a/rootly_sdk/models/webhooks_endpoint_response_data_type.py +++ b/rootly_sdk/models/webhooks_endpoint_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WebhooksEndpointResponseDataType = Literal["webhooks_endpoints"] @@ -11,5 +11,5 @@ def check_webhooks_endpoint_response_data_type(value: str | None) -> WebhooksEnd if value is None: return None if value in WEBHOOKS_ENDPOINT_RESPONSE_DATA_TYPE_VALUES: - return cast(WebhooksEndpointResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {WEBHOOKS_ENDPOINT_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/workflow.py b/rootly_sdk/models/workflow.py index 255a05be..d02c2613 100644 --- a/rootly_sdk/models/workflow.py +++ b/rootly_sdk/models/workflow.py @@ -1,9 +1,15 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field +from ..models.workflow_failure_notification_mode import ( + WorkflowFailureNotificationMode, + check_workflow_failure_notification_mode, +) from ..models.workflow_repeat_on_type_0_item import WorkflowRepeatOnType0Item, check_workflow_repeat_on_type_0_item from ..types import UNSET, Unset @@ -13,6 +19,7 @@ from ..models.incident_trigger_params import IncidentTriggerParams from ..models.pulse_trigger_params import PulseTriggerParams from ..models.simple_trigger_params import SimpleTriggerParams + from ..models.workflow_failure_notification_channels_item import WorkflowFailureNotificationChannelsItem T = TypeVar("T", bound="Workflow") @@ -25,71 +32,84 @@ class Workflow: name (str): The title of the workflow created_at (str): Date of creation updated_at (str): Date of last update - 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 + 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 repeat_condition_duration_since_first_run and repeat_condition_number_of_repeats parameters. - 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]]): + run_once_per_resource (bool | Unset): When true, the workflow runs at most once per incident. Later triggers on + the same incident create a canceled run instead. Manual runs and repeats are not affected. Only applies to + incident workflows. + 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): + group_assignment_ids (list[str] | Unset): Owning team IDs. Requires team-scoped workflows. + cause_ids (list[str] | Unset): + sub_status_ids (list[str] | Unset): + failure_notification_mode (WorkflowFailureNotificationMode | Unset): Where failure notifications for this + workflow are sent. `inherit` uses the account default channel, `custom` uses `failure_notification_channels`, + `off` suppresses them. + failure_notification_channels (list[WorkflowFailureNotificationChannelsItem] | Unset): Slack channels notified + when a run of this workflow fails. Used when `failure_notification_mode` is `custom`. """ name: str created_at: str updated_at: str - 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 + 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 + run_once_per_resource: 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 + group_assignment_ids: list[str] | Unset = UNSET + cause_ids: list[str] | Unset = UNSET + sub_status_ids: list[str] | Unset = UNSET + failure_notification_mode: WorkflowFailureNotificationMode | Unset = UNSET + failure_notification_channels: list[WorkflowFailureNotificationChannelsItem] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -106,37 +126,37 @@ def to_dict(self) -> dict[str, Any]: slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: description = self.description - command: None | Unset | str + command: None | str | Unset if isinstance(self.command, Unset): command = UNSET else: command = self.command - command_feedback_enabled: None | Unset | bool + command_feedback_enabled: bool | None | Unset if isinstance(self.command_feedback_enabled, Unset): command_feedback_enabled = UNSET else: command_feedback_enabled = self.command_feedback_enabled - wait: None | Unset | str + wait: None | str | Unset if isinstance(self.wait, Unset): wait = UNSET else: wait = self.wait - repeat_every_duration: None | Unset | str + repeat_every_duration: None | str | Unset 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 | Unset | str + repeat_condition_duration_since_first_run: None | str | Unset if isinstance(self.repeat_condition_duration_since_first_run, Unset): repeat_condition_duration_since_first_run = UNSET else: @@ -146,7 +166,9 @@ def to_dict(self) -> dict[str, Any]: continuously_repeat = self.continuously_repeat - repeat_on: None | Unset | list[str] + run_once_per_resource = self.run_once_per_resource + + repeat_on: list[str] | None | Unset if isinstance(self.repeat_on, Unset): repeat_on = UNSET elif isinstance(self.repeat_on, list): @@ -164,13 +186,13 @@ def to_dict(self) -> dict[str, Any]: position = self.position - workflow_group_id: None | Unset | str + workflow_group_id: None | str | Unset if isinstance(self.workflow_group_id, Unset): workflow_group_id = UNSET else: workflow_group_id = self.workflow_group_id - trigger_params: Unset | dict[str, Any] + trigger_params: dict[str, Any] | Unset if isinstance(self.trigger_params, Unset): trigger_params = UNSET elif isinstance(self.trigger_params, IncidentTriggerParams): @@ -184,42 +206,57 @@ def to_dict(self) -> dict[str, Any]: else: trigger_params = self.trigger_params.to_dict() - environment_ids: Unset | list[str] = UNSET + environment_ids: list[str] | Unset = UNSET if not isinstance(self.environment_ids, Unset): environment_ids = self.environment_ids - severity_ids: Unset | list[str] = UNSET + severity_ids: list[str] | Unset = UNSET if not isinstance(self.severity_ids, Unset): severity_ids = self.severity_ids - incident_type_ids: Unset | list[str] = UNSET + incident_type_ids: list[str] | Unset = UNSET if not isinstance(self.incident_type_ids, Unset): incident_type_ids = self.incident_type_ids - incident_role_ids: Unset | list[str] = UNSET + incident_role_ids: list[str] | Unset = UNSET if not isinstance(self.incident_role_ids, Unset): incident_role_ids = self.incident_role_ids - service_ids: Unset | list[str] = UNSET + service_ids: list[str] | Unset = UNSET if not isinstance(self.service_ids, Unset): service_ids = self.service_ids - functionality_ids: Unset | list[str] = UNSET + functionality_ids: list[str] | Unset = UNSET if not isinstance(self.functionality_ids, Unset): functionality_ids = self.functionality_ids - group_ids: Unset | list[str] = UNSET + group_ids: list[str] | Unset = UNSET if not isinstance(self.group_ids, Unset): group_ids = self.group_ids - cause_ids: Unset | list[str] = UNSET + group_assignment_ids: list[str] | Unset = UNSET + if not isinstance(self.group_assignment_ids, Unset): + group_assignment_ids = self.group_assignment_ids + + cause_ids: list[str] | Unset = UNSET if not isinstance(self.cause_ids, Unset): cause_ids = self.cause_ids - sub_status_ids: Unset | list[str] = UNSET + sub_status_ids: list[str] | Unset = UNSET if not isinstance(self.sub_status_ids, Unset): sub_status_ids = self.sub_status_ids + failure_notification_mode: str | Unset = UNSET + if not isinstance(self.failure_notification_mode, Unset): + failure_notification_mode = self.failure_notification_mode + + failure_notification_channels: list[dict[str, Any]] | Unset = UNSET + if not isinstance(self.failure_notification_channels, Unset): + failure_notification_channels = [] + for failure_notification_channels_item_data in self.failure_notification_channels: + failure_notification_channels_item = failure_notification_channels_item_data.to_dict() + failure_notification_channels.append(failure_notification_channels_item) + field_dict: dict[str, Any] = {} field_dict.update(self.additional_properties) field_dict.update( @@ -247,6 +284,8 @@ def to_dict(self) -> dict[str, Any]: field_dict["repeat_condition_number_of_repeats"] = repeat_condition_number_of_repeats if continuously_repeat is not UNSET: field_dict["continuously_repeat"] = continuously_repeat + if run_once_per_resource is not UNSET: + field_dict["run_once_per_resource"] = run_once_per_resource if repeat_on is not UNSET: field_dict["repeat_on"] = repeat_on if enabled is not UNSET: @@ -273,10 +312,16 @@ def to_dict(self) -> dict[str, Any]: field_dict["functionality_ids"] = functionality_ids if group_ids is not UNSET: field_dict["group_ids"] = group_ids + if group_assignment_ids is not UNSET: + field_dict["group_assignment_ids"] = group_assignment_ids if cause_ids is not UNSET: field_dict["cause_ids"] = cause_ids if sub_status_ids is not UNSET: field_dict["sub_status_ids"] = sub_status_ids + if failure_notification_mode is not UNSET: + field_dict["failure_notification_mode"] = failure_notification_mode + if failure_notification_channels is not UNSET: + field_dict["failure_notification_channels"] = failure_notification_channels return field_dict @@ -287,6 +332,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.incident_trigger_params import IncidentTriggerParams from ..models.pulse_trigger_params import PulseTriggerParams from ..models.simple_trigger_params import SimpleTriggerParams + from ..models.workflow_failure_notification_channels_item import WorkflowFailureNotificationChannelsItem d = dict(src_dict) name = d.pop("name") @@ -297,57 +343,57 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) - def _parse_command(data: object) -> None | Unset | str: + def _parse_command(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) command = _parse_command(d.pop("command", UNSET)) - def _parse_command_feedback_enabled(data: object) -> None | Unset | bool: + def _parse_command_feedback_enabled(data: object) -> bool | None | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | bool, data) + return cast(bool | None | Unset, data) command_feedback_enabled = _parse_command_feedback_enabled(d.pop("command_feedback_enabled", UNSET)) - def _parse_wait(data: object) -> None | Unset | str: + def _parse_wait(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) wait = _parse_wait(d.pop("wait", UNSET)) - def _parse_repeat_every_duration(data: object) -> None | Unset | str: + def _parse_repeat_every_duration(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, 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 | Unset | str: + def _parse_repeat_condition_duration_since_first_run(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) repeat_condition_duration_since_first_run = _parse_repeat_condition_duration_since_first_run( d.pop("repeat_condition_duration_since_first_run", UNSET) @@ -357,7 +403,9 @@ def _parse_repeat_condition_duration_since_first_run(data: object) -> None | Uns continuously_repeat = d.pop("continuously_repeat", UNSET) - def _parse_repeat_on(data: object) -> None | Unset | list[WorkflowRepeatOnType0Item]: + run_once_per_resource = d.pop("run_once_per_resource", UNSET) + + def _parse_repeat_on(data: object) -> list[WorkflowRepeatOnType0Item] | None | Unset: if data is None: return data if isinstance(data, Unset): @@ -373,9 +421,9 @@ def _parse_repeat_on(data: object) -> None | Unset | list[WorkflowRepeatOnType0I repeat_on_type_0.append(repeat_on_type_0_item) return repeat_on_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass - return cast(None | Unset | list[WorkflowRepeatOnType0Item], data) + return cast(list[WorkflowRepeatOnType0Item] | None | Unset, data) repeat_on = _parse_repeat_on(d.pop("repeat_on", UNSET)) @@ -385,25 +433,25 @@ def _parse_repeat_on(data: object) -> None | Unset | list[WorkflowRepeatOnType0I position = d.pop("position", UNSET) - def _parse_workflow_group_id(data: object) -> None | Unset | str: + def _parse_workflow_group_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) workflow_group_id = _parse_workflow_group_id(d.pop("workflow_group_id", UNSET)) def _parse_trigger_params( data: object, - ) -> Union[ - "ActionItemTriggerParams", - "AlertTriggerParams", - "IncidentTriggerParams", - "PulseTriggerParams", - "SimpleTriggerParams", - Unset, - ]: + ) -> ( + ActionItemTriggerParams + | AlertTriggerParams + | IncidentTriggerParams + | PulseTriggerParams + | SimpleTriggerParams + | Unset + ): if isinstance(data, Unset): return data try: @@ -412,7 +460,7 @@ def _parse_trigger_params( trigger_params_type_0 = IncidentTriggerParams.from_dict(data) return trigger_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -420,7 +468,7 @@ def _parse_trigger_params( trigger_params_type_1 = ActionItemTriggerParams.from_dict(data) return trigger_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -428,7 +476,7 @@ def _parse_trigger_params( trigger_params_type_2 = AlertTriggerParams.from_dict(data) return trigger_params_type_2 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -436,7 +484,7 @@ def _parse_trigger_params( trigger_params_type_3 = PulseTriggerParams.from_dict(data) return trigger_params_type_3 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() @@ -460,10 +508,30 @@ def _parse_trigger_params( group_ids = cast(list[str], d.pop("group_ids", UNSET)) + group_assignment_ids = cast(list[str], d.pop("group_assignment_ids", UNSET)) + cause_ids = cast(list[str], d.pop("cause_ids", UNSET)) sub_status_ids = cast(list[str], d.pop("sub_status_ids", UNSET)) + _failure_notification_mode = d.pop("failure_notification_mode", UNSET) + failure_notification_mode: WorkflowFailureNotificationMode | Unset + if isinstance(_failure_notification_mode, Unset): + failure_notification_mode = UNSET + else: + failure_notification_mode = check_workflow_failure_notification_mode(_failure_notification_mode) + + _failure_notification_channels = d.pop("failure_notification_channels", UNSET) + failure_notification_channels: list[WorkflowFailureNotificationChannelsItem] | Unset = UNSET + if _failure_notification_channels is not UNSET: + failure_notification_channels = [] + for failure_notification_channels_item_data in _failure_notification_channels: + failure_notification_channels_item = WorkflowFailureNotificationChannelsItem.from_dict( + failure_notification_channels_item_data + ) + + failure_notification_channels.append(failure_notification_channels_item) + workflow = cls( name=name, created_at=created_at, @@ -477,6 +545,7 @@ def _parse_trigger_params( repeat_condition_duration_since_first_run=repeat_condition_duration_since_first_run, repeat_condition_number_of_repeats=repeat_condition_number_of_repeats, continuously_repeat=continuously_repeat, + run_once_per_resource=run_once_per_resource, repeat_on=repeat_on, enabled=enabled, locked=locked, @@ -490,8 +559,11 @@ def _parse_trigger_params( service_ids=service_ids, functionality_ids=functionality_ids, group_ids=group_ids, + group_assignment_ids=group_assignment_ids, cause_ids=cause_ids, sub_status_ids=sub_status_ids, + failure_notification_mode=failure_notification_mode, + failure_notification_channels=failure_notification_channels, ) workflow.additional_properties = d 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 e483d466..511e7fa5 100644 --- a/rootly_sdk/models/workflow_action_item_form_field_condition.py +++ b/rootly_sdk/models/workflow_action_item_form_field_condition.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -24,13 +26,13 @@ class WorkflowActionItemFormFieldCondition: selected_catalog_entity_ids (list[str]): selected_option_ids (list[str]): selected_user_ids (list[int]): - 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]]): + 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): """ workflow_id: str @@ -39,13 +41,13 @@ class WorkflowActionItemFormFieldCondition: selected_option_ids: list[str] selected_user_ids: list[int] action_item_condition: WorkflowActionItemFormFieldConditionActionItemCondition = "ANY" - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -61,31 +63,31 @@ def to_dict(self) -> dict[str, Any]: selected_user_ids = self.selected_user_ids - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values - selected_functionality_ids: Unset | list[str] = UNSET + selected_functionality_ids: list[str] | Unset = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: Unset | list[str] = UNSET + selected_group_ids: list[str] | Unset = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_service_ids: Unset | list[str] = UNSET + selected_service_ids: list[str] | Unset = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_cause_ids: Unset | list[str] = UNSET + selected_cause_ids: list[str] | Unset = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: Unset | list[str] = UNSET + selected_environment_ids: list[str] | Unset = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: Unset | list[str] = UNSET + selected_incident_type_ids: list[str] | Unset = 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_action_item_condition.py b/rootly_sdk/models/workflow_action_item_form_field_condition_action_item_condition.py index a42f286b..7738be35 100644 --- a/rootly_sdk/models/workflow_action_item_form_field_condition_action_item_condition.py +++ b/rootly_sdk/models/workflow_action_item_form_field_condition_action_item_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowActionItemFormFieldConditionActionItemCondition = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -25,7 +25,7 @@ def check_workflow_action_item_form_field_condition_action_item_condition( if value is None: return None if value in WORKFLOW_ACTION_ITEM_FORM_FIELD_CONDITION_ACTION_ITEM_CONDITION_VALUES: - return cast(WorkflowActionItemFormFieldConditionActionItemCondition, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {WORKFLOW_ACTION_ITEM_FORM_FIELD_CONDITION_ACTION_ITEM_CONDITION_VALUES!r}" ) 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 cac4c8f0..d967d793 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -22,16 +24,16 @@ class WorkflowActionItemFormFieldConditionList: """ Attributes: - data (list['WorkflowActionItemFormFieldConditionListDataItem']): + data (list[WorkflowActionItemFormFieldConditionListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["WorkflowActionItemFormFieldConditionListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[WorkflowActionItemFormFieldConditionListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -44,7 +46,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -86,12 +88,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 274ccb1a..2c2baf4e 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/workflow_action_item_form_field_condition_list_data_item_type.py b/rootly_sdk/models/workflow_action_item_form_field_condition_list_data_item_type.py index e154aa36..44bbad3f 100644 --- a/rootly_sdk/models/workflow_action_item_form_field_condition_list_data_item_type.py +++ b/rootly_sdk/models/workflow_action_item_form_field_condition_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowActionItemFormFieldConditionListDataItemType = Literal["workflow_action_item_form_field_conditions"] @@ -15,7 +15,7 @@ def check_workflow_action_item_form_field_condition_list_data_item_type( if value is None: return None if value in WORKFLOW_ACTION_ITEM_FORM_FIELD_CONDITION_LIST_DATA_ITEM_TYPE_VALUES: - return cast(WorkflowActionItemFormFieldConditionListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {WORKFLOW_ACTION_ITEM_FORM_FIELD_CONDITION_LIST_DATA_ITEM_TYPE_VALUES!r}" ) 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 10f0545c..7eae004a 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -21,17 +23,17 @@ class WorkflowActionItemFormFieldConditionResponse: """ Attributes: data (WorkflowActionItemFormFieldConditionResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "WorkflowActionItemFormFieldConditionResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: WorkflowActionItemFormFieldConditionResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -60,12 +62,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 52a2c586..1ff2a922 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/workflow_action_item_form_field_condition_response_data_type.py b/rootly_sdk/models/workflow_action_item_form_field_condition_response_data_type.py index c91f2c5e..33082cb1 100644 --- a/rootly_sdk/models/workflow_action_item_form_field_condition_response_data_type.py +++ b/rootly_sdk/models/workflow_action_item_form_field_condition_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowActionItemFormFieldConditionResponseDataType = Literal["workflow_action_item_form_field_conditions"] @@ -15,7 +15,7 @@ def check_workflow_action_item_form_field_condition_response_data_type( if value is None: return None if value in WORKFLOW_ACTION_ITEM_FORM_FIELD_CONDITION_RESPONSE_DATA_TYPE_VALUES: - return cast(WorkflowActionItemFormFieldConditionResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {WORKFLOW_ACTION_ITEM_FORM_FIELD_CONDITION_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/workflow_custom_field_selection.py b/rootly_sdk/models/workflow_custom_field_selection.py index b236ae05..aa0bec5c 100644 --- a/rootly_sdk/models/workflow_custom_field_selection.py +++ b/rootly_sdk/models/workflow_custom_field_selection.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -21,14 +23,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 (Union[Unset, list[str]]): + values (list[str] | Unset): """ workflow_id: str custom_field_id: int selected_option_ids: list[int] incident_condition: WorkflowCustomFieldSelectionIncidentCondition = "ANY" - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -40,7 +42,7 @@ def to_dict(self) -> dict[str, Any]: selected_option_ids = self.selected_option_ids - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values diff --git a/rootly_sdk/models/workflow_custom_field_selection_incident_condition.py b/rootly_sdk/models/workflow_custom_field_selection_incident_condition.py index 77281974..8c6477a4 100644 --- a/rootly_sdk/models/workflow_custom_field_selection_incident_condition.py +++ b/rootly_sdk/models/workflow_custom_field_selection_incident_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowCustomFieldSelectionIncidentCondition = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_workflow_custom_field_selection_incident_condition( if value is None: return None if value in WORKFLOW_CUSTOM_FIELD_SELECTION_INCIDENT_CONDITION_VALUES: - return cast(WorkflowCustomFieldSelectionIncidentCondition, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {WORKFLOW_CUSTOM_FIELD_SELECTION_INCIDENT_CONDITION_VALUES!r}" ) diff --git a/rootly_sdk/models/workflow_custom_field_selection_list.py b/rootly_sdk/models/workflow_custom_field_selection_list.py index 88ea8c43..924642b3 100644 --- a/rootly_sdk/models/workflow_custom_field_selection_list.py +++ b/rootly_sdk/models/workflow_custom_field_selection_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class WorkflowCustomFieldSelectionList: """ Attributes: - data (list['WorkflowCustomFieldSelectionListDataItem']): + data (list[WorkflowCustomFieldSelectionListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["WorkflowCustomFieldSelectionListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[WorkflowCustomFieldSelectionListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 5dee7a75..efbc03c1 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/workflow_custom_field_selection_list_data_item_type.py b/rootly_sdk/models/workflow_custom_field_selection_list_data_item_type.py index 8de0bcfb..7f6108aa 100644 --- a/rootly_sdk/models/workflow_custom_field_selection_list_data_item_type.py +++ b/rootly_sdk/models/workflow_custom_field_selection_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowCustomFieldSelectionListDataItemType = Literal["workflow_custom_field_selections"] @@ -13,7 +13,7 @@ def check_workflow_custom_field_selection_list_data_item_type( if value is None: return None if value in WORKFLOW_CUSTOM_FIELD_SELECTION_LIST_DATA_ITEM_TYPE_VALUES: - return cast(WorkflowCustomFieldSelectionListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {WORKFLOW_CUSTOM_FIELD_SELECTION_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/workflow_custom_field_selection_response.py b/rootly_sdk/models/workflow_custom_field_selection_response.py index dddd95eb..c2bccfc9 100644 --- a/rootly_sdk/models/workflow_custom_field_selection_response.py +++ b/rootly_sdk/models/workflow_custom_field_selection_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class WorkflowCustomFieldSelectionResponse: """ Attributes: data (WorkflowCustomFieldSelectionResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "WorkflowCustomFieldSelectionResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: WorkflowCustomFieldSelectionResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 0ae87605..48636735 100644 --- a/rootly_sdk/models/workflow_custom_field_selection_response_data.py +++ b/rootly_sdk/models/workflow_custom_field_selection_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/workflow_custom_field_selection_response_data_type.py b/rootly_sdk/models/workflow_custom_field_selection_response_data_type.py index d8a55b74..8b2323cc 100644 --- a/rootly_sdk/models/workflow_custom_field_selection_response_data_type.py +++ b/rootly_sdk/models/workflow_custom_field_selection_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowCustomFieldSelectionResponseDataType = Literal["workflow_custom_field_selections"] @@ -13,7 +13,7 @@ def check_workflow_custom_field_selection_response_data_type( if value is None: return None if value in WORKFLOW_CUSTOM_FIELD_SELECTION_RESPONSE_DATA_TYPE_VALUES: - return cast(WorkflowCustomFieldSelectionResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {WORKFLOW_CUSTOM_FIELD_SELECTION_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/workflow_failure_notification_channels_item.py b/rootly_sdk/models/workflow_failure_notification_channels_item.py new file mode 100644 index 00000000..87d4424c --- /dev/null +++ b/rootly_sdk/models/workflow_failure_notification_channels_item.py @@ -0,0 +1,51 @@ +from __future__ import annotations + +from collections.abc import Mapping +from typing import Any, TypeVar + +from attrs import define as _attrs_define + +T = TypeVar("T", bound="WorkflowFailureNotificationChannelsItem") + + +@_attrs_define +class WorkflowFailureNotificationChannelsItem: + """ + Attributes: + id (str): Slack channel ID. Liquid is allowed, for example `{{ incident.slack_channel_id }}` for the incident + channel. + name (str): Slack channel name + """ + + id: str + name: str + + def to_dict(self) -> dict[str, Any]: + id = self.id + + name = self.name + + field_dict: dict[str, Any] = {} + + field_dict.update( + { + "id": id, + "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") + + name = d.pop("name") + + workflow_failure_notification_channels_item = cls( + id=id, + name=name, + ) + + return workflow_failure_notification_channels_item diff --git a/rootly_sdk/models/workflow_failure_notification_mode.py b/rootly_sdk/models/workflow_failure_notification_mode.py new file mode 100644 index 00000000..8b263746 --- /dev/null +++ b/rootly_sdk/models/workflow_failure_notification_mode.py @@ -0,0 +1,17 @@ +from typing import Literal + +WorkflowFailureNotificationMode = Literal["custom", "inherit", "off"] + +WORKFLOW_FAILURE_NOTIFICATION_MODE_VALUES: set[WorkflowFailureNotificationMode] = { + "custom", + "inherit", + "off", +} + + +def check_workflow_failure_notification_mode(value: str | None) -> WorkflowFailureNotificationMode | None: + if value is None: + return None + if value in WORKFLOW_FAILURE_NOTIFICATION_MODE_VALUES: + return value + raise TypeError(f"Unexpected value {value!r}. Expected one of {WORKFLOW_FAILURE_NOTIFICATION_MODE_VALUES!r}") diff --git a/rootly_sdk/models/workflow_form_field_condition.py b/rootly_sdk/models/workflow_form_field_condition.py index b937c662..f3d3ed95 100644 --- a/rootly_sdk/models/workflow_form_field_condition.py +++ b/rootly_sdk/models/workflow_form_field_condition.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -23,13 +25,13 @@ class WorkflowFormFieldCondition: selected_catalog_entity_ids (list[str]): selected_option_ids (list[str]): selected_user_ids (list[int]): - 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]]): + 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): """ workflow_id: str @@ -38,13 +40,13 @@ class WorkflowFormFieldCondition: selected_option_ids: list[str] selected_user_ids: list[int] incident_condition: WorkflowFormFieldConditionIncidentCondition = "ANY" - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -60,31 +62,31 @@ def to_dict(self) -> dict[str, Any]: selected_user_ids = self.selected_user_ids - values: Unset | list[str] = UNSET + values: list[str] | Unset = UNSET if not isinstance(self.values, Unset): values = self.values - selected_functionality_ids: Unset | list[str] = UNSET + selected_functionality_ids: list[str] | Unset = UNSET if not isinstance(self.selected_functionality_ids, Unset): selected_functionality_ids = self.selected_functionality_ids - selected_group_ids: Unset | list[str] = UNSET + selected_group_ids: list[str] | Unset = UNSET if not isinstance(self.selected_group_ids, Unset): selected_group_ids = self.selected_group_ids - selected_service_ids: Unset | list[str] = UNSET + selected_service_ids: list[str] | Unset = UNSET if not isinstance(self.selected_service_ids, Unset): selected_service_ids = self.selected_service_ids - selected_cause_ids: Unset | list[str] = UNSET + selected_cause_ids: list[str] | Unset = UNSET if not isinstance(self.selected_cause_ids, Unset): selected_cause_ids = self.selected_cause_ids - selected_environment_ids: Unset | list[str] = UNSET + selected_environment_ids: list[str] | Unset = UNSET if not isinstance(self.selected_environment_ids, Unset): selected_environment_ids = self.selected_environment_ids - selected_incident_type_ids: Unset | list[str] = UNSET + selected_incident_type_ids: list[str] | Unset = 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_incident_condition.py b/rootly_sdk/models/workflow_form_field_condition_incident_condition.py index eadcd8c8..3db34ccf 100644 --- a/rootly_sdk/models/workflow_form_field_condition_incident_condition.py +++ b/rootly_sdk/models/workflow_form_field_condition_incident_condition.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowFormFieldConditionIncidentCondition = Literal[ "ANY", "CONTAINS", "CONTAINS_ALL", "CONTAINS_NONE", "IS", "IS NOT", "NONE", "SET", "UNSET" @@ -23,7 +23,7 @@ def check_workflow_form_field_condition_incident_condition( if value is None: return None if value in WORKFLOW_FORM_FIELD_CONDITION_INCIDENT_CONDITION_VALUES: - return cast(WorkflowFormFieldConditionIncidentCondition, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {WORKFLOW_FORM_FIELD_CONDITION_INCIDENT_CONDITION_VALUES!r}" ) diff --git a/rootly_sdk/models/workflow_form_field_condition_list.py b/rootly_sdk/models/workflow_form_field_condition_list.py index f3b99e98..2748d1a5 100644 --- a/rootly_sdk/models/workflow_form_field_condition_list.py +++ b/rootly_sdk/models/workflow_form_field_condition_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class WorkflowFormFieldConditionList: """ Attributes: - data (list['WorkflowFormFieldConditionListDataItem']): + data (list[WorkflowFormFieldConditionListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["WorkflowFormFieldConditionListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[WorkflowFormFieldConditionListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 3597e8e1..9c98bfa0 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,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/workflow_form_field_condition_list_data_item_type.py b/rootly_sdk/models/workflow_form_field_condition_list_data_item_type.py index c14e7928..27031436 100644 --- a/rootly_sdk/models/workflow_form_field_condition_list_data_item_type.py +++ b/rootly_sdk/models/workflow_form_field_condition_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowFormFieldConditionListDataItemType = Literal["workflow_form_field_conditions"] @@ -13,7 +13,7 @@ def check_workflow_form_field_condition_list_data_item_type( if value is None: return None if value in WORKFLOW_FORM_FIELD_CONDITION_LIST_DATA_ITEM_TYPE_VALUES: - return cast(WorkflowFormFieldConditionListDataItemType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {WORKFLOW_FORM_FIELD_CONDITION_LIST_DATA_ITEM_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/workflow_form_field_condition_response.py b/rootly_sdk/models/workflow_form_field_condition_response.py index 671954a0..d45539f4 100644 --- a/rootly_sdk/models/workflow_form_field_condition_response.py +++ b/rootly_sdk/models/workflow_form_field_condition_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class WorkflowFormFieldConditionResponse: """ Attributes: data (WorkflowFormFieldConditionResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "WorkflowFormFieldConditionResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: WorkflowFormFieldConditionResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 c7a81d78..a4b46959 100644 --- a/rootly_sdk/models/workflow_form_field_condition_response_data.py +++ b/rootly_sdk/models/workflow_form_field_condition_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/workflow_form_field_condition_response_data_type.py b/rootly_sdk/models/workflow_form_field_condition_response_data_type.py index 1b037582..382049de 100644 --- a/rootly_sdk/models/workflow_form_field_condition_response_data_type.py +++ b/rootly_sdk/models/workflow_form_field_condition_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowFormFieldConditionResponseDataType = Literal["workflow_form_field_conditions"] @@ -13,7 +13,7 @@ def check_workflow_form_field_condition_response_data_type( if value is None: return None if value in WORKFLOW_FORM_FIELD_CONDITION_RESPONSE_DATA_TYPE_VALUES: - return cast(WorkflowFormFieldConditionResponseDataType, value) + return value raise TypeError( f"Unexpected value {value!r}. Expected one of {WORKFLOW_FORM_FIELD_CONDITION_RESPONSE_DATA_TYPE_VALUES!r}" ) diff --git a/rootly_sdk/models/workflow_group.py b/rootly_sdk/models/workflow_group.py index bc80f73e..1563246a 100644 --- a/rootly_sdk/models/workflow_group.py +++ b/rootly_sdk/models/workflow_group.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar, cast @@ -16,20 +18,20 @@ class WorkflowGroup: Attributes: name (str): The name of the workflow group. position (int): The position of the workflow group - 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. + 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. """ name: str position: int - kind: Unset | WorkflowGroupKind = UNSET - slug: Unset | str = UNSET - description: None | Unset | str = UNSET - icon: Unset | str = UNSET - expanded: Unset | bool = UNSET + kind: WorkflowGroupKind | Unset = UNSET + slug: str | Unset = UNSET + description: None | str | Unset = UNSET + icon: str | Unset = UNSET + expanded: bool | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -37,13 +39,13 @@ def to_dict(self) -> dict[str, Any]: position = self.position - kind: Unset | str = UNSET + kind: str | Unset = UNSET if not isinstance(self.kind, Unset): kind = self.kind slug = self.slug - description: None | Unset | str + description: None | str | Unset if isinstance(self.description, Unset): description = UNSET else: @@ -82,7 +84,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: position = d.pop("position") _kind = d.pop("kind", UNSET) - kind: Unset | WorkflowGroupKind + kind: WorkflowGroupKind | Unset if isinstance(_kind, Unset): kind = UNSET else: @@ -90,12 +92,12 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: slug = d.pop("slug", UNSET) - def _parse_description(data: object) -> None | Unset | str: + def _parse_description(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) description = _parse_description(d.pop("description", UNSET)) diff --git a/rootly_sdk/models/workflow_group_kind.py b/rootly_sdk/models/workflow_group_kind.py index f07368ef..e69c7374 100644 --- a/rootly_sdk/models/workflow_group_kind.py +++ b/rootly_sdk/models/workflow_group_kind.py @@ -1,12 +1,13 @@ -from typing import Literal, cast +from typing import Literal -WorkflowGroupKind = Literal["action_item", "alert", "incident", "post_mortem", "pulse", "simple"] +WorkflowGroupKind = Literal["action_item", "alert", "incident", "post_mortem", "problem", "pulse", "simple"] WORKFLOW_GROUP_KIND_VALUES: set[WorkflowGroupKind] = { "action_item", "alert", "incident", "post_mortem", + "problem", "pulse", "simple", } @@ -16,5 +17,5 @@ def check_workflow_group_kind(value: str | None) -> WorkflowGroupKind | None: if value is None: return None if value in WORKFLOW_GROUP_KIND_VALUES: - return cast(WorkflowGroupKind, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {WORKFLOW_GROUP_KIND_VALUES!r}") diff --git a/rootly_sdk/models/workflow_group_list.py b/rootly_sdk/models/workflow_group_list.py index 9a38d9db..86bd1372 100644 --- a/rootly_sdk/models/workflow_group_list.py +++ b/rootly_sdk/models/workflow_group_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class WorkflowGroupList: """ Attributes: - data (list['WorkflowGroupListDataItem']): + data (list[WorkflowGroupListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["WorkflowGroupListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[WorkflowGroupListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 adf2c51c..f6ba32cb 100644 --- a/rootly_sdk/models/workflow_group_list_data_item.py +++ b/rootly_sdk/models/workflow_group_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/workflow_group_list_data_item_type.py b/rootly_sdk/models/workflow_group_list_data_item_type.py index 5c6929e1..ca537cd8 100644 --- a/rootly_sdk/models/workflow_group_list_data_item_type.py +++ b/rootly_sdk/models/workflow_group_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowGroupListDataItemType = Literal["workflow_groups"] @@ -11,5 +11,5 @@ def check_workflow_group_list_data_item_type(value: str | None) -> WorkflowGroup if value is None: return None if value in WORKFLOW_GROUP_LIST_DATA_ITEM_TYPE_VALUES: - return cast(WorkflowGroupListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {WORKFLOW_GROUP_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/workflow_group_response.py b/rootly_sdk/models/workflow_group_response.py index 3dd3f4e3..c2f0488c 100644 --- a/rootly_sdk/models/workflow_group_response.py +++ b/rootly_sdk/models/workflow_group_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class WorkflowGroupResponse: """ Attributes: data (WorkflowGroupResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "WorkflowGroupResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: WorkflowGroupResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 6fcd902e..dfe198b8 100644 --- a/rootly_sdk/models/workflow_group_response_data.py +++ b/rootly_sdk/models/workflow_group_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/workflow_group_response_data_type.py b/rootly_sdk/models/workflow_group_response_data_type.py index ff706bc2..0dec38ff 100644 --- a/rootly_sdk/models/workflow_group_response_data_type.py +++ b/rootly_sdk/models/workflow_group_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowGroupResponseDataType = Literal["workflow_groups"] @@ -11,5 +11,5 @@ def check_workflow_group_response_data_type(value: str | None) -> WorkflowGroupR if value is None: return None if value in WORKFLOW_GROUP_RESPONSE_DATA_TYPE_VALUES: - return cast(WorkflowGroupResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {WORKFLOW_GROUP_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/workflow_list.py b/rootly_sdk/models/workflow_list.py index b6b1a4f9..fc586bde 100644 --- a/rootly_sdk/models/workflow_list.py +++ b/rootly_sdk/models/workflow_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class WorkflowList: """ Attributes: - data (list['WorkflowListDataItem']): + data (list[WorkflowListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["WorkflowListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[WorkflowListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 b751de36..1dc431c1 100644 --- a/rootly_sdk/models/workflow_list_data_item.py +++ b/rootly_sdk/models/workflow_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/workflow_list_data_item_type.py b/rootly_sdk/models/workflow_list_data_item_type.py index 7d5ec7d2..839d8134 100644 --- a/rootly_sdk/models/workflow_list_data_item_type.py +++ b/rootly_sdk/models/workflow_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowListDataItemType = Literal["workflows"] @@ -11,5 +11,5 @@ def check_workflow_list_data_item_type(value: str | None) -> WorkflowListDataIte if value is None: return None if value in WORKFLOW_LIST_DATA_ITEM_TYPE_VALUES: - return cast(WorkflowListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {WORKFLOW_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/workflow_repeat_on_type_0_item.py b/rootly_sdk/models/workflow_repeat_on_type_0_item.py index 91dc2d4c..97b9f0e9 100644 --- a/rootly_sdk/models/workflow_repeat_on_type_0_item.py +++ b/rootly_sdk/models/workflow_repeat_on_type_0_item.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowRepeatOnType0Item = Literal["F", "M", "R", "S", "T", "U", "W"] @@ -17,5 +17,5 @@ def check_workflow_repeat_on_type_0_item(value: str | None) -> WorkflowRepeatOnT if value is None: return None if value in WORKFLOW_REPEAT_ON_TYPE_0_ITEM_VALUES: - return cast(WorkflowRepeatOnType0Item, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {WORKFLOW_REPEAT_ON_TYPE_0_ITEM_VALUES!r}") diff --git a/rootly_sdk/models/workflow_response.py b/rootly_sdk/models/workflow_response.py index 1166b999..a63999e2 100644 --- a/rootly_sdk/models/workflow_response.py +++ b/rootly_sdk/models/workflow_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class WorkflowResponse: """ Attributes: data (WorkflowResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "WorkflowResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: WorkflowResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 eeced5e7..0a58c477 100644 --- a/rootly_sdk/models/workflow_response_data.py +++ b/rootly_sdk/models/workflow_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/workflow_response_data_type.py b/rootly_sdk/models/workflow_response_data_type.py index a23e0e15..fa3660a6 100644 --- a/rootly_sdk/models/workflow_response_data_type.py +++ b/rootly_sdk/models/workflow_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowResponseDataType = Literal["workflows"] @@ -11,5 +11,5 @@ def check_workflow_response_data_type(value: str | None) -> WorkflowResponseData if value is None: return None if value in WORKFLOW_RESPONSE_DATA_TYPE_VALUES: - return cast(WorkflowResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {WORKFLOW_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/workflow_run.py b/rootly_sdk/models/workflow_run.py index 53b52940..c94f5585 100644 --- a/rootly_sdk/models/workflow_run.py +++ b/rootly_sdk/models/workflow_run.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union, cast +from typing import TYPE_CHECKING, Any, TypeVar, cast from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -22,33 +24,33 @@ class WorkflowRun: workflow_id (str): status (WorkflowRunStatus): triggered_by (WorkflowRunTriggeredBy): - 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]): + 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): """ workflow_id: str status: WorkflowRunStatus triggered_by: WorkflowRunTriggeredBy - 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 + 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 additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -58,67 +60,67 @@ def to_dict(self) -> dict[str, Any]: triggered_by: str = self.triggered_by - status_message: None | Unset | str + status_message: None | str | Unset if isinstance(self.status_message, Unset): status_message = UNSET else: status_message = self.status_message - started_at: None | Unset | str + started_at: None | str | Unset if isinstance(self.started_at, Unset): started_at = UNSET else: started_at = self.started_at - completed_at: None | Unset | str + completed_at: None | str | Unset if isinstance(self.completed_at, Unset): completed_at = UNSET else: completed_at = self.completed_at - failed_at: None | Unset | str + failed_at: None | str | Unset if isinstance(self.failed_at, Unset): failed_at = UNSET else: failed_at = self.failed_at - canceled_at: None | Unset | str + canceled_at: None | str | Unset if isinstance(self.canceled_at, Unset): canceled_at = UNSET else: canceled_at = self.canceled_at - incident_id: None | Unset | str + incident_id: None | str | Unset if isinstance(self.incident_id, Unset): incident_id = UNSET else: incident_id = self.incident_id - post_mortem_id: None | Unset | str + post_mortem_id: None | str | Unset if isinstance(self.post_mortem_id, Unset): post_mortem_id = UNSET else: post_mortem_id = self.post_mortem_id - action_item_id: None | Unset | str + action_item_id: None | str | Unset if isinstance(self.action_item_id, Unset): action_item_id = UNSET else: action_item_id = self.action_item_id - alert_id: None | Unset | str + alert_id: None | str | Unset if isinstance(self.alert_id, Unset): alert_id = UNSET else: alert_id = self.alert_id - pulse_id: None | Unset | str + pulse_id: None | str | Unset if isinstance(self.pulse_id, Unset): pulse_id = UNSET else: pulse_id = self.pulse_id - context: Unset | dict[str, Any] = UNSET + context: dict[str, Any] | Unset = UNSET if not isinstance(self.context, Unset): context = self.context.to_dict() @@ -167,98 +169,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 | Unset | str: + def _parse_status_message(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) status_message = _parse_status_message(d.pop("status_message", UNSET)) - def _parse_started_at(data: object) -> None | Unset | str: + def _parse_started_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) started_at = _parse_started_at(d.pop("started_at", UNSET)) - def _parse_completed_at(data: object) -> None | Unset | str: + def _parse_completed_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) completed_at = _parse_completed_at(d.pop("completed_at", UNSET)) - def _parse_failed_at(data: object) -> None | Unset | str: + def _parse_failed_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) failed_at = _parse_failed_at(d.pop("failed_at", UNSET)) - def _parse_canceled_at(data: object) -> None | Unset | str: + def _parse_canceled_at(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) canceled_at = _parse_canceled_at(d.pop("canceled_at", UNSET)) - def _parse_incident_id(data: object) -> None | Unset | str: + def _parse_incident_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) incident_id = _parse_incident_id(d.pop("incident_id", UNSET)) - def _parse_post_mortem_id(data: object) -> None | Unset | str: + def _parse_post_mortem_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) post_mortem_id = _parse_post_mortem_id(d.pop("post_mortem_id", UNSET)) - def _parse_action_item_id(data: object) -> None | Unset | str: + def _parse_action_item_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) action_item_id = _parse_action_item_id(d.pop("action_item_id", UNSET)) - def _parse_alert_id(data: object) -> None | Unset | str: + def _parse_alert_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) alert_id = _parse_alert_id(d.pop("alert_id", UNSET)) - def _parse_pulse_id(data: object) -> None | Unset | str: + def _parse_pulse_id(data: object) -> None | str | Unset: if data is None: return data if isinstance(data, Unset): return data - return cast(None | Unset | str, data) + return cast(None | str | Unset, data) pulse_id = _parse_pulse_id(d.pop("pulse_id", UNSET)) _context = d.pop("context", UNSET) - context: Unset | WorkflowRunContext + context: WorkflowRunContext | Unset 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 28bff04f..ecd3107f 100644 --- a/rootly_sdk/models/workflow_run_context.py +++ b/rootly_sdk/models/workflow_run_context.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import Any, TypeVar @@ -14,6 +16,7 @@ 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 50819314..3a98f56f 100644 --- a/rootly_sdk/models/workflow_run_response.py +++ b/rootly_sdk/models/workflow_run_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class WorkflowRunResponse: """ Attributes: data (WorkflowRunResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "WorkflowRunResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: WorkflowRunResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 73ec5e96..a2b091e9 100644 --- a/rootly_sdk/models/workflow_run_response_data.py +++ b/rootly_sdk/models/workflow_run_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -24,7 +26,7 @@ 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]: diff --git a/rootly_sdk/models/workflow_run_response_data_type.py b/rootly_sdk/models/workflow_run_response_data_type.py index 43ec0a3c..ccc8c38a 100644 --- a/rootly_sdk/models/workflow_run_response_data_type.py +++ b/rootly_sdk/models/workflow_run_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowRunResponseDataType = Literal["workflow_runs"] @@ -11,5 +11,5 @@ def check_workflow_run_response_data_type(value: str | None) -> WorkflowRunRespo if value is None: return None if value in WORKFLOW_RUN_RESPONSE_DATA_TYPE_VALUES: - return cast(WorkflowRunResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {WORKFLOW_RUN_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/workflow_run_status.py b/rootly_sdk/models/workflow_run_status.py index 4966ac31..c3eac972 100644 --- a/rootly_sdk/models/workflow_run_status.py +++ b/rootly_sdk/models/workflow_run_status.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowRunStatus = Literal["canceled", "completed", "completed_with_errors", "failed", "queued", "started"] @@ -16,5 +16,5 @@ def check_workflow_run_status(value: str | None) -> WorkflowRunStatus | None: if value is None: return None if value in WORKFLOW_RUN_STATUS_VALUES: - return cast(WorkflowRunStatus, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {WORKFLOW_RUN_STATUS_VALUES!r}") diff --git a/rootly_sdk/models/workflow_run_triggered_by.py b/rootly_sdk/models/workflow_run_triggered_by.py index a70e7829..6f0ba3c0 100644 --- a/rootly_sdk/models/workflow_run_triggered_by.py +++ b/rootly_sdk/models/workflow_run_triggered_by.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowRunTriggeredBy = Literal["system", "user", "workflow"] @@ -13,5 +13,5 @@ def check_workflow_run_triggered_by(value: str | None) -> WorkflowRunTriggeredBy if value is None: return None if value in WORKFLOW_RUN_TRIGGERED_BY_VALUES: - return cast(WorkflowRunTriggeredBy, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {WORKFLOW_RUN_TRIGGERED_BY_VALUES!r}") diff --git a/rootly_sdk/models/workflow_runs_list.py b/rootly_sdk/models/workflow_runs_list.py index f4f48a91..61f7796a 100644 --- a/rootly_sdk/models/workflow_runs_list.py +++ b/rootly_sdk/models/workflow_runs_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class WorkflowRunsList: """ Attributes: - data (list['WorkflowRunsListDataItem']): + data (list[WorkflowRunsListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["WorkflowRunsListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[WorkflowRunsListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 970d0bec..a501592c 100644 --- a/rootly_sdk/models/workflow_runs_list_data_item.py +++ b/rootly_sdk/models/workflow_runs_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/workflow_runs_list_data_item_type.py b/rootly_sdk/models/workflow_runs_list_data_item_type.py index 05031091..e93806f0 100644 --- a/rootly_sdk/models/workflow_runs_list_data_item_type.py +++ b/rootly_sdk/models/workflow_runs_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowRunsListDataItemType = Literal["workflow_runs"] @@ -11,5 +11,5 @@ def check_workflow_runs_list_data_item_type(value: str | None) -> WorkflowRunsLi if value is None: return None if value in WORKFLOW_RUNS_LIST_DATA_ITEM_TYPE_VALUES: - return cast(WorkflowRunsListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {WORKFLOW_RUNS_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/workflow_task.py b/rootly_sdk/models/workflow_task.py index 0804153f..c6cdbdad 100644 --- a/rootly_sdk/models/workflow_task.py +++ b/rootly_sdk/models/workflow_task.py @@ -1,5 +1,7 @@ +from __future__ import annotations + from collections.abc import Mapping -from typing import TYPE_CHECKING, Any, TypeVar, Union +from typing import TYPE_CHECKING, Any, TypeVar from attrs import define as _attrs_define from attrs import field as _attrs_field @@ -79,6 +81,7 @@ from ..models.create_shortcut_story_task_params_type_0 import CreateShortcutStoryTaskParamsType0 from ..models.create_shortcut_story_task_params_type_1 import CreateShortcutStoryTaskParamsType1 from ..models.create_shortcut_task_task_params import CreateShortcutTaskTaskParams + from ..models.create_slack_canvas_task_params import CreateSlackCanvasTaskParams from ..models.create_slack_channel_task_params import CreateSlackChannelTaskParams from ..models.create_sub_incident_task_params import CreateSubIncidentTaskParams from ..models.create_trello_card_task_params import CreateTrelloCardTaskParams @@ -124,6 +127,7 @@ from ..models.print_task_params import PrintTaskParams from ..models.publish_incident_task_params import PublishIncidentTaskParams from ..models.redis_client_task_params import RedisClientTaskParams + from ..models.remove_from_slack_channel_task_params import RemoveFromSlackChannelTaskParams from ..models.remove_google_docs_permissions_task_params import RemoveGoogleDocsPermissionsTaskParams from ..models.rename_google_chat_space_task_params import RenameGoogleChatSpaceTaskParams from ..models.rename_microsoft_teams_channel_task_params import RenameMicrosoftTeamsChannelTaskParams @@ -180,6 +184,7 @@ from ..models.update_sharepoint_page_task_params import UpdateSharepointPageTaskParams from ..models.update_shortcut_story_task_params import UpdateShortcutStoryTaskParams from ..models.update_shortcut_task_task_params import UpdateShortcutTaskTaskParams + from ..models.update_slack_canvas_task_params import UpdateSlackCanvasTaskParams from ..models.update_slack_channel_topic_task_params import UpdateSlackChannelTopicTaskParams from ..models.update_status_task_params import UpdateStatusTaskParams from ..models.update_trello_card_task_params import UpdateTrelloCardTaskParams @@ -195,252 +200,252 @@ class WorkflowTask: """ Attributes: workflow_id (str): The ID of the parent workflow - 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']): + task_params (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 | 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 | CreateSlackCanvasTaskParams | + 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 | RemoveFromSlackChannelTaskParams | 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 | UpdateSlackCanvasTaskParams | 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 (Union[Unset, str]): Name of the workflow task + name (str | Unset): Name of the workflow task """ workflow_id: str - 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", - ] + task_params: ( + 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 + | 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 + | CreateSlackCanvasTaskParams + | 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 + | RemoveFromSlackChannelTaskParams + | 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 + | UpdateSlackCanvasTaskParams + | UpdateSlackChannelTopicTaskParams + | UpdateStatusTaskParams + | UpdateTrelloCardTaskParams + | UpdateVictorOpsIncidentTaskParams + | UpdateZendeskTicketTaskParams + ) position: int skip_on_failure: bool created_at: str updated_at: str enabled: bool = True - name: Unset | str = UNSET + name: str | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -517,6 +522,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.create_shortcut_story_task_params_type_0 import CreateShortcutStoryTaskParamsType0 from ..models.create_shortcut_story_task_params_type_1 import CreateShortcutStoryTaskParamsType1 from ..models.create_shortcut_task_task_params import CreateShortcutTaskTaskParams + from ..models.create_slack_canvas_task_params import CreateSlackCanvasTaskParams from ..models.create_slack_channel_task_params import CreateSlackChannelTaskParams from ..models.create_sub_incident_task_params import CreateSubIncidentTaskParams from ..models.create_trello_card_task_params import CreateTrelloCardTaskParams @@ -562,6 +568,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.print_task_params import PrintTaskParams from ..models.publish_incident_task_params import PublishIncidentTaskParams from ..models.redis_client_task_params import RedisClientTaskParams + from ..models.remove_from_slack_channel_task_params import RemoveFromSlackChannelTaskParams from ..models.remove_google_docs_permissions_task_params import RemoveGoogleDocsPermissionsTaskParams from ..models.rename_google_chat_space_task_params import RenameGoogleChatSpaceTaskParams from ..models.rename_microsoft_teams_channel_task_params import RenameMicrosoftTeamsChannelTaskParams @@ -618,6 +625,7 @@ def to_dict(self) -> dict[str, Any]: from ..models.update_sharepoint_page_task_params import UpdateSharepointPageTaskParams from ..models.update_shortcut_story_task_params import UpdateShortcutStoryTaskParams from ..models.update_shortcut_task_task_params import UpdateShortcutTaskTaskParams + from ..models.update_slack_canvas_task_params import UpdateSlackCanvasTaskParams from ..models.update_slack_channel_topic_task_params import UpdateSlackChannelTopicTaskParams from ..models.update_status_task_params import UpdateStatusTaskParams from ..models.update_trello_card_task_params import UpdateTrelloCardTaskParams @@ -873,6 +881,8 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, RenameSlackChannelTaskParams): task_params = self.task_params.to_dict() + elif isinstance(self.task_params, RemoveFromSlackChannelTaskParams): + task_params = self.task_params.to_dict() elif isinstance(self.task_params, ChangeSlackChannelPrivacyTaskParams): task_params = self.task_params.to_dict() elif isinstance(self.task_params, RunCommandHerokuTaskParams): @@ -883,6 +893,8 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, CreateSlackChannelTaskParams): task_params = self.task_params.to_dict() + elif isinstance(self.task_params, CreateSlackCanvasTaskParams): + task_params = self.task_params.to_dict() elif isinstance(self.task_params, SendSlackMessageTaskParamsType0): task_params = self.task_params.to_dict() elif isinstance(self.task_params, SendSlackMessageTaskParamsType1): @@ -927,6 +939,8 @@ def to_dict(self) -> dict[str, Any]: task_params = self.task_params.to_dict() elif isinstance(self.task_params, UpdateSlackChannelTopicTaskParams): task_params = self.task_params.to_dict() + elif isinstance(self.task_params, UpdateSlackCanvasTaskParams): + task_params = self.task_params.to_dict() elif isinstance(self.task_params, UpdateStatusTaskParams): task_params = self.task_params.to_dict() elif isinstance(self.task_params, UpdateIncidentStatusTimestampTaskParams): @@ -1066,6 +1080,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.create_shortcut_story_task_params_type_0 import CreateShortcutStoryTaskParamsType0 from ..models.create_shortcut_story_task_params_type_1 import CreateShortcutStoryTaskParamsType1 from ..models.create_shortcut_task_task_params import CreateShortcutTaskTaskParams + from ..models.create_slack_canvas_task_params import CreateSlackCanvasTaskParams from ..models.create_slack_channel_task_params import CreateSlackChannelTaskParams from ..models.create_sub_incident_task_params import CreateSubIncidentTaskParams from ..models.create_trello_card_task_params import CreateTrelloCardTaskParams @@ -1111,6 +1126,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.print_task_params import PrintTaskParams from ..models.publish_incident_task_params import PublishIncidentTaskParams from ..models.redis_client_task_params import RedisClientTaskParams + from ..models.remove_from_slack_channel_task_params import RemoveFromSlackChannelTaskParams from ..models.remove_google_docs_permissions_task_params import RemoveGoogleDocsPermissionsTaskParams from ..models.rename_google_chat_space_task_params import RenameGoogleChatSpaceTaskParams from ..models.rename_microsoft_teams_channel_task_params import RenameMicrosoftTeamsChannelTaskParams @@ -1167,6 +1183,7 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: from ..models.update_sharepoint_page_task_params import UpdateSharepointPageTaskParams from ..models.update_shortcut_story_task_params import UpdateShortcutStoryTaskParams from ..models.update_shortcut_task_task_params import UpdateShortcutTaskTaskParams + from ..models.update_slack_canvas_task_params import UpdateSlackCanvasTaskParams from ..models.update_slack_channel_topic_task_params import UpdateSlackChannelTopicTaskParams from ..models.update_status_task_params import UpdateStatusTaskParams from ..models.update_trello_card_task_params import UpdateTrelloCardTaskParams @@ -1178,181 +1195,184 @@ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T: def _parse_task_params( data: object, - ) -> 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", - ]: + ) -> ( + 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 + | 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 + | CreateSlackCanvasTaskParams + | 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 + | RemoveFromSlackChannelTaskParams + | 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 + | UpdateSlackCanvasTaskParams + | 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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1360,7 +1380,7 @@ def _parse_task_params( task_params_type_1 = UpdateActionItemTaskParams.from_dict(data) return task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1368,7 +1388,7 @@ def _parse_task_params( task_params_type_2 = AddRoleTaskParams.from_dict(data) return task_params_type_2 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1376,7 +1396,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1384,7 +1404,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1392,7 +1412,7 @@ def _parse_task_params( task_params_type_4 = AddTeamTaskParams.from_dict(data) return task_params_type_4 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1400,7 +1420,7 @@ def _parse_task_params( task_params_type_5 = AddToTimelineTaskParams.from_dict(data) return task_params_type_5 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1408,7 +1428,7 @@ def _parse_task_params( task_params_type_6 = ArchiveSlackChannelsTaskParams.from_dict(data) return task_params_type_6 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1416,7 +1436,7 @@ def _parse_task_params( task_params_type_7 = AttachDatadogDashboardsTaskParams.from_dict(data) return task_params_type_7 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1424,7 +1444,7 @@ def _parse_task_params( task_params_type_8 = AutoAssignRoleOpsgenieTaskParams.from_dict(data) return task_params_type_8 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1434,7 +1454,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_rootly_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1444,7 +1464,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_rootly_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1454,7 +1474,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_rootly_task_params_type_2 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1464,7 +1484,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_rootly_task_params_type_3 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1474,7 +1494,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_rootly_task_params_type_4 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1484,7 +1504,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_pagerduty_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1494,7 +1514,7 @@ def _parse_task_params( ) return componentsschemasauto_assign_role_pagerduty_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1502,7 +1522,7 @@ def _parse_task_params( task_params_type_11 = UpdatePagerdutyIncidentTaskParams.from_dict(data) return task_params_type_11 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1510,7 +1530,7 @@ def _parse_task_params( task_params_type_12 = CreatePagerdutyStatusUpdateTaskParams.from_dict(data) return task_params_type_12 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1518,7 +1538,7 @@ def _parse_task_params( task_params_type_13 = CreatePagertreeAlertTaskParams.from_dict(data) return task_params_type_13 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1526,7 +1546,7 @@ def _parse_task_params( task_params_type_14 = UpdatePagertreeAlertTaskParams.from_dict(data) return task_params_type_14 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1534,7 +1554,7 @@ def _parse_task_params( task_params_type_15 = AutoAssignRoleVictorOpsTaskParams.from_dict(data) return task_params_type_15 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1542,7 +1562,7 @@ def _parse_task_params( task_params_type_16 = CallPeopleTaskParams.from_dict(data) return task_params_type_16 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1550,7 +1570,7 @@ def _parse_task_params( task_params_type_17 = CreateAirtableTableRecordTaskParams.from_dict(data) return task_params_type_17 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1558,7 +1578,7 @@ def _parse_task_params( task_params_type_18 = CreateAsanaSubtaskTaskParams.from_dict(data) return task_params_type_18 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1566,7 +1586,7 @@ def _parse_task_params( task_params_type_19 = CreateAsanaTaskTaskParams.from_dict(data) return task_params_type_19 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1574,7 +1594,7 @@ def _parse_task_params( task_params_type_20 = CreateConfluencePageTaskParams.from_dict(data) return task_params_type_20 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1582,7 +1602,7 @@ def _parse_task_params( task_params_type_21 = CreateDatadogNotebookTaskParams.from_dict(data) return task_params_type_21 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1590,7 +1610,7 @@ def _parse_task_params( task_params_type_22 = CreateCodaPageTaskParams.from_dict(data) return task_params_type_22 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1598,7 +1618,7 @@ def _parse_task_params( task_params_type_23 = CreateDropboxPaperPageTaskParams.from_dict(data) return task_params_type_23 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1606,7 +1626,7 @@ def _parse_task_params( task_params_type_24 = CreateGithubIssueTaskParams.from_dict(data) return task_params_type_24 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1614,7 +1634,7 @@ def _parse_task_params( task_params_type_25 = CreateGitlabIssueTaskParams.from_dict(data) return task_params_type_25 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1622,7 +1642,7 @@ def _parse_task_params( task_params_type_26 = CreateOutlookEventTaskParams.from_dict(data) return task_params_type_26 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1630,7 +1650,7 @@ def _parse_task_params( task_params_type_27 = CreateGoogleCalendarEventTaskParams.from_dict(data) return task_params_type_27 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1638,7 +1658,7 @@ def _parse_task_params( task_params_type_28 = UpdateGoogleDocsPageTaskParams.from_dict(data) return task_params_type_28 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1646,7 +1666,7 @@ def _parse_task_params( task_params_type_29 = UpdateCodaPageTaskParams.from_dict(data) return task_params_type_29 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1654,7 +1674,7 @@ def _parse_task_params( task_params_type_30 = UpdateGoogleCalendarEventTaskParams.from_dict(data) return task_params_type_30 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1662,7 +1682,7 @@ def _parse_task_params( task_params_type_31 = CreateSharepointPageTaskParams.from_dict(data) return task_params_type_31 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1670,7 +1690,7 @@ def _parse_task_params( task_params_type_32 = CreateGoogleDocsPageTaskParams.from_dict(data) return task_params_type_32 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1678,7 +1698,7 @@ def _parse_task_params( task_params_type_33 = CreateGoogleDocsPermissionsTaskParams.from_dict(data) return task_params_type_33 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1686,7 +1706,7 @@ def _parse_task_params( task_params_type_34 = RemoveGoogleDocsPermissionsTaskParams.from_dict(data) return task_params_type_34 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1694,7 +1714,7 @@ def _parse_task_params( task_params_type_35 = CreateQuipPageTaskParams.from_dict(data) return task_params_type_35 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1702,7 +1722,7 @@ def _parse_task_params( task_params_type_36 = CreateGoogleMeetingTaskParams.from_dict(data) return task_params_type_36 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1710,7 +1730,7 @@ def _parse_task_params( task_params_type_37 = CreateGoToMeetingTaskParams.from_dict(data) return task_params_type_37 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1718,7 +1738,7 @@ def _parse_task_params( task_params_type_38 = CreateIncidentTaskParams.from_dict(data) return task_params_type_38 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1726,7 +1746,7 @@ def _parse_task_params( task_params_type_39 = CreateSubIncidentTaskParams.from_dict(data) return task_params_type_39 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1734,7 +1754,7 @@ def _parse_task_params( task_params_type_40 = CreateIncidentPostmortemTaskParams.from_dict(data) return task_params_type_40 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1742,7 +1762,7 @@ def _parse_task_params( task_params_type_41 = CreateJiraIssueTaskParams.from_dict(data) return task_params_type_41 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1750,7 +1770,7 @@ def _parse_task_params( task_params_type_42 = CreateJiraSubtaskTaskParams.from_dict(data) return task_params_type_42 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1758,7 +1778,7 @@ def _parse_task_params( task_params_type_43 = AttachRetrospectivePdfToJiraIssueTaskParams.from_dict(data) return task_params_type_43 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1766,7 +1786,7 @@ def _parse_task_params( task_params_type_44 = AttachRetrospectivePdfToFreshserviceTicketTaskParams.from_dict(data) return task_params_type_44 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1774,7 +1794,7 @@ def _parse_task_params( task_params_type_45 = CreateLinearIssueTaskParams.from_dict(data) return task_params_type_45 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1782,7 +1802,7 @@ def _parse_task_params( task_params_type_46 = CreateLinearSubtaskIssueTaskParams.from_dict(data) return task_params_type_46 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1790,7 +1810,7 @@ def _parse_task_params( task_params_type_47 = CreateLinearIssueCommentTaskParams.from_dict(data) return task_params_type_47 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1798,7 +1818,7 @@ def _parse_task_params( task_params_type_48 = CreateMicrosoftTeamsMeetingTaskParams.from_dict(data) return task_params_type_48 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1806,7 +1826,7 @@ def _parse_task_params( task_params_type_49 = CreateMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_49 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1814,7 +1834,7 @@ def _parse_task_params( task_params_type_50 = CreateMicrosoftTeamsChatTaskParams.from_dict(data) return task_params_type_50 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1824,7 +1844,7 @@ def _parse_task_params( ) return componentsschemasadd_microsoft_teams_tab_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1834,7 +1854,7 @@ def _parse_task_params( ) return componentsschemasadd_microsoft_teams_tab_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1842,7 +1862,7 @@ def _parse_task_params( task_params_type_52 = AddMicrosoftTeamsChatTabTaskParams.from_dict(data) return task_params_type_52 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1850,7 +1870,7 @@ def _parse_task_params( task_params_type_53 = CreateGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_53 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1858,7 +1878,7 @@ def _parse_task_params( task_params_type_54 = SendGoogleChatMessageTaskParams.from_dict(data) return task_params_type_54 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1866,7 +1886,7 @@ def _parse_task_params( task_params_type_55 = SendGoogleChatAttachmentsTaskParams.from_dict(data) return task_params_type_55 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1874,7 +1894,7 @@ def _parse_task_params( task_params_type_56 = InviteToGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_56 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1882,7 +1902,7 @@ def _parse_task_params( task_params_type_57 = ArchiveGoogleChatSpacesTaskParams.from_dict(data) return task_params_type_57 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1890,7 +1910,7 @@ def _parse_task_params( task_params_type_58 = RenameGoogleChatSpaceTaskParams.from_dict(data) return task_params_type_58 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1898,7 +1918,7 @@ def _parse_task_params( task_params_type_59 = UpdateGoogleChatSpaceDescriptionTaskParams.from_dict(data) return task_params_type_59 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1906,7 +1926,7 @@ def _parse_task_params( task_params_type_60 = ChangeGoogleChatSpacePrivacyTaskParams.from_dict(data) return task_params_type_60 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1914,7 +1934,7 @@ def _parse_task_params( task_params_type_61 = ArchiveMicrosoftTeamsChannelsTaskParams.from_dict(data) return task_params_type_61 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1922,7 +1942,7 @@ def _parse_task_params( task_params_type_62 = RenameMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_62 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1930,7 +1950,7 @@ def _parse_task_params( task_params_type_63 = InviteToMicrosoftTeamsChannelTaskParams.from_dict(data) return task_params_type_63 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1938,7 +1958,7 @@ def _parse_task_params( task_params_type_64 = CreateNotionPageTaskParams.from_dict(data) return task_params_type_64 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1948,7 +1968,7 @@ def _parse_task_params( ) return componentsschemassend_microsoft_teams_message_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1956,7 +1976,7 @@ def _parse_task_params( task_params_type_66 = SendMicrosoftTeamsChatMessageTaskParams.from_dict(data) return task_params_type_66 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1966,7 +1986,7 @@ def _parse_task_params( ) return componentsschemassend_microsoft_teams_blocks_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1974,7 +1994,7 @@ def _parse_task_params( task_params_type_68 = UpdateNotionPageTaskParams.from_dict(data) return task_params_type_68 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1982,7 +2002,7 @@ def _parse_task_params( task_params_type_69 = UpdateQuipPageTaskParams.from_dict(data) return task_params_type_69 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1990,7 +2010,7 @@ def _parse_task_params( task_params_type_70 = UpdateConfluencePageTaskParams.from_dict(data) return task_params_type_70 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -1998,7 +2018,7 @@ def _parse_task_params( task_params_type_71 = UpdateSharepointPageTaskParams.from_dict(data) return task_params_type_71 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2006,7 +2026,7 @@ def _parse_task_params( task_params_type_72 = UpdateDropboxPaperPageTaskParams.from_dict(data) return task_params_type_72 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2014,7 +2034,7 @@ def _parse_task_params( task_params_type_73 = UpdateDatadogNotebookTaskParams.from_dict(data) return task_params_type_73 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2022,7 +2042,7 @@ def _parse_task_params( task_params_type_74 = CreateServiceNowIncidentTaskParams.from_dict(data) return task_params_type_74 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2032,7 +2052,7 @@ def _parse_task_params( ) return componentsschemascreate_shortcut_story_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2042,7 +2062,7 @@ def _parse_task_params( ) return componentsschemascreate_shortcut_story_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2050,7 +2070,7 @@ def _parse_task_params( task_params_type_76 = CreateShortcutTaskTaskParams.from_dict(data) return task_params_type_76 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2058,7 +2078,7 @@ def _parse_task_params( task_params_type_77 = CreateTrelloCardTaskParams.from_dict(data) return task_params_type_77 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2066,7 +2086,7 @@ def _parse_task_params( task_params_type_78 = CreateWebexMeetingTaskParams.from_dict(data) return task_params_type_78 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2074,7 +2094,7 @@ def _parse_task_params( task_params_type_79 = CreateZendeskTicketTaskParams.from_dict(data) return task_params_type_79 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2082,7 +2102,7 @@ def _parse_task_params( task_params_type_80 = CreateZendeskJiraLinkTaskParams.from_dict(data) return task_params_type_80 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2090,7 +2110,7 @@ def _parse_task_params( task_params_type_81 = CreateClickupTaskTaskParams.from_dict(data) return task_params_type_81 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2098,7 +2118,7 @@ def _parse_task_params( task_params_type_82 = CreateMotionTaskTaskParams.from_dict(data) return task_params_type_82 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2106,7 +2126,7 @@ def _parse_task_params( task_params_type_83 = CreateZoomMeetingTaskParams.from_dict(data) return task_params_type_83 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2114,7 +2134,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2122,7 +2142,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2130,7 +2150,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2138,7 +2158,7 @@ def _parse_task_params( componentsschemasget_gitlab_commits_task_params_type_1 = GetGitlabCommitsTaskParamsType1.from_dict(data) return componentsschemasget_gitlab_commits_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2146,7 +2166,7 @@ def _parse_task_params( task_params_type_86 = GetPulsesTaskParams.from_dict(data) return task_params_type_86 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2154,7 +2174,7 @@ def _parse_task_params( task_params_type_87 = GetAlertsTaskParams.from_dict(data) return task_params_type_87 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2162,7 +2182,7 @@ def _parse_task_params( task_params_type_88 = HttpClientTaskParams.from_dict(data) return task_params_type_88 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2170,7 +2190,7 @@ def _parse_task_params( task_params_type_89 = InviteToSlackChannelOpsgenieTaskParams.from_dict(data) return task_params_type_89 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2178,7 +2198,7 @@ def _parse_task_params( task_params_type_90 = InviteToSlackChannelRootlyTaskParams.from_dict(data) return task_params_type_90 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2186,7 +2206,7 @@ def _parse_task_params( task_params_type_91 = InviteToMicrosoftTeamsChannelRootlyTaskParams.from_dict(data) return task_params_type_91 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2196,7 +2216,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_pagerduty_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2206,7 +2226,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_pagerduty_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2216,7 +2236,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2226,7 +2246,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2236,7 +2256,7 @@ def _parse_task_params( ) return componentsschemasinvite_to_slack_channel_task_params_type_2 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2244,7 +2264,7 @@ def _parse_task_params( task_params_type_94 = InviteToSlackChannelVictorOpsTaskParams.from_dict(data) return task_params_type_94 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2252,7 +2272,7 @@ def _parse_task_params( task_params_type_95 = PageOpsgenieOnCallRespondersTaskParams.from_dict(data) return task_params_type_95 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2260,7 +2280,7 @@ def _parse_task_params( task_params_type_96 = CreateOpsgenieAlertTaskParams.from_dict(data) return task_params_type_96 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2268,7 +2288,7 @@ def _parse_task_params( task_params_type_97 = CreateJsmopsAlertTaskParams.from_dict(data) return task_params_type_97 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2276,7 +2296,7 @@ def _parse_task_params( task_params_type_98 = PageJsmopsOnCallRespondersTaskParams.from_dict(data) return task_params_type_98 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2284,7 +2304,7 @@ def _parse_task_params( task_params_type_99 = UpdateOpsgenieAlertTaskParams.from_dict(data) return task_params_type_99 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2292,7 +2312,7 @@ def _parse_task_params( task_params_type_100 = UpdateOpsgenieIncidentTaskParams.from_dict(data) return task_params_type_100 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2300,7 +2320,7 @@ def _parse_task_params( task_params_type_101 = PageRootlyOnCallRespondersTaskParams.from_dict(data) return task_params_type_101 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2308,7 +2328,7 @@ def _parse_task_params( task_params_type_102 = PagePagerdutyOnCallRespondersTaskParams.from_dict(data) return task_params_type_102 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2318,7 +2338,7 @@ def _parse_task_params( ) return componentsschemaspage_victor_ops_on_call_responders_task_params_type_0 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2328,7 +2348,7 @@ def _parse_task_params( ) return componentsschemaspage_victor_ops_on_call_responders_task_params_type_1 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2336,7 +2356,7 @@ def _parse_task_params( task_params_type_104 = UpdateVictorOpsIncidentTaskParams.from_dict(data) return task_params_type_104 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2344,7 +2364,7 @@ def _parse_task_params( task_params_type_105 = PrintTaskParams.from_dict(data) return task_params_type_105 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2352,7 +2372,7 @@ def _parse_task_params( task_params_type_106 = PublishIncidentTaskParams.from_dict(data) return task_params_type_106 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2360,7 +2380,7 @@ def _parse_task_params( task_params_type_107 = RedisClientTaskParams.from_dict(data) return task_params_type_107 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2368,287 +2388,311 @@ def _parse_task_params( task_params_type_108 = RenameSlackChannelTaskParams.from_dict(data) return task_params_type_108 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_109 = ChangeSlackChannelPrivacyTaskParams.from_dict(data) + task_params_type_109 = RemoveFromSlackChannelTaskParams.from_dict(data) return task_params_type_109 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_110 = RunCommandHerokuTaskParams.from_dict(data) + task_params_type_110 = ChangeSlackChannelPrivacyTaskParams.from_dict(data) return task_params_type_110 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_111 = SendEmailTaskParams.from_dict(data) + task_params_type_111 = RunCommandHerokuTaskParams.from_dict(data) return task_params_type_111 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_112 = SendDashboardReportTaskParams.from_dict(data) + task_params_type_112 = SendEmailTaskParams.from_dict(data) return task_params_type_112 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_113 = CreateSlackChannelTaskParams.from_dict(data) + task_params_type_113 = SendDashboardReportTaskParams.from_dict(data) return task_params_type_113 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - componentsschemassend_slack_message_task_params_type_0 = SendSlackMessageTaskParamsType0.from_dict(data) + task_params_type_114 = CreateSlackChannelTaskParams.from_dict(data) - return componentsschemassend_slack_message_task_params_type_0 - except: # noqa: E722 + return task_params_type_114 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - componentsschemassend_slack_message_task_params_type_1 = SendSlackMessageTaskParamsType1.from_dict(data) + task_params_type_115 = CreateSlackCanvasTaskParams.from_dict(data) - return componentsschemassend_slack_message_task_params_type_1 - except: # noqa: E722 + return task_params_type_115 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - componentsschemassend_slack_message_task_params_type_2 = SendSlackMessageTaskParamsType2.from_dict(data) + componentsschemassend_slack_message_task_params_type_0 = SendSlackMessageTaskParamsType0.from_dict(data) - return componentsschemassend_slack_message_task_params_type_2 - except: # noqa: E722 + return componentsschemassend_slack_message_task_params_type_0 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_115 = SendSmsTaskParams.from_dict(data) + componentsschemassend_slack_message_task_params_type_1 = SendSlackMessageTaskParamsType1.from_dict(data) - return task_params_type_115 - except: # noqa: E722 + return componentsschemassend_slack_message_task_params_type_1 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_116 = SendWhatsappMessageTaskParams.from_dict(data) + componentsschemassend_slack_message_task_params_type_2 = SendSlackMessageTaskParamsType2.from_dict(data) - return task_params_type_116 - except: # noqa: E722 + 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_117 = SnapshotDatadogGraphTaskParams.from_dict(data) + task_params_type_117 = SendSmsTaskParams.from_dict(data) return task_params_type_117 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_118 = SnapshotGrafanaDashboardTaskParams.from_dict(data) + task_params_type_118 = SendWhatsappMessageTaskParams.from_dict(data) return task_params_type_118 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_119 = SnapshotLookerLookTaskParams.from_dict(data) + task_params_type_119 = SnapshotDatadogGraphTaskParams.from_dict(data) return task_params_type_119 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_120 = SnapshotNewRelicGraphTaskParams.from_dict(data) + task_params_type_120 = SnapshotGrafanaDashboardTaskParams.from_dict(data) return task_params_type_120 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_121 = TweetTwitterMessageTaskParams.from_dict(data) + task_params_type_121 = SnapshotLookerLookTaskParams.from_dict(data) return task_params_type_121 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_122 = UpdateAirtableTableRecordTaskParams.from_dict(data) + task_params_type_122 = SnapshotNewRelicGraphTaskParams.from_dict(data) return task_params_type_122 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_123 = UpdateAsanaTaskTaskParams.from_dict(data) + task_params_type_123 = TweetTwitterMessageTaskParams.from_dict(data) return task_params_type_123 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_124 = UpdateGithubIssueTaskParams.from_dict(data) + task_params_type_124 = UpdateAirtableTableRecordTaskParams.from_dict(data) return task_params_type_124 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_125 = UpdateGitlabIssueTaskParams.from_dict(data) + task_params_type_125 = UpdateAsanaTaskTaskParams.from_dict(data) return task_params_type_125 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_126 = UpdateIncidentTaskParams.from_dict(data) + task_params_type_126 = UpdateGithubIssueTaskParams.from_dict(data) return task_params_type_126 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_127 = UpdateIncidentPostmortemTaskParams.from_dict(data) + task_params_type_127 = UpdateGitlabIssueTaskParams.from_dict(data) return task_params_type_127 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_128 = UpdateJiraIssueTaskParams.from_dict(data) + task_params_type_128 = UpdateIncidentTaskParams.from_dict(data) return task_params_type_128 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_129 = UpdateLinearIssueTaskParams.from_dict(data) + task_params_type_129 = UpdateIncidentPostmortemTaskParams.from_dict(data) return task_params_type_129 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_130 = UpdateServiceNowIncidentTaskParams.from_dict(data) + task_params_type_130 = UpdateJiraIssueTaskParams.from_dict(data) return task_params_type_130 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_131 = UpdateShortcutStoryTaskParams.from_dict(data) + task_params_type_131 = UpdateLinearIssueTaskParams.from_dict(data) return task_params_type_131 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_132 = UpdateShortcutTaskTaskParams.from_dict(data) + task_params_type_132 = UpdateServiceNowIncidentTaskParams.from_dict(data) return task_params_type_132 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_133 = UpdateSlackChannelTopicTaskParams.from_dict(data) + task_params_type_133 = UpdateShortcutStoryTaskParams.from_dict(data) return task_params_type_133 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_134 = UpdateStatusTaskParams.from_dict(data) + task_params_type_134 = UpdateShortcutTaskTaskParams.from_dict(data) return task_params_type_134 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_135 = UpdateIncidentStatusTimestampTaskParams.from_dict(data) + task_params_type_135 = UpdateSlackChannelTopicTaskParams.from_dict(data) return task_params_type_135 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_136 = UpdateTrelloCardTaskParams.from_dict(data) + task_params_type_136 = UpdateSlackCanvasTaskParams.from_dict(data) return task_params_type_136 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_137 = UpdateClickupTaskTaskParams.from_dict(data) + task_params_type_137 = UpdateStatusTaskParams.from_dict(data) return task_params_type_137 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_138 = UpdateMotionTaskTaskParams.from_dict(data) + task_params_type_138 = UpdateIncidentStatusTimestampTaskParams.from_dict(data) return task_params_type_138 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_139 = UpdateZendeskTicketTaskParams.from_dict(data) + task_params_type_139 = UpdateTrelloCardTaskParams.from_dict(data) return task_params_type_139 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_140 = UpdateAttachedAlertsTaskParams.from_dict(data) + task_params_type_140 = UpdateClickupTaskTaskParams.from_dict(data) return task_params_type_140 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_141 = TriggerWorkflowTaskParams.from_dict(data) + task_params_type_141 = UpdateMotionTaskTaskParams.from_dict(data) return task_params_type_141 - except: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_142 = UpdateZendeskTicketTaskParams.from_dict(data) + + return task_params_type_142 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_143 = UpdateAttachedAlertsTaskParams.from_dict(data) + + return task_params_type_143 + except (TypeError, ValueError, AttributeError, KeyError): + pass + try: + if not isinstance(data, dict): + raise TypeError() + task_params_type_144 = TriggerWorkflowTaskParams.from_dict(data) + + return task_params_type_144 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2656,7 +2700,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2664,7 +2708,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): @@ -2672,45 +2716,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: # noqa: E722 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_143 = CreateOpenaiChatCompletionTaskParams.from_dict(data) + task_params_type_146 = CreateOpenaiChatCompletionTaskParams.from_dict(data) - return task_params_type_143 - except: # noqa: E722 + return task_params_type_146 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_144 = CreateWatsonxChatCompletionTaskParams.from_dict(data) + task_params_type_147 = CreateWatsonxChatCompletionTaskParams.from_dict(data) - return task_params_type_144 - except: # noqa: E722 + return task_params_type_147 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_145 = CreateGoogleGeminiChatCompletionTaskParams.from_dict(data) + task_params_type_148 = CreateGoogleGeminiChatCompletionTaskParams.from_dict(data) - return task_params_type_145 - except: # noqa: E722 + return task_params_type_148 + except (TypeError, ValueError, AttributeError, KeyError): pass try: if not isinstance(data, dict): raise TypeError() - task_params_type_146 = CreateMistralChatCompletionTaskParams.from_dict(data) + task_params_type_149 = CreateMistralChatCompletionTaskParams.from_dict(data) - return task_params_type_146 - except: # noqa: E722 + return task_params_type_149 + except (TypeError, ValueError, AttributeError, KeyError): pass if not isinstance(data, dict): raise TypeError() - task_params_type_147 = CreateAnthropicChatCompletionTaskParams.from_dict(data) + task_params_type_150 = CreateAnthropicChatCompletionTaskParams.from_dict(data) - return task_params_type_147 + return task_params_type_150 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 9fbe3d7b..45cb8b18 100644 --- a/rootly_sdk/models/workflow_task_list.py +++ b/rootly_sdk/models/workflow_task_list.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -20,16 +22,16 @@ class WorkflowTaskList: """ Attributes: - data (list['WorkflowTaskListDataItem']): + data (list[WorkflowTaskListDataItem]): links (Links): meta (Meta): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: list["WorkflowTaskListDataItem"] - links: "Links" - meta: "Meta" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: list[WorkflowTaskListDataItem] + links: Links + meta: Meta + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: @@ -42,7 +44,7 @@ def to_dict(self) -> dict[str, Any]: meta = self.meta.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -82,12 +84,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 43d4b2c7..eb0f4179 100644 --- a/rootly_sdk/models/workflow_task_list_data_item.py +++ b/rootly_sdk/models/workflow_task_list_data_item.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/workflow_task_list_data_item_type.py b/rootly_sdk/models/workflow_task_list_data_item_type.py index 42672824..b3bb326a 100644 --- a/rootly_sdk/models/workflow_task_list_data_item_type.py +++ b/rootly_sdk/models/workflow_task_list_data_item_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowTaskListDataItemType = Literal["workflow_tasks"] @@ -11,5 +11,5 @@ def check_workflow_task_list_data_item_type(value: str | None) -> WorkflowTaskLi if value is None: return None if value in WORKFLOW_TASK_LIST_DATA_ITEM_TYPE_VALUES: - return cast(WorkflowTaskListDataItemType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {WORKFLOW_TASK_LIST_DATA_ITEM_TYPE_VALUES!r}") diff --git a/rootly_sdk/models/workflow_task_response.py b/rootly_sdk/models/workflow_task_response.py index a50417be..e7d64499 100644 --- a/rootly_sdk/models/workflow_task_response.py +++ b/rootly_sdk/models/workflow_task_response.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -19,17 +21,17 @@ class WorkflowTaskResponse: """ Attributes: data (WorkflowTaskResponseData): - included (Union[Unset, list['JsonapiIncludedResource']]): + included (list[JsonapiIncludedResource] | Unset): """ - data: "WorkflowTaskResponseData" - included: Unset | list["JsonapiIncludedResource"] = UNSET + data: WorkflowTaskResponseData + included: list[JsonapiIncludedResource] | Unset = UNSET additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict) def to_dict(self) -> dict[str, Any]: data = self.data.to_dict() - included: Unset | list[dict[str, Any]] = UNSET + included: list[dict[str, Any]] | Unset = UNSET if not isinstance(self.included, Unset): included = [] for included_item_data in self.included: @@ -56,12 +58,14 @@ 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) - for included_item_data in _included or []: - included_item = JsonapiIncludedResource.from_dict(included_item_data) + 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) - 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 73762081..a042e828 100644 --- a/rootly_sdk/models/workflow_task_response_data.py +++ b/rootly_sdk/models/workflow_task_response_data.py @@ -1,3 +1,5 @@ +from __future__ import annotations + from collections.abc import Mapping from typing import TYPE_CHECKING, Any, TypeVar @@ -27,7 +29,7 @@ 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]: diff --git a/rootly_sdk/models/workflow_task_response_data_type.py b/rootly_sdk/models/workflow_task_response_data_type.py index 180d2598..ffc39dc1 100644 --- a/rootly_sdk/models/workflow_task_response_data_type.py +++ b/rootly_sdk/models/workflow_task_response_data_type.py @@ -1,4 +1,4 @@ -from typing import Literal, cast +from typing import Literal WorkflowTaskResponseDataType = Literal["workflow_tasks"] @@ -11,5 +11,5 @@ def check_workflow_task_response_data_type(value: str | None) -> WorkflowTaskRes if value is None: return None if value in WORKFLOW_TASK_RESPONSE_DATA_TYPE_VALUES: - return cast(WorkflowTaskResponseDataType, value) + return value raise TypeError(f"Unexpected value {value!r}. Expected one of {WORKFLOW_TASK_RESPONSE_DATA_TYPE_VALUES!r}") diff --git a/rootly_sdk/types.py b/rootly_sdk/types.py index 7b033942..b64af095 100644 --- a/rootly_sdk/types.py +++ b/rootly_sdk/types.py @@ -19,9 +19,8 @@ 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]] diff --git a/tools/config.yaml b/tools/config.yaml index 9f3bfafe..0ad3fa5d 100644 --- a/tools/config.yaml +++ b/tools/config.yaml @@ -2,6 +2,4 @@ project_name_override: rootly package_name_override: rootly_sdk literal_enums: true -post_hooks: - - "ruff check . --fix" - - "ruff format ." +post_hooks: [] diff --git a/tools/fix_nullable_severity.py b/tools/fix_nullable_severity.py new file mode 100644 index 00000000..20910b8e --- /dev/null +++ b/tools/fix_nullable_severity.py @@ -0,0 +1,52 @@ +#!/usr/bin/env python3 +"""Extract the inline data schema from nullable severity responses.""" + +import json +import sys +from pathlib import Path + +SCHEMA_NAME = "nullable_severity_response" +DATA_SCHEMA_NAME = "nullable_severity_response_data" +DATA_SCHEMA_REF = f"#/components/schemas/{DATA_SCHEMA_NAME}" + + +def fix_spec(data: dict) -> int: + schemas = data.get("components", {}).get("schemas", {}) + schema = schemas.get(SCHEMA_NAME) + if not isinstance(schema, dict): + print(f"{SCHEMA_NAME} not found in spec") + return 1 + + properties = schema.get("properties") + data_schema = properties.get("data") if isinstance(properties, dict) else None + if isinstance(data_schema, dict) and data_schema.get("$ref") == DATA_SCHEMA_REF: + print("Nullable severity data schema already extracted") + return 0 + if not isinstance(data_schema, dict) or data_schema.get("type") != "object": + print(f"{SCHEMA_NAME}.data is not an inline object schema") + return 1 + if DATA_SCHEMA_NAME in schemas: + print(f"{DATA_SCHEMA_NAME} already exists in spec") + return 1 + + schemas[DATA_SCHEMA_NAME] = data_schema + properties["data"] = {"$ref": DATA_SCHEMA_REF} + print(f"Extracted {SCHEMA_NAME}.data as {DATA_SCHEMA_NAME}") + return 0 + + +def main() -> int: + if len(sys.argv) != 2: + print(f"Usage: {sys.argv[0]} ") + return 1 + + path = Path(sys.argv[1]) + data = json.loads(path.read_text()) + result = fix_spec(data) + if result == 0: + path.write_text(json.dumps(data)) + return result + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tools/fix_openapi_escalation_paths.py b/tools/fix_openapi_escalation_paths.py index 5fe9a2f4..08f722d2 100644 --- a/tools/fix_openapi_escalation_paths.py +++ b/tools/fix_openapi_escalation_paths.py @@ -51,6 +51,7 @@ def fix_spec(data: dict) -> int: ref_name = RULE_NAMES[rule_type] variant["type"] = "object" + variant.pop("title", None) schemas[ref_name] = variant extracted += 1 diff --git a/uv.lock b/uv.lock index a3feb39b..87bb014f 100644 --- a/uv.lock +++ b/uv.lock @@ -1,6 +1,28 @@ version = 1 -revision = 2 -requires-python = ">=3.9" +revision = 3 +requires-python = ">=3.10" +resolution-markers = [ + "python_full_version >= '3.11'", + "python_full_version < '3.11'", +] + +[[package]] +name = "annotated-doc" +version = "0.0.5" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5a/8e/38aa427ed5402449e226975b649c5dc73ccadfefeb95e6aecb8f8ea4b6b6/annotated_doc-0.0.5.tar.gz", hash = "sha256:c7e58ce09192557605d8bbd92836d7e1d520ac9580096042c0bfd197efacf1bb", size = 10758, upload-time = "2026-07-28T13:50:58.129Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/3e/30/e900b21425a860e195f32e37657aa1f7c7f2b1bfb26f03ca209b90933c06/annotated_doc-0.0.5-py3-none-any.whl", hash = "sha256:117bac03a25ede5df5440e855b32d556049ca169ead221505badf432fed4b101", size = 5302, upload-time = "2026-07-28T13:50:57.239Z" }, +] + +[[package]] +name = "annotated-types" +version = "0.8.0" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/5f/56/a8120250d128bed162cd73c76d45f6ef9991f3e068f62a8ee060afa3104a/annotated_types-0.8.0.tar.gz", hash = "sha256:13b2beaad985e05e2d6407ee4c4f35590b11f8d693a258a561055cac8f64cab7", size = 15893, upload-time = "2026-07-23T20:16:13.995Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/99/91/8acff4f5e50511b911bbccb72b8628a49c68ce14148cd9f6431094859a90/annotated_types-0.8.0-py3-none-any.whl", hash = "sha256:f072f4d804ea359e4eaf198b1af7a8b0943881a87f31bb764f8bf219bb9419e0", size = 13427, upload-time = "2026-07-23T20:16:12.938Z" }, +] [[package]] name = "anyio" @@ -26,22 +48,6 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/77/06/bb80f5f86020c4551da315d78b3ab75e8228f89f0162f2c3a819e407941a/attrs-25.3.0-py3-none-any.whl", hash = "sha256:427318ce031701fea540783410126f03899a97ffc6f61596ad581ac2e40e3bc3", size = 63815, upload-time = "2025-03-13T11:10:21.14Z" }, ] -[[package]] -name = "build" -version = "1.2.2.post1" -source = { registry = "https://pypi.org/simple" } -dependencies = [ - { name = "colorama", marker = "os_name == 'nt'" }, - { name = "importlib-metadata", marker = "python_full_version < '3.10.2'" }, - { name = "packaging" }, - { name = "pyproject-hooks" }, - { name = "tomli", marker = "python_full_version < '3.11'" }, -] -sdist = { url = "https://files.pythonhosted.org/packages/7d/46/aeab111f8e06793e4f0e421fcad593d547fb8313b50990f31681ee2fb1ad/build-1.2.2.post1.tar.gz", hash = "sha256:b36993e92ca9375a219c99e606a122ff365a760a2d4bba0caa09bd5278b608b7", size = 46701, upload-time = "2024-10-06T17:22:25.251Z" } -wheels = [ - { url = "https://files.pythonhosted.org/packages/84/c2/80633736cd183ee4a62107413def345f7e6e3c01563dbca1417363cf957e/build-1.2.2.post1-py3-none-any.whl", hash = "sha256:1d61c0887fa860c01971625baae8bdd338e517b836a2f70dd1f7aa3a6b2fc5b5", size = 22950, upload-time = "2024-10-06T17:22:23.299Z" }, -] - [[package]] name = "certifi" version = "2025.7.14" @@ -65,7 +71,7 @@ name = "exceptiongroup" version = "1.3.0" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "typing-extensions", marker = "python_full_version < '3.13'" }, + { name = "typing-extensions", marker = "python_full_version < '3.11'" }, ] sdist = { url = "https://files.pythonhosted.org/packages/0b/9f/a65090624ecf468cdca03533906e7c69ed7588582240cfe7cc9e770b50eb/exceptiongroup-1.3.0.tar.gz", hash = "sha256:b241f5885f560bc56a59ee63ca4c6a8bfa46ae4ad651af316d4e81817bb9fd88", size = 29749, upload-time = "2025-05-10T17:42:51.123Z" } wheels = [ @@ -119,33 +125,339 @@ wheels = [ ] [[package]] -name = "importlib-metadata" -version = "8.7.0" +name = "jinja2" +version = "3.1.6" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markupsafe", marker = "python_full_version >= '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/df/bf/f7da0350254c0ed7c72f3e33cef02e048281fec7ecec5f032d4aac52226b/jinja2-3.1.6.tar.gz", hash = "sha256:0137fb05990d35f1275a587e9aee6d56da821fc83491a0fb838183be43f66d6d", size = 245115, upload-time = "2025-03-05T20:05:02.478Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/62/a1/3d680cbfd5f4b8f15abc1d571870c5fc3e594bb582bc3b64ea099db13e56/jinja2-3.1.6-py3-none-any.whl", hash = "sha256:85ece4451f492d0c13c5dd7c13a64681a86afae63a5f347908daf103ce6d2f67", size = 134899, upload-time = "2025-03-05T20:05:00.369Z" }, +] + +[[package]] +name = "markdown-it-py" +version = "4.2.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "mdurl", marker = "python_full_version >= '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/06/ff/7841249c247aa650a76b9ee4bbaeae59370dc8bfd2f6c01f3630c35eb134/markdown_it_py-4.2.0.tar.gz", hash = "sha256:04a21681d6fbb623de53f6f364d352309d4094dd4194040a10fd51833e418d49", size = 82454, upload-time = "2026-05-07T12:08:28.36Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/81/4da04ced5a082363ecfa159c010d200ecbd959ae410c10c0264a38cac0f5/markdown_it_py-4.2.0-py3-none-any.whl", hash = "sha256:9f7ebbcd14fe59494226453aed97c1070d83f8d24b6fc3a3bcf9a38092641c4a", size = 91687, upload-time = "2026-05-07T12:08:27.182Z" }, +] + +[[package]] +name = "markupsafe" +version = "3.0.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/38/9b/e422a865e1d5d57d0e509b4e0bf1c1a70a7f6382c29a5aa428df994c8bc8/markupsafe-3.0.4.tar.gz", hash = "sha256:2e9ad7dd851bf45fab9f75cbff4cb493fee9979e8d8c7c9c3ee119022518edd6", size = 153777, upload-time = "2026-10-02T23:07:22.29Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/41/aa/9a65962e364bf19745f6bec7bde398fb1f5ca53ad2e734258e6198cc32ba/markupsafe-3.0.4-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:dd8ea6ebee7aedbf7c749fa80521d9ccf1ba473e0d1e14805caafbaad281c889", size = 11521, upload-time = "2026-10-02T23:04:20.141Z" }, + { url = "https://files.pythonhosted.org/packages/14/36/927999a34b7d1def6957de89153d327fedc4030061940b5a468584e6c5a8/markupsafe-3.0.4-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:dff05cb7016dff1e9fd68f4122c127b65dfc59de5306cfb7ad92f956f230bee2", size = 12066, upload-time = "2026-10-02T23:04:21.275Z" }, + { url = "https://files.pythonhosted.org/packages/17/54/69e7b0db9bd687bfd83451eed5666384d67cfed3be062bfc59a06a15474e/markupsafe-3.0.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:cf63c214fe879a65e69a386f915e36104fc84254ab141240f8854602d8e0be2a", size = 22081, upload-time = "2026-10-02T23:04:22.221Z" }, + { url = "https://files.pythonhosted.org/packages/bd/14/f6f5c97903f7d2db76bbfaced31509a47d360a103b3aaf4849f6536591ec/markupsafe-3.0.4-cp310-cp310-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:2a6ef68ae94aed8721934072b27a3b654ea2100b97e4ab864cf1489c90926fbc", size = 26079, upload-time = "2026-10-02T23:04:23.346Z" }, + { url = "https://files.pythonhosted.org/packages/d0/04/c3cc9b75f94f8b54d7e503c44cebd4b4a115ec1d6f1b996b999807daba99/markupsafe-3.0.4-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:fd9f8797427910198f95bced71ddfed61130d7e349213bfb8466c9c99e2c46a8", size = 22611, upload-time = "2026-10-02T23:04:24.401Z" }, + { url = "https://files.pythonhosted.org/packages/00/26/c4708ed3b0f08e8e6d7cbce3314ac130cb5352d1f62951b6fef7878f2b1e/markupsafe-3.0.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:d1aca03ede943eb80ab3d63bb082c84b7aab85ea83bd0fd0c200260945fb49d9", size = 20712, upload-time = "2026-10-02T23:04:25.386Z" }, + { url = "https://files.pythonhosted.org/packages/d9/b9/f3894d6aae3d7a52c9363317f4baf2fcadc052163d6dbc871266e32639ed/markupsafe-3.0.4-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:0764a13d34cae40db7bbf3a09b7e9b491bf4603e20b263a7a9d6b8e324975d0a", size = 20742, upload-time = "2026-10-02T23:04:26.403Z" }, + { url = "https://files.pythonhosted.org/packages/59/7c/8e248ddbfe286ab6bddb462bdac0851cbb1510d2cbbb815a415fcb0511af/markupsafe-3.0.4-cp310-cp310-musllinux_1_2_aarch64.whl", hash = "sha256:9388003072b95f2f1e3fd908604194d653ba21330d811961a78b7da1a77e9e36", size = 21560, upload-time = "2026-10-02T23:04:27.522Z" }, + { url = "https://files.pythonhosted.org/packages/df/26/2353fef7d4bcf2b18e16bad81979fcecff2915156ca6882447917205b8e2/markupsafe-3.0.4-cp310-cp310-musllinux_1_2_armv7l.whl", hash = "sha256:8698d70a8081ee8c090dbb394768b5789a1da8b131b5499f89d071dd3cfaf6be", size = 20973, upload-time = "2026-10-02T23:04:28.573Z" }, + { url = "https://files.pythonhosted.org/packages/67/6f/a9561d98d9a6ee3494b0b970a1c766e58bab128cc84841d56ec009456dbd/markupsafe-3.0.4-cp310-cp310-musllinux_1_2_ppc64le.whl", hash = "sha256:bf053da3c97a4bc5ecfbb218cdd2983febd91c617be8367d139882aa11e490aa", size = 22036, upload-time = "2026-10-02T23:04:29.568Z" }, + { url = "https://files.pythonhosted.org/packages/55/83/6217df9192eca95af3ff0cad955c9854a93fa43b288cf7411ae24713eb52/markupsafe-3.0.4-cp310-cp310-musllinux_1_2_riscv64.whl", hash = "sha256:9438a2648b2195980cb2dd8e53ed7b8df91319e2d0b70ae61a9e1d1bc8d3bec9", size = 20314, upload-time = "2026-10-02T23:04:30.881Z" }, + { url = "https://files.pythonhosted.org/packages/35/7c/9cd8081dae70e17fdab3558121fa618d459c7950c8abd8fc10fc024486d7/markupsafe-3.0.4-cp310-cp310-musllinux_1_2_x86_64.whl", hash = "sha256:88d59b473bfb03259722600839af9bbd7fa13a2eb514beefeedb95997882f69a", size = 20780, upload-time = "2026-10-02T23:04:31.975Z" }, + { url = "https://files.pythonhosted.org/packages/44/37/c5f2f45f4d8f0c24e4af7b9dc711640c888044cbf5f7e2ba2c0bb74cbb55/markupsafe-3.0.4-cp310-cp310-win32.whl", hash = "sha256:4a540e2d3192792fc84eced57bef37851ccb2b41f73291bb17408eea77bcd278", size = 14096, upload-time = "2026-10-02T23:04:33.129Z" }, + { url = "https://files.pythonhosted.org/packages/50/50/394a1c61c9b9972cb4f76875c332af7109bd39bdad09d3a0ec5327a339dc/markupsafe-3.0.4-cp310-cp310-win_amd64.whl", hash = "sha256:5c22873ad1f0532ba40fa1727f3c0fc1bbbaab6d373d4cbe3f0dc74b2e2521c7", size = 14329, upload-time = "2026-10-02T23:04:34.168Z" }, + { url = "https://files.pythonhosted.org/packages/d1/9a/86d03d2f32ba41a57baa124a7bcb76d0a6d39b1622e9bd4d550074e8b61a/markupsafe-3.0.4-cp310-cp310-win_arm64.whl", hash = "sha256:3d23795802fc8bd72534836d64489bbf0f67c088959091bdb22e10735a5107bf", size = 14196, upload-time = "2026-10-02T23:04:35.201Z" }, + { url = "https://files.pythonhosted.org/packages/32/55/18dbb4778b30ada5ce071608503cc3edc9e14e13d868c17a6d178fc30f7a/markupsafe-3.0.4-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:9e25feb9e330b63edb0278a0acdf85e50d0cb0fbf49c3084abbe4e24ae195346", size = 11520, upload-time = "2026-10-02T23:04:36.299Z" }, + { url = "https://files.pythonhosted.org/packages/6c/14/0b05f79b4733e264a18d08fe08fa1df7347630ff32a6cb82180d9dccec55/markupsafe-3.0.4-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:7d3391b2188d18737cb2fa147028b1096236eaa7e156446c650a489fa2cadc91", size = 12063, upload-time = "2026-10-02T23:04:37.291Z" }, + { url = "https://files.pythonhosted.org/packages/ca/3a/63ba10b6c1463216b3e4df669a9f0e5a3b0c3071557d2e8229e3968c79fb/markupsafe-3.0.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:849dd2bb0e5e4ab2b71c7191726a4a8d5aa8a610daa584728cbee0b710ddc4ef", size = 24321, upload-time = "2026-10-02T23:04:38.262Z" }, + { url = "https://files.pythonhosted.org/packages/1a/2e/5f015261b76ad633d187ef6f388b413aedd64a8773c4df59e530a0be5525/markupsafe-3.0.4-cp311-cp311-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:befb4158af32106b9a93db8d6d1d1cbbd418c0d5aca0cabb7b1780abf0c89169", size = 28845, upload-time = "2026-10-02T23:04:39.295Z" }, + { url = "https://files.pythonhosted.org/packages/33/cf/26e594b26be40c2f1fec63ccf8a8b99d0335a5b2cbe84835c7d82a994375/markupsafe-3.0.4-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:71f88e749ea29f67f21f3b36433c1dc54c7729ed2a6d9e2da2e0d9e0d7b224eb", size = 24701, upload-time = "2026-10-02T23:04:40.348Z" }, + { url = "https://files.pythonhosted.org/packages/81/a5/a513b76c139a3915b43404324e55c0b7979ae4f0d39eb6f075b0282e90a8/markupsafe-3.0.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:6da83a088f8ef93b2d483a8232a4dbf4d69d3d8496b568a03c56becac43e1808", size = 22961, upload-time = "2026-10-02T23:04:41.372Z" }, + { url = "https://files.pythonhosted.org/packages/46/cf/4c66192c100b4542bcbe392ae06696b670f66927be3ac38a213234778ff9/markupsafe-3.0.4-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:8f0fac8b13d14bb06c68195f849371924ae53dd7b1c00fed24650f704383b692", size = 21920, upload-time = "2026-10-02T23:04:42.429Z" }, + { url = "https://files.pythonhosted.org/packages/cb/17/ac3662678bfbad649893117ada2ba44dc30bf56884e84f13154a792b10f1/markupsafe-3.0.4-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:4a7cdc2a420ca01058182da4253329764d4bfa055564d1eced90e6ba1e8b1d3d", size = 23726, upload-time = "2026-10-02T23:04:43.531Z" }, + { url = "https://files.pythonhosted.org/packages/f7/af/fe47cee339180a69ebca3c57fb3483d0f5cbd1e8337d1871fb1d9c1aebee/markupsafe-3.0.4-cp311-cp311-musllinux_1_2_armv7l.whl", hash = "sha256:83b3944fea42a8400edf92fd1770fb8d0d4f7de651353bd2d8525a92dba69a21", size = 22539, upload-time = "2026-10-02T23:04:44.618Z" }, + { url = "https://files.pythonhosted.org/packages/12/32/d55440ba140442800e02d799c9cb5ab597bf6ebdb1177b5ea39a11f797bd/markupsafe-3.0.4-cp311-cp311-musllinux_1_2_ppc64le.whl", hash = "sha256:8138eb83940ec7299024d92d4dee45f601b9e6c5ffde9d25f4e35e326203c707", size = 23963, upload-time = "2026-10-02T23:04:45.656Z" }, + { url = "https://files.pythonhosted.org/packages/50/9d/9c86042cb364c2ad4c971e6d1247929effd25f714cd7ee11b05e6316445b/markupsafe-3.0.4-cp311-cp311-musllinux_1_2_riscv64.whl", hash = "sha256:811d02d5122171c1941357efd8f9bf4ffe907b7f0a1a4e729a880e4be3f46e3e", size = 21506, upload-time = "2026-10-02T23:04:46.671Z" }, + { url = "https://files.pythonhosted.org/packages/75/ef/5b824f03ba40c3b3652b6272d083d2fc4fcdd440de519a3a39ba2c3e7262/markupsafe-3.0.4-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:50b5bedc9ed8a94fc8857a42ef4f84a81ea88f8d4f05dc8705fb23ee6d8dcca7", size = 22955, upload-time = "2026-10-02T23:04:47.698Z" }, + { url = "https://files.pythonhosted.org/packages/1e/e8/44cfcb5ea40e5e43cec7793ef90704ed0c475280839076c4345757eb8e59/markupsafe-3.0.4-cp311-cp311-win32.whl", hash = "sha256:2e5a7cd7fdd14fcb1ae5d7d8bf23d24fbd1daefd1fbca2580132e1ea75f098b5", size = 14094, upload-time = "2026-10-02T23:04:48.788Z" }, + { url = "https://files.pythonhosted.org/packages/91/89/f2b509f7bf79352e40117824c1070dbeafd4df67031d3fa98165a3134228/markupsafe-3.0.4-cp311-cp311-win_amd64.whl", hash = "sha256:fdb4ca07ab75ffadab4a8b135ad59cdbb3156b99310f3d565370da74a15d6bd3", size = 14328, upload-time = "2026-10-02T23:04:49.801Z" }, + { url = "https://files.pythonhosted.org/packages/2b/5a/ccf22672a0f64dc682306e288f0dabcb06c7a201f3bb6e6cbf86d9e8ad03/markupsafe-3.0.4-cp311-cp311-win_arm64.whl", hash = "sha256:569d65055d367e3dcdf30c3f41119467b73d9ee9faf332bdf40402644f5ac08e", size = 14188, upload-time = "2026-10-02T23:04:50.847Z" }, + { url = "https://files.pythonhosted.org/packages/81/09/4c59d56b8461ae8eb0d8ba34bb25b7e618547044679d58a82ef9b2479fc1/markupsafe-3.0.4-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:61631e08084be9e21a8967ec3139c7616ed7c5e9368e05c86d1b39562c8a57b6", size = 11658, upload-time = "2026-10-02T23:04:51.876Z" }, + { url = "https://files.pythonhosted.org/packages/a2/f0/d6613774d86fbf6d145751d43c59875e47a6f9f17daee0aef173bd36d90e/markupsafe-3.0.4-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:0930db9bdc62d22944e10b066448bb65dc9abe9112880c7cab8da54db4284d5f", size = 12050, upload-time = "2026-10-02T23:04:52.931Z" }, + { url = "https://files.pythonhosted.org/packages/0d/f2/8f18e0b806eb13c1f8d07d917a720831ead54253a6dec011fbc78098a6f8/markupsafe-3.0.4-cp312-cp312-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:6a45c3d514f2436064db00d7fc8778d888f0236ebfed649b53d13a59e69ad51b", size = 24363, upload-time = "2026-10-02T23:04:53.895Z" }, + { url = "https://files.pythonhosted.org/packages/60/ce/fa07dbe8a5675558fa36dea033e19995bc783de2dec5f540ccb9030b06aa/markupsafe-3.0.4-cp312-cp312-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:1e1451fab512d1bcc3dc26988ec1edb0b82c2db909132872cd9356070a6b63df", size = 28525, upload-time = "2026-10-02T23:04:54.905Z" }, + { url = "https://files.pythonhosted.org/packages/85/40/be87c01f3868ec217f8a2015089d71c22c8c5a75324822e5ed1cdd87210d/markupsafe-3.0.4-cp312-cp312-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:bd3ce56ae2cbae3ba82b683bc425cd7e48d2ed8b10f3e818186b6f5646d9271c", size = 24733, upload-time = "2026-10-02T23:04:56.229Z" }, + { url = "https://files.pythonhosted.org/packages/4f/a7/aeedb5140afa41fc74c225e9184ab96723a6e873b6ee1c9fede7283456d8/markupsafe-3.0.4-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:8e124f974786f831d6043728e38296969d3579db8896fe004682f5758e613581", size = 22985, upload-time = "2026-10-02T23:04:57.521Z" }, + { url = "https://files.pythonhosted.org/packages/c3/fc/e91352bb08c6a59da3ef0909d457bf95a5f5908fbf151b30a06d9dbcfbb4/markupsafe-3.0.4-cp312-cp312-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:c02e8f18bdedba082cef725942ac823b9b60656db07f7e265cb31618dfd00d77", size = 22001, upload-time = "2026-10-02T23:04:58.597Z" }, + { url = "https://files.pythonhosted.org/packages/5d/f8/bffee5e7d2a3deb59748a797650a48af7e672025cf641a79344a771ad106/markupsafe-3.0.4-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:9f098115c247e11d138ab83a28fa0323c77015007ea2df73ba5fd714dfefd67c", size = 23793, upload-time = "2026-10-02T23:04:59.686Z" }, + { url = "https://files.pythonhosted.org/packages/ed/59/b853d6628ecb4d658e1d637224846d5e9bb4adf4f8df97f3be9f29dce2ec/markupsafe-3.0.4-cp312-cp312-musllinux_1_2_armv7l.whl", hash = "sha256:d5f93ebbeb8032d47e349328ec8662d973d9b05a70b3c35df1f91fe419b84749", size = 22640, upload-time = "2026-10-02T23:05:00.768Z" }, + { url = "https://files.pythonhosted.org/packages/09/b2/1506df394f0f075797c418d0301498f49e43be194e3ffcb49e6fe6ccf022/markupsafe-3.0.4-cp312-cp312-musllinux_1_2_ppc64le.whl", hash = "sha256:64511c54db4e4987aef4c41923235927428729e8174c5dba488429be70a998ed", size = 24074, upload-time = "2026-10-02T23:05:01.813Z" }, + { url = "https://files.pythonhosted.org/packages/c7/81/5ed69cda630ac69ef60d06c09ba5a7f84ff66a2e28cf986fd5614ab3c6e6/markupsafe-3.0.4-cp312-cp312-musllinux_1_2_riscv64.whl", hash = "sha256:e1a622f13970d81f95d0c72f9dc090dce9085fccfa4c9f2174377ee32bd15786", size = 21563, upload-time = "2026-10-02T23:05:03.239Z" }, + { url = "https://files.pythonhosted.org/packages/0c/fe/fb1e79be0fea60aa32602ebefc9c35a82bb42b4df157285ab7dfec12341a/markupsafe-3.0.4-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:c9a7f43c0b202b334cc9184af09bb8f21d3a209e038efaf106936fb69e6b026e", size = 23048, upload-time = "2026-10-02T23:05:04.479Z" }, + { url = "https://files.pythonhosted.org/packages/c8/52/7632a53360671a9b750cdbabaf9cdd89f18b42248b8e4cb42c0b0296e459/markupsafe-3.0.4-cp312-cp312-win32.whl", hash = "sha256:f0ec3b750b59375eab5b0fb2b9254810c00a3375be6d789899f1055a1d556237", size = 14108, upload-time = "2026-10-02T23:05:05.513Z" }, + { url = "https://files.pythonhosted.org/packages/3f/bf/62495e180b7000aaf30000fff849e933f74264638057176cf46852500adc/markupsafe-3.0.4-cp312-cp312-win_amd64.whl", hash = "sha256:11935df9bf455ed0c04eb87bcd720f02b1fe5e02128a9430f23aed6f93336fc7", size = 14303, upload-time = "2026-10-02T23:05:06.538Z" }, + { url = "https://files.pythonhosted.org/packages/c5/8e/4c24208776a65878d656996945aacfbfe010d3720d1a98fc0eb8491fc03b/markupsafe-3.0.4-cp312-cp312-win_arm64.whl", hash = "sha256:a4bbd2d87dd233b9fc5812160c3d0ffbe42edc22a26ce0469f58479ede633fe9", size = 14174, upload-time = "2026-10-02T23:05:07.617Z" }, + { url = "https://files.pythonhosted.org/packages/6d/18/4bc5ba32499e87bb2b0ef5b3a9bb9c00a131fa961ddf0be548cb550f548b/markupsafe-3.0.4-cp313-cp313-android_24_arm64_v8a.whl", hash = "sha256:de8b364c423ef0a4bad9069657d617f9a5d2b2062457a89b1fa16ee199c399c1", size = 12786, upload-time = "2026-10-02T23:05:08.709Z" }, + { url = "https://files.pythonhosted.org/packages/4e/6f/17f0c099bf25f3e31e63cc19244d9f6af861a9a4ab778c203997903cfdd0/markupsafe-3.0.4-cp313-cp313-android_24_x86_64.whl", hash = "sha256:34bdde374c5932765d7dc685c4a1d191a3207852d67e8e0a9eb6ea85156181f1", size = 12510, upload-time = "2026-10-02T23:05:09.93Z" }, + { url = "https://files.pythonhosted.org/packages/11/af/1a141081b905036ee904ec4bd945e1f70b4e1b32d33c4e59e8cf1d58b247/markupsafe-3.0.4-cp313-cp313-ios_13_0_arm64_iphoneos.whl", hash = "sha256:6bd9e1788e15bfcf6a9082de42e30387e7b85d211ab21e57a939bb8cfaaf8d96", size = 11583, upload-time = "2026-10-02T23:05:10.884Z" }, + { url = "https://files.pythonhosted.org/packages/e7/0a/a89385ae590232622a03e091805cff12f24fabe6c11e0e8bae096cece81c/markupsafe-3.0.4-cp313-cp313-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:5066b244f576f91afc8ee3ba029a89f99d39c79b1853fe9d39bea9f0afbec148", size = 11801, upload-time = "2026-10-02T23:05:11.913Z" }, + { url = "https://files.pythonhosted.org/packages/ed/85/ea548dc013962eb73653124bc595635fbf9e0fa41d1f181a967ccb784dfb/markupsafe-3.0.4-cp313-cp313-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:7a83aa6e4805df46fed18e989d3d16f86ef60cb50bbc8d9ce3a6be89165fbf6e", size = 11443, upload-time = "2026-10-02T23:05:12.887Z" }, + { url = "https://files.pythonhosted.org/packages/cc/72/15f2e5ec9cf2eb00d5cdfe968d94e4156a7bd7303832c3f3b2c403a36839/markupsafe-3.0.4-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:2d1b7d9308288661f56672b1b157d75fc536714d3638487bbea17b6318a78248", size = 11665, upload-time = "2026-10-02T23:05:13.829Z" }, + { url = "https://files.pythonhosted.org/packages/ca/e0/4030bea613677e333c8a2c901fd405055f657f9d06acba5b7357984b6ef7/markupsafe-3.0.4-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:73e77980c7207854f00fc4e71fb1626868d5740ab4012623d55c7a99ad122a72", size = 12061, upload-time = "2026-10-02T23:05:14.807Z" }, + { url = "https://files.pythonhosted.org/packages/f3/a5/28b76a7449eb702966b88bef599e2360b411fbb3afeee8fe560939be06ec/markupsafe-3.0.4-cp313-cp313-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:7018d4af1cd272e847aa5917983ab5e83e4f6579f9dbfecd4a79c0ca80b144c2", size = 24395, upload-time = "2026-10-02T23:05:15.909Z" }, + { url = "https://files.pythonhosted.org/packages/07/6c/21232811afc3a063b5e934b1ae2efda52f46154ec382f585149c020e61fe/markupsafe-3.0.4-cp313-cp313-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:c90d5b3d4e944e065a301d741b3c1d784f6bd1f503aa68b4967e32b2ba313d85", size = 27183, upload-time = "2026-10-02T23:05:16.976Z" }, + { url = "https://files.pythonhosted.org/packages/14/38/6ccdfa5b59049cb36fb80cbc80aee9cf1fc9bb77d1335ad435f2070b08cf/markupsafe-3.0.4-cp313-cp313-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:18a801868a884f216e784d7d14db2a4077143ce7610440aee2ce8f734e7cfcde", size = 24772, upload-time = "2026-10-02T23:05:18.209Z" }, + { url = "https://files.pythonhosted.org/packages/63/e0/cec6865dfe88cb48fedd4b20aed6af5158e41092adcbf3e028bcc6ec2108/markupsafe-3.0.4-cp313-cp313-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:434139499bb20b502ed3baa1f169e618f924a97e7a777fea1a49446d80106cf6", size = 23017, upload-time = "2026-10-02T23:05:19.286Z" }, + { url = "https://files.pythonhosted.org/packages/ee/76/6ed4940bb7648a9aac457c14f870cfdd5105f139a0fb1f29cd61fafa47d1/markupsafe-3.0.4-cp313-cp313-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:9e227f3dbe6bde7491cf0a9965d00b88c6b1a4a95d11480ddf88bb96d397c19f", size = 22036, upload-time = "2026-10-02T23:05:20.352Z" }, + { url = "https://files.pythonhosted.org/packages/a1/4f/ed476226d4fe46a09090a36025bf319296810028df55eb12f1253b540f3a/markupsafe-3.0.4-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:b8cd1f918b26fd7b1832ece557cc18f2d8747309ff8b3f0ef9d4250c5ad67a39", size = 23786, upload-time = "2026-10-02T23:05:21.576Z" }, + { url = "https://files.pythonhosted.org/packages/9a/35/66ff30450e35ef5fba9ebc930c9411747e537fd9447b65e44f5007e2b84d/markupsafe-3.0.4-cp313-cp313-musllinux_1_2_armv7l.whl", hash = "sha256:a5fcffb37e602b0b3c1638a97746b9b96125caa9bcf6fa41d337a9261de231ee", size = 22672, upload-time = "2026-10-02T23:05:22.922Z" }, + { url = "https://files.pythonhosted.org/packages/32/0b/72f45ce4b4efcbca4b80cf1b06703eff0be8d37e82abb78f66c85a7ead1e/markupsafe-3.0.4-cp313-cp313-musllinux_1_2_ppc64le.whl", hash = "sha256:5989cb26b2e1efc6a42216a9f6b5ee495ce5ace2e5b352a9af489976b32d1ee2", size = 24107, upload-time = "2026-10-02T23:05:24.175Z" }, + { url = "https://files.pythonhosted.org/packages/d2/03/71776e5fdcba04614b384cc102e8a4198208579d896fd1394cb7cb9aa900/markupsafe-3.0.4-cp313-cp313-musllinux_1_2_riscv64.whl", hash = "sha256:add96447a86d205ab616665d53b2950ee81083757f56e6ea833c8b2917646b46", size = 21615, upload-time = "2026-10-02T23:05:25.215Z" }, + { url = "https://files.pythonhosted.org/packages/ab/5f/801ce02a02e7aee0f784b1ec7843026178f6adeb9c93ac67eb1992a9a84d/markupsafe-3.0.4-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:2628d3a8cb648ecebb3c5d6b0a1052d400e4d8b7ac0fb786be8d285b50040d17", size = 23076, upload-time = "2026-10-02T23:05:26.423Z" }, + { url = "https://files.pythonhosted.org/packages/4a/85/c43776625428f3bb4a61e8633940400e3efe6409e3c6f5bff26de5e45618/markupsafe-3.0.4-cp313-cp313-win32.whl", hash = "sha256:672d207103e6b16ca098611b0f9efad6bc00afd47c03d6ef62186495ca677dc0", size = 14118, upload-time = "2026-10-02T23:05:27.716Z" }, + { url = "https://files.pythonhosted.org/packages/6f/36/163da64de88a13db79214ef75fa041be7fa13bdb42261cf5b7484de14bfb/markupsafe-3.0.4-cp313-cp313-win_amd64.whl", hash = "sha256:1f1f9477e174582b0a1b583d60b66e1f2cf5d3fe12cee985e4aedf44766600e5", size = 14313, upload-time = "2026-10-02T23:05:28.749Z" }, + { url = "https://files.pythonhosted.org/packages/9f/a8/9b662783ffaa1149221432a923cee562f78b9cbbb8baa3df9b3753e63e1e/markupsafe-3.0.4-cp313-cp313-win_arm64.whl", hash = "sha256:06de8ef6331f6e822c28d577dc8bf43fe398800477c49498f38fc38b67ff33fc", size = 14189, upload-time = "2026-10-02T23:05:29.917Z" }, + { url = "https://files.pythonhosted.org/packages/5c/c3/a944f3b0df22bd129e96915b9f4e98d2eeca6516687d7618304a966c3c74/markupsafe-3.0.4-cp314-cp314-android_24_arm64_v8a.whl", hash = "sha256:4ed644d75aa94a2baf7ec3a96eaa160ea58c742eb9d27c6506053c5c40fc84ed", size = 12787, upload-time = "2026-10-02T23:05:30.971Z" }, + { url = "https://files.pythonhosted.org/packages/d4/d6/a44863f69d88b6c7e27889108f70d47aed259edf89d5df3c5fca1eac87d6/markupsafe-3.0.4-cp314-cp314-android_24_x86_64.whl", hash = "sha256:6d2a9efe686f9de00d0d1ea32a4a5a86d558a2277501bd78d964214eab625e59", size = 12525, upload-time = "2026-10-02T23:05:32.263Z" }, + { url = "https://files.pythonhosted.org/packages/17/8f/168ba80e532dd6a93f96f8f706f1ad41d7990b6e1aeedc1cc0d211a33497/markupsafe-3.0.4-cp314-cp314-ios_13_0_arm64_iphoneos.whl", hash = "sha256:8781a792a070cf2bd1b86d3aa943894115faaba6e88122a7bf32d62072742453", size = 11589, upload-time = "2026-10-02T23:05:33.251Z" }, + { url = "https://files.pythonhosted.org/packages/32/b3/aa2c95a574d3af39403a469b295886eb9b6d448da568cbebb5a2cbfdc2e5/markupsafe-3.0.4-cp314-cp314-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:971a3bbb75d97ae4e2e8f7d4834236f86f85f0c85e04ab2e191db1123b04f80b", size = 11801, upload-time = "2026-10-02T23:05:34.315Z" }, + { url = "https://files.pythonhosted.org/packages/60/d0/34b810107d83840e768bf485de795893ebbae35b26ab061b487adfa0a692/markupsafe-3.0.4-cp314-cp314-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:8909c2f1c6dd65e054ac4b573a91c8384d1492281e55d82d159d653f7a13adf6", size = 11447, upload-time = "2026-10-02T23:05:35.302Z" }, + { url = "https://files.pythonhosted.org/packages/6c/ab/2f8488f0f817a39fca068d2b17daf446bf5cdb3eae28c3720af534d873b4/markupsafe-3.0.4-cp314-cp314-macosx_10_15_x86_64.whl", hash = "sha256:4cf3468d5ec187ffffcaca8e61929a37448f215dafc1386a12c750a72fe53634", size = 11722, upload-time = "2026-10-02T23:05:36.363Z" }, + { url = "https://files.pythonhosted.org/packages/ad/40/e2d117b048d47282ade906fbfd92814cbee5647afc13fda88a3406039372/markupsafe-3.0.4-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:52704c5d36eb6dda8866493decd61111fff86244c9b1ad225ca01b9e91e5970f", size = 12061, upload-time = "2026-10-02T23:05:37.397Z" }, + { url = "https://files.pythonhosted.org/packages/9a/a8/73a81135e85ba66217f5af7facb03bbb386807e1a729ab64532e4c802652/markupsafe-3.0.4-cp314-cp314-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:1caa2fa5a6184fb233153b35f654e6687bd555476f6170f29d8ee9be1a8b0af9", size = 24434, upload-time = "2026-10-02T23:05:38.407Z" }, + { url = "https://files.pythonhosted.org/packages/ac/ca/fa9216dd01efee2dfdacafe7df32b4d0170fbac694b0c258a193d6e53999/markupsafe-3.0.4-cp314-cp314-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:387d8cd30e69b3f0a72877b9ae717033396404e19095b17fe89753a981fda44f", size = 27183, upload-time = "2026-10-02T23:05:39.581Z" }, + { url = "https://files.pythonhosted.org/packages/fa/4e/a469509e538d37af51103b17b073126973f2b1cbf197ff32c7ddf025cfe5/markupsafe-3.0.4-cp314-cp314-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:051417f74bcaaefa316276e0ff723f541616ca51043d070da00249d9bddd3e3c", size = 24813, upload-time = "2026-10-02T23:05:40.671Z" }, + { url = "https://files.pythonhosted.org/packages/8f/db/d7282caf7ab03af44d5d6fdbaa019b35c7d7f1c90588b839c07cba640d6a/markupsafe-3.0.4-cp314-cp314-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:a8e9f292fcda89b324f2f5c91d13f1424a153e40fc2756f38ee23b15835ff300", size = 23049, upload-time = "2026-10-02T23:05:41.864Z" }, + { url = "https://files.pythonhosted.org/packages/30/f3/b6a425206e6964efda6acee544d0eb01d1501784d0b8e2dcc74986f33b17/markupsafe-3.0.4-cp314-cp314-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:df1ae86ff54725a01fa1a0510b914ca53a161b7050be74f6204e24aded5971d0", size = 22088, upload-time = "2026-10-02T23:05:43.014Z" }, + { url = "https://files.pythonhosted.org/packages/ea/8a/84d3582fc1f0d5bd466cdf2eebf175e172158a6e70701aacec1de1b35430/markupsafe-3.0.4-cp314-cp314-musllinux_1_2_aarch64.whl", hash = "sha256:8965520ac587c94a4ac48b729be3d8b8de00af39699b17585dfb599babe77977", size = 23846, upload-time = "2026-10-02T23:05:44.098Z" }, + { url = "https://files.pythonhosted.org/packages/1c/65/db101cce51b7ba4864ac491a9859d297dd1adf0e55b103fee9db9c47c527/markupsafe-3.0.4-cp314-cp314-musllinux_1_2_armv7l.whl", hash = "sha256:340cbb1957ba99929cbf19a75626d36ba1ae21d1730b287d1cf7f824a20c4fc7", size = 22674, upload-time = "2026-10-02T23:05:45.23Z" }, + { url = "https://files.pythonhosted.org/packages/e0/49/ddee9813d71db0c7a5c9d97c832125e6758a0c844777f1cf076569bb0e22/markupsafe-3.0.4-cp314-cp314-musllinux_1_2_ppc64le.whl", hash = "sha256:3a93d9616ddecfb393727a0041a562cf0b15a244e20f2bd25efc7949be4c4f17", size = 24104, upload-time = "2026-10-02T23:05:46.398Z" }, + { url = "https://files.pythonhosted.org/packages/aa/0e/7d8518d726726870a2399d69fd30d0fa36c5e57a2132c336b58d7c491073/markupsafe-3.0.4-cp314-cp314-musllinux_1_2_riscv64.whl", hash = "sha256:d2e56fd3b00222722abfb3f5f0759ddbae4b90811b5ad4343c64030ad1bde70c", size = 21637, upload-time = "2026-10-02T23:05:47.48Z" }, + { url = "https://files.pythonhosted.org/packages/b4/b0/b505e8a361ba557dbf3b3aa7331ea39b00d2022a26e925ff8463b9714bb3/markupsafe-3.0.4-cp314-cp314-musllinux_1_2_x86_64.whl", hash = "sha256:0d9c47709875fdb321452056622e930c52afbc07a7d780762fbb8b4d91ce6fa4", size = 23081, upload-time = "2026-10-02T23:05:48.611Z" }, + { url = "https://files.pythonhosted.org/packages/1c/ea/9cc3cea873f980c75cbdb6f4277ce30ee955de38be0b3d02f14c108e0698/markupsafe-3.0.4-cp314-cp314-win32.whl", hash = "sha256:38fc55594dab834470b6733dead2ee9e3f657fb0608c769dcafa0ba5ab52f45c", size = 14272, upload-time = "2026-10-02T23:05:49.707Z" }, + { url = "https://files.pythonhosted.org/packages/80/f0/5792ff768a410f93ee3f84fc19345295ffc352d2c936b424cb37e514714c/markupsafe-3.0.4-cp314-cp314-win_amd64.whl", hash = "sha256:c1bc67752d5f21013cfe430df4062441714eab79f65a6a05e01505957e9c35fe", size = 14501, upload-time = "2026-10-02T23:05:50.788Z" }, + { url = "https://files.pythonhosted.org/packages/5f/cf/3d074a8edffcc6899355232ff2543ae8d929733239596423b7db79698bc9/markupsafe-3.0.4-cp314-cp314-win_arm64.whl", hash = "sha256:7e1636da3d8dfc220b6dd10264db5f2b165e4888c4518594898fbe381049af8a", size = 14364, upload-time = "2026-10-02T23:05:51.857Z" }, + { url = "https://files.pythonhosted.org/packages/d9/31/87ce42159aae2163cf3bbbd0c44bc87780510eecab1ea3859099aed95dcb/markupsafe-3.0.4-cp314-cp314t-macosx_10_15_x86_64.whl", hash = "sha256:805c8b84534fa10891890f0e4be39f3a99e94615d93e8836bf9fa1fdca2feeb2", size = 11759, upload-time = "2026-10-02T23:05:52.951Z" }, + { url = "https://files.pythonhosted.org/packages/5f/53/b047207eeb7752e960aca3eb1df5fb7eefa7dd4c62ac49bb156456c8a702/markupsafe-3.0.4-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:fa95848c929b6a75f6848d3c9793e59db365ee436776e57db835cdbfa79ba977", size = 12096, upload-time = "2026-10-02T23:05:54.066Z" }, + { url = "https://files.pythonhosted.org/packages/ee/51/4326c88a13c7b755657d44b4bb986f8c3d9843ecba7e22d98661d87f9a57/markupsafe-3.0.4-cp314-cp314t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:e916035e3e9930cbdfdd10abf48861340221857f45509565898e012263f7b289", size = 25699, upload-time = "2026-10-02T23:05:55.15Z" }, + { url = "https://files.pythonhosted.org/packages/f2/bb/990581b7474bfcf2cf34bed6ba5ea23bd87adb9d671213d68e88620e7a6b/markupsafe-3.0.4-cp314-cp314t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:b4d12837e0203bbace818ff4a7461afdcd78bcd782351cea148139180d7bcffe", size = 27804, upload-time = "2026-10-02T23:05:56.29Z" }, + { url = "https://files.pythonhosted.org/packages/6b/89/89491878c28e8291f5aa2fffe2c2d57230d10ae366d55dd810b840513d78/markupsafe-3.0.4-cp314-cp314t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:5086f9975abb1ab531ee6afca1761e4b59a19b446f3f6522ed776963228cfe5a", size = 25912, upload-time = "2026-10-02T23:05:57.416Z" }, + { url = "https://files.pythonhosted.org/packages/30/77/680998b54efdea06fc114565cd739b6d059f826a0279219b218dfa750d29/markupsafe-3.0.4-cp314-cp314t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:b4a635a0487774f841cb1fb62e907e7195cc95bc761e053184b8acc3ceb20733", size = 23623, upload-time = "2026-10-02T23:05:58.557Z" }, + { url = "https://files.pythonhosted.org/packages/ae/75/2709f5ac5de9467b40b10e2bb8f89cc63dfb74582e09aa734b1124a217de/markupsafe-3.0.4-cp314-cp314t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:cb96e6e088d6cf71c1ea977510948320234824cf226e32f6f6e044f7a9c82b34", size = 23301, upload-time = "2026-10-02T23:05:59.94Z" }, + { url = "https://files.pythonhosted.org/packages/a0/c8/39eadc6c5b14c9c7679bfb98f4d4c6a97863b5beb91839aca4d2d6e16e55/markupsafe-3.0.4-cp314-cp314t-musllinux_1_2_aarch64.whl", hash = "sha256:8b5d563170ff8ba3181caa967c99a3c804d1dedb702c7cb93a6a7c32247da978", size = 24950, upload-time = "2026-10-02T23:06:01.289Z" }, + { url = "https://files.pythonhosted.org/packages/1a/5e/01037f8a43e8ccb0bffb4fbdc5212db05bf080fdd7286cd392332d58128a/markupsafe-3.0.4-cp314-cp314t-musllinux_1_2_armv7l.whl", hash = "sha256:396ec4e65cc889f69786b3b89478b471cee5a3bcf468b9d9bb03e1a30fb291fc", size = 23330, upload-time = "2026-10-02T23:06:02.441Z" }, + { url = "https://files.pythonhosted.org/packages/d4/f4/23e83ce0596bb0cbe670502d31df8f757bbd01a392aa486fa3b40d1ed399/markupsafe-3.0.4-cp314-cp314t-musllinux_1_2_ppc64le.whl", hash = "sha256:15ba9e28640feef770374b116a6f019c21f52404aeabe516aa7f800587b98cfc", size = 25239, upload-time = "2026-10-02T23:06:03.579Z" }, + { url = "https://files.pythonhosted.org/packages/88/5b/3708897368073cc683d524750474f41a77d2986152c380dcc55b20fdf340/markupsafe-3.0.4-cp314-cp314t-musllinux_1_2_riscv64.whl", hash = "sha256:d920abdfa61279ba1a2ef9484aab07bf03331f8c08a10120fa332353d06e6932", size = 22767, upload-time = "2026-10-02T23:06:04.699Z" }, + { url = "https://files.pythonhosted.org/packages/c6/61/ebda1307864b409e6b3115757a3d4a09cca46cfb6cc65191b5de226b424b/markupsafe-3.0.4-cp314-cp314t-musllinux_1_2_x86_64.whl", hash = "sha256:a9f54054101545a9a9cccefddf54316aa6e4491611fcbef9e91b3b6bebec04f6", size = 23668, upload-time = "2026-10-02T23:06:05.9Z" }, + { url = "https://files.pythonhosted.org/packages/09/15/98075cceac3b5ba0dbb8e4762a847be967d2befc349a2cf2d0ac77f62c9d/markupsafe-3.0.4-cp314-cp314t-win32.whl", hash = "sha256:12a606a492de952afcb43b59a14aaaaad120e708d3663dd0fdf2d738d427a691", size = 14301, upload-time = "2026-10-02T23:06:07.109Z" }, + { url = "https://files.pythonhosted.org/packages/0b/a3/768b560fcc4156685cb563d922b217810cfa7bc135773367f62f1f9d2078/markupsafe-3.0.4-cp314-cp314t-win_amd64.whl", hash = "sha256:a18f38cafc329bac5e3c2b96c765b4c96d3d103421ed22ab7988c1e3fce27464", size = 14526, upload-time = "2026-10-02T23:06:08.276Z" }, + { url = "https://files.pythonhosted.org/packages/93/63/da554b4c97a6b0ea3229ca7fe8cbfb620be81613d517f482e85958550537/markupsafe-3.0.4-cp314-cp314t-win_arm64.whl", hash = "sha256:eba154571c16e032112afac0dc2dfe9e63c2ceb7aedd07bb7eecf2ce26d4dd4c", size = 14421, upload-time = "2026-10-02T23:06:09.402Z" }, + { url = "https://files.pythonhosted.org/packages/a9/30/54d11c8ca027114898cab97421fb39e4ffd9ddf47cdbc44df2ec76722da9/markupsafe-3.0.4-cp315-cp315-android_24_arm64_v8a.whl", hash = "sha256:737c9c3981998eba27f11786f84fddcbabc74068b72a4a1f454ea02094b57b65", size = 12791, upload-time = "2026-10-02T23:06:10.485Z" }, + { url = "https://files.pythonhosted.org/packages/10/6d/97c913e253a14bd3cd0e15a5c56d13203b823fa7ee32498342896a072dc4/markupsafe-3.0.4-cp315-cp315-android_24_x86_64.whl", hash = "sha256:489505b03f692c3f376394e49194fa7a7f9e8558d6e293a7056a0032b0c38163", size = 12527, upload-time = "2026-10-02T23:06:11.834Z" }, + { url = "https://files.pythonhosted.org/packages/26/f9/b86d032042a4d597d9e1997f0e5f63a3eedaf11258e0a05760b0a0a826ea/markupsafe-3.0.4-cp315-cp315-ios_13_0_arm64_iphoneos.whl", hash = "sha256:077293e425f28ec737dbcad442a71752e28f8ae27cde3d68acd1fb212091cd92", size = 11602, upload-time = "2026-10-02T23:06:13.122Z" }, + { url = "https://files.pythonhosted.org/packages/f2/dc/73c14c1eedf0ac5fa3292ba43435e6c49d2c2050f33cebde541f8f4807f1/markupsafe-3.0.4-cp315-cp315-ios_13_0_arm64_iphonesimulator.whl", hash = "sha256:9348cbb300d224fe3b89793262cb093504d4ae927004468463f745188a193e4a", size = 11817, upload-time = "2026-10-02T23:06:14.227Z" }, + { url = "https://files.pythonhosted.org/packages/8f/69/2c2fcaa5fcee22d72c7819c0d536fd181c74a688e6143845419579cd2863/markupsafe-3.0.4-cp315-cp315-ios_13_0_x86_64_iphonesimulator.whl", hash = "sha256:b807e598953730f82e4eae3bd30f6a122cf6b31c398c6b504c0e04c13c170429", size = 11446, upload-time = "2026-10-02T23:06:15.574Z" }, + { url = "https://files.pythonhosted.org/packages/88/54/9e5ec76c62e6e2834d5a93623018c943e8b3bb41d663e3fd4c03303b9b85/markupsafe-3.0.4-cp315-cp315-macosx_10_15_x86_64.whl", hash = "sha256:799c39bdf5e2f1292fedd3009f7b3c9e760f10b2420cb9638d56920840ff6db8", size = 11719, upload-time = "2026-10-02T23:06:16.701Z" }, + { url = "https://files.pythonhosted.org/packages/96/24/3ec292b44064c16229e064d770b2625bd8ea941aa61f44905a9fa44942c0/markupsafe-3.0.4-cp315-cp315-macosx_11_0_arm64.whl", hash = "sha256:ae9dcb8fbe244cb82f8a6458b455b927a03685e383d9bacf1ea5ce180b96dc97", size = 12075, upload-time = "2026-10-02T23:06:17.855Z" }, + { url = "https://files.pythonhosted.org/packages/aa/85/b64fdb1f304848518742136983c24e96d967bfb59a0ea160e92736901ab0/markupsafe-3.0.4-cp315-cp315-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:4bced6e2a6dba6a28f7dd3c6ce14df1b2dd495923f16ea484cad03decd463b2b", size = 24656, upload-time = "2026-10-02T23:06:18.963Z" }, + { url = "https://files.pythonhosted.org/packages/9c/18/23997d4c65b355da6390d61cd56e0ab3befd6ba8dda25cb40c602bd0fa6b/markupsafe-3.0.4-cp315-cp315-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:3882fb412298575bae3b9c46868251f15cc69307359f87bb1b382e53d6e5a2c9", size = 27737, upload-time = "2026-10-02T23:06:20.117Z" }, + { url = "https://files.pythonhosted.org/packages/d4/36/35998dead3c6af88c38265a56e58100211f036234ab88eb2283fd4cbce44/markupsafe-3.0.4-cp315-cp315-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:04e7902ba80ee4bac1d50a549606527a1dcf0476cd81403db41099d3b60ec653", size = 25003, upload-time = "2026-10-02T23:06:21.284Z" }, + { url = "https://files.pythonhosted.org/packages/82/96/ef49135ce260db4ca4a12b119ed468449cd248db6b1468e2112b546d7a2e/markupsafe-3.0.4-cp315-cp315-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:925f929d6b59a8b3f8b8c6ac363cd0af7eecc81efb3071770b3c6717c450a369", size = 23111, upload-time = "2026-10-02T23:06:22.524Z" }, + { url = "https://files.pythonhosted.org/packages/50/7d/83126e338bd88c17a220668235368ad719fd4638e426739858cbb8508f77/markupsafe-3.0.4-cp315-cp315-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f68edfc67aabac33708941f26f22a7b8e9f81429bc0cf249fcf7d66b23af8d19", size = 22403, upload-time = "2026-10-02T23:06:23.785Z" }, + { url = "https://files.pythonhosted.org/packages/83/dd/daf7e420de23c8206c365204e7b85e1251d8e19d34196a56336f316e5ed2/markupsafe-3.0.4-cp315-cp315-musllinux_1_2_aarch64.whl", hash = "sha256:e5c802729725bd07e2bc3ab7b76dc7e0bbfc53129d8f1eb1c002c24cf774717e", size = 24083, upload-time = "2026-10-02T23:06:25.037Z" }, + { url = "https://files.pythonhosted.org/packages/19/3c/11eecdc06bc44ad5570350085b572ebf049e8f9a38d1ece6d76640b739cd/markupsafe-3.0.4-cp315-cp315-musllinux_1_2_armv7l.whl", hash = "sha256:55ffd6ce583d97dc71dc92e930324c8c0d25aea7e3ade6ae54ef77cedb096811", size = 22931, upload-time = "2026-10-02T23:06:26.328Z" }, + { url = "https://files.pythonhosted.org/packages/0d/9e/ac0fd77f2a726e56ecc3ca0235d095feace1358d1b822406c2a2ef26a4dc/markupsafe-3.0.4-cp315-cp315-musllinux_1_2_ppc64le.whl", hash = "sha256:2cb3dd71fc6be918ad4264346a8ed69485f9b7ed7bf35495d8e22807cd6b8bea", size = 24299, upload-time = "2026-10-02T23:06:27.742Z" }, + { url = "https://files.pythonhosted.org/packages/d7/09/c6bd842ad58ff5b3bc76eeed7e9a42a6f11adc5d090ec697b72c9672731e/markupsafe-3.0.4-cp315-cp315-musllinux_1_2_riscv64.whl", hash = "sha256:94f5407f7bc64fa6463906b896f9904beeeb7dd8dc116ee8e9056c8714ff9916", size = 21948, upload-time = "2026-10-02T23:06:29.274Z" }, + { url = "https://files.pythonhosted.org/packages/a3/46/82f586711fed61e86faa1ee1bc317d68cd45a10c8bdbe3f7d1fdf9026ad8/markupsafe-3.0.4-cp315-cp315-musllinux_1_2_x86_64.whl", hash = "sha256:2dad610540cb2e6272855c178f08ae9a1c7ac258a7fb71660553a5f104b42741", size = 23150, upload-time = "2026-10-02T23:06:30.583Z" }, + { url = "https://files.pythonhosted.org/packages/19/2d/2dfdce99318abbfa26925195fbc17db188c46a1ec6457be121b6f9cfeb42/markupsafe-3.0.4-cp315-cp315-win32.whl", hash = "sha256:03470d1a8268e692ecf79ecd565593e59d44219377a7ead61f1f1b94c1f7ff6b", size = 14269, upload-time = "2026-10-02T23:06:31.949Z" }, + { url = "https://files.pythonhosted.org/packages/5b/ec/6000fd82e8791e58fcd0456ec20f098957e2b03d5ed02eb73241a577c0ba/markupsafe-3.0.4-cp315-cp315-win_amd64.whl", hash = "sha256:d882a373d8093c2941e01291b7ced96e9cbe4781da9a7751ca7e6c70385e5214", size = 14496, upload-time = "2026-10-02T23:06:33.258Z" }, + { url = "https://files.pythonhosted.org/packages/bc/66/e73bd5016421d5d6e2fb6de7dd609f9de020942ac8c626526bd8c6eeaf82/markupsafe-3.0.4-cp315-cp315-win_arm64.whl", hash = "sha256:353bd63081912ab8cfa6a0c7d185934cdf8426f04c618bba6bc4b394f2069b67", size = 14361, upload-time = "2026-10-02T23:06:34.539Z" }, + { url = "https://files.pythonhosted.org/packages/90/df/cb8c3dc98d313a951df2f8968f44e4cb5643df6d3cab749a530ce2f7d972/markupsafe-3.0.4-cp315-cp315t-macosx_10_15_x86_64.whl", hash = "sha256:c61750fadcd119d0825bcb7d7d675dd264dcc89cc05292aab5be68ebdbb374ad", size = 11760, upload-time = "2026-10-02T23:06:35.807Z" }, + { url = "https://files.pythonhosted.org/packages/d6/bb/4af9b3ca0753d654ac75f9531d5bd741bb77ca6e696f36807c475ffc099a/markupsafe-3.0.4-cp315-cp315t-macosx_11_0_arm64.whl", hash = "sha256:1c0df495a977d10460a94941799c72d5b5ab03d3858d949b55b5a66c8f371c99", size = 12108, upload-time = "2026-10-02T23:06:37.089Z" }, + { url = "https://files.pythonhosted.org/packages/3f/d4/b56429313aee5fd59b079c3df5615299959e25e7113eb6d8caadbdd7d38a/markupsafe-3.0.4-cp315-cp315t-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl", hash = "sha256:02fa4acbc6a3fc5c693c34d4dd8c1130b7fe99cc915181b0ddd6f72aeb296002", size = 25762, upload-time = "2026-10-02T23:06:38.419Z" }, + { url = "https://files.pythonhosted.org/packages/65/f5/34c181e891aa4f7d59c918584672e0c5eb7fffe76c1387d1246008bf4081/markupsafe-3.0.4-cp315-cp315t-manylinux2014_armv7l.manylinux_2_17_armv7l.manylinux_2_31_armv7l.whl", hash = "sha256:05295589e619b9bed252a86b532b8e27350abc372d18ba89b59375325e91ec1e", size = 28400, upload-time = "2026-10-02T23:06:39.819Z" }, + { url = "https://files.pythonhosted.org/packages/ce/b5/ad14694fd0ac9a5ce30bc6498f2999378f418583dd1679cca5a1b512957e/markupsafe-3.0.4-cp315-cp315t-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl", hash = "sha256:be6cb0c799abb0e2ba3e618e6d28ddddf7e485f6c2ce938dfa237daf3905072c", size = 25946, upload-time = "2026-10-02T23:06:41.381Z" }, + { url = "https://files.pythonhosted.org/packages/d6/a8/26b606445387d0ceb1eb1f21840094b84e4e3c3c3983d80d10b89823b490/markupsafe-3.0.4-cp315-cp315t-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl", hash = "sha256:26e9867520db70d37f7fb421a7f0d8adb40171011fb84ce869afa1a83370dfa8", size = 23634, upload-time = "2026-10-02T23:06:42.748Z" }, + { url = "https://files.pythonhosted.org/packages/39/a2/b8814de672f1f0094d498bf646f2fec9d6356b503d28ef500b71c5095377/markupsafe-3.0.4-cp315-cp315t-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl", hash = "sha256:f03460ff076f70ab595bb45a0205ccea1971443575b6920c52e755dec2b3fbfe", size = 23488, upload-time = "2026-10-02T23:06:44.176Z" }, + { url = "https://files.pythonhosted.org/packages/db/c7/287223376fb73335a3cc5d6eb22c6ab01358cf33945a9c39c06b9dac3f4b/markupsafe-3.0.4-cp315-cp315t-musllinux_1_2_aarch64.whl", hash = "sha256:436e3ffc6310d3c41878c601db29098102fe5d8a467c49da4a4125254e0980f2", size = 25037, upload-time = "2026-10-02T23:06:45.646Z" }, + { url = "https://files.pythonhosted.org/packages/f9/29/4df8355e313426d19e62ba33e0253c009ca12a0894ee77d67fa67255361c/markupsafe-3.0.4-cp315-cp315t-musllinux_1_2_armv7l.whl", hash = "sha256:4e2c4809c14559aa7ef426f27fb35afbb38104c349a903bf8f3600456764bb38", size = 23543, upload-time = "2026-10-02T23:06:47.264Z" }, + { url = "https://files.pythonhosted.org/packages/71/e5/8377731e8495668dcc768f645e717df18318c841edaf023a99395f6da9b4/markupsafe-3.0.4-cp315-cp315t-musllinux_1_2_ppc64le.whl", hash = "sha256:da2af0d7aebfc2074080d72efa6ab8317c62481ef1f896f65d9999c1c01f4494", size = 25282, upload-time = "2026-10-02T23:06:48.795Z" }, + { url = "https://files.pythonhosted.org/packages/ed/5f/373456e37ceb1478d657d6fe769cbe0a39f0a8dfc1548eeb19c471eefdd9/markupsafe-3.0.4-cp315-cp315t-musllinux_1_2_riscv64.whl", hash = "sha256:aa2c838cc024642cc04c6854232f32b43e5e22833dd11119c1766c7873b8370d", size = 22993, upload-time = "2026-10-02T23:06:50.31Z" }, + { url = "https://files.pythonhosted.org/packages/d7/93/2cbd5628435afb6f541bbaced4bce0c2edac4b09a142e6e928b8b0da9858/markupsafe-3.0.4-cp315-cp315t-musllinux_1_2_x86_64.whl", hash = "sha256:b91cc9d336957239ff200f30097e6fea2dc6d6fb3c81e853eaa09eac904fd894", size = 23712, upload-time = "2026-10-02T23:06:51.759Z" }, + { url = "https://files.pythonhosted.org/packages/81/99/157e10966b033b363aeda5263e82596ee232a0b1d082fdbf90aa417ff083/markupsafe-3.0.4-cp315-cp315t-win32.whl", hash = "sha256:e49fb0d1ce92cfa0cb198cc5b1b11cdf9d0638658e2a2db2687e39db7c87fc78", size = 14300, upload-time = "2026-10-02T23:06:53.241Z" }, + { url = "https://files.pythonhosted.org/packages/33/05/55884815414c9706a23deca150b72c25a62109e65b0b6ce232077802c719/markupsafe-3.0.4-cp315-cp315t-win_amd64.whl", hash = "sha256:4f6e0852a0283b1b1fd776eeb7b766a5f440b3e2bd31ab51af3b400585f3965c", size = 14522, upload-time = "2026-10-02T23:06:54.729Z" }, + { url = "https://files.pythonhosted.org/packages/92/f9/ecbde7149e95b8a0f18e16d5d747f7dc06049d5da2e4f77f6f5e4a1f46a8/markupsafe-3.0.4-cp315-cp315t-win_arm64.whl", hash = "sha256:39dbacefc411633db5b4378b066a9aca70a3d7e2922c9e578d825f844026eeba", size = 14417, upload-time = "2026-10-02T23:06:56.246Z" }, +] + +[[package]] +name = "mdurl" +version = "0.1.2" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/d6/54/cfe61301667036ec958cb99bd3efefba235e65cdeb9c84d24a8293ba1d90/mdurl-0.1.2.tar.gz", hash = "sha256:bb413d29f5eea38f31dd4754dd7377d4465116fb207585f97bf925588687c1ba", size = 8729, upload-time = "2022-08-14T12:40:10.846Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b3/38/89ba8ad64ae25be8de66a6d463314cf1eb366222074cfda9ee839c56a4b4/mdurl-0.1.2-py3-none-any.whl", hash = "sha256:84008a41e51615a49fc9966191ff91509e3c40b939176e643fd50a5c2196b8f8", size = 9979, upload-time = "2022-08-14T12:40:09.779Z" }, +] + +[[package]] +name = "openapi-python-client" +version = "0.29.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "attrs", marker = "python_full_version >= '3.11'" }, + { name = "colorama", marker = "python_full_version >= '3.11' and sys_platform == 'win32'" }, + { name = "httpx", marker = "python_full_version >= '3.11'" }, + { name = "jinja2", marker = "python_full_version >= '3.11'" }, + { name = "pydantic", marker = "python_full_version >= '3.11'" }, + { name = "ruamel-yaml", marker = "python_full_version >= '3.11'" }, + { name = "ruff", marker = "python_full_version >= '3.11'" }, + { name = "shellingham", marker = "python_full_version >= '3.11'" }, + { name = "typer", marker = "python_full_version >= '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/63/f6/67dfe73b5073251b6e2aba3d67191819798dd33dd09fcb2d12242662a960/openapi_python_client-0.29.0.tar.gz", hash = "sha256:4ff439a63765aaef548e69c4eedd86dfad57891dc322709450af0c2c9a72a23e", size = 125697, upload-time = "2026-05-30T20:32:10.533Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/fb/d1/7391a205622c40b8e9d1b79b892b4944d6e3637674b47a56196e2c96c5d1/openapi_python_client-0.29.0-py3-none-any.whl", hash = "sha256:1085864c1e0a42fb50e1f5eb84363b19de07ebfb8a3f82a146c8529b948b8f12", size = 182954, upload-time = "2026-05-30T20:32:09.037Z" }, +] + +[[package]] +name = "pydantic" +version = "2.13.5" source = { registry = "https://pypi.org/simple" } dependencies = [ - { name = "zipp" }, + { name = "annotated-types", marker = "python_full_version >= '3.11'" }, + { name = "pydantic-core", marker = "python_full_version >= '3.11'" }, + { name = "typing-extensions", marker = "python_full_version >= '3.11'" }, + { name = "typing-inspection", marker = "python_full_version >= '3.11'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/76/66/650a33bd90f786193e4de4b3ad86ea60b53c89b669a5c7be931fac31cdb0/importlib_metadata-8.7.0.tar.gz", hash = "sha256:d13b81ad223b890aa16c5471f2ac3056cf76c5f10f82d6f9292f0b415f389000", size = 56641, upload-time = "2025-04-27T15:29:01.736Z" } +sdist = { url = "https://files.pythonhosted.org/packages/53/ef/fc4f868f4e2cee79f863883abffceff107875f569b848507319842d2a681/pydantic-2.13.5.tar.gz", hash = "sha256:51a9c5f7b2f8e636f04c6cada605d9b6a3bf1348fdf945a3d8869b19bba0ee08", size = 845750, upload-time = "2026-08-28T14:04:00.916Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/20/b0/36bd937216ec521246249be3bf9855081de4c5e06a0c9b4219dbeda50373/importlib_metadata-8.7.0-py3-none-any.whl", hash = "sha256:e5dd1551894c77868a30651cef00984d50e1002d06942a7101d34870c5f02afd", size = 27656, upload-time = "2025-04-27T15:29:00.214Z" }, + { url = "https://files.pythonhosted.org/packages/eb/47/c95ffc2009878c7aac0c5e08528022dcb885933252a88b5f170058014464/pydantic-2.13.5-py3-none-any.whl", hash = "sha256:346a034f080da3755d8e9cb5e00e8b07de1d39e4f6e2c87d8ab7cafa0b269a73", size = 472589, upload-time = "2026-08-28T14:03:59.136Z" }, ] [[package]] -name = "packaging" -version = "25.0" +name = "pydantic-core" +version = "2.46.5" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/a1/d4/1fc4078c65507b51b96ca8f8c3ba19e6a61c8253c72794544580a7b6c24d/packaging-25.0.tar.gz", hash = "sha256:d443872c98d677bf60f6a1f2f8c1cb748e8fe762d2bf9d3148b5599295b0fc4f", size = 165727, upload-time = "2025-04-19T11:48:59.673Z" } +dependencies = [ + { name = "typing-extensions", marker = "python_full_version >= '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/af/f9/8a06bea35ef8daf588f707784c973a7046e0034c8d8cfb08828eeffb8b75/pydantic_core-2.46.5.tar.gz", hash = "sha256:10416c15b8839ecc4ef4d0885da76da6fd0f67333a0eb8aff6d93c4b8f2910fc", size = 472262, upload-time = "2026-08-28T10:01:31.677Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/20/12/38679034af332785aac8774540895e234f4d07f7545804097de4b666afd8/packaging-25.0-py3-none-any.whl", hash = "sha256:29572ef2b1f17581046b3a2227d5c611fb25ec70ca1ba8554b24b0e69331a484", size = 66469, upload-time = "2025-04-19T11:48:57.875Z" }, + { url = "https://files.pythonhosted.org/packages/74/6b/8f79692844269427abb3e4dd9e68edfcbe65ae25527d99183214de716c59/pydantic_core-2.46.5-cp310-cp310-macosx_10_12_x86_64.whl", hash = "sha256:657b40d6240c0a7b6a64b30f22d1e3aa631c7e846c621b0c0f6d1d75e2e15ea6", size = 2076533, upload-time = "2026-08-28T09:57:35.421Z" }, + { url = "https://files.pythonhosted.org/packages/bd/d0/c787604c71c2bdcda1a5656942fc822cd0f9cd879b9484bb84fc42172703/pydantic_core-2.46.5-cp310-cp310-macosx_11_0_arm64.whl", hash = "sha256:ecb42011e12ee19cafbc312887cbf3546959fe02fbad44f272d4be5baa997615", size = 1924650, upload-time = "2026-08-28T09:57:37.944Z" }, + { url = "https://files.pythonhosted.org/packages/4a/77/ca2f8e997d9bfdb32205297aff38f210f398822d895b1af1b59fd9df9c13/pydantic_core-2.46.5-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4dedce55295becb61921e386b99d4f2706045306e7fa52249a33004c837379fb", size = 1951261, upload-time = "2026-08-28T09:57:39.339Z" }, + { url = "https://files.pythonhosted.org/packages/a0/53/bd12e1a9255df4edee00353778e2614b5346265d51e1567ab72153e803a2/pydantic_core-2.46.5-cp310-cp310-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:9f47b8a949e60f027f0aa0a6f6c7b7e9c55cbf4380d10b344e282fa4e7ab1e1b", size = 2021808, upload-time = "2026-08-28T09:57:40.69Z" }, + { url = "https://files.pythonhosted.org/packages/d7/41/f7f312751ebc6d6767da91964a9c7954c18e226a1720ab234e3dfb9d6c17/pydantic_core-2.46.5-cp310-cp310-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:200aa3dc9f8d54f0754f43247c0bad0999fdcfbfd2488384dd44f37279271fe6", size = 2196184, upload-time = "2026-08-28T09:57:42.275Z" }, + { url = "https://files.pythonhosted.org/packages/3d/93/ce93aa030ab6bac4683ba8861e7baad89dd24b02e66b8801a0e4f6a00311/pydantic_core-2.46.5-cp310-cp310-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:6d30e1a4f138b8951063e9a394752a9179b51da288ffa507b1e659222f4c1793", size = 2238212, upload-time = "2026-08-28T09:57:44.122Z" }, + { url = "https://files.pythonhosted.org/packages/34/a1/c8e6b66f499f510752c07a092dfe27621f9c255635e59d38704b5681c35a/pydantic_core-2.46.5-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:850a08d167dde16db8702c274f320c7be9d7da6f6dff2b58b18f9e815bd94f5b", size = 2064073, upload-time = "2026-08-28T09:57:45.613Z" }, + { url = "https://files.pythonhosted.org/packages/5c/fa/605e2b127ee30dbf4b1da9da4843587cf2b2d16486c241cc7a5be2d2c1bd/pydantic_core-2.46.5-cp310-cp310-manylinux_2_31_riscv64.whl", hash = "sha256:c3471e5c4a949c26ec00a77f01df59096aa9495877de76fd60a980f8ee6be461", size = 2093102, upload-time = "2026-08-28T09:57:46.953Z" }, + { url = "https://files.pythonhosted.org/packages/4a/f7/1ab28093c09032ddce7c92c7a55d503b6ecd70f42c32492946c1cb5477b1/pydantic_core-2.46.5-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:3a3e26b6a8274211bddee2d0e4d0d42778f17a34510f49d2ec44b58abfc41736", size = 2133452, upload-time = "2026-08-28T09:57:48.362Z" }, + { url = "https://files.pythonhosted.org/packages/30/c8/47c79b756f12f85e8b0fbdb2b495f6b6eb32e6c98a4beae7a570a0b7c63c/pydantic_core-2.46.5-cp310-cp310-musllinux_1_1_aarch64.whl", hash = "sha256:fc5d783bd4a2387e97b8a2d5ec781cfb92b3d893bf82370548e99db5915935d3", size = 2146477, upload-time = "2026-08-28T09:57:49.74Z" }, + { url = "https://files.pythonhosted.org/packages/13/5c/79fc00cb8f651d6061991de8d7cedf1c78c73cbd4862c42ef418f03b8bfa/pydantic_core-2.46.5-cp310-cp310-musllinux_1_1_armv7l.whl", hash = "sha256:356c8368cbc321050b169595683a2e1d63413b1e0e2868b330af9fc14c616d3f", size = 2300832, upload-time = "2026-08-28T09:57:51.639Z" }, + { url = "https://files.pythonhosted.org/packages/b4/72/dd1a29853cf6d22a1ebd9e3baf0239cbc57d2d16caff36a89e38eb9b1db3/pydantic_core-2.46.5-cp310-cp310-musllinux_1_1_x86_64.whl", hash = "sha256:eb7d8d0e5886a89a55d2eef490e272fa965a9d57c6b29a5b5088a7997ec2cad1", size = 2320505, upload-time = "2026-08-28T09:57:53.236Z" }, + { url = "https://files.pythonhosted.org/packages/ec/d1/ba4a8e06a9ddad0b4caf69cfaeecc0fbfcec20473bd808f5127fd16491c4/pydantic_core-2.46.5-cp310-cp310-win32.whl", hash = "sha256:4d44cf99ddebf875f9b68cc267aa684c99b7b44fe63ee1cac4ec163807290069", size = 1956853, upload-time = "2026-08-28T09:57:54.592Z" }, + { url = "https://files.pythonhosted.org/packages/f2/94/205ed9d7ddaf44acd489889708ea124a3f41bdb42c141c8684d528ad0e7a/pydantic_core-2.46.5-cp310-cp310-win_amd64.whl", hash = "sha256:1e5aad1220a1192c42341c8fd4a8686657e73ab2a920c970bdc4de334fe3193d", size = 2042551, upload-time = "2026-08-28T09:57:56.017Z" }, + { url = "https://files.pythonhosted.org/packages/a2/b6/81d2d19ea0be2c03664381b59f65fa72fc7969decedae00bc2c4ad835708/pydantic_core-2.46.5-cp311-cp311-macosx_10_12_x86_64.whl", hash = "sha256:a1dee1b804ff4d11c663636cf15d2ea47e9f79cd56c033fb1cbf08924842a48f", size = 2074737, upload-time = "2026-08-28T09:57:57.711Z" }, + { url = "https://files.pythonhosted.org/packages/0c/18/b70da8300e292df4099684ea11b1958043580d2f50d2dc8bf7e542bdd84a/pydantic_core-2.46.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:d625a186a65201c23a9e3b8ed9c47e90a026e03256608cc91851c6709096844f", size = 1921751, upload-time = "2026-08-28T09:57:59.265Z" }, + { url = "https://files.pythonhosted.org/packages/e7/1a/0d590341b6ffa4b4aca83508e6b8db4761aaeacfc15a25ca3815876d4797/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f8507560a9284e1370bb048ed4282012fbef4e8d109875b95e884d228552061", size = 1948231, upload-time = "2026-08-28T09:58:00.678Z" }, + { url = "https://files.pythonhosted.org/packages/7d/1d/02eb35761c51f2f7b1b042d6ab4cda6600f0c8c88a2243b3f734376201e5/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:5f93c5fe914d75fbec9a49209b00da5f08e9e467d69da2b1510c81940cfd10be", size = 2020708, upload-time = "2026-08-28T09:58:02.267Z" }, + { url = "https://files.pythonhosted.org/packages/4a/ea/f86073830e35d508cc8ddf9c3d9e6e6840fcb88d34bf726b0b4710186f27/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:aca6c767f552b21b10f774aeac128e828eafb796adfa1b666a18bf6321453c3a", size = 2194914, upload-time = "2026-08-28T09:58:03.934Z" }, + { url = "https://files.pythonhosted.org/packages/bb/d7/fc36240d7791ce90939e51608568c33bfdae26202016f9770c229a487d86/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:701b2e04b560eeb4bddf7a25ab8ca476176e34fdbd9a0e18196f0d12d4685f0b", size = 2235622, upload-time = "2026-08-28T09:58:05.516Z" }, + { url = "https://files.pythonhosted.org/packages/cf/bc/3fa2d76b83162820a17da7f645b28d1cba99fc8e1e5fc6517067ec450fa1/pydantic_core-2.46.5-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:49776eab08766a08dfff7012f8b422dcd7e25e43b316eedf0477c24fcfa84b7c", size = 2062091, upload-time = "2026-08-28T09:58:07.135Z" }, + { url = "https://files.pythonhosted.org/packages/ab/9a/095d557bb492c90cd8a70a6dd048bf793d433d03d86c81c11e912e4cd049/pydantic_core-2.46.5-cp311-cp311-manylinux_2_31_riscv64.whl", hash = "sha256:a2468d93d181667a7abd66e1b64bb9f76f361b0fef8faddf687456453576f5ee", size = 2089904, upload-time = "2026-08-28T09:58:08.814Z" }, + { url = "https://files.pythonhosted.org/packages/24/98/7b76b1ad10a19a617a52aaa1d80e159115af939b095e86f8e756fd52e0df/pydantic_core-2.46.5-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:53feb344243bb9510a9dec7bf3cf1b64d88a98af5dc7872a5160465f8b198c8e", size = 2132244, upload-time = "2026-08-28T09:58:10.435Z" }, + { url = "https://files.pythonhosted.org/packages/20/32/7d6ca365fadba186a0c8f85de1a701663bce81efd309d9479be58687622f/pydantic_core-2.46.5-cp311-cp311-musllinux_1_1_aarch64.whl", hash = "sha256:cd5214352ae68f3b5e9af7768bdc5253695ee069675db3480518420b3be881f2", size = 2143901, upload-time = "2026-08-28T09:58:12.033Z" }, + { url = "https://files.pythonhosted.org/packages/f8/09/eb9a6aa57f22fd1541a9c0aa2a1f3aeef3ec65347d33e10a6da2f43e0ee9/pydantic_core-2.46.5-cp311-cp311-musllinux_1_1_armv7l.whl", hash = "sha256:9432f3598db432cb51c5b37fdbf29a60fcccc79e30d37a05022776a6bc4ab689", size = 2299425, upload-time = "2026-08-28T09:58:13.614Z" }, + { url = "https://files.pythonhosted.org/packages/8a/f9/548a5bb9d4ba8cd26e26daf48052236f6b38bb61e7b7241fbc3c995719eb/pydantic_core-2.46.5-cp311-cp311-musllinux_1_1_x86_64.whl", hash = "sha256:8feeac04b5794e513e710af2f9c87d49f31a6dc47967bb264a1fed61a8989bec", size = 2318566, upload-time = "2026-08-28T09:58:15.199Z" }, + { url = "https://files.pythonhosted.org/packages/4a/20/06454d18834c02c406c9133f1a3b485305fd9ee984f9636c2f730bef6a9d/pydantic_core-2.46.5-cp311-cp311-win32.whl", hash = "sha256:892a881d5f68c2b9ea304b7a6c2c60d9343df578a311b0f86b94bc8f1ffe8129", size = 1954258, upload-time = "2026-08-28T09:58:16.813Z" }, + { url = "https://files.pythonhosted.org/packages/9e/c2/718b9deb4b72453b5d8c7447a3b14cb77bef36917ef5f514e0948a4096a0/pydantic_core-2.46.5-cp311-cp311-win_amd64.whl", hash = "sha256:40375c2d05acec10323e45dfe2077ac44bc74659008614af5069034e2cfc781c", size = 2041030, upload-time = "2026-08-28T09:58:18.288Z" }, + { url = "https://files.pythonhosted.org/packages/67/ea/c1d1a5b72d6e1ff7f377a4d9199f6591f095beb5b409a8a5d89f7238d939/pydantic_core-2.46.5-cp311-cp311-win_arm64.whl", hash = "sha256:28a6a556cd3b6066bea827857f9d9cce027c96f776e512f544a581f9e42161f8", size = 2009234, upload-time = "2026-08-28T09:58:19.929Z" }, + { url = "https://files.pythonhosted.org/packages/82/3f/76358795aa7a8c6d4f36e2cb828ad1c90ee118e1393a9281664f5aade9d4/pydantic_core-2.46.5-cp312-cp312-macosx_10_12_x86_64.whl", hash = "sha256:b9fe6fb92520e3fd61f2e49000b6911b188824f089b75973ea06d6267f0b476d", size = 2076516, upload-time = "2026-08-28T09:58:21.576Z" }, + { url = "https://files.pythonhosted.org/packages/db/50/26b091836076ce4cb2fac264186936acc069e0595772cfd02a563bc4761a/pydantic_core-2.46.5-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:a39ac25a9a2fa4072efdb429833c4a4c8009a51ff9eea3eeae131713cd27991e", size = 1922874, upload-time = "2026-08-28T09:58:23.766Z" }, + { url = "https://files.pythonhosted.org/packages/09/f0/2a8ce3849e299d44e2d2c196b6082643a3235565a735cb51db7a6261f614/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4fdc8b93a41521988916eeaa271173fcca7fa0803d62f87675aac8dcec1c8e29", size = 1951772, upload-time = "2026-08-28T09:58:25.435Z" }, + { url = "https://files.pythonhosted.org/packages/87/46/ac0dc8bdd9e6048183a14eb127764e7ad9240021c17513074a4711b0e31e/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:b98134087d9de723658d17a42c7d0da8d6e2ef08015dee7dc93889047315f5e4", size = 2031832, upload-time = "2026-08-28T09:58:27.102Z" }, + { url = "https://files.pythonhosted.org/packages/c4/c2/339de5bef7be36301a2231eaa52e62163742c2281f11b5f4892bc79785cd/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:e652ab17569c94bff5475520f907b7148b8c24036a8ebbe5cf7cf7493d28579a", size = 2208645, upload-time = "2026-08-28T09:58:28.948Z" }, + { url = "https://files.pythonhosted.org/packages/7b/a0/9ff22b797724262da14427abaed4dd1d864a139693fc5e7809114376a716/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d925f3d9afd05a8c0fb3a1031463a8d59ebe5e2afad297e29c78be19e13b4e62", size = 2265935, upload-time = "2026-08-28T09:58:30.625Z" }, + { url = "https://files.pythonhosted.org/packages/c0/a4/eb9409ec0736e50aa70a412f16c204ed149516846912f7e6724d4c73ee53/pydantic_core-2.46.5-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0fc5be0abd4a407e200d844b404e33639a554e7bd0d448e7b9ae181be4789ac2", size = 2066284, upload-time = "2026-08-28T09:58:32.289Z" }, + { url = "https://files.pythonhosted.org/packages/c0/02/7f6156ffc926857f1c37c07d9a388682865a81830ab6a1b637082c25e399/pydantic_core-2.46.5-cp312-cp312-manylinux_2_31_riscv64.whl", hash = "sha256:816ff0a6550ffc06c098ccd2e0698600f9aa7da192a79eaa6f9af504a35db869", size = 2105889, upload-time = "2026-08-28T09:58:33.986Z" }, + { url = "https://files.pythonhosted.org/packages/92/b1/e781d357ebe09fc929f995700f1b3503e8897f1cece183ecb1300d4d67e9/pydantic_core-2.46.5-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:c7ea57fc63aa7da93a1bd2d644e6577befae10c52c4e36377635eea1056a74f5", size = 2158006, upload-time = "2026-08-28T09:58:35.647Z" }, + { url = "https://files.pythonhosted.org/packages/70/0a/644597d84ab400e50609c192120b85c9681c22d3a20461b9060a79be0a7a/pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_aarch64.whl", hash = "sha256:efd62a42486f1bda5d24cb4f63d15a3c7768375fe83d36f9417b4ad7a2fb20b3", size = 2158408, upload-time = "2026-08-28T09:58:37.38Z" }, + { url = "https://files.pythonhosted.org/packages/1e/ee/ca3b7b3a4b3769ffe9ce9432a7c9be755de9593a46d3b0d54d0409323e44/pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_armv7l.whl", hash = "sha256:2bc9419666990c06d7397831f2126a1ecc3594aaa3ff7de5bf2d066802f4e07b", size = 2309609, upload-time = "2026-08-28T09:58:39.22Z" }, + { url = "https://files.pythonhosted.org/packages/ce/52/39fa1f451486019524ca685020390e7ca351832fd874530ba30c8628e6dc/pydantic_core-2.46.5-cp312-cp312-musllinux_1_1_x86_64.whl", hash = "sha256:18a09e1e1011b462f2e32774f25859ef1223d5c2b0546a633cf56654710721e0", size = 2342618, upload-time = "2026-08-28T09:58:40.89Z" }, + { url = "https://files.pythonhosted.org/packages/81/5e/468fc630568c61dcef3cd47ad32ffbeed9af643f49208d1ea86ab4f890c4/pydantic_core-2.46.5-cp312-cp312-win32.whl", hash = "sha256:5cb482e9e84c851f4e623fe4acc1ced89168cf1fe18f7089db4548c8f5bbb65b", size = 1939475, upload-time = "2026-08-28T09:58:42.591Z" }, + { url = "https://files.pythonhosted.org/packages/cf/c9/4c19f41b84cf6b622a72fbeed7665b25d47a187d68d47d0d430c07f23268/pydantic_core-2.46.5-cp312-cp312-win_amd64.whl", hash = "sha256:5e81740c09e310f5aa5cbd3e434a01c154d4bef93241c7877b39f211d2b78ba8", size = 2043140, upload-time = "2026-08-28T09:58:44.272Z" }, + { url = "https://files.pythonhosted.org/packages/af/dd/0c1a050299147c746e5256db16d645ab5efd4f78c59937d581a0524e74a2/pydantic_core-2.46.5-cp312-cp312-win_arm64.whl", hash = "sha256:f7b0ec93a2893de856652154d73b7ba622f26fa97726487dcac373de5f4c6084", size = 1997729, upload-time = "2026-08-28T09:58:46.13Z" }, + { url = "https://files.pythonhosted.org/packages/f5/37/5abe39a8372a61d3dc3c1338fc504281c01b32fdb3169cd7187153b56d3e/pydantic_core-2.46.5-cp313-cp313-macosx_10_12_x86_64.whl", hash = "sha256:b7ca9034437b6022f941f4857459562ee00a560b97e7cce8a0ec5a74fc6766e0", size = 2075885, upload-time = "2026-08-28T09:58:47.856Z" }, + { url = "https://files.pythonhosted.org/packages/21/43/6323b1f8b217780454c61304bcd2b38ae4762f50754414124603ccc90bb2/pydantic_core-2.46.5-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:f332f0e72a5a0400141f830744e141bf9f97917878dbe968669e8a7fefea78ff", size = 1922768, upload-time = "2026-08-28T09:58:49.58Z" }, + { url = "https://files.pythonhosted.org/packages/0f/a3/c05ca796e1197618a774b01e596aeedfefc2f7d8c01ae3054e910b120e8a/pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:193375f3548919d3f0b60936ca113ada3e38f264f91b9b8e0508efaad57be931", size = 1951241, upload-time = "2026-08-28T09:58:51.511Z" }, + { url = "https://files.pythonhosted.org/packages/68/32/33bc39ac705c52cffc908e8389f9754fdb208aea5c69cceddf4eb3ce99af/pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:79bdfa52f843137045b2d081cc05c120ba6665d29b7559c2c47690906f39279f", size = 2031975, upload-time = "2026-08-28T09:58:53.166Z" }, + { url = "https://files.pythonhosted.org/packages/b0/70/2333e885c0f6a67bc105c5916965dac9b57f2718ee20d81d1a06a4ebdc13/pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:24922243639cbdac66c75fcb6fd6495a9cb52b213d62f9a0d16f0310b1ff8038", size = 2208542, upload-time = "2026-08-28T09:58:55.017Z" }, + { url = "https://files.pythonhosted.org/packages/f7/ea/296debfb4264207bbda5936133892e027c0a58875ad53ebd512fba8ec3a2/pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c76fe65e607be28c7fd4d56fc3c42b1583aa058ce3408b7ad0fd540171d31f9f", size = 2264692, upload-time = "2026-08-28T09:58:56.767Z" }, + { url = "https://files.pythonhosted.org/packages/d3/f2/9e4de77a6271e07a76d2d58b11c091a979c191ed2939bf80067568b369d2/pydantic_core-2.46.5-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6f7b393a8b3da82f5c1fc0751e6d01ac6c55b93c18226a60bdfba4a724efafd1", size = 2066633, upload-time = "2026-08-28T09:58:58.531Z" }, + { url = "https://files.pythonhosted.org/packages/8d/db/f9e9d0c97445987b2084823d5c240de88087338f04fc2cfaa2df186b8049/pydantic_core-2.46.5-cp313-cp313-manylinux_2_31_riscv64.whl", hash = "sha256:7ac031912d54f3d83ef3b3eb98dfabc1608802e2202263d25957eeed40b94761", size = 2105235, upload-time = "2026-08-28T09:59:00.421Z" }, + { url = "https://files.pythonhosted.org/packages/07/c5/79169b047b3b2c3e99e04bc76372af9637e0bf6db638274fa927df96369e/pydantic_core-2.46.5-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:837b396ca3d7b74091ca623f6cbd8351bd42d670a79c2683e79fb089f06a2de5", size = 2157367, upload-time = "2026-08-28T09:59:02.442Z" }, + { url = "https://files.pythonhosted.org/packages/26/b5/ba6057afb7c291bd449f51b867f95aef2072941c4ce4e5c31d6ffd132d3b/pydantic_core-2.46.5-cp313-cp313-musllinux_1_1_aarch64.whl", hash = "sha256:5ee239d575f80b08eca11f6e20f90c4c695de7825c67eefe6091fbf20dda648e", size = 2158420, upload-time = "2026-08-28T09:59:04.2Z" }, + { url = "https://files.pythonhosted.org/packages/6e/28/2057abecaafdc22912afa819603a51f0a62d40643b7c4871c51721fea9be/pydantic_core-2.46.5-cp313-cp313-musllinux_1_1_armv7l.whl", hash = "sha256:e80675d75ae2cd14372cb65cad5400d9347a3d3f6c13000183f22dfd027283ed", size = 2309588, upload-time = "2026-08-28T09:59:06.048Z" }, + { url = "https://files.pythonhosted.org/packages/71/9d/881156dc404e27479c4246128d73538464cab4a239bec61995e227644c30/pydantic_core-2.46.5-cp313-cp313-musllinux_1_1_x86_64.whl", hash = "sha256:9c4b71f10dd532fb7a5cbc8f58707779e64f03a258c2bf8bfbaecfcd9970b519", size = 2341866, upload-time = "2026-08-28T09:59:08.539Z" }, + { url = "https://files.pythonhosted.org/packages/5a/38/d66f443a259f84d13babdceae568e572b0ed26da17ca5d0a649ebb110a67/pydantic_core-2.46.5-cp313-cp313-win32.whl", hash = "sha256:97bf8de4d541598c94a59344eeb988a94c08ff76b5723c41f6567ec18c7892ea", size = 1938580, upload-time = "2026-08-28T09:59:10.402Z" }, + { url = "https://files.pythonhosted.org/packages/2c/1e/1d5371213f4cc9a7ed70c0bfcc7911de22311ee99a662a56077d7292d2ac/pydantic_core-2.46.5-cp313-cp313-win_amd64.whl", hash = "sha256:15f4a94963c95accac15b7b657bb177d3ad82bb90b0d0526d9a9b85079925db5", size = 2041980, upload-time = "2026-08-28T09:59:12.396Z" }, + { url = "https://files.pythonhosted.org/packages/5a/48/4222d90b1c67568bace4dec6dca6271449c66de3595d72b6d098f5fde597/pydantic_core-2.46.5-cp313-cp313-win_arm64.whl", hash = "sha256:d22a945598fb91236b4dd793a6e42e4f3dd7740bb5aace5ebd7d4c08d13bb575", size = 1997213, upload-time = "2026-08-28T09:59:14.245Z" }, + { url = "https://files.pythonhosted.org/packages/8e/8a/14596f2a8367da50cf7cbac48169ee5d9c8e11d486a3b527082384630c72/pydantic_core-2.46.5-cp314-cp314-macosx_10_12_x86_64.whl", hash = "sha256:c1c43ad4339643d70ebb8124e1305a7dab423001eff58bb41a0f731adbc98355", size = 2074081, upload-time = "2026-08-28T09:59:16.141Z" }, + { url = "https://files.pythonhosted.org/packages/ae/d5/d8a4eb6d6c7f66b91dd37c576d76e9e60fba900caf5372c17bcf949febc2/pydantic_core-2.46.5-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:1a353f84de772f423b5ffb11d7ae352fbbef0f446f3c0b0af0f8236d7233606e", size = 1920497, upload-time = "2026-08-28T09:59:18.065Z" }, + { url = "https://files.pythonhosted.org/packages/8e/26/092079428f86e927e030b2c0ced87df69dbb1c875cdeaa67bf42ea2be746/pydantic_core-2.46.5-cp314-cp314-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5086029a57366b8cf81b130a43908738095c270c21a8d7f0e8bdfdb89718e2f3", size = 1952130, upload-time = "2026-08-28T09:59:20.476Z" }, + { url = "https://files.pythonhosted.org/packages/08/c3/8ec0e290a9ebaebd64047bf5fda94be835c6b1551b02437e4b76778fbcd7/pydantic_core-2.46.5-cp314-cp314-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:46c25dda9d092a06c08db76ffe0a197107904d0dfac653f7d5306bbcd6d6119c", size = 2026371, upload-time = "2026-08-28T09:59:22.227Z" }, + { url = "https://files.pythonhosted.org/packages/01/72/4fd20ad520fb8da0157f95b27a7eb05a72790ef08138e7701ac972c342ea/pydantic_core-2.46.5-cp314-cp314-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:37ea7b83c935e5b0d68c9449b82651accf78a10828b2c02b2f2d9e9496446c21", size = 2202822, upload-time = "2026-08-28T09:59:24.277Z" }, + { url = "https://files.pythonhosted.org/packages/31/b0/d16e0771206b29314f0d52198b720be21e8a99ab2bf11e3bc0d7c9cebdff/pydantic_core-2.46.5-cp314-cp314-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:e64e88d5585bea9ce95861079de72006c7fa6d3df4e3a3b65ba31eb979c15c9f", size = 2262756, upload-time = "2026-08-28T09:59:26.608Z" }, + { url = "https://files.pythonhosted.org/packages/2c/9b/59634b7ac631c63b2a37760eb6943af3e29573d6b59a4abc5e7f019d4cee/pydantic_core-2.46.5-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:54d510bac3ee52247af28ed4bb18a1e799f040ac60fd2bf5ccd4c92f1fbe786f", size = 2068352, upload-time = "2026-08-28T09:59:29.044Z" }, + { url = "https://files.pythonhosted.org/packages/08/7c/570abb1ad2155348dc754ea91be22e5aaa18eb6d69a6068f7c6f2679a6ed/pydantic_core-2.46.5-cp314-cp314-manylinux_2_31_riscv64.whl", hash = "sha256:a2a5e1d0ff29adddc9f6d6821a66302e4493f8ca898b715b6b1182c2c201ea0a", size = 2104777, upload-time = "2026-08-28T09:59:30.95Z" }, + { url = "https://files.pythonhosted.org/packages/8e/25/5bf74adc65a1ac5b7be3f6cb0bcb5433615c1598a801c19d830d84c98ded/pydantic_core-2.46.5-cp314-cp314-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:03b9666e41e35d8909852ba191a0607520f81b74eaf12ccf8737005dbb313821", size = 2156312, upload-time = "2026-08-28T09:59:32.604Z" }, + { url = "https://files.pythonhosted.org/packages/90/6a/2ef38830675e050121040618135564ed56b860b45433b02d9b4ebece46f3/pydantic_core-2.46.5-cp314-cp314-musllinux_1_1_aarch64.whl", hash = "sha256:a91c17edf6eea2402cb5457b4c89e99bc5ed1004aa34c4adf1d4258c1a5c22c2", size = 2150067, upload-time = "2026-08-28T09:59:34.453Z" }, + { url = "https://files.pythonhosted.org/packages/90/ef/a7dbb03a14a64c2a4621f989c615ed9a892535a6cad938fc27079f919d80/pydantic_core-2.46.5-cp314-cp314-musllinux_1_1_armv7l.whl", hash = "sha256:b49924c73a235e969511bf2aabdff3beebf9820931f646c80274d5d780010c47", size = 2304516, upload-time = "2026-08-28T09:59:36.194Z" }, + { url = "https://files.pythonhosted.org/packages/68/f8/6bb4c4b80e8a6fde1904c64a51c62a1d04fcdfa3ea521a66b2ddefa1d885/pydantic_core-2.46.5-cp314-cp314-musllinux_1_1_x86_64.whl", hash = "sha256:2cbd9a5eff05e51c447c34dfa4632145b26b09120cf04bd0c871e44c1a5e1c9a", size = 2335223, upload-time = "2026-08-28T09:59:37.931Z" }, + { url = "https://files.pythonhosted.org/packages/2a/80/f46b8c681195190b2c1f1c7c0a81abce60663e987613e09ef64d433dd96b/pydantic_core-2.46.5-cp314-cp314-win32.whl", hash = "sha256:2d5d76654becf5efd62c9e51c3756c67b49498b0c9a40884934c40807adbd074", size = 1934827, upload-time = "2026-08-28T09:59:39.836Z" }, + { url = "https://files.pythonhosted.org/packages/f7/3c/60674207246bc0a4009d2391b7c7251c7159f279c8d2ab8aae8ef46f3dee/pydantic_core-2.46.5-cp314-cp314-win_amd64.whl", hash = "sha256:fa10ef4112775900e7a0661068635eb67b2ab824fbde764de6e0e21982a93db0", size = 2042648, upload-time = "2026-08-28T09:59:41.792Z" }, + { url = "https://files.pythonhosted.org/packages/69/0c/117c562c7c1babdf44576b72a5e496906506c93690387ecfbca7c729ae2e/pydantic_core-2.46.5-cp314-cp314-win_arm64.whl", hash = "sha256:045ab3b6d308439e32b81cc173bba5b9018bc6ed896afd0c65b3b009b1699af5", size = 1989652, upload-time = "2026-08-28T09:59:43.702Z" }, + { url = "https://files.pythonhosted.org/packages/e8/66/9336ae58f9eb68c41d121894e52c4c89eccb07eb8f602a04ee9c3f37736a/pydantic_core-2.46.5-cp314-cp314t-macosx_10_12_x86_64.whl", hash = "sha256:8816f3d218beb4b787de5c9759c259b8fa61f9dec42dc7811f320a33771778b7", size = 2065829, upload-time = "2026-08-28T09:59:45.364Z" }, + { url = "https://files.pythonhosted.org/packages/c5/02/bc19b47a96c2d3109760711acf22369e56bd7e405ca52f7ade164d2ead57/pydantic_core-2.46.5-cp314-cp314t-macosx_11_0_arm64.whl", hash = "sha256:bce57638e08ac148e5778cce7feb968307a727d66f8e2274a543d0cf0c9ad6a3", size = 1905716, upload-time = "2026-08-28T09:59:47.18Z" }, + { url = "https://files.pythonhosted.org/packages/52/a4/70b47c0509923dd98ccfed04fb3e32ea3849c82a0ff2205bb41009b43c00/pydantic_core-2.46.5-cp314-cp314t-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:976e1128455aa595ea04c79ccfedff1aaeab96ee013fcc916bed120c4f0ad94f", size = 1934216, upload-time = "2026-08-28T09:59:49.241Z" }, + { url = "https://files.pythonhosted.org/packages/52/ab/aa03b65f7bb198585edf806b906c3223ecf1795543e39e23aec4cce27ad2/pydantic_core-2.46.5-cp314-cp314t-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:e7b891faeedeafba41b2983e5001a81b6a915b69544c7e7570d1989ce1c36ac7", size = 2010635, upload-time = "2026-08-28T09:59:51.692Z" }, + { url = "https://files.pythonhosted.org/packages/3c/8b/0da06343f30b84ec549aafd309c6456223d5dc8bd36af504c573faad561d/pydantic_core-2.46.5-cp314-cp314t-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5f194189415698233dd1114a093a9b56e61e2c57e11b469be3b0506f46f0771c", size = 2209369, upload-time = "2026-08-28T09:59:53.582Z" }, + { url = "https://files.pythonhosted.org/packages/d6/5b/844c4defaa34a3df66eb9257087d121d70c201298b96abdf9f492fc2f1bf/pydantic_core-2.46.5-cp314-cp314t-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:82a36973cf8a2ef5406f4fe2edbf8ed0c99629535d959e0b100c76a32535a111", size = 2253238, upload-time = "2026-08-28T09:59:55.484Z" }, + { url = "https://files.pythonhosted.org/packages/f4/64/a4e536cb16d7f61a7fd3120b46c577fc7fa7325992f69c4f52bc786d77d8/pydantic_core-2.46.5-cp314-cp314t-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:cdbb78909f52b981d3b2d56b97328d71eb0b974c36bd77c920123a7ebb192829", size = 2065740, upload-time = "2026-08-28T09:59:58.038Z" }, + { url = "https://files.pythonhosted.org/packages/5f/75/aaa38c6bc2d085f6605b34eabdc6a8a4e0b2e61fc9c8e6e52b28e97b3125/pydantic_core-2.46.5-cp314-cp314t-manylinux_2_31_riscv64.whl", hash = "sha256:52e24eacdb536cade636aa90fb851835222becff8484b7001fdc78cb0290f2aa", size = 2087425, upload-time = "2026-08-28T09:59:59.898Z" }, + { url = "https://files.pythonhosted.org/packages/55/ae/fcab4cfc39aba3689e1d20c8b5250ad280957022c09af2ed9cd585602a5e/pydantic_core-2.46.5-cp314-cp314t-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:37ae34309d7bd8c0d61ab839668058f2a7962ea1fc51d105d2db228fe0618034", size = 2139306, upload-time = "2026-08-28T10:00:03.057Z" }, + { url = "https://files.pythonhosted.org/packages/2d/f4/f1d03a4bc9d9acbc62f4d742b8a319af52f71885079868b2ff8e48a651ee/pydantic_core-2.46.5-cp314-cp314t-musllinux_1_1_aarch64.whl", hash = "sha256:0cdbada856a1c69a7624a64d3d9aefe79300bd6ef827b43a4f265010b9b55184", size = 2144589, upload-time = "2026-08-28T10:00:05.645Z" }, + { url = "https://files.pythonhosted.org/packages/83/f3/7a53bb1356de514a4cd295f25b6ac39237895620c0462d2592b76c16e114/pydantic_core-2.46.5-cp314-cp314t-musllinux_1_1_armv7l.whl", hash = "sha256:545f26c504b27c3758439a5e6d9349931f0a04f855668d5fe323c89e82300a38", size = 2288882, upload-time = "2026-08-28T10:00:07.931Z" }, + { url = "https://files.pythonhosted.org/packages/cd/94/5a81583660c175c59d49ffb09f4b3a44debeaf86a19fca664ae1cdd9ee32/pydantic_core-2.46.5-cp314-cp314t-musllinux_1_1_x86_64.whl", hash = "sha256:ff218293c9c806138dca139765e3b067621be52bcd93cdc14c7711be7ddc90a9", size = 2335210, upload-time = "2026-08-28T10:00:10.177Z" }, + { url = "https://files.pythonhosted.org/packages/5a/9f/5d685c2693b972d1a59c998586e8823712b66603aeff47ee60a4bdaafd37/pydantic_core-2.46.5-cp314-cp314t-win32.whl", hash = "sha256:97cf3eb53a8cccacf9d46686a0926186c9bfb5574f2ed66d3639d5fe117cd3a9", size = 1921180, upload-time = "2026-08-28T10:00:12.35Z" }, + { url = "https://files.pythonhosted.org/packages/70/12/5c94ee16d65a37a15f9e869f5e6256df111154491173801a4c5e800ab548/pydantic_core-2.46.5-cp314-cp314t-win_amd64.whl", hash = "sha256:d2f9fc07a8042a8f95925b35c4f04f469707c981fc33245b6ca187cf5d2dd290", size = 2020515, upload-time = "2026-08-28T10:00:14.774Z" }, + { url = "https://files.pythonhosted.org/packages/63/19/67830dda664e6bdf9285ee2e40f355d0d7d6b92aa0c42e8d217bb8d33d36/pydantic_core-2.46.5-cp314-cp314t-win_arm64.whl", hash = "sha256:acf8a67ba51f4ca9ddbd0e6b3000a65ac51ab734661778b3e7ba64d99a710f2f", size = 1989276, upload-time = "2026-08-28T10:00:16.984Z" }, + { url = "https://files.pythonhosted.org/packages/af/1e/ecca01fce348f7e8afa9572441ff6f7d1cc70d21e4859f33944d10877e1e/pydantic_core-2.46.5-graalpy311-graalpy242_311_native-macosx_10_12_x86_64.whl", hash = "sha256:c14ad3bdc85ee7f318742c457ca3968a92126d144b15721c759033bfb06296c2", size = 2075342, upload-time = "2026-08-28T10:00:51.353Z" }, + { url = "https://files.pythonhosted.org/packages/1f/4c/af80c7a8032dfc897040ad5cb772bebde529a381186499e6e29987f23f8c/pydantic_core-2.46.5-graalpy311-graalpy242_311_native-macosx_11_0_arm64.whl", hash = "sha256:0bddb4020d8f04175865ccd17eff3040874fc11fb593f424edb452653b4b947c", size = 1907219, upload-time = "2026-08-28T10:00:53.438Z" }, + { url = "https://files.pythonhosted.org/packages/be/3e/54d89e2b092e778716bf6153634ef479e955f48c261090be23aa1e0fb0b5/pydantic_core-2.46.5-graalpy311-graalpy242_311_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2471fd51c61c610e1dcf7de44d7299283661654d11264ab4802b303368d69c47", size = 1953393, upload-time = "2026-08-28T10:00:55.58Z" }, + { url = "https://files.pythonhosted.org/packages/ea/89/828ee90cda28ce17bdefaa3a6eaf74fe430e113295a10e6126beca559d6c/pydantic_core-2.46.5-graalpy311-graalpy242_311_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:b10ec717381bdbfafef34607824db4c91de69ff085e4fca3b2af91b4fa17e68a", size = 2099024, upload-time = "2026-08-28T10:00:57.794Z" }, + { url = "https://files.pythonhosted.org/packages/df/dd/053c2e4303f791f3b8f8a14ab0b22008e8eb21d868c0c90b4f9be705b76a/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-macosx_10_12_x86_64.whl", hash = "sha256:013d6f3483d81e02e7c328831808f336c8596ee33b4bd4026b9ffb1e960b8942", size = 2062540, upload-time = "2026-08-28T10:01:00.318Z" }, + { url = "https://files.pythonhosted.org/packages/d7/dd/a18df751a5e37dd51bfad7f68e766999125bebe68c9e1d10a493ad01bd63/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-macosx_11_0_arm64.whl", hash = "sha256:e9c134bb666dd54b778b9fc0d2b50cbb7f979b9e3716f26a88c9ab3b6fc1dd0f", size = 1902040, upload-time = "2026-08-28T10:01:02.529Z" }, + { url = "https://files.pythonhosted.org/packages/b7/13/01d40f9d07ce8a779fd6e0bd8ad4fba91309500dd67b869e2e219d261a6d/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:347ec774390c87326a2e4929d58d3f7e8763a104d5d35f4cd595a4c952366433", size = 1967479, upload-time = "2026-08-28T10:01:05.004Z" }, + { url = "https://files.pythonhosted.org/packages/fa/04/c81d4841331c2178b6fb09ae225425e110ed72d990c9fe556c4ec03d1013/pydantic_core-2.46.5-graalpy312-graalpy250_312_native-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8e24d8f05fa2d28513d94e877e9c75ad66175376209b3977f916e240e623193c", size = 2111034, upload-time = "2026-08-28T10:01:07.345Z" }, + { url = "https://files.pythonhosted.org/packages/20/21/22102e9950b3049526d20e811b95396508377d87651edd2b80d2b3d28659/pydantic_core-2.46.5-pp311-pypy311_pp73-macosx_10_12_x86_64.whl", hash = "sha256:ab4b66edffb32d9e951efb3814bd104b8367a7501b81b955cacb5726d897389f", size = 2071333, upload-time = "2026-08-28T10:01:09.636Z" }, + { url = "https://files.pythonhosted.org/packages/d8/18/87aefa427d191e6d3ab1447f1efc1cdcac86af1069239b133e8a0fd7f7c9/pydantic_core-2.46.5-pp311-pypy311_pp73-macosx_11_0_arm64.whl", hash = "sha256:337639ba62a11acde6ef3aeb08c8ea755f8ef1fe5e513356c0f36a2b0d7568b0", size = 1912713, upload-time = "2026-08-28T10:01:12.285Z" }, + { url = "https://files.pythonhosted.org/packages/1f/93/fd89e9ad49b1805ca94d24ce1088b7d305f05c35ffafcedb9819d03588a0/pydantic_core-2.46.5-pp311-pypy311_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:413a717a410d0c817ef5b786a059415550b3794e1d0c2abffd9efb93a3d9f7b4", size = 2090926, upload-time = "2026-08-28T10:01:15.19Z" }, + { url = "https://files.pythonhosted.org/packages/6f/45/8e59dab6acf8d35f02f0a958980074f31038968bdb2c983fcae9d1efee03/pydantic_core-2.46.5-pp311-pypy311_pp73-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:1e449def1945a462c464331254e5a44fca7c3b4f9aedf59ec2f50f8066dd8e25", size = 2131303, upload-time = "2026-08-28T10:01:17.937Z" }, + { url = "https://files.pythonhosted.org/packages/d5/a5/e1d4dc5180dd887a9522efc1f8716b8692b7606b1d3273d7862eaf66be44/pydantic_core-2.46.5-pp311-pypy311_pp73-musllinux_1_1_aarch64.whl", hash = "sha256:a445486499897b88a7d6c310c88ed64dd37b1b59bfd7ae9107490bbb362f47d6", size = 2145128, upload-time = "2026-08-28T10:01:20.694Z" }, + { url = "https://files.pythonhosted.org/packages/c2/d7/ad493864a7fb21c0c4df98f965e2db430cb25a9d7369b5778d5016c09fd9/pydantic_core-2.46.5-pp311-pypy311_pp73-musllinux_1_1_armv7l.whl", hash = "sha256:2d330aaba8621b1edcec8ae2c4050f63b84ccf6d98723a8f212e9684713abf0e", size = 2294560, upload-time = "2026-08-28T10:01:23.495Z" }, + { url = "https://files.pythonhosted.org/packages/02/8e/b41c84c913f29973a268e6c2b5bbf13c95adb9956c126d10da11ba3b2bef/pydantic_core-2.46.5-pp311-pypy311_pp73-musllinux_1_1_x86_64.whl", hash = "sha256:b6acfb46a814762367fb7ba0828b0a17d441b92ce249a0e007474c9072662dda", size = 2317531, upload-time = "2026-08-28T10:01:26.334Z" }, + { url = "https://files.pythonhosted.org/packages/db/1d/068464f23075f66a8f1b806935e9cd9363ee446636ea70d2c22ee8659dbf/pydantic_core-2.46.5-pp311-pypy311_pp73-win_amd64.whl", hash = "sha256:d0a24b40877af2de4950252be9d21eaf7fb07660f3c2cae1f56c6b599ada5266", size = 2140686, upload-time = "2026-08-28T10:01:28.947Z" }, ] [[package]] -name = "pyproject-hooks" -version = "1.2.0" +name = "pygments" +version = "2.21.0" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/e7/82/28175b2414effca1cdac8dc99f76d660e7a4fb0ceefa4b4ab8f5f6742925/pyproject_hooks-1.2.0.tar.gz", hash = "sha256:1e859bd5c40fae9448642dd871adf459e5e2084186e8d2c2a79a824c970da1f8", size = 19228, upload-time = "2024-09-29T09:24:13.293Z" } +sdist = { url = "https://files.pythonhosted.org/packages/49/2e/ced460408999b33da6b31b0021b0f37d329e202d4169aeb164493778f25b/pygments-2.21.0.tar.gz", hash = "sha256:610ca751c9bc2492b38eb9a38a7fbc93edbbb2d7182edaf34e66ae493dee5c8c", size = 5005329, upload-time = "2026-08-17T08:02:48.824Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/bd/24/12818598c362d7f300f18e74db45963dbcb85150324092410c8b49405e42/pyproject_hooks-1.2.0-py3-none-any.whl", hash = "sha256:9e5c6bfa8dcc30091c74b0cf803c81fdd29d94f01992a7707bc97babb1141913", size = 10216, upload-time = "2024-09-29T09:24:11.978Z" }, + { url = "https://files.pythonhosted.org/packages/71/46/17f022dd3e953bf20a04a028a21ec746d942f8d2af30fa0f124fa0e6a684/pygments-2.21.0-py3-none-any.whl", hash = "sha256:2363c69b61c4a97c838da3b130dcd6468f4848992b21a82f2a63ec34377137d9", size = 1250147, upload-time = "2026-08-17T08:02:44.912Z" }, ] [[package]] @@ -160,9 +472,22 @@ wheels = [ { url = "https://files.pythonhosted.org/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl", hash = "sha256:a8b2bc7bffae282281c8140a97d3aa9c14da0b136dfe83f850eea9a5f7470427", size = 229892, upload-time = "2024-03-01T18:36:18.57Z" }, ] +[[package]] +name = "rich" +version = "15.0.0" +source = { registry = "https://pypi.org/simple" } +dependencies = [ + { name = "markdown-it-py", marker = "python_full_version >= '3.11'" }, + { name = "pygments", marker = "python_full_version >= '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/c0/8f/0722ca900cc807c13a6a0c696dacf35430f72e0ec571c4275d2371fca3e9/rich-15.0.0.tar.gz", hash = "sha256:edd07a4824c6b40189fb7ac9bc4c52536e9780fbbfbddf6f1e2502c31b068c36", size = 230680, upload-time = "2026-04-12T08:24:00.75Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/82/3b/64d4899d73f91ba49a8c18a8ff3f0ea8f1c1d75481760df8c68ef5235bf5/rich-15.0.0-py3-none-any.whl", hash = "sha256:33bd4ef74232fb73fe9279a257718407f169c09b78a87ad3d296f548e27de0bb", size = 310654, upload-time = "2026-04-12T08:24:02.83Z" }, +] + [[package]] name = "rootly" -version = "1.0.0" +version = "3.0.0" source = { editable = "." } dependencies = [ { name = "attrs" }, @@ -172,18 +497,65 @@ dependencies = [ [package.dev-dependencies] dev = [ - { name = "build" }, + { name = "openapi-python-client", marker = "python_full_version >= '3.11'" }, + { name = "ruff" }, ] [package.metadata] requires-dist = [ { name = "attrs", specifier = ">=22.2.0" }, - { name = "httpx", specifier = ">=0.20.0,<0.29.0" }, - { name = "python-dateutil", specifier = ">=2.8.0" }, + { name = "httpx", specifier = ">=0.23.0,<0.29.0" }, + { name = "python-dateutil", specifier = ">=2.8.0,<3.0.0" }, ] [package.metadata.requires-dev] -dev = [{ name = "build", specifier = ">=1.2.2.post1" }] +dev = [ + { name = "openapi-python-client", marker = "python_full_version >= '3.11'", specifier = "==0.29.0" }, + { name = "ruff", specifier = "==0.16.3" }, +] + +[[package]] +name = "ruamel-yaml" +version = "0.19.1" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/c7/3b/ebda527b56beb90cb7652cb1c7e4f91f48649fbcd8d2eb2fb6e77cd3329b/ruamel_yaml-0.19.1.tar.gz", hash = "sha256:53eb66cd27849eff968ebf8f0bf61f46cdac2da1d1f3576dd4ccee9b25c31993", size = 142709, upload-time = "2026-01-02T16:50:31.84Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/b8/0c/51f6841f1d84f404f92463fc2b1ba0da357ca1e3db6b7fbda26956c3b82a/ruamel_yaml-0.19.1-py3-none-any.whl", hash = "sha256:27592957fedf6e0b62f281e96effd28043345e0e66001f97683aa9a40c667c93", size = 118102, upload-time = "2026-01-02T16:50:29.201Z" }, +] + +[[package]] +name = "ruff" +version = "0.16.3" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/61/b3/3213589383f8f1b3938781bd1278713f6d18621a14992b3e81fefb8a5ef9/ruff-0.16.3.tar.gz", hash = "sha256:e76d33a347661a84b5be6d043d0347fdc745dfdcf825a8f4fed64b5e26eebdf2", size = 4891904, upload-time = "2026-08-13T15:17:13.381Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/bf/96/493770daebd68c0a67f1549fdf519f53be51fc435186c0585bcc272fd76c/ruff-0.16.3-py3-none-linux_armv6l.whl", hash = "sha256:0c5710e247a58a4521e66e124ba9a74655b414f61ba3a2e9e3811e11098f48f7", size = 10902799, upload-time = "2026-08-13T15:16:27.382Z" }, + { url = "https://files.pythonhosted.org/packages/5e/e6/2becf3942fddc29a29b8df47691d456fb1085391a694f74d84513251418c/ruff-0.16.3-py3-none-macosx_10_12_x86_64.whl", hash = "sha256:fe155130631a2471fd2e14a7a664a4dfbd7194b8229c3d7b2a40b21178639081", size = 11135539, upload-time = "2026-08-13T15:16:30.87Z" }, + { url = "https://files.pythonhosted.org/packages/3e/1e/4b8b72f0d006dbf19326aa99f9ca0ee2ff374187c4d301cf529a51aa06fe/ruff-0.16.3-py3-none-macosx_11_0_arm64.whl", hash = "sha256:e2ed719e14aa64d895c2ee922594a90a43c861a93f0575a95ff8c47cdbd13eb9", size = 10475095, upload-time = "2026-08-13T15:16:33.259Z" }, + { url = "https://files.pythonhosted.org/packages/92/32/2201fa49ba1f6c101ee321e83f051ac7a4b8d07b0ef6b4d3f2772b302275/ruff-0.16.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9e0b1da805eb043654645d74d5de1e5ce2edc686e40790d2b86f56d71cc06a84", size = 10668771, upload-time = "2026-08-13T15:16:35.65Z" }, + { url = "https://files.pythonhosted.org/packages/c3/66/4afc5c8363bd04d45effce1b7c8713ca037d7a6740b7451a2403a6e3a972/ruff-0.16.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl", hash = "sha256:a37bdea0bbe21780f590bf437d6412c8c4e1b6cd010f91a65c2c40c5e5f5f870", size = 10699568, upload-time = "2026-08-13T15:16:38.195Z" }, + { url = "https://files.pythonhosted.org/packages/53/fd/c67d246bf36bf1698551c56de39e95cd07f70e64433e0098e6267d77061b/ruff-0.16.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:09571e6d1288ed9be475207a3ac04ada404f1cd898104be0f6ab8d7df438575b", size = 11499365, upload-time = "2026-08-13T15:16:40.623Z" }, + { url = "https://files.pythonhosted.org/packages/67/0b/00ecbceb99a263af7b12f6f05ac3c92bc47b905e91adc3f207a836e3bc01/ruff-0.16.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:2c18c5a101eb540010638cc1ff3c84944d3adb3df62b8d98ca8f22ba484d3413", size = 12311728, upload-time = "2026-08-13T15:16:43.564Z" }, + { url = "https://files.pythonhosted.org/packages/54/b2/b7b3bb54f4d3f7db504e476ad4ab8de530dceebe2c061384b2757ee419e8/ruff-0.16.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:8457c44f15033c85ddbb77b15d451df9e24e4bd03b628396dd3610cedc3b8f82", size = 11699896, upload-time = "2026-08-13T15:16:46.209Z" }, + { url = "https://files.pythonhosted.org/packages/c7/30/4c468429ac195addc5ee1b717b6ab1b66632786737ca3b2ed3443fb0c26a/ruff-0.16.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:294b95c4ae0cda9388525c2047778aa758d6b8d4bb876fd4e9eaa3ebc92343eb", size = 11058736, upload-time = "2026-08-13T15:16:48.823Z" }, + { url = "https://files.pythonhosted.org/packages/43/67/7a113cdaddf24b64d7f75b1242a99d04c82fcef4f6921fdbb832beaffb5f/ruff-0.16.3-py3-none-manylinux_2_31_riscv64.whl", hash = "sha256:3d0c7c40c87c2a820509c31ba007968da6e1306468c067b2d82fbfdbcd0e8474", size = 11586911, upload-time = "2026-08-13T15:16:51.913Z" }, + { url = "https://files.pythonhosted.org/packages/f1/c1/2e66f24c0f3ead25a5e660111778685e505e5da353c82802bf49f0cbe7b9/ruff-0.16.3-py3-none-musllinux_1_2_aarch64.whl", hash = "sha256:9f738c0fdfa8eed0b2ce7fb27ee7258208a92a68d7949e62aa15164bc7b389da", size = 10954265, upload-time = "2026-08-13T15:16:54.763Z" }, + { url = "https://files.pythonhosted.org/packages/c2/ba/4cee23bf52cba9a058d3726de623624daf50ef9638868edd86f4126157f6/ruff-0.16.3-py3-none-musllinux_1_2_armv7l.whl", hash = "sha256:fb785f0be25abe69d320415cd4f833b59e17ba7613d9ba6a958023b6bceb0a50", size = 10709886, upload-time = "2026-08-13T15:16:57.339Z" }, + { url = "https://files.pythonhosted.org/packages/82/df/7da7194fa5d9dc0a285f7e6fa5a4722e7c63faac0b45b614ded9314363a1/ruff-0.16.3-py3-none-musllinux_1_2_i686.whl", hash = "sha256:c5536e3acfbf9563085aa2be7b13c629c3077e902afc5b941ac44024dbb9f506", size = 11210392, upload-time = "2026-08-13T15:17:00.171Z" }, + { url = "https://files.pythonhosted.org/packages/35/85/7795f6e817af050e7517bf3e7aa9b061cce70ef33d280aad902c956c1ecf/ruff-0.16.3-py3-none-musllinux_1_2_x86_64.whl", hash = "sha256:a2d85c02f9b8e165d85e6779184d38c4132de12603dab59c51c28e22584f9e4d", size = 11626910, upload-time = "2026-08-13T15:17:03.299Z" }, + { url = "https://files.pythonhosted.org/packages/78/9b/475b927cf27a5cbbda3c7bafb69ed6ff77e1d7923d5d85f17c2749d7ae32/ruff-0.16.3-py3-none-win32.whl", hash = "sha256:388cdf2166642bd9b13d52b5932d3170f34f8abed7e8d9a855f1d84b83645a0a", size = 10931415, upload-time = "2026-08-13T15:17:05.726Z" }, + { url = "https://files.pythonhosted.org/packages/b2/99/e2a2bfc4fbf0a1e8a916bc9ebe6fe6c58cc34c28e0ffc6ce281d572d1c2e/ruff-0.16.3-py3-none-win_amd64.whl", hash = "sha256:e80a7d69ca2a6d1c4d352ec91458cdca6e56c83cdbcabd93e4abe1e53591d948", size = 11445993, upload-time = "2026-08-13T15:17:08.353Z" }, + { url = "https://files.pythonhosted.org/packages/69/3e/4132e539aed78c148854d4997a2685b0ed4dc4e87110b59ce528564e184e/ruff-0.16.3-py3-none-win_arm64.whl", hash = "sha256:b8ca152da82c1acc1fa8d5874b15951935f0eef46f10e6954c83859011b6178a", size = 11399302, upload-time = "2026-08-13T15:17:10.908Z" }, +] + +[[package]] +name = "shellingham" +version = "1.5.4" +source = { registry = "https://pypi.org/simple" } +sdist = { url = "https://files.pythonhosted.org/packages/58/15/8b3609fd3830ef7b27b655beb4b4e9c62313a4e8da8c676e142cc210d58e/shellingham-1.5.4.tar.gz", hash = "sha256:8dbca0739d487e5bd35ab3ca4b36e11c4078f3a234bfce294b0a0291363404de", size = 10310, upload-time = "2023-10-24T04:13:40.426Z" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/e0/f9/0595336914c5619e5f28a1fb793285925a8cd4b432c9da0a987836c7f822/shellingham-1.5.4-py2.py3-none-any.whl", hash = "sha256:7ecfff8f2fd72616f7481040475a65b2bf8af90a56c89140852d1120324e8686", size = 9755, upload-time = "2023-10-24T04:13:38.866Z" }, +] [[package]] name = "six" @@ -204,42 +576,18 @@ wheels = [ ] [[package]] -name = "tomli" -version = "2.2.1" +name = "typer" +version = "0.26.8" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/18/87/302344fed471e44a87289cf4967697d07e532f2421fdaf868a303cbae4ff/tomli-2.2.1.tar.gz", hash = "sha256:cd45e1dc79c835ce60f7404ec8119f2eb06d38b1deba146f07ced3bbc44505ff", size = 17175, upload-time = "2024-11-27T22:38:36.873Z" } +dependencies = [ + { name = "annotated-doc", marker = "python_full_version >= '3.11'" }, + { name = "colorama", marker = "python_full_version >= '3.11' and sys_platform == 'win32'" }, + { name = "rich", marker = "python_full_version >= '3.11'" }, + { name = "shellingham", marker = "python_full_version >= '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/7c/f7/68adc395201b20b872d68e975386832e8005ffeacedd43a1d837a32815be/typer-0.26.8.tar.gz", hash = "sha256:c244a6bd558886fe3f8780efb6bdd28bb9aff005a94eedebaa5cb32926fe2f7e", size = 202097, upload-time = "2026-06-26T09:22:45.705Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/43/ca/75707e6efa2b37c77dadb324ae7d9571cb424e61ea73fad7c56c2d14527f/tomli-2.2.1-cp311-cp311-macosx_10_9_x86_64.whl", hash = "sha256:678e4fa69e4575eb77d103de3df8a895e1591b48e740211bd1067378c69e8249", size = 131077, upload-time = "2024-11-27T22:37:54.956Z" }, - { url = "https://files.pythonhosted.org/packages/c7/16/51ae563a8615d472fdbffc43a3f3d46588c264ac4f024f63f01283becfbb/tomli-2.2.1-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:023aa114dd824ade0100497eb2318602af309e5a55595f76b626d6d9f3b7b0a6", size = 123429, upload-time = "2024-11-27T22:37:56.698Z" }, - { url = "https://files.pythonhosted.org/packages/f1/dd/4f6cd1e7b160041db83c694abc78e100473c15d54620083dbd5aae7b990e/tomli-2.2.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ece47d672db52ac607a3d9599a9d48dcb2f2f735c6c2d1f34130085bb12b112a", size = 226067, upload-time = "2024-11-27T22:37:57.63Z" }, - { url = "https://files.pythonhosted.org/packages/a9/6b/c54ede5dc70d648cc6361eaf429304b02f2871a345bbdd51e993d6cdf550/tomli-2.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:6972ca9c9cc9f0acaa56a8ca1ff51e7af152a9f87fb64623e31d5c83700080ee", size = 236030, upload-time = "2024-11-27T22:37:59.344Z" }, - { url = "https://files.pythonhosted.org/packages/1f/47/999514fa49cfaf7a92c805a86c3c43f4215621855d151b61c602abb38091/tomli-2.2.1-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c954d2250168d28797dd4e3ac5cf812a406cd5a92674ee4c8f123c889786aa8e", size = 240898, upload-time = "2024-11-27T22:38:00.429Z" }, - { url = "https://files.pythonhosted.org/packages/73/41/0a01279a7ae09ee1573b423318e7934674ce06eb33f50936655071d81a24/tomli-2.2.1-cp311-cp311-musllinux_1_2_aarch64.whl", hash = "sha256:8dd28b3e155b80f4d54beb40a441d366adcfe740969820caf156c019fb5c7ec4", size = 229894, upload-time = "2024-11-27T22:38:02.094Z" }, - { url = "https://files.pythonhosted.org/packages/55/18/5d8bc5b0a0362311ce4d18830a5d28943667599a60d20118074ea1b01bb7/tomli-2.2.1-cp311-cp311-musllinux_1_2_i686.whl", hash = "sha256:e59e304978767a54663af13c07b3d1af22ddee3bb2fb0618ca1593e4f593a106", size = 245319, upload-time = "2024-11-27T22:38:03.206Z" }, - { url = "https://files.pythonhosted.org/packages/92/a3/7ade0576d17f3cdf5ff44d61390d4b3febb8a9fc2b480c75c47ea048c646/tomli-2.2.1-cp311-cp311-musllinux_1_2_x86_64.whl", hash = "sha256:33580bccab0338d00994d7f16f4c4ec25b776af3ffaac1ed74e0b3fc95e885a8", size = 238273, upload-time = "2024-11-27T22:38:04.217Z" }, - { url = "https://files.pythonhosted.org/packages/72/6f/fa64ef058ac1446a1e51110c375339b3ec6be245af9d14c87c4a6412dd32/tomli-2.2.1-cp311-cp311-win32.whl", hash = "sha256:465af0e0875402f1d226519c9904f37254b3045fc5084697cefb9bdde1ff99ff", size = 98310, upload-time = "2024-11-27T22:38:05.908Z" }, - { url = "https://files.pythonhosted.org/packages/6a/1c/4a2dcde4a51b81be3530565e92eda625d94dafb46dbeb15069df4caffc34/tomli-2.2.1-cp311-cp311-win_amd64.whl", hash = "sha256:2d0f2fdd22b02c6d81637a3c95f8cd77f995846af7414c5c4b8d0545afa1bc4b", size = 108309, upload-time = "2024-11-27T22:38:06.812Z" }, - { url = "https://files.pythonhosted.org/packages/52/e1/f8af4c2fcde17500422858155aeb0d7e93477a0d59a98e56cbfe75070fd0/tomli-2.2.1-cp312-cp312-macosx_10_13_x86_64.whl", hash = "sha256:4a8f6e44de52d5e6c657c9fe83b562f5f4256d8ebbfe4ff922c495620a7f6cea", size = 132762, upload-time = "2024-11-27T22:38:07.731Z" }, - { url = "https://files.pythonhosted.org/packages/03/b8/152c68bb84fc00396b83e7bbddd5ec0bd3dd409db4195e2a9b3e398ad2e3/tomli-2.2.1-cp312-cp312-macosx_11_0_arm64.whl", hash = "sha256:8d57ca8095a641b8237d5b079147646153d22552f1c637fd3ba7f4b0b29167a8", size = 123453, upload-time = "2024-11-27T22:38:09.384Z" }, - { url = "https://files.pythonhosted.org/packages/c8/d6/fc9267af9166f79ac528ff7e8c55c8181ded34eb4b0e93daa767b8841573/tomli-2.2.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e340144ad7ae1533cb897d406382b4b6fede8890a03738ff1683af800d54192", size = 233486, upload-time = "2024-11-27T22:38:10.329Z" }, - { url = "https://files.pythonhosted.org/packages/5c/51/51c3f2884d7bab89af25f678447ea7d297b53b5a3b5730a7cb2ef6069f07/tomli-2.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:db2b95f9de79181805df90bedc5a5ab4c165e6ec3fe99f970d0e302f384ad222", size = 242349, upload-time = "2024-11-27T22:38:11.443Z" }, - { url = "https://files.pythonhosted.org/packages/ab/df/bfa89627d13a5cc22402e441e8a931ef2108403db390ff3345c05253935e/tomli-2.2.1-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:40741994320b232529c802f8bc86da4e1aa9f413db394617b9a256ae0f9a7f77", size = 252159, upload-time = "2024-11-27T22:38:13.099Z" }, - { url = "https://files.pythonhosted.org/packages/9e/6e/fa2b916dced65763a5168c6ccb91066f7639bdc88b48adda990db10c8c0b/tomli-2.2.1-cp312-cp312-musllinux_1_2_aarch64.whl", hash = "sha256:400e720fe168c0f8521520190686ef8ef033fb19fc493da09779e592861b78c6", size = 237243, upload-time = "2024-11-27T22:38:14.766Z" }, - { url = "https://files.pythonhosted.org/packages/b4/04/885d3b1f650e1153cbb93a6a9782c58a972b94ea4483ae4ac5cedd5e4a09/tomli-2.2.1-cp312-cp312-musllinux_1_2_i686.whl", hash = "sha256:02abe224de6ae62c19f090f68da4e27b10af2b93213d36cf44e6e1c5abd19fdd", size = 259645, upload-time = "2024-11-27T22:38:15.843Z" }, - { url = "https://files.pythonhosted.org/packages/9c/de/6b432d66e986e501586da298e28ebeefd3edc2c780f3ad73d22566034239/tomli-2.2.1-cp312-cp312-musllinux_1_2_x86_64.whl", hash = "sha256:b82ebccc8c8a36f2094e969560a1b836758481f3dc360ce9a3277c65f374285e", size = 244584, upload-time = "2024-11-27T22:38:17.645Z" }, - { url = "https://files.pythonhosted.org/packages/1c/9a/47c0449b98e6e7d1be6cbac02f93dd79003234ddc4aaab6ba07a9a7482e2/tomli-2.2.1-cp312-cp312-win32.whl", hash = "sha256:889f80ef92701b9dbb224e49ec87c645ce5df3fa2cc548664eb8a25e03127a98", size = 98875, upload-time = "2024-11-27T22:38:19.159Z" }, - { url = "https://files.pythonhosted.org/packages/ef/60/9b9638f081c6f1261e2688bd487625cd1e660d0a85bd469e91d8db969734/tomli-2.2.1-cp312-cp312-win_amd64.whl", hash = "sha256:7fc04e92e1d624a4a63c76474610238576942d6b8950a2d7f908a340494e67e4", size = 109418, upload-time = "2024-11-27T22:38:20.064Z" }, - { url = "https://files.pythonhosted.org/packages/04/90/2ee5f2e0362cb8a0b6499dc44f4d7d48f8fff06d28ba46e6f1eaa61a1388/tomli-2.2.1-cp313-cp313-macosx_10_13_x86_64.whl", hash = "sha256:f4039b9cbc3048b2416cc57ab3bda989a6fcf9b36cf8937f01a6e731b64f80d7", size = 132708, upload-time = "2024-11-27T22:38:21.659Z" }, - { url = "https://files.pythonhosted.org/packages/c0/ec/46b4108816de6b385141f082ba99e315501ccd0a2ea23db4a100dd3990ea/tomli-2.2.1-cp313-cp313-macosx_11_0_arm64.whl", hash = "sha256:286f0ca2ffeeb5b9bd4fcc8d6c330534323ec51b2f52da063b11c502da16f30c", size = 123582, upload-time = "2024-11-27T22:38:22.693Z" }, - { url = "https://files.pythonhosted.org/packages/a0/bd/b470466d0137b37b68d24556c38a0cc819e8febe392d5b199dcd7f578365/tomli-2.2.1-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a92ef1a44547e894e2a17d24e7557a5e85a9e1d0048b0b5e7541f76c5032cb13", size = 232543, upload-time = "2024-11-27T22:38:24.367Z" }, - { url = "https://files.pythonhosted.org/packages/d9/e5/82e80ff3b751373f7cead2815bcbe2d51c895b3c990686741a8e56ec42ab/tomli-2.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9316dc65bed1684c9a98ee68759ceaed29d229e985297003e494aa825ebb0281", size = 241691, upload-time = "2024-11-27T22:38:26.081Z" }, - { url = "https://files.pythonhosted.org/packages/05/7e/2a110bc2713557d6a1bfb06af23dd01e7dde52b6ee7dadc589868f9abfac/tomli-2.2.1-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:e85e99945e688e32d5a35c1ff38ed0b3f41f43fad8df0bdf79f72b2ba7bc5272", size = 251170, upload-time = "2024-11-27T22:38:27.921Z" }, - { url = "https://files.pythonhosted.org/packages/64/7b/22d713946efe00e0adbcdfd6d1aa119ae03fd0b60ebed51ebb3fa9f5a2e5/tomli-2.2.1-cp313-cp313-musllinux_1_2_aarch64.whl", hash = "sha256:ac065718db92ca818f8d6141b5f66369833d4a80a9d74435a268c52bdfa73140", size = 236530, upload-time = "2024-11-27T22:38:29.591Z" }, - { url = "https://files.pythonhosted.org/packages/38/31/3a76f67da4b0cf37b742ca76beaf819dca0ebef26d78fc794a576e08accf/tomli-2.2.1-cp313-cp313-musllinux_1_2_i686.whl", hash = "sha256:d920f33822747519673ee656a4b6ac33e382eca9d331c87770faa3eef562aeb2", size = 258666, upload-time = "2024-11-27T22:38:30.639Z" }, - { url = "https://files.pythonhosted.org/packages/07/10/5af1293da642aded87e8a988753945d0cf7e00a9452d3911dd3bb354c9e2/tomli-2.2.1-cp313-cp313-musllinux_1_2_x86_64.whl", hash = "sha256:a198f10c4d1b1375d7687bc25294306e551bf1abfa4eace6650070a5c1ae2744", size = 243954, upload-time = "2024-11-27T22:38:31.702Z" }, - { url = "https://files.pythonhosted.org/packages/5b/b9/1ed31d167be802da0fc95020d04cd27b7d7065cc6fbefdd2f9186f60d7bd/tomli-2.2.1-cp313-cp313-win32.whl", hash = "sha256:d3f5614314d758649ab2ab3a62d4f2004c825922f9e370b29416484086b264ec", size = 98724, upload-time = "2024-11-27T22:38:32.837Z" }, - { url = "https://files.pythonhosted.org/packages/c7/32/b0963458706accd9afcfeb867c0f9175a741bf7b19cd424230714d722198/tomli-2.2.1-cp313-cp313-win_amd64.whl", hash = "sha256:a38aa0308e754b0e3c67e344754dff64999ff9b513e691d0e786265c93583c69", size = 109383, upload-time = "2024-11-27T22:38:34.455Z" }, - { url = "https://files.pythonhosted.org/packages/6e/c2/61d3e0f47e2b74ef40a68b9e6ad5984f6241a942f7cd3bbfbdbd03861ea9/tomli-2.2.1-py3-none-any.whl", hash = "sha256:cb55c73c5f4408779d0cf3eef9f762b9c9f147a77de7b258bef0a5628adc85cc", size = 14257, upload-time = "2024-11-27T22:38:35.385Z" }, + { url = "https://files.pythonhosted.org/packages/80/87/b9fd69c92c6102a066e1b86a35243f53e70bd4c709f2a26d9f4fee4f4dc0/typer-0.26.8-py3-none-any.whl", hash = "sha256:3512ca79ac5c11113414b36e80281b872884477722440691c89d1112e321a49c", size = 122564, upload-time = "2026-06-26T09:22:44.72Z" }, ] [[package]] @@ -252,10 +600,13 @@ wheels = [ ] [[package]] -name = "zipp" -version = "3.23.0" +name = "typing-inspection" +version = "0.4.2" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/e3/02/0f2892c661036d50ede074e376733dca2ae7c6eb617489437771209d4180/zipp-3.23.0.tar.gz", hash = "sha256:a07157588a12518c9d4034df3fbbee09c814741a33ff63c05fa29d26a2404166", size = 25547, upload-time = "2025-06-08T17:06:39.4Z" } +dependencies = [ + { name = "typing-extensions", marker = "python_full_version >= '3.11'" }, +] +sdist = { url = "https://files.pythonhosted.org/packages/55/e3/70399cb7dd41c10ac53367ae42139cf4b1ca5f36bb3dc6c9d33acdb43655/typing_inspection-0.4.2.tar.gz", hash = "sha256:ba561c48a67c5958007083d386c3295464928b01faa735ab8547c5692e87f464", size = 75949, upload-time = "2025-10-01T02:14:41.687Z" } wheels = [ - { url = "https://files.pythonhosted.org/packages/2e/54/647ade08bf0db230bfea292f893923872fd20be6ac6f53b2b936ba839d75/zipp-3.23.0-py3-none-any.whl", hash = "sha256:071652d6115ed432f5ce1d34c336c0adfd6a884660d1e9712a256d3d3bd4b14e", size = 10276, upload-time = "2025-06-08T17:06:38.034Z" }, + { url = "https://files.pythonhosted.org/packages/dc/9b/47798a6c91d8bdb567fe2698fe81e0c6b7cb7ef4d13da4114b41d239f65d/typing_inspection-0.4.2-py3-none-any.whl", hash = "sha256:4ed1cacbdc298c220f1bd249ed5287caa16f34d44ef4e9c3d0cbad5b521545e7", size = 14611, upload-time = "2025-10-01T02:14:40.154Z" }, ]